@sonny-ui/core 0.1.0-alpha.2 → 0.1.0-alpha.21
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 +187 -40
- package/fesm2022/sonny-ui-core.mjs +6646 -272
- package/fesm2022/sonny-ui-core.mjs.map +1 -1
- package/package.json +8 -5
- package/schematics/ng-add/index.js +27 -0
- package/schematics/ng-add/schema.json +1 -1
- package/schematics/ng-generate/component/index.js +182 -1
- package/schematics/ng-generate/component/schema.json +2 -2
- package/src/lib/accordion/accordion.directives.spec.ts +173 -0
- package/src/lib/accordion/accordion.directives.ts +143 -0
- package/src/lib/accordion/index.ts +8 -0
- package/src/lib/alert/alert.directives.spec.ts +154 -0
- package/src/lib/alert/alert.directives.ts +67 -0
- package/src/lib/alert/alert.variants.ts +25 -0
- package/src/lib/alert/index.ts +6 -0
- package/src/lib/avatar/avatar.component.spec.ts +75 -0
- package/src/lib/avatar/avatar.component.ts +43 -0
- package/src/lib/avatar/avatar.variants.ts +26 -0
- package/src/lib/avatar/index.ts +2 -0
- package/src/lib/avatar-group/avatar-group.component.spec.ts +74 -0
- package/src/lib/avatar-group/avatar-group.component.ts +88 -0
- package/src/lib/avatar-group/index.ts +1 -0
- package/src/lib/badge/badge.directive.spec.ts +74 -0
- package/src/lib/badge/badge.directive.ts +17 -0
- package/src/lib/badge/badge.variants.ts +29 -0
- package/src/lib/badge/index.ts +2 -0
- package/src/lib/breadcrumb/breadcrumb.directives.spec.ts +80 -0
- package/src/lib/breadcrumb/breadcrumb.directives.ts +78 -0
- package/src/lib/breadcrumb/index.ts +8 -0
- package/src/lib/button/button.directive.spec.ts +92 -0
- package/src/lib/button/button.directive.ts +28 -0
- package/src/lib/button/button.variants.ts +30 -0
- package/src/lib/button/index.ts +2 -0
- package/src/lib/button-group/button-group.directive.spec.ts +46 -0
- package/src/lib/button-group/button-group.directive.ts +19 -0
- package/src/lib/button-group/button-group.variants.ts +18 -0
- package/src/lib/button-group/index.ts +2 -0
- package/src/lib/calendar/calendar.component.spec.ts +192 -0
- package/src/lib/calendar/calendar.component.ts +342 -0
- package/src/lib/calendar/calendar.types.ts +24 -0
- package/src/lib/calendar/index.ts +7 -0
- package/src/lib/card/card.directives.spec.ts +104 -0
- package/src/lib/card/card.directives.ts +72 -0
- package/src/lib/card/card.variants.ts +28 -0
- package/src/lib/card/index.ts +9 -0
- package/src/lib/carousel/carousel.directives.spec.ts +85 -0
- package/src/lib/carousel/carousel.directives.ts +159 -0
- package/src/lib/carousel/index.ts +8 -0
- package/src/lib/chat-bubble/chat-bubble.directives.spec.ts +52 -0
- package/src/lib/chat-bubble/chat-bubble.directives.ts +96 -0
- package/src/lib/chat-bubble/index.ts +11 -0
- package/src/lib/checkbox/checkbox.directive.spec.ts +57 -0
- package/src/lib/checkbox/checkbox.directive.ts +16 -0
- package/src/lib/checkbox/checkbox.variants.ts +19 -0
- package/src/lib/checkbox/index.ts +2 -0
- package/src/lib/color-picker/color-picker.component.spec.ts +328 -0
- package/src/lib/color-picker/color-picker.component.ts +537 -0
- package/src/lib/color-picker/color-picker.types.ts +24 -0
- package/src/lib/color-picker/color-picker.utils.ts +183 -0
- package/src/lib/color-picker/color-picker.variants.ts +17 -0
- package/src/lib/color-picker/index.ts +20 -0
- package/src/lib/combobox/combobox.component.spec.ts +151 -0
- package/src/lib/combobox/combobox.component.ts +264 -0
- package/src/lib/combobox/combobox.variants.ts +19 -0
- package/src/lib/combobox/index.ts +2 -0
- package/src/lib/command-palette/command-palette.component.spec.ts +178 -0
- package/src/lib/command-palette/command-palette.component.ts +194 -0
- package/src/lib/command-palette/command-palette.service.ts +36 -0
- package/src/lib/command-palette/command-palette.types.ts +23 -0
- package/src/lib/command-palette/index.ts +7 -0
- package/src/lib/data-table/data-table.component.spec.ts +443 -0
- package/src/lib/data-table/data-table.component.ts +602 -0
- package/src/lib/data-table/data-table.directives.ts +31 -0
- package/src/lib/data-table/data-table.types.ts +20 -0
- package/src/lib/data-table/index.ts +13 -0
- package/src/lib/date-picker/date-picker.component.spec.ts +131 -0
- package/src/lib/date-picker/date-picker.component.ts +220 -0
- package/src/lib/date-picker/date-picker.variants.ts +17 -0
- package/src/lib/date-picker/index.ts +2 -0
- package/src/lib/date-range-picker/date-range-picker.component.spec.ts +151 -0
- package/src/lib/date-range-picker/date-range-picker.component.ts +340 -0
- package/src/lib/date-range-picker/index.ts +1 -0
- package/src/lib/diff/diff.component.spec.ts +47 -0
- package/src/lib/diff/diff.component.ts +82 -0
- package/src/lib/diff/index.ts +1 -0
- package/src/lib/divider/divider.component.spec.ts +48 -0
- package/src/lib/divider/divider.component.ts +51 -0
- package/src/lib/divider/divider.variants.ts +22 -0
- package/src/lib/divider/index.ts +2 -0
- package/src/lib/dock/dock.directives.spec.ts +85 -0
- package/src/lib/dock/dock.directives.ts +81 -0
- package/src/lib/dock/index.ts +1 -0
- package/src/lib/drawer/drawer.directives.spec.ts +62 -0
- package/src/lib/drawer/drawer.directives.ts +80 -0
- package/src/lib/drawer/index.ts +8 -0
- package/src/lib/dropdown/dropdown.directives.spec.ts +106 -0
- package/src/lib/dropdown/dropdown.directives.ts +136 -0
- package/src/lib/dropdown/dropdown.variants.ts +27 -0
- package/src/lib/dropdown/index.ts +15 -0
- package/src/lib/fab/fab.directives.spec.ts +60 -0
- package/src/lib/fab/fab.directives.ts +77 -0
- package/src/lib/fab/index.ts +8 -0
- package/src/lib/fieldset/fieldset.directives.spec.ts +74 -0
- package/src/lib/fieldset/fieldset.directives.ts +49 -0
- package/src/lib/fieldset/fieldset.variants.ts +15 -0
- package/src/lib/fieldset/index.ts +6 -0
- package/src/lib/file-input/file-input.component.spec.ts +114 -0
- package/src/lib/file-input/file-input.component.ts +155 -0
- package/src/lib/file-input/file-input.variants.ts +25 -0
- package/src/lib/file-input/index.ts +6 -0
- package/src/lib/indicator/index.ts +6 -0
- package/src/lib/indicator/indicator.directives.spec.ts +64 -0
- package/src/lib/indicator/indicator.directives.ts +59 -0
- package/src/lib/input/index.ts +3 -0
- package/src/lib/input/input.directive.spec.ts +103 -0
- package/src/lib/input/input.directive.ts +25 -0
- package/src/lib/input/input.variants.ts +42 -0
- package/src/lib/input/label.directive.ts +16 -0
- package/src/lib/kbd/index.ts +2 -0
- package/src/lib/kbd/kbd.directive.spec.ts +42 -0
- package/src/lib/kbd/kbd.directive.ts +18 -0
- package/src/lib/kbd/kbd.variants.ts +19 -0
- package/src/lib/link/index.ts +2 -0
- package/src/lib/link/link.directive.spec.ts +41 -0
- package/src/lib/link/link.directive.ts +18 -0
- package/src/lib/link/link.variants.ts +20 -0
- package/src/lib/list/index.ts +8 -0
- package/src/lib/list/list.directives.spec.ts +65 -0
- package/src/lib/list/list.directives.ts +81 -0
- package/src/lib/loader/index.ts +2 -0
- package/src/lib/loader/loader.component.spec.ts +58 -0
- package/src/lib/loader/loader.component.ts +47 -0
- package/src/lib/loader/loader.variants.ts +21 -0
- package/src/lib/modal/dialog-ref.ts +19 -0
- package/src/lib/modal/dialog.directives.ts +84 -0
- package/src/lib/modal/dialog.service.spec.ts +52 -0
- package/src/lib/modal/dialog.service.ts +61 -0
- package/src/lib/modal/dialog.types.ts +16 -0
- package/src/lib/modal/index.ts +11 -0
- package/src/lib/navbar/index.ts +7 -0
- package/src/lib/navbar/navbar.directives.spec.ts +59 -0
- package/src/lib/navbar/navbar.directives.ts +57 -0
- package/src/lib/number-input/index.ts +2 -0
- package/src/lib/number-input/number-input.component.spec.ts +151 -0
- package/src/lib/number-input/number-input.component.ts +152 -0
- package/src/lib/number-input/number-input.variants.ts +17 -0
- package/src/lib/otp-input/index.ts +2 -0
- package/src/lib/otp-input/otp-input.component.spec.ts +252 -0
- package/src/lib/otp-input/otp-input.component.ts +274 -0
- package/src/lib/otp-input/otp-input.variants.ts +18 -0
- package/src/lib/pagination/index.ts +6 -0
- package/src/lib/pagination/pagination.component.spec.ts +59 -0
- package/src/lib/pagination/pagination.component.ts +143 -0
- package/src/lib/pagination/pagination.variants.ts +31 -0
- package/src/lib/popover/index.ts +6 -0
- package/src/lib/popover/popover.directives.spec.ts +147 -0
- package/src/lib/popover/popover.directives.ts +151 -0
- package/src/lib/progress/index.ts +7 -0
- package/src/lib/progress/progress.component.spec.ts +117 -0
- package/src/lib/progress/progress.component.ts +64 -0
- package/src/lib/progress/progress.variants.ts +43 -0
- package/src/lib/radial-progress/index.ts +5 -0
- package/src/lib/radial-progress/radial-progress.component.spec.ts +41 -0
- package/src/lib/radial-progress/radial-progress.component.ts +70 -0
- package/src/lib/radio/index.ts +2 -0
- package/src/lib/radio/radio.directive.spec.ts +46 -0
- package/src/lib/radio/radio.directive.ts +16 -0
- package/src/lib/radio/radio.variants.ts +19 -0
- package/src/lib/rating/index.ts +2 -0
- package/src/lib/rating/rating.component.spec.ts +157 -0
- package/src/lib/rating/rating.component.ts +163 -0
- package/src/lib/rating/rating.variants.ts +20 -0
- package/src/lib/select/index.ts +2 -0
- package/src/lib/select/select.component.spec.ts +112 -0
- package/src/lib/select/select.component.ts +235 -0
- package/src/lib/select/select.variants.ts +19 -0
- package/src/lib/sheet/index.ts +10 -0
- package/src/lib/sheet/sheet-ref.ts +18 -0
- package/src/lib/sheet/sheet.component.spec.ts +67 -0
- package/src/lib/sheet/sheet.directives.ts +70 -0
- package/src/lib/sheet/sheet.service.ts +100 -0
- package/src/lib/sheet/sheet.types.ts +23 -0
- package/src/lib/skeleton/index.ts +2 -0
- package/src/lib/skeleton/skeleton.directive.spec.ts +63 -0
- package/src/lib/skeleton/skeleton.directive.ts +21 -0
- package/src/lib/skeleton/skeleton.variants.ts +27 -0
- package/src/lib/slider/index.ts +2 -0
- package/src/lib/slider/slider.component.spec.ts +104 -0
- package/src/lib/slider/slider.component.ts +181 -0
- package/src/lib/slider/slider.variants.ts +25 -0
- package/src/lib/stat/index.ts +8 -0
- package/src/lib/stat/stat.directives.spec.ts +60 -0
- package/src/lib/stat/stat.directives.ts +79 -0
- package/src/lib/status/index.ts +2 -0
- package/src/lib/status/status.directive.spec.ts +43 -0
- package/src/lib/status/status.directive.ts +37 -0
- package/src/lib/status/status.variants.ts +26 -0
- package/src/lib/steps/index.ts +8 -0
- package/src/lib/steps/steps.directives.spec.ts +52 -0
- package/src/lib/steps/steps.directives.ts +78 -0
- package/src/lib/switch/index.ts +2 -0
- package/src/lib/switch/switch.component.spec.ts +98 -0
- package/src/lib/switch/switch.component.ts +76 -0
- package/src/lib/switch/switch.variants.ts +31 -0
- package/src/lib/table/index.ts +12 -0
- package/src/lib/table/table.directives.spec.ts +111 -0
- package/src/lib/table/table.directives.ts +126 -0
- package/src/lib/table/table.variants.ts +36 -0
- package/src/lib/tabs/index.ts +8 -0
- package/src/lib/tabs/tabs.directives.spec.ts +136 -0
- package/src/lib/tabs/tabs.directives.ts +126 -0
- package/src/lib/tabs/tabs.variants.ts +17 -0
- package/src/lib/tag-input/index.ts +2 -0
- package/src/lib/tag-input/tag-input.component.spec.ts +190 -0
- package/src/lib/tag-input/tag-input.component.ts +172 -0
- package/src/lib/tag-input/tag-input.variants.ts +31 -0
- package/src/lib/textarea/index.ts +7 -0
- package/src/lib/textarea/textarea.directive.spec.ts +84 -0
- package/src/lib/textarea/textarea.directive.ts +71 -0
- package/src/lib/textarea/textarea.variants.ts +34 -0
- package/src/lib/timeline/index.ts +11 -0
- package/src/lib/timeline/timeline.directives.spec.ts +55 -0
- package/src/lib/timeline/timeline.directives.ts +85 -0
- package/src/lib/toast/index.ts +3 -0
- package/src/lib/toast/toast.service.spec.ts +71 -0
- package/src/lib/toast/toast.service.ts +60 -0
- package/src/lib/toast/toast.variants.ts +38 -0
- package/src/lib/toast/toaster.component.spec.ts +38 -0
- package/src/lib/toast/toaster.component.ts +81 -0
- package/src/lib/toggle/index.ts +2 -0
- package/src/lib/toggle/toggle.directive.spec.ts +100 -0
- package/src/lib/toggle/toggle.directive.ts +61 -0
- package/src/lib/toggle/toggle.variants.ts +25 -0
- package/src/lib/tooltip/index.ts +2 -0
- package/src/lib/tooltip/tooltip.directive.spec.ts +113 -0
- package/src/lib/tooltip/tooltip.directive.ts +130 -0
- package/src/lib/tooltip/tooltip.variants.ts +20 -0
- package/src/lib/validator/index.ts +5 -0
- package/src/lib/validator/validator.directives.spec.ts +47 -0
- package/src/lib/validator/validator.directives.ts +50 -0
- package/src/styles/sonny-theme.css +45 -0
- package/types/sonny-ui-core.d.ts +1443 -13
package/README.md
CHANGED
|
@@ -1,40 +1,187 @@
|
|
|
1
|
-
# @sonny-ui/core
|
|
2
|
-
|
|
3
|
-
Angular
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
# @sonny-ui/core
|
|
2
|
+
|
|
3
|
+
Beautiful, accessible Angular components built with **Tailwind CSS v4** and **Signals**. Inspired by [shadcn/ui](https://ui.shadcn.com/).
|
|
4
|
+
|
|
5
|
+
- **Directive & Component-based** — lightweight directives for simple elements, full components for complex interactions
|
|
6
|
+
- **Signal inputs** — `input()`, `model()`, `output()`, `computed()`, `linkedSignal()` — pure Angular 21 signals API
|
|
7
|
+
- **Zoneless** — built for `provideZonelessChangeDetection()`
|
|
8
|
+
- **Themeable** — CSS custom properties with light, dark, and corporate themes
|
|
9
|
+
- **Accessible** — WAI-ARIA compliant, keyboard navigation, screen reader support
|
|
10
|
+
- **Reactive Forms** — ControlValueAccessor on all form components
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
### Automatic (recommended)
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
ng add @sonny-ui/core
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This installs the package, adds Tailwind CSS v4 if needed, imports `sonny-theme.css`, and provides `SonnyUI` in your app config.
|
|
21
|
+
|
|
22
|
+
### Manual
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install @sonny-ui/core
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then in your `app.config.ts`:
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { provideZonelessChangeDetection } from '@angular/core';
|
|
32
|
+
import { provideSonnyUI } from '@sonny-ui/core';
|
|
33
|
+
|
|
34
|
+
export const appConfig = {
|
|
35
|
+
providers: [
|
|
36
|
+
provideZonelessChangeDetection(),
|
|
37
|
+
provideSonnyUI({ defaultTheme: 'light' }),
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
And import the theme in your global styles:
|
|
43
|
+
|
|
44
|
+
```css
|
|
45
|
+
@import "tailwindcss";
|
|
46
|
+
@import "@sonny-ui/core/styles/sonny-theme.css";
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Requirements
|
|
50
|
+
|
|
51
|
+
- Angular >= 21.0.0
|
|
52
|
+
- Angular CDK >= 21.0.0
|
|
53
|
+
- Tailwind CSS v4
|
|
54
|
+
|
|
55
|
+
## Components (60+)
|
|
56
|
+
|
|
57
|
+
### Layout & Navigation
|
|
58
|
+
| Component | Description |
|
|
59
|
+
|-----------|-------------|
|
|
60
|
+
| **Accordion** | Expandable sections, single/multi mode |
|
|
61
|
+
| **Breadcrumb** | Navigation trail with dynamic segments |
|
|
62
|
+
| **Navbar** | Responsive navigation bar with variants |
|
|
63
|
+
| **Tabs** | Tabbed content with triggers and panels |
|
|
64
|
+
| **Steps** | Step-by-step progress indicator |
|
|
65
|
+
| **Pagination** | Page navigation with sibling/boundary counts |
|
|
66
|
+
| **Divider** | Horizontal/vertical content separator |
|
|
67
|
+
|
|
68
|
+
### Data Display
|
|
69
|
+
| Component | Description |
|
|
70
|
+
|-----------|-------------|
|
|
71
|
+
| **Table** | Default/striped/bordered, 3 densities, sticky header |
|
|
72
|
+
| **Data Table** | Full-featured: sorting, filtering, pagination, row selection, expansion, column visibility, custom cell templates, bulk actions, loading skeleton, JSON export |
|
|
73
|
+
| **Card** | Content containers — 4 variants, selectable |
|
|
74
|
+
| **Badge** | Status labels — 6 variants, 3 sizes |
|
|
75
|
+
| **Avatar** | User images with fallback initials |
|
|
76
|
+
| **Avatar Group** | Stacked avatars with overflow counter, fallback initials |
|
|
77
|
+
| **Stat** | Statistic display with label/value/change |
|
|
78
|
+
| **Timeline** | Chronological event display |
|
|
79
|
+
| **List** | Styled list items |
|
|
80
|
+
| **Kbd** | Keyboard shortcut display |
|
|
81
|
+
| **Status** | Status indicator dots |
|
|
82
|
+
| **Indicator** | Positioned badge indicators |
|
|
83
|
+
| **Diff** | Side-by-side content comparison |
|
|
84
|
+
|
|
85
|
+
### Form Controls
|
|
86
|
+
| Component | Description |
|
|
87
|
+
|-----------|-------------|
|
|
88
|
+
| **Input** | Text input — default/error/success variants |
|
|
89
|
+
| **Textarea** | Multi-line text input |
|
|
90
|
+
| **Select** | Dropdown selection with search |
|
|
91
|
+
| **Combobox** | Searchable dropdown with keyboard navigation |
|
|
92
|
+
| **Checkbox** | Signal-based with two-way binding |
|
|
93
|
+
| **Radio** | Signal-based radio groups |
|
|
94
|
+
| **Switch** | Toggle switches with two-way binding |
|
|
95
|
+
| **Slider** | Range input with min/max/step, drag support |
|
|
96
|
+
| **Toggle** | Pressed state buttons for toolbars |
|
|
97
|
+
| **Rating** | Star rating with half-star support |
|
|
98
|
+
| **File Input** | File upload with drag & drop |
|
|
99
|
+
| **Fieldset** | Grouped form fields with legend |
|
|
100
|
+
| **Calendar** | Date grid with single/range selection, hover preview |
|
|
101
|
+
| **Date Picker** | Single date with calendar dropdown, clearable, min/max |
|
|
102
|
+
| **Date Range Picker** | Date range with dual calendar, preset ranges, responsive |
|
|
103
|
+
| **Color Picker** | Visual color selector with saturation panel, hue slider, HEX/RGB/HSL, presets, favorites, EyeDropper API |
|
|
104
|
+
| **Number Input** | Numeric stepper with +/- buttons, min/max/step, ArrowUp/Down |
|
|
105
|
+
| **OTP Input** | One-time password input with auto-focus, paste, mask, separator, status feedback |
|
|
106
|
+
| **Tag Input** | Tag/chip creator with Enter/comma, validation, maxTags, Backspace remove |
|
|
107
|
+
| **Validator** | Form validation message display |
|
|
108
|
+
|
|
109
|
+
### Feedback & Overlays
|
|
110
|
+
| Component | Description |
|
|
111
|
+
|-----------|-------------|
|
|
112
|
+
| **Alert** | Callout messages — 5 variants, dismissible |
|
|
113
|
+
| **Toast** | Notifications — 4 variants, positioned, with actions |
|
|
114
|
+
| **Modal / Dialog** | Dialog overlays using Angular CDK |
|
|
115
|
+
| **Sheet** | Slide-out panels from any side |
|
|
116
|
+
| **Drawer** | Bottom/side drawer panels |
|
|
117
|
+
| **Tooltip** | Hover/focus tooltips |
|
|
118
|
+
| **Dropdown Menu** | Context menus with items, separators, labels |
|
|
119
|
+
| **Command Palette** | Searchable command menu with groups, keyboard nav, service-based |
|
|
120
|
+
| **Popover** | Floating panel with trigger, positioning, click-outside, escape |
|
|
121
|
+
|
|
122
|
+
### Visual
|
|
123
|
+
| Component | Description |
|
|
124
|
+
|-----------|-------------|
|
|
125
|
+
| **Button** | 6 variants, 4 sizes, loading state, link mode |
|
|
126
|
+
| **Button Group** | Grouped actions, horizontal/vertical |
|
|
127
|
+
| **Loader** | Spinner, dots, and bars variants |
|
|
128
|
+
| **Skeleton** | Loading placeholders — line/circular/rounded |
|
|
129
|
+
| **Progress** | Linear progress bar |
|
|
130
|
+
| **Radial Progress** | Circular progress indicator |
|
|
131
|
+
| **Carousel** | Image/content slider |
|
|
132
|
+
| **Chat Bubble** | Message bubbles for chat UI |
|
|
133
|
+
| **Dock** | macOS-style dock with hover scaling |
|
|
134
|
+
| **FAB** | Floating action button |
|
|
135
|
+
| **Link** | Styled anchor with variants |
|
|
136
|
+
|
|
137
|
+
## Usage
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { SnyButtonDirective, SnyCardDirective } from '@sonny-ui/core';
|
|
141
|
+
|
|
142
|
+
@Component({
|
|
143
|
+
imports: [SnyButtonDirective, SnyCardDirective],
|
|
144
|
+
template: `
|
|
145
|
+
<div snyCard padding="md">
|
|
146
|
+
<h3>My Card</h3>
|
|
147
|
+
<button snyBtn variant="default">Click me</button>
|
|
148
|
+
<button snyBtn variant="outline">Cancel</button>
|
|
149
|
+
</div>
|
|
150
|
+
`,
|
|
151
|
+
})
|
|
152
|
+
export class MyComponent {}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Theming
|
|
156
|
+
|
|
157
|
+
Three built-in themes: **light**, **dark**, **corporate**. Toggle at runtime:
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
import { ThemeService } from '@sonny-ui/core';
|
|
161
|
+
|
|
162
|
+
themeService = inject(ThemeService);
|
|
163
|
+
themeService.setTheme('dark');
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
CSS custom properties:
|
|
167
|
+
|
|
168
|
+
```css
|
|
169
|
+
--sny-background, --sny-foreground,
|
|
170
|
+
--sny-primary, --sny-primary-foreground,
|
|
171
|
+
--sny-secondary, --sny-secondary-foreground,
|
|
172
|
+
--sny-accent, --sny-accent-foreground,
|
|
173
|
+
--sny-muted, --sny-muted-foreground,
|
|
174
|
+
--sny-destructive, --sny-destructive-foreground,
|
|
175
|
+
--sny-border, --sny-ring, --sny-radius
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Links
|
|
179
|
+
|
|
180
|
+
- [Documentation](https://coci-dev.github.io/sonny-ui/)
|
|
181
|
+
- [GitHub](https://github.com/coci-dev/sonny-ui)
|
|
182
|
+
- [npm](https://www.npmjs.com/package/@sonny-ui/core)
|
|
183
|
+
- [Issues](https://github.com/coci-dev/sonny-ui/issues)
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
|
|
187
|
+
MIT
|