@smartsoft001/angular 2.114.0 → 2.116.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
CHANGED
|
@@ -32,6 +32,85 @@ For more details, see our [Contributing Guidelines](../../../CONTRIBUTING.md).
|
|
|
32
32
|
|
|
33
33
|
All notable changes to this project will be documented in the [CHANGELOG](../../../CHANGELOG.md).
|
|
34
34
|
|
|
35
|
+
## Button Component
|
|
36
|
+
|
|
37
|
+
The `<smart-button>` component provides a flexible button with three shape variants, three color variants, five sizes, and support for loading, disabled, and confirm states.
|
|
38
|
+
|
|
39
|
+
### Usage
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<!-- Standard (default shape) -->
|
|
43
|
+
<smart-button [options]="{ click: onClick, variant: 'primary', size: 'md' }">
|
|
44
|
+
Save
|
|
45
|
+
</smart-button>
|
|
46
|
+
|
|
47
|
+
<!-- Rounded -->
|
|
48
|
+
<smart-button [options]="{ click: onClick, variant: 'secondary', rounded: true }">
|
|
49
|
+
Cancel
|
|
50
|
+
</smart-button>
|
|
51
|
+
|
|
52
|
+
<!-- Circular with icon -->
|
|
53
|
+
<smart-button [options]="{ click: onClick, variant: 'primary', circular: true }">
|
|
54
|
+
<svg>...</svg>
|
|
55
|
+
</smart-button>
|
|
56
|
+
|
|
57
|
+
<!-- Loading state (pass a signal) -->
|
|
58
|
+
<smart-button [options]="{ click: onClick, loading: loadingSignal }">
|
|
59
|
+
Submit
|
|
60
|
+
</smart-button>
|
|
61
|
+
|
|
62
|
+
<!-- Disabled -->
|
|
63
|
+
<smart-button [options]="{ click: onClick }" [disabled]="true">
|
|
64
|
+
Disabled
|
|
65
|
+
</smart-button>
|
|
66
|
+
|
|
67
|
+
<!-- Confirm mode (shows confirmation before executing click) -->
|
|
68
|
+
<smart-button [options]="{ click: onDelete, confirm: true }">
|
|
69
|
+
Delete
|
|
70
|
+
</smart-button>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### IButtonOptions
|
|
74
|
+
|
|
75
|
+
| Property | Type | Default | Description |
|
|
76
|
+
| ---------- | --------------------------------- | ----------- | ------------------------------------ |
|
|
77
|
+
| `click` | `() => void` | *required* | Click handler |
|
|
78
|
+
| `variant` | `'primary' \| 'secondary' \| 'soft'` | `'primary'` | Color variant |
|
|
79
|
+
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Button size |
|
|
80
|
+
| `rounded` | `boolean` | `false` | Rounded pill shape |
|
|
81
|
+
| `circular` | `boolean` | `false` | Circular shape (for icon buttons) |
|
|
82
|
+
| `confirm` | `boolean` | `false` | Show confirmation before click |
|
|
83
|
+
| `loading` | `Signal<boolean>` | - | Show loading spinner when true |
|
|
84
|
+
| `type` | `'submit' \| 'button'` | `'button'` | HTML button type |
|
|
85
|
+
| `expand` | `'block' \| 'full'` | - | Expand button width |
|
|
86
|
+
| `color` | `string` | `'primary'` | Legacy color option |
|
|
87
|
+
|
|
88
|
+
### Inputs
|
|
89
|
+
|
|
90
|
+
| Input | Type | Default | Description |
|
|
91
|
+
| ---------- | --------- | ------- | -------------------- |
|
|
92
|
+
| `options` | `IButtonOptions` | *required* | Button configuration |
|
|
93
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
94
|
+
| `class` | `string` | `''` | External CSS class |
|
|
95
|
+
|
|
96
|
+
### Variants
|
|
97
|
+
|
|
98
|
+
| Variant | Description |
|
|
99
|
+
| ----------- | -------------------------------------------- |
|
|
100
|
+
| `primary` | Indigo background with white text |
|
|
101
|
+
| `secondary` | White background with gray text and border |
|
|
102
|
+
| `soft` | Light indigo background with indigo text |
|
|
103
|
+
|
|
104
|
+
### Sizes
|
|
105
|
+
|
|
106
|
+
| Size | Description |
|
|
107
|
+
| ---- | -------------- |
|
|
108
|
+
| `xs` | Extra small |
|
|
109
|
+
| `sm` | Small |
|
|
110
|
+
| `md` | Medium (default) |
|
|
111
|
+
| `lg` | Large |
|
|
112
|
+
| `xl` | Extra large |
|
|
113
|
+
|
|
35
114
|
## 📜 License
|
|
36
115
|
|
|
37
116
|
This project is licensed under the MIT License.
|