@egose/shadcn-theme-ng-tw 0.1.0 → 0.2.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.
Files changed (86) hide show
  1. package/README.md +1 -1
  2. package/accordion/README.md +405 -2
  3. package/alert/README.md +372 -2
  4. package/alert-dialog/README.md +471 -5
  5. package/aspect-ratio/README.md +272 -5
  6. package/autocomplete/README.md +502 -2
  7. package/avatar/README.md +357 -5
  8. package/badge/README.md +318 -2
  9. package/basic-alert/README.md +353 -2
  10. package/breadcrumb/README.md +406 -5
  11. package/button/README.md +482 -2
  12. package/button/fesm2022/button.mjs +85 -107
  13. package/button/types/button.d.ts +5 -8
  14. package/button-group/README.md +318 -5
  15. package/button-group/fesm2022/button-group.mjs +1 -1
  16. package/calendar/README.md +357 -2
  17. package/card/README.md +331 -5
  18. package/carousel/README.md +333 -5
  19. package/carousel/fesm2022/carousel.mjs +4 -1
  20. package/checkbox/README.md +320 -2
  21. package/collapsible/README.md +332 -5
  22. package/combobox/README.md +507 -5
  23. package/combobox/fesm2022/combobox.mjs +4 -1
  24. package/command/README.md +435 -5
  25. package/confirmation-dialog/README.md +301 -2
  26. package/context-menu/README.md +366 -5
  27. package/date-picker/README.md +465 -2
  28. package/date-picker/fesm2022/date-picker.mjs +2 -2
  29. package/dialog/README.md +448 -2
  30. package/drawer/README.md +395 -5
  31. package/dropdown-menu/README.md +417 -5
  32. package/empty/README.md +329 -5
  33. package/field/README.md +385 -5
  34. package/form-checkbox/README.md +312 -2
  35. package/form-date-picker/README.md +322 -2
  36. package/form-field/README.md +356 -2
  37. package/form-field-simple/README.md +340 -2
  38. package/form-searchable-multiselect/README.md +361 -2
  39. package/form-select/README.md +350 -2
  40. package/form-text-input/README.md +371 -2
  41. package/form-textarea/README.md +347 -2
  42. package/hover-card/README.md +256 -5
  43. package/icon/README.md +239 -2
  44. package/input/README.md +269 -2
  45. package/input-group/README.md +335 -5
  46. package/input-group/fesm2022/input-group.mjs +3 -3
  47. package/input-otp/README.md +375 -5
  48. package/item/README.md +385 -5
  49. package/item/fesm2022/item.mjs +3 -3
  50. package/kbd/README.md +291 -5
  51. package/label/README.md +272 -2
  52. package/layout-simple/README.md +193 -2
  53. package/layout-simple/fesm2022/layout-simple.mjs +877 -409
  54. package/layout-simple/types/layout-simple.d.ts +174 -137
  55. package/menu/README.md +417 -2
  56. package/menubar/README.md +343 -5
  57. package/native-select/README.md +323 -5
  58. package/navigation-menu/README.md +369 -5
  59. package/package.json +1 -1
  60. package/pagination/README.md +388 -5
  61. package/popover/README.md +331 -2
  62. package/progress/README.md +311 -5
  63. package/radio-group/README.md +364 -2
  64. package/radio-group/fesm2022/radio-group.mjs +5 -1
  65. package/resizable/README.md +269 -5
  66. package/scroll-area/README.md +233 -5
  67. package/searchable-multiselect/README.md +323 -2
  68. package/select/README.md +437 -2
  69. package/separator/README.md +222 -2
  70. package/sheet/README.md +311 -2
  71. package/sidebar/README.md +457 -5
  72. package/skeleton/README.md +217 -5
  73. package/slider/README.md +273 -5
  74. package/slider/fesm2022/slider.mjs +17 -13
  75. package/sonner/README.md +346 -2
  76. package/spinner/README.md +284 -2
  77. package/switch/README.md +310 -2
  78. package/table/README.md +423 -5
  79. package/tabs/README.md +411 -2
  80. package/tabs/fesm2022/tabs.mjs +12 -2
  81. package/textarea/README.md +282 -5
  82. package/toggle/README.md +270 -5
  83. package/toggle-group/README.md +340 -5
  84. package/tooltip/README.md +269 -2
  85. package/typography/README.md +271 -5
  86. package/utils/README.md +303 -2
package/sheet/README.md CHANGED
@@ -1,3 +1,312 @@
1
- # Sheet Subpath
1
+ # Sheet (`@egose/shadcn-theme-ng/sheet`)
2
2
 
