@akcelik/strct 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/LICENSE +21 -0
- package/README.md +99 -0
- package/fesm2022/akcelik-strct.mjs +5375 -0
- package/fesm2022/akcelik-strct.mjs.map +1 -0
- package/package.json +54 -0
- package/styles/_base.scss +46 -0
- package/styles/_forms.scss +53 -0
- package/styles/_tokens.scss +113 -0
- package/styles/theme.scss +10 -0
- package/types/akcelik-strct.d.ts +1375 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Serkan Akcelik
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# @akcelik/strct
|
|
2
|
+
|
|
3
|
+
A standalone Angular component library built around a **tokenised, multi-palette
|
|
4
|
+
theme system**. Everything is driven by CSS custom properties, so a single
|
|
5
|
+
attribute swap re-skins the whole library.
|
|
6
|
+
|
|
7
|
+
- **3 palettes** — Arctic, Ember, Sage
|
|
8
|
+
- **2 modes** — Dark, Light
|
|
9
|
+
- Standalone components, signal inputs, `OnPush` everywhere
|
|
10
|
+
- `ControlValueAccessor` support on every form control
|
|
11
|
+
- No runtime CSS framework dependency
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @akcelik/strct
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`@angular/core`, `@angular/common`, `@angular/forms` and
|
|
20
|
+
`@angular/platform-browser` are peer dependencies.
|
|
21
|
+
|
|
22
|
+
## Theme setup
|
|
23
|
+
|
|
24
|
+
Import the theme once in your global stylesheet (ships tokens + base reset +
|
|
25
|
+
form-control styles):
|
|
26
|
+
|
|
27
|
+
```scss
|
|
28
|
+
// styles.scss
|
|
29
|
+
@use '@akcelik/strct/styles/theme';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Set the scheme on the document root (or let `StrctThemeService` manage it):
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<html data-palette="arctic" data-theme="dark">
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { StrctThemeService } from '@akcelik/strct';
|
|
40
|
+
|
|
41
|
+
const theme = inject(StrctThemeService);
|
|
42
|
+
theme.setPalette('ember'); // 'arctic' | 'ember' | 'sage'
|
|
43
|
+
theme.setMode('light'); // 'dark' | 'light' (persisted to localStorage)
|
|
44
|
+
theme.toggleMode();
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Drop the ready-made switcher anywhere:
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<strct-theme-switcher />
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Components
|
|
54
|
+
|
|
55
|
+
Import only what you use — every component is standalone.
|
|
56
|
+
|
|
57
|
+
| Area | Components |
|
|
58
|
+
|-----------|------------|
|
|
59
|
+
| Layout | `strct-shell`, `strct-header`, `strct-footer`, `strct-vertical-nav`, `strct-nav` / `strct-nav-item`, `strct-login` |
|
|
60
|
+
| Controls | `button[strct-button]`, `strct-badge`, `strct-tag`, `strct-avatar`, `strct-progress`, `strct-spinner`, `strct-skeleton` |
|
|
61
|
+
| Surfaces | `strct-card` (+ header/block/footer), `strct-accordion`, `strct-tabs`, `strct-tree`, `strct-modal`, `strct-dropdown`, `strct-context-menu` (+ `strct-submenu`), `strct-wizard`, `strct-divider` |
|
|
62
|
+
| Navigation | `strct-breadcrumb` / `strct-breadcrumb-item`, `strct-pagination` |
|
|
63
|
+
| Forms | `strctInput`, `strct-checkbox`, `strct-toggle`, `strct-radio-group` / `strct-radio`, `strct-range`, `strct-combobox`, `strct-cascade-select`, `strct-datepicker`, `strct-password`, `strct-file`, `strct-color-picker` |
|
|
64
|
+
| Data | `strct-table`, `strct-datagrid`, `strct-timeline` / `strct-timeline-item`, `strct-stack` / `strct-stack-item` |
|
|
65
|
+
| Charts | `strct-sparkline`, `strct-chart` (line / area / bar), `strct-donut`, `strct-gauge` |
|
|
66
|
+
| Feedback | `strct-alert`, `strctTooltip`, `strct-signpost`, `strct-toast-outlet` + `StrctToastService` |
|
|
67
|
+
| Foundations | `strct-icon` (datacenter icon set + status `badge`), `strct-theme-switcher` |
|
|
68
|
+
|
|
69
|
+
### Examples
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<button strct-button variant="primary">Save</button>
|
|
73
|
+
<button strct-button variant="outline" size="sm">Cancel</button>
|
|
74
|
+
|
|
75
|
+
<strct-badge status="success">Active</strct-badge>
|
|
76
|
+
|
|
77
|
+
<strct-modal [(open)]="show" title="Confirm">
|
|
78
|
+
Body…
|
|
79
|
+
<ng-container strctModalFooter>
|
|
80
|
+
<button strct-button (click)="show = false">Cancel</button>
|
|
81
|
+
<button strct-button variant="primary" (click)="show = false">OK</button>
|
|
82
|
+
</ng-container>
|
|
83
|
+
</strct-modal>
|
|
84
|
+
|
|
85
|
+
<input strctInput placeholder="Name" [(ngModel)]="name" />
|
|
86
|
+
<strct-checkbox [(ngModel)]="agree">I agree</strct-checkbox>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Design tokens
|
|
90
|
+
|
|
91
|
+
Components reference these CSS variables only — never hard-coded colors:
|
|
92
|
+
|
|
93
|
+
`--bg-0..--bg-a` surfaces · `--hdr` header · `--b1/--b2/--b3` borders ·
|
|
94
|
+
`--t1..--t4` text · `--inv` inverse · `--acc` (+ `--acc-m/-s/50/30/18`) accent ·
|
|
95
|
+
`--ok / --wrn / --crt` semantic (+ `*-bg`) · `--sh / --shh` shadows · `--sb` scrollbar.
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
[MIT](./LICENSE) © Serkan Akcelik
|