3
- This project ships only as `@egose/shadcn-theme-ng/sheet` or `@egose/shadcn-theme-ng-tw/sheet`. See the [package README](../../README.md) for installation, compatibility, Tailwind variant, test, and release guidance. Do not publish this project directory independently.
3
+ A shadcn/ui-style **Sheet** — a slide-over panel (dialog) anchored to any screen edge. This is the Angular equivalent of shadcn/ui `Sheet` (`SheetTrigger`, `SheetContent`, `SheetHeader`, `SheetFooter`, `SheetTitle`, `SheetDescription`, `SheetClose`).
4
+
5
+ The overlay/focus-trap/dialog mechanics come from **spartan-ng/brain** (`BrnSheet`, `BrnSheetOverlay`, `BrnSheetClose`, `BrnSheetTitle`, `BrnSheetDescription`, `BrnDialog`). This package adds the shadcn shell: `HlmSheet` root (extends `BrnSheet`, renders the overlay + content outlet), `HlmSheetContent` with `side` variants (top/bottom/left/right, default right) plus a built-in close button, header/footer/title/description layout pieces, and overlay/close styling directives.
6
+
7
+ > **Ships as:** `@egose/shadcn-theme-ng/sheet` and `@egose/shadcn-theme-ng-tw/sheet` (the `tw:`-prefixed Tailwind variant — same API, class strings prefixed with `tw:`).
8
+ > See the [package README](../../README.md) for installation, peer dependencies, and Tailwind setup. Do not publish this project directory independently.
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ # Plain Tailwind (no prefix)
14
+ npm install @egose/shadcn-theme-ng
15
+
16
+ # Or the tw:-prefixed variant
17
+ npm install @egose/shadcn-theme-ng-tw
18
+ ```
19
+
20
+ ```ts
21
+ import { HlmSheetImports } from '@egose/shadcn-theme-ng/sheet';
22
+ // tw variant:
23
+ // import { HlmSheetImports } from '@egose/shadcn-theme-ng-tw/sheet';
24
+ ```
25
+
26
+ Peer dependencies (see [package README](../../README.md) for versions): `@angular/core`, `@angular/common`. Icons use `@ng-icons/lucide` (`lucideX` for the built-in close button), installed transitively.
27
+
28
+ ## Imports
29
+
30
+ Real exported symbols (from `src/public-api.ts`):
31
+
32
+ | Symbol | Kind | Selector |
33
+ | --------------------- | ------------------------------ | ------------------------------------------------------------------------------ |
34
+ | `HlmSheet` | Component (extends `BrnSheet`) | `hlm-sheet` (`exportAs: 'hlmSheet'`) |
35
+ | `HlmSheetContent` | Component | `hlm-sheet-content` |
36
+ | `HlmSheetHeader` | Component | `hlm-sheet-header` |
37
+ | `HlmSheetFooter` | Component | `hlm-sheet-footer` |
38
+ | `HlmSheetTitle` | Directive | `[hlmSheetTitle]` |
39
+ | `HlmSheetDescription` | Directive | `[hlmSheetDescription]` |
40
+ | `HlmSheetOverlay` | Directive | `[hlmSheetOverlay],brn-sheet-overlay[hlm]` |
41
+ | `HlmSheetClose` | Directive | `[hlmSheetClose],[brnSheetClose][hlm]` |
42
+ | `sheetVariants` | `cva` | Side-variant class builder (`top \| bottom \| left \| right`, default `right`) |
43
+ | `HlmSheetImports` | `const` array | All components/directives above, for standalone `imports` |
44
+ | `HlmSheetModule` | `NgModule` | NgModule wrapper re-exporting all of the above |
45
+
46
+ Standalone usage:
47
+
48
+ ```ts
49
+ import { Component } from '@angular/core';
50
+ import { HlmSheetImports } from '@egose/shadcn-theme-ng/sheet';
51
+
52
+ @Component({
53
+ selector: 'app-demo',
54
+ standalone: true,
55
+ imports: [HlmSheetImports],
56
+ template: `...`,
57
+ })
58
+ export class DemoComponent {}
59
+ ```
60
+
61
+ NgModule usage:
62
+
63
+ ```ts
64
+ import { NgModule } from '@angular/core';
65
+ import { HlmSheetModule } from '@egose/shadcn-theme-ng/sheet';
66
+
67
+ @NgModule({ imports: [HlmSheetModule] })
68
+ export class DemoModule {}
69
+ ```
70
+
71
+ ## Anatomy / Structure
72
+
73
+ The `HlmSheet` root renders `<brn-sheet-overlay hlm />` plus your projected content. `HlmSheetContent` must be projected with the brain structural directive `*brnSheetContent` so it opens/closes with dialog state; the trigger uses `*brnSheetTrigger`:
74
+
75
+ ```html
76
+ <hlm-sheet>
77
+ <button hlmButton *brnSheetTrigger>Edit profile</button>
78
+
79
+ <hlm-sheet-content *brnSheetContent="let ctx">
80
+ <hlm-sheet-header>
81
+ <h2 hlmSheetTitle>Edit profile</h2>
82
+ <p hlmSheetDescription>Update your details. Click save when done.</p>
83
+ </hlm-sheet-header>
84
+
85
+ <div class="tw:px-4">...form fields...</div>
86
+
87
+ <hlm-sheet-footer>
88
+ <button hlmButton brnSheetClose hlmSheetClose>Save</button>
89
+ <button hlmButton variant="outline" brnSheetClose hlmSheetClose>Cancel</button>
90
+ </hlm-sheet-footer>
91
+ </hlm-sheet-content>
92
+ </hlm-sheet>
93
+ ```
94
+
95
+ Real selectors:
96
+
97
+ | Selector | Class | Notes |
98
+ | ------------------------------------------ | --------------------- | -------------------------------------------------------------------------------------------- |
99
+ | `hlm-sheet` | `HlmSheet` | Root; template = overlay + `<ng-content />`; provides itself as `BrnDialog`/`BrnSheet` |
100
+ | `hlm-sheet-content` | `HlmSheetContent` | Sliding panel; auto close (X) button; `data-state` reflects open/closed |
101
+ | `hlm-sheet-header` | `HlmSheetHeader` | Column layout, padded |
102
+ | `hlm-sheet-footer` | `HlmSheetFooter` | Bottom-pinned column (`mt-auto`), padded |
103
+ | `[hlmSheetTitle]` | `HlmSheetTitle` | Semibold title; forwards `BrnSheetTitle` (accessible dialog name) |
104
+ | `[hlmSheetDescription]` | `HlmSheetDescription` | Muted small description; forwards `BrnSheetDescription` |
105
+ | `[hlmSheetOverlay],brn-sheet-overlay[hlm]` | `HlmSheetOverlay` | Dimmed backdrop with fade animations |
106
+ | `[hlmSheetClose],[brnSheetClose][hlm]` | `HlmSheetClose` | Close-button styling (absolute top-right); apply on an element that also has `brnSheetClose` |
107
+
108
+ ## API reference
109
+
110
+ ### HlmSheet (component)
111
+
112
+ Extends `BrnSheet`, so every `BrnSheet`/`BrnDialog` input/output (e.g. `state`, `stateChanged`, `side` where supported) is available on the host. Own template: `<brn-sheet-overlay hlm />` + content outlet. `exportAs: 'hlmSheet'` for `#sheet="hlmSheet"` references.
113
+
114
+ ### HlmSheetContent (component)
115
+
116
+ | Input | Type | Default | Description |
117
+ | --------------------- | ------------ | ------- | --------------------------------------------------------------------- |
118
+ | `class` (`userClass`) | `ClassValue` | `''` | Extra classes appended to the `sheetVariants({ side })` panel classes |
119
+
120
+ The `side` comes from the exposed-side provider of the enclosing brain sheet context (`injectExposedSideProvider`); the open state comes from `injectExposesStateProvider` and is mirrored to `data-state`. Side classes via the exported `sheetVariants` cva:
121
+
122
+ | `side` | Placement |
123
+ | ----------------- | ------------------------------------------------------------------ |
124
+ | `right` (default) | Right edge, full height, `w-3/4 sm:max-w-sm`, slides in from right |
125
+ | `left` | Left edge, mirrored |
126
+ | `top` | Top edge, full width, auto height, bottom border |
127
+ | `bottom` | Bottom edge, full width, auto height, top border |
128
+
129
+ The built-in close button (`<button brnSheetClose hlm>` with `lucideX` icon + sr-only "Close") is always rendered — add `class="...hidden"` overrides or your own close controls as needed; you cannot remove it via input.
130
+
131
+ ### HlmSheetHeader / HlmSheetFooter / HlmSheetTitle / HlmSheetDescription
132
+
133
+ Layout-only (header: `flex flex-col gap-1.5 p-4`; footer: `mt-auto flex flex-col gap-2 p-4`) plus a `class` (`userClass`) input each. Title forwards `BrnSheetTitle`, description forwards `BrnSheetDescription` — always include a title so the dialog has an accessible name.
134
+
135
+ ### HlmSheetOverlay / HlmSheetClose (directives)
136
+
137
+ Styling-only, each with a `class` (`userClass`) input. `HlmSheetOverlay` pushes its computed class into a custom-class-settable host when present (brain overlay interop). `HlmSheetClose` positions the button absolutely top-right with the subtle-opacity hover treatment — it must sit on an element that also closes the sheet (`brnSheetClose`).
138
+
139
+ ## Examples
140
+
141
+ ### 1. Basic right-side sheet
142
+
143
+ ```ts
144
+ import { Component } from '@angular/core';
145
+ import { BrnSheetImports } from '@spartan-ng/brain/sheet';
146
+ import { HlmButtonImports } from '@egose/shadcn-theme-ng/button';
147
+ import { HlmSheetImports } from '@egose/shadcn-theme-ng/sheet';
148
+
149
+ @Component({
150
+ selector: 'app-basic-sheet',
151
+ standalone: true,
152
+ imports: [BrnSheetImports, HlmButtonImports, HlmSheetImports],
153
+ template: `
154
+ <hlm-sheet>
155
+ <button hlmButton variant="outline" *brnSheetTrigger>Open sheet</button>
156
+
157
+ <hlm-sheet-content *brnSheetContent="let ctx">
158
+ <hlm-sheet-header>
159
+ <h2 hlmSheetTitle>Notifications</h2>
160
+ <p hlmSheetDescription>You have 3 unread messages.</p>
161
+ </hlm-sheet-header>
162
+ <div class="tw:px-4 tw:text-sm">Sheet body…</div>
163
+ <hlm-sheet-footer>
164
+ <button hlmButton brnSheetClose hlmSheetClose>Done</button>
165
+ </hlm-sheet-footer>
166
+ </hlm-sheet-content>
167
+ </hlm-sheet>
168
+ `,
169
+ })
170
+ export class BasicSheetComponent {}
171
+ ```
172
+
173
+ (`*brnSheetTrigger` / `*brnSheetContent` come from `BrnSheetImports` — import that alongside `HlmSheetImports`.)
174
+
175
+ ### 2. All four sides
176
+
177
+ ```html
178
+ <hlm-sheet [side]="'left'">
179
+ <button hlmButton *brnSheetTrigger>Left nav</button>
180
+ <hlm-sheet-content *brnSheetContent="let ctx">
181
+ <hlm-sheet-header>
182
+ <h2 hlmSheetTitle>Menu</h2>
183
+ </hlm-sheet-header>
184
+ </hlm-sheet-content>
185
+ </hlm-sheet>
186
+
187
+ <!-- side="top" | side="bottom" work the same; omit for the default right -->
188
+ ```
189
+
190
+ `side` is read by `HlmSheetContent` through the exposed-side provider, and `sheetVariants({ side })` drives the slide animation direction.
191
+
192
+ ### 3. Form sheet with footer actions
193
+
194
+ ```ts
195
+ import { Component } from '@angular/core';
196
+ import { FormsModule } from '@angular/forms';
197
+ import { BrnSheetImports } from '@spartan-ng/brain/sheet';
198
+ import { HlmButtonImports } from '@egose/shadcn-theme-ng/button';
199
+ import { HlmInputImports } from '@egose/shadcn-theme-ng/input';
200
+ import { HlmLabelImports } from '@egose/shadcn-theme-ng/label';
201
+ import { HlmSheetImports } from '@egose/shadcn-theme-ng/sheet';
202
+
203
+ @Component({
204
+ selector: 'app-form-sheet',
205
+ standalone: true,
206
+ imports: [BrnSheetImports, FormsModule, HlmButtonImports, HlmInputImports, HlmLabelImports, HlmSheetImports],
207
+ template: `
208
+ <hlm-sheet>
209
+ <button hlmButton *brnSheetTrigger>Edit profile</button>
210
+ <hlm-sheet-content *brnSheetContent="let ctx">
211
+ <hlm-sheet-header>
212
+ <h2 hlmSheetTitle>Edit profile</h2>
213
+ <p hlmSheetDescription>Changes save when you click Save.</p>
214
+ </hlm-sheet-header>
215
+
216
+ <div class="tw:grid tw:gap-4 tw:px-4">
217
+ <div class="tw:grid tw:gap-2">
218
+ <label hlmLabel for="sheet-name">Name</label>
219
+ <input hlmInput id="sheet-name" [(ngModel)]="name" name="name" />
220
+ </div>
221
+ </div>
222
+
223
+ <hlm-sheet-footer>
224
+ <button hlmButton (click)="save(ctx)">Save</button>
225
+ <button hlmButton variant="outline" brnSheetClose hlmSheetClose>Cancel</button>
226
+ </hlm-sheet-footer>
227
+ </hlm-sheet-content>
228
+ </hlm-sheet>
229
+ `,
230
+ })
231
+ export class FormSheetComponent {
232
+ name = 'Ada';
233
+
234
+ save(ctx: { close: () => void }): void {
235
+ console.log('saving', this.name);
236
+ ctx.close();
237
+ }
238
+ }
239
+ ```
240
+
241
+ ### 4. Programmatic open/close via exportAs
242
+
243
+ ```html
244
+ <hlm-sheet #sheet="hlmSheet" [state]="state">
245
+ <hlm-sheet-content *brnSheetContent="let ctx">
246
+ <hlm-sheet-header>
247
+ <h2 hlmSheetTitle>Controlled</h2>
248
+ <p hlmSheetDescription>Opened from code.</p>
249
+ </hlm-sheet-header>
250
+ <hlm-sheet-footer>
251
+ <button hlmButton (click)="state = 'closed'">Close from code</button>
252
+ </hlm-sheet-footer>
253
+ </hlm-sheet-content>
254
+ </hlm-sheet>
255
+
256
+ <button hlmButton (click)="state = 'open'">Open from code</button>
257
+ ```
258
+
259
+ ### 5. Custom close affordances with `hlmSheetClose`
260
+
261
+ ```html
262
+ <hlm-sheet-content *brnSheetContent="let ctx">
263
+ <hlm-sheet-header>
264
+ <h2 hlmSheetTitle>Confirm delete</h2>
265
+ <p hlmSheetDescription>This action cannot be undone.</p>
266
+ </hlm-sheet-header>
267
+
268
+ <hlm-sheet-footer>
269
+ <button hlmButton variant="destructive" brnSheetClose hlmSheetClose>Delete</button>
270
+ <button hlmButton variant="ghost" brnSheetClose hlmSheetClose>Keep it</button>
271
+ </hlm-sheet-footer>
272
+ </hlm-sheet-content>
273
+ ```
274
+
275
+ `brnSheetClose` does the closing; `hlmSheetClose` only styles. You can also put `hlmSheetClose` on any absolutely-positioned custom close button.
276
+
277
+ ### 6. Wide / custom-sized content with `sheetVariants`
278
+
279
+ ```ts
280
+ import { Component } from '@angular/core';
281
+ import { sheetVariants } from '@egose/shadcn-theme-ng/sheet';
282
+
283
+ @Component({ selector: 'app-wide-sheet', template: '' })
284
+ export class WideSheetComponent {
285
+ // Reuse the exact variant builder for a custom panel:
286
+ protected readonly panelClass = sheetVariants({ side: 'right' });
287
+ }
288
+ ```
289
+
290
+ ```html
291
+ <hlm-sheet-content *brnSheetContent="let ctx" class="tw:sm:max-w-lg"> ... </hlm-sheet-content>
292
+ ```
293
+
294
+ `userClass` merges after the variant classes, so `tw:sm:max-w-lg` widens the default `sm:max-w-sm` panel.
295
+
296
+ ## Accessibility notes
297
+
298
+ - Always include `hlmSheetTitle` — it forwards `BrnSheetTitle` and gives the dialog its accessible name. Add `hlmSheetDescription` for context.
299
+ - Focus is trapped inside the open sheet and returned to the trigger on close (brain dialog behavior); keep the trigger in the DOM and don't unmount the sheet while open.
300
+ - The overlay click + `Escape` dismiss via brain defaults; destructive flows should still require an explicit footer confirmation, not overlay dismissal alone.
301
+ - The built-in X button has an sr-only "Close" label — if you hide it, provide another labelled close control.
302
+
303
+ ## Theming / CSS variables
304
+
305
+ Class-driven (`bg-background` panel, `bg-black/50` overlay, border tokens). Animate via the `data-[state=open|closed]` attributes if you customize transitions. Dark mode follows the theme tokens.
306
+
307
+ ## Related subpaths
308
+
309
+ - `@egose/shadcn-theme-ng/dialog` — centered modal counterpart
310
+ - `@egose/shadcn-theme-ng/drawer` — bottom-anchored mobile-style panel counterpart
311
+ - `@egose/shadcn-theme-ng/sidebar` — persistent app navigation (uses `hlm-sheet` internally on mobile)
312
+ - `@egose/shadcn-theme-ng/button` — triggers and footer actions