@edsis/ui 0.0.2
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 +40 -0
- package/accordion/README.md +195 -0
- package/alert/README.md +177 -0
- package/alert-dialog/README.md +239 -0
- package/aspect-ratio/README.md +112 -0
- package/avatar/README.md +176 -0
- package/badge/README.md +133 -0
- package/breadcrumb/README.md +216 -0
- package/button/README.md +139 -0
- package/button-group/README.md +204 -0
- package/calendar/README.md +132 -0
- package/card/README.md +220 -0
- package/carousel/README.md +276 -0
- package/chart/README.md +249 -0
- package/checkbox/README.md +149 -0
- package/collapsible/README.md +191 -0
- package/combobox/README.md +198 -0
- package/command/README.md +275 -0
- package/composer/README.md +235 -0
- package/context-menu/README.md +267 -0
- package/date-picker/README.md +177 -0
- package/dialog/README.md +237 -0
- package/drawer/README.md +145 -0
- package/dropdown-menu/README.md +311 -0
- package/editor/README.md +136 -0
- package/empty/README.md +183 -0
- package/fesm2022/edsis-ui-accordion.mjs +174 -0
- package/fesm2022/edsis-ui-accordion.mjs.map +1 -0
- package/fesm2022/edsis-ui-alert-dialog.mjs +242 -0
- package/fesm2022/edsis-ui-alert-dialog.mjs.map +1 -0
- package/fesm2022/edsis-ui-alert.mjs +90 -0
- package/fesm2022/edsis-ui-alert.mjs.map +1 -0
- package/fesm2022/edsis-ui-aspect-ratio.mjs +33 -0
- package/fesm2022/edsis-ui-aspect-ratio.mjs.map +1 -0
- package/fesm2022/edsis-ui-avatar.mjs +123 -0
- package/fesm2022/edsis-ui-avatar.mjs.map +1 -0
- package/fesm2022/edsis-ui-badge.mjs +47 -0
- package/fesm2022/edsis-ui-badge.mjs.map +1 -0
- package/fesm2022/edsis-ui-breadcrumb.mjs +186 -0
- package/fesm2022/edsis-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/edsis-ui-button-group.mjs +95 -0
- package/fesm2022/edsis-ui-button-group.mjs.map +1 -0
- package/fesm2022/edsis-ui-button.mjs +64 -0
- package/fesm2022/edsis-ui-button.mjs.map +1 -0
- package/fesm2022/edsis-ui-calendar.mjs +78 -0
- package/fesm2022/edsis-ui-calendar.mjs.map +1 -0
- package/fesm2022/edsis-ui-card.mjs +137 -0
- package/fesm2022/edsis-ui-card.mjs.map +1 -0
- package/fesm2022/edsis-ui-carousel.mjs +310 -0
- package/fesm2022/edsis-ui-carousel.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-area.mjs +6 -0
- package/fesm2022/edsis-ui-chart-area.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-bar.mjs +6 -0
- package/fesm2022/edsis-ui-chart-bar.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-line.mjs +6 -0
- package/fesm2022/edsis-ui-chart-line.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-pie.mjs +6 -0
- package/fesm2022/edsis-ui-chart-pie.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-radar.mjs +6 -0
- package/fesm2022/edsis-ui-chart-radar.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-radial.mjs +6 -0
- package/fesm2022/edsis-ui-chart-radial.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-scatter.mjs +6 -0
- package/fesm2022/edsis-ui-chart-scatter.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart.mjs +3714 -0
- package/fesm2022/edsis-ui-chart.mjs.map +1 -0
- package/fesm2022/edsis-ui-checkbox.mjs +104 -0
- package/fesm2022/edsis-ui-checkbox.mjs.map +1 -0
- package/fesm2022/edsis-ui-collapsible.mjs +116 -0
- package/fesm2022/edsis-ui-collapsible.mjs.map +1 -0
- package/fesm2022/edsis-ui-combobox.mjs +263 -0
- package/fesm2022/edsis-ui-combobox.mjs.map +1 -0
- package/fesm2022/edsis-ui-command.mjs +268 -0
- package/fesm2022/edsis-ui-command.mjs.map +1 -0
- package/fesm2022/edsis-ui-composer.mjs +329 -0
- package/fesm2022/edsis-ui-composer.mjs.map +1 -0
- package/fesm2022/edsis-ui-context-menu.mjs +100 -0
- package/fesm2022/edsis-ui-context-menu.mjs.map +1 -0
- package/fesm2022/edsis-ui-date-picker.mjs +155 -0
- package/fesm2022/edsis-ui-date-picker.mjs.map +1 -0
- package/fesm2022/edsis-ui-dialog.mjs +262 -0
- package/fesm2022/edsis-ui-dialog.mjs.map +1 -0
- package/fesm2022/edsis-ui-drawer.mjs +6 -0
- package/fesm2022/edsis-ui-drawer.mjs.map +1 -0
- package/fesm2022/edsis-ui-dropdown-menu.mjs +466 -0
- package/fesm2022/edsis-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/edsis-ui-editor.mjs +692 -0
- package/fesm2022/edsis-ui-editor.mjs.map +1 -0
- package/fesm2022/edsis-ui-empty.mjs +132 -0
- package/fesm2022/edsis-ui-empty.mjs.map +1 -0
- package/fesm2022/edsis-ui-form.mjs +334 -0
- package/fesm2022/edsis-ui-form.mjs.map +1 -0
- package/fesm2022/edsis-ui-hover-card.mjs +284 -0
- package/fesm2022/edsis-ui-hover-card.mjs.map +1 -0
- package/fesm2022/edsis-ui-input-group.mjs +164 -0
- package/fesm2022/edsis-ui-input-group.mjs.map +1 -0
- package/fesm2022/edsis-ui-input-otp.mjs +485 -0
- package/fesm2022/edsis-ui-input-otp.mjs.map +1 -0
- package/fesm2022/edsis-ui-input.mjs +43 -0
- package/fesm2022/edsis-ui-input.mjs.map +1 -0
- package/fesm2022/edsis-ui-item.mjs +241 -0
- package/fesm2022/edsis-ui-item.mjs.map +1 -0
- package/fesm2022/edsis-ui-kanban.mjs +289 -0
- package/fesm2022/edsis-ui-kanban.mjs.map +1 -0
- package/fesm2022/edsis-ui-kbd.mjs +51 -0
- package/fesm2022/edsis-ui-kbd.mjs.map +1 -0
- package/fesm2022/edsis-ui-label.mjs +30 -0
- package/fesm2022/edsis-ui-label.mjs.map +1 -0
- package/fesm2022/edsis-ui-menubar.mjs +302 -0
- package/fesm2022/edsis-ui-menubar.mjs.map +1 -0
- package/fesm2022/edsis-ui-native-select.mjs +61 -0
- package/fesm2022/edsis-ui-native-select.mjs.map +1 -0
- package/fesm2022/edsis-ui-navigation-menu.mjs +399 -0
- package/fesm2022/edsis-ui-navigation-menu.mjs.map +1 -0
- package/fesm2022/edsis-ui-pagination.mjs +216 -0
- package/fesm2022/edsis-ui-pagination.mjs.map +1 -0
- package/fesm2022/edsis-ui-pillbox.mjs +777 -0
- package/fesm2022/edsis-ui-pillbox.mjs.map +1 -0
- package/fesm2022/edsis-ui-popover.mjs +163 -0
- package/fesm2022/edsis-ui-popover.mjs.map +1 -0
- package/fesm2022/edsis-ui-progress.mjs +53 -0
- package/fesm2022/edsis-ui-progress.mjs.map +1 -0
- package/fesm2022/edsis-ui-radio.mjs +111 -0
- package/fesm2022/edsis-ui-radio.mjs.map +1 -0
- package/fesm2022/edsis-ui-resizable.mjs +454 -0
- package/fesm2022/edsis-ui-resizable.mjs.map +1 -0
- package/fesm2022/edsis-ui-scroll-area.mjs +48 -0
- package/fesm2022/edsis-ui-scroll-area.mjs.map +1 -0
- package/fesm2022/edsis-ui-select.mjs +164 -0
- package/fesm2022/edsis-ui-select.mjs.map +1 -0
- package/fesm2022/edsis-ui-separator.mjs +33 -0
- package/fesm2022/edsis-ui-separator.mjs.map +1 -0
- package/fesm2022/edsis-ui-sheet.mjs +264 -0
- package/fesm2022/edsis-ui-sheet.mjs.map +1 -0
- package/fesm2022/edsis-ui-skeleton.mjs +29 -0
- package/fesm2022/edsis-ui-skeleton.mjs.map +1 -0
- package/fesm2022/edsis-ui-slider.mjs +405 -0
- package/fesm2022/edsis-ui-slider.mjs.map +1 -0
- package/fesm2022/edsis-ui-spinner.mjs +58 -0
- package/fesm2022/edsis-ui-spinner.mjs.map +1 -0
- package/fesm2022/edsis-ui-switch.mjs +107 -0
- package/fesm2022/edsis-ui-switch.mjs.map +1 -0
- package/fesm2022/edsis-ui-table.mjs +139 -0
- package/fesm2022/edsis-ui-table.mjs.map +1 -0
- package/fesm2022/edsis-ui-tabs.mjs +252 -0
- package/fesm2022/edsis-ui-tabs.mjs.map +1 -0
- package/fesm2022/edsis-ui-textarea.mjs +37 -0
- package/fesm2022/edsis-ui-textarea.mjs.map +1 -0
- package/fesm2022/edsis-ui-timeline.mjs +213 -0
- package/fesm2022/edsis-ui-timeline.mjs.map +1 -0
- package/fesm2022/edsis-ui-toast.mjs +71 -0
- package/fesm2022/edsis-ui-toast.mjs.map +1 -0
- package/fesm2022/edsis-ui-toggle-group.mjs +269 -0
- package/fesm2022/edsis-ui-toggle-group.mjs.map +1 -0
- package/fesm2022/edsis-ui-toggle.mjs +76 -0
- package/fesm2022/edsis-ui-toggle.mjs.map +1 -0
- package/fesm2022/edsis-ui-tooltip.mjs +339 -0
- package/fesm2022/edsis-ui-tooltip.mjs.map +1 -0
- package/fesm2022/edsis-ui-utils.mjs +13 -0
- package/fesm2022/edsis-ui-utils.mjs.map +1 -0
- package/fesm2022/edsis-ui.mjs +11 -0
- package/fesm2022/edsis-ui.mjs.map +1 -0
- package/form/README.md +210 -0
- package/hover-card/README.md +146 -0
- package/input/README.md +159 -0
- package/input-group/README.md +234 -0
- package/input-otp/README.md +273 -0
- package/item/README.md +247 -0
- package/kanban/README.md +81 -0
- package/kbd/README.md +139 -0
- package/label/README.md +136 -0
- package/menubar/README.md +269 -0
- package/native-select/README.md +176 -0
- package/navigation-menu/README.md +160 -0
- package/package.json +310 -0
- package/pagination/README.md +144 -0
- package/pillbox/README.md +67 -0
- package/popover/README.md +43 -0
- package/progress/README.md +160 -0
- package/radio/README.md +209 -0
- package/resizable/README.md +164 -0
- package/scroll-area/README.md +143 -0
- package/select/README.md +174 -0
- package/separator/README.md +170 -0
- package/sheet/README.md +183 -0
- package/skeleton/README.md +158 -0
- package/slider/README.md +207 -0
- package/spinner/README.md +160 -0
- package/switch/README.md +166 -0
- package/table/README.md +291 -0
- package/tabs/README.md +214 -0
- package/textarea/README.md +154 -0
- package/timeline/README.md +94 -0
- package/toast/README.md +321 -0
- package/toggle/README.md +131 -0
- package/toggle-group/README.md +206 -0
- package/tooltip/README.md +211 -0
- package/types/edsis-ui-accordion.d.ts +51 -0
- package/types/edsis-ui-alert-dialog.d.ts +93 -0
- package/types/edsis-ui-alert.d.ts +37 -0
- package/types/edsis-ui-aspect-ratio.d.ts +12 -0
- package/types/edsis-ui-avatar.d.ts +51 -0
- package/types/edsis-ui-badge.d.ts +19 -0
- package/types/edsis-ui-breadcrumb.d.ts +46 -0
- package/types/edsis-ui-button-group.d.ts +26 -0
- package/types/edsis-ui-button.d.ts +22 -0
- package/types/edsis-ui-calendar.d.ts +33 -0
- package/types/edsis-ui-card.d.ts +60 -0
- package/types/edsis-ui-carousel.d.ts +86 -0
- package/types/edsis-ui-chart-area.d.ts +1 -0
- package/types/edsis-ui-chart-bar.d.ts +1 -0
- package/types/edsis-ui-chart-line.d.ts +1 -0
- package/types/edsis-ui-chart-pie.d.ts +1 -0
- package/types/edsis-ui-chart-radar.d.ts +1 -0
- package/types/edsis-ui-chart-radial.d.ts +1 -0
- package/types/edsis-ui-chart-scatter.d.ts +1 -0
- package/types/edsis-ui-chart.d.ts +1094 -0
- package/types/edsis-ui-checkbox.d.ts +35 -0
- package/types/edsis-ui-collapsible.d.ts +42 -0
- package/types/edsis-ui-combobox.d.ts +51 -0
- package/types/edsis-ui-command.d.ts +99 -0
- package/types/edsis-ui-composer.d.ts +90 -0
- package/types/edsis-ui-context-menu.d.ts +35 -0
- package/types/edsis-ui-date-picker.d.ts +41 -0
- package/types/edsis-ui-dialog.d.ts +87 -0
- package/types/edsis-ui-drawer.d.ts +1 -0
- package/types/edsis-ui-dropdown-menu.d.ts +136 -0
- package/types/edsis-ui-editor.d.ts +123 -0
- package/types/edsis-ui-empty.d.ts +50 -0
- package/types/edsis-ui-form.d.ts +141 -0
- package/types/edsis-ui-hover-card.d.ts +74 -0
- package/types/edsis-ui-input-group.d.ts +51 -0
- package/types/edsis-ui-input-otp.d.ts +136 -0
- package/types/edsis-ui-input.d.ts +16 -0
- package/types/edsis-ui-item.d.ts +88 -0
- package/types/edsis-ui-kanban.d.ts +70 -0
- package/types/edsis-ui-kbd.d.ts +16 -0
- package/types/edsis-ui-label.d.ts +11 -0
- package/types/edsis-ui-menubar.d.ts +67 -0
- package/types/edsis-ui-native-select.d.ts +26 -0
- package/types/edsis-ui-navigation-menu.d.ts +96 -0
- package/types/edsis-ui-pagination.d.ts +34 -0
- package/types/edsis-ui-pillbox.d.ts +157 -0
- package/types/edsis-ui-popover.d.ts +43 -0
- package/types/edsis-ui-progress.d.ts +17 -0
- package/types/edsis-ui-radio.d.ts +40 -0
- package/types/edsis-ui-resizable.d.ts +99 -0
- package/types/edsis-ui-scroll-area.d.ts +19 -0
- package/types/edsis-ui-select.d.ts +57 -0
- package/types/edsis-ui-separator.d.ts +14 -0
- package/types/edsis-ui-sheet.d.ts +76 -0
- package/types/edsis-ui-skeleton.d.ts +10 -0
- package/types/edsis-ui-slider.d.ts +74 -0
- package/types/edsis-ui-spinner.d.ts +13 -0
- package/types/edsis-ui-switch.d.ts +40 -0
- package/types/edsis-ui-table.d.ts +52 -0
- package/types/edsis-ui-tabs.d.ts +92 -0
- package/types/edsis-ui-textarea.d.ts +12 -0
- package/types/edsis-ui-timeline.d.ts +63 -0
- package/types/edsis-ui-toast.d.ts +38 -0
- package/types/edsis-ui-toggle-group.d.ts +89 -0
- package/types/edsis-ui-toggle.d.ts +25 -0
- package/types/edsis-ui-tooltip.d.ts +89 -0
- package/types/edsis-ui-utils.d.ts +5 -0
- package/types/edsis-ui.d.ts +2 -0
package/sheet/README.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Sheet
|
|
2
|
+
|
|
3
|
+
Edge-anchored overlay surface that extends Dialog into a side panel. The Sheet slides in from the top, right, bottom, or left edge of the viewport and is backed by CDK Overlay plus FocusTrap.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import {
|
|
9
|
+
SheetCloseDirective,
|
|
10
|
+
SheetComponent,
|
|
11
|
+
SheetContentComponent,
|
|
12
|
+
SheetDescriptionComponent,
|
|
13
|
+
SheetFooterComponent,
|
|
14
|
+
SheetHeaderComponent,
|
|
15
|
+
SheetTitleComponent,
|
|
16
|
+
} from '@your-scope/angular/component/sheet';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Composition
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
button[ui-button] (external trigger; sets the open signal)
|
|
23
|
+
ui-sheet
|
|
24
|
+
├── built-in close button (optional)
|
|
25
|
+
├── ui-sheet-header
|
|
26
|
+
│ ├── ui-sheet-title
|
|
27
|
+
│ └── ui-sheet-description
|
|
28
|
+
├── ui-sheet-content (optional body / scroll region)
|
|
29
|
+
└── ui-sheet-footer
|
|
30
|
+
└── button[ui-sheet-close] (optional custom close action)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The Angular surface intentionally keeps the trigger outside the overlay component. Instead of a JSX-style `SheetTrigger`, you open the sheet by setting the bound `open` signal from a regular button or link.
|
|
34
|
+
|
|
35
|
+
## Basic Usage
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { signal } from '@angular/core';
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<button type="button" ui-button variant="outline" (click)="open.set(true)">Edit profile</button>
|
|
43
|
+
|
|
44
|
+
<ui-sheet [(open)]="open" aria-labelledby="sheet-title" aria-describedby="sheet-description" class="sm:max-w-md">
|
|
45
|
+
<ui-sheet-header>
|
|
46
|
+
<ui-sheet-title id="sheet-title">Edit profile</ui-sheet-title>
|
|
47
|
+
<ui-sheet-description id="sheet-description">
|
|
48
|
+
Make changes to your profile here. Click save when you are done.
|
|
49
|
+
</ui-sheet-description>
|
|
50
|
+
</ui-sheet-header>
|
|
51
|
+
|
|
52
|
+
<ui-sheet-content class="grid gap-4 py-4">
|
|
53
|
+
<div class="grid gap-2">
|
|
54
|
+
<label ui-label for="sheet-name">Name</label>
|
|
55
|
+
<input ui-input id="sheet-name" value="Pedro Duarte" />
|
|
56
|
+
</div>
|
|
57
|
+
<div class="grid gap-2">
|
|
58
|
+
<label ui-label for="sheet-username">Username</label>
|
|
59
|
+
<input ui-input id="sheet-username" value="@peduarte" />
|
|
60
|
+
</div>
|
|
61
|
+
</ui-sheet-content>
|
|
62
|
+
|
|
63
|
+
<ui-sheet-footer>
|
|
64
|
+
<button type="button" ui-button variant="outline" ui-sheet-close>Cancel</button>
|
|
65
|
+
<button type="button" ui-button (click)="open.set(false)">Save changes</button>
|
|
66
|
+
</ui-sheet-footer>
|
|
67
|
+
</ui-sheet>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Common Patterns
|
|
71
|
+
|
|
72
|
+
### Side selection
|
|
73
|
+
|
|
74
|
+
Use `side` to choose where the surface enters from. Right is the default for `ui-sheet`, while the `ui-drawer` alias defaults to bottom.
|
|
75
|
+
|
|
76
|
+
```html
|
|
77
|
+
<button type="button" ui-button variant="outline" (click)="rightOpen.set(true)">Right</button>
|
|
78
|
+
<button type="button" ui-button variant="outline" (click)="leftOpen.set(true)">Left</button>
|
|
79
|
+
|
|
80
|
+
<ui-sheet [(open)]="rightOpen" side="right" class="sm:max-w-md">...</ui-sheet>
|
|
81
|
+
<ui-sheet [(open)]="leftOpen" side="left" class="sm:max-w-md">...</ui-sheet>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
For `top` and `bottom`, add a height constraint such as `class="max-h-[55vh]"` when the body content can grow on shorter screens.
|
|
85
|
+
|
|
86
|
+
### No close button
|
|
87
|
+
|
|
88
|
+
Hide the default corner close affordance with `[showCloseButton]="false"` and own dismissal explicitly through the footer or body.
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<ui-sheet [(open)]="noCloseOpen" [showCloseButton]="false" class="sm:max-w-sm">
|
|
92
|
+
<ui-sheet-header>
|
|
93
|
+
<ui-sheet-title>No Close Button</ui-sheet-title>
|
|
94
|
+
<ui-sheet-description> Hide the top-right control when dismissal should stay in the footer. </ui-sheet-description>
|
|
95
|
+
</ui-sheet-header>
|
|
96
|
+
|
|
97
|
+
<ui-sheet-footer class="sm:justify-start">
|
|
98
|
+
<button type="button" ui-button variant="outline" ui-sheet-close>Close</button>
|
|
99
|
+
</ui-sheet-footer>
|
|
100
|
+
</ui-sheet>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### RTL
|
|
104
|
+
|
|
105
|
+
Because the overlay surface renders through CDK Overlay, set `dir="rtl"` on projected content inside the sheet when the direction should be scoped to the open panel.
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<ui-sheet [(open)]="rtlOpen" [showCloseButton]="false" side="left" class="sm:max-w-md">
|
|
109
|
+
<div dir="rtl" lang="ar" class="flex flex-1 flex-col gap-4 text-right">
|
|
110
|
+
<ui-sheet-header>
|
|
111
|
+
<ui-sheet-title>تعديل الملف الشخصي</ui-sheet-title>
|
|
112
|
+
<ui-sheet-description>قم بإجراء تغييرات على ملفك الشخصي هنا ثم احفظها.</ui-sheet-description>
|
|
113
|
+
</ui-sheet-header>
|
|
114
|
+
|
|
115
|
+
<ui-sheet-content class="grid gap-4 py-4">
|
|
116
|
+
<div class="grid gap-2">
|
|
117
|
+
<label ui-label for="sheet-rtl-name">الاسم</label>
|
|
118
|
+
<input ui-input id="sheet-rtl-name" value="بيدرو دوارتي" />
|
|
119
|
+
</div>
|
|
120
|
+
</ui-sheet-content>
|
|
121
|
+
|
|
122
|
+
<ui-sheet-footer class="sm:justify-start">
|
|
123
|
+
<button type="button" ui-button variant="outline" ui-sheet-close>إغلاق</button>
|
|
124
|
+
<button type="button" ui-button (click)="rtlOpen.set(false)">حفظ التغييرات</button>
|
|
125
|
+
</ui-sheet-footer>
|
|
126
|
+
</div>
|
|
127
|
+
</ui-sheet>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## API Reference
|
|
131
|
+
|
|
132
|
+
| Input | Type | Default |
|
|
133
|
+
| ---------------------- | --------------- | ---------- | ----------- | ------- | ---------------------------------------------------- |
|
|
134
|
+
| `open` | `boolean` model | `false` |
|
|
135
|
+
| `side` | `'top' \\ | 'right' \\ | 'bottom' \\ | 'left'` | `'right'` for `ui-sheet`, `'bottom'` for `ui-drawer` |
|
|
136
|
+
| `closeOnEscape` | `boolean` | `true` |
|
|
137
|
+
| `closeOnBackdropClick` | `boolean` | `true` |
|
|
138
|
+
| `showCloseButton` | `boolean` | `true` |
|
|
139
|
+
| `closeButtonLabel` | `string` | `'Close'` |
|
|
140
|
+
| `aria-labelledby` | `string \\ | null` | `null` |
|
|
141
|
+
| `aria-describedby` | `string \\ | null` | `null` |
|
|
142
|
+
| `class` | `string` | `''` |
|
|
143
|
+
|
|
144
|
+
| Part | Purpose |
|
|
145
|
+
| ------------------------ | -------------------------------------------------------------- |
|
|
146
|
+
| `ui-sheet-header` | Title and supporting description wrapper |
|
|
147
|
+
| `ui-sheet-title` | Visible, accessible sheet title |
|
|
148
|
+
| `ui-sheet-description` | Supporting copy that can be referenced from `aria-describedby` |
|
|
149
|
+
| `ui-sheet-content` | Optional body wrapper for forms, spacing, and scroll regions |
|
|
150
|
+
| `ui-sheet-footer` | Action row for primary and secondary controls |
|
|
151
|
+
| `button[ui-sheet-close]` | Angular-friendly equivalent of shadcn `SheetClose` |
|
|
152
|
+
|
|
153
|
+
## Styling And Theming
|
|
154
|
+
|
|
155
|
+
- The surface uses theme border tokens such as `border-border` on its edge divider so it stays aligned with the current theme.
|
|
156
|
+
- Left and right sheets default to `w-3/4 sm:max-w-sm`; add width utilities through the `class` input when a broader side panel is needed.
|
|
157
|
+
- Top and bottom sheets stretch across the viewport edge. Use `max-h-*` or spacing utilities on the root `class` input when the body can grow.
|
|
158
|
+
- `ui-sheet-content` is the best place for internal scroll handling. Keep footer actions outside that overflow region when they must stay visible.
|
|
159
|
+
- Entry animation comes from `--ui-sheet-from` and automatically collapses to zero duration under `prefers-reduced-motion`.
|
|
160
|
+
|
|
161
|
+
## Accessibility
|
|
162
|
+
|
|
163
|
+
- The surface renders with `role="dialog"` and `aria-modal="true"`.
|
|
164
|
+
- Focus is trapped with `FocusTrap` and restored to the previously focused element on close.
|
|
165
|
+
- `Escape` and backdrop click close the sheet by default and can be disabled independently.
|
|
166
|
+
- Use stable IDs for the visible title and description when the sheet contains forms or longer instructional copy.
|
|
167
|
+
|
|
168
|
+
## Keyboard Interactions
|
|
169
|
+
|
|
170
|
+
- `Tab` and `Shift+Tab` move focus within the trapped overlay.
|
|
171
|
+
- `Escape` closes the sheet unless `closeOnEscape` is disabled.
|
|
172
|
+
- `Enter` and `Space` activate the trigger, footer actions, and custom `ui-sheet-close` controls through native button behavior.
|
|
173
|
+
|
|
174
|
+
## Angular Notes
|
|
175
|
+
|
|
176
|
+
- `ui-sheet` combines the upstream `Sheet` root and `SheetContent` overlay surface into a single Angular component.
|
|
177
|
+
- `ui-sheet-content` remains available as an internal body wrapper for layout, padding, and scroll regions.
|
|
178
|
+
- `ui-drawer` is exported as a bottom-first alias over the same primitive when the interaction reads more naturally as a drawer.
|
|
179
|
+
- `button[ui-sheet-close]` and `a[ui-sheet-close]` are the Angular-friendly equivalents of shadcn `SheetClose` for internal dismissal actions.
|
|
180
|
+
|
|
181
|
+
## Source Parity
|
|
182
|
+
|
|
183
|
+
The local Sheet follows the shadcn component information architecture and behavior, but translates trigger ownership to an external signal instead of a `SheetTrigger` child component. Lower-level dialog semantics and API expectations still map closely to the Radix Dialog reference at https://www.radix-ui.com/primitives/docs/components/dialog#api-reference.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Skeleton
|
|
2
|
+
|
|
3
|
+
Use Skeleton to show low-contrast placeholders while content is loading.
|
|
4
|
+
|
|
5
|
+
The component mirrors shadcn/ui's Skeleton primitive: it supplies the pulsing muted surface, while dimensions, shape, and layout are provided by utility classes at the call site.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { SkeletonComponent } from '@edsis/ui/skeleton';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Give each skeleton an explicit width, height, and optional radius. Without dimensions, the element exists in the DOM but will not create a visible placeholder.
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<ui-skeleton class="h-5 w-25 rounded-full" />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<div class="flex items-center gap-4">
|
|
23
|
+
<ui-skeleton class="h-12 w-12 rounded-full" />
|
|
24
|
+
<div class="space-y-2">
|
|
25
|
+
<ui-skeleton class="h-4 w-62.5" />
|
|
26
|
+
<ui-skeleton class="h-4 w-50" />
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Common patterns
|
|
32
|
+
|
|
33
|
+
### Avatar
|
|
34
|
+
|
|
35
|
+
Use a round placeholder and two lines when loading profile identity, assignee, or author metadata.
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<div class="flex w-fit items-center gap-4">
|
|
39
|
+
<ui-skeleton class="size-10 shrink-0 rounded-full" />
|
|
40
|
+
<div class="grid gap-2">
|
|
41
|
+
<ui-skeleton class="h-4 w-37.5" />
|
|
42
|
+
<ui-skeleton class="h-4 w-25" />
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Card
|
|
48
|
+
|
|
49
|
+
Skeleton composes inside `ui-card` parts. Match the final loaded geometry to avoid layout shift.
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<ui-card class="w-full max-w-xs">
|
|
53
|
+
<ui-card-header>
|
|
54
|
+
<div class="col-span-2 grid gap-2">
|
|
55
|
+
<ui-skeleton class="h-4 w-2/3" />
|
|
56
|
+
<ui-skeleton class="h-4 w-1/2" />
|
|
57
|
+
</div>
|
|
58
|
+
</ui-card-header>
|
|
59
|
+
<ui-card-content>
|
|
60
|
+
<ui-skeleton class="aspect-video w-full" />
|
|
61
|
+
</ui-card-content>
|
|
62
|
+
</ui-card>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Text
|
|
66
|
+
|
|
67
|
+
Use repeated bars and shorten the final line for paragraph rhythm.
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<div class="flex w-full max-w-xs flex-col gap-2">
|
|
71
|
+
<ui-skeleton class="h-4 w-full" />
|
|
72
|
+
<ui-skeleton class="h-4 w-full" />
|
|
73
|
+
<ui-skeleton class="h-4 w-3/4" />
|
|
74
|
+
</div>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Form
|
|
78
|
+
|
|
79
|
+
Pair short label placeholders with wider control placeholders when loading form metadata.
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<div class="flex w-full max-w-xs flex-col gap-7">
|
|
83
|
+
<div class="flex flex-col gap-3">
|
|
84
|
+
<ui-skeleton class="h-4 w-20" />
|
|
85
|
+
<ui-skeleton class="h-8 w-full" />
|
|
86
|
+
</div>
|
|
87
|
+
<div class="flex flex-col gap-3">
|
|
88
|
+
<ui-skeleton class="h-4 w-24" />
|
|
89
|
+
<ui-skeleton class="h-8 w-full" />
|
|
90
|
+
</div>
|
|
91
|
+
<ui-skeleton class="h-8 w-24" />
|
|
92
|
+
</div>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Table
|
|
96
|
+
|
|
97
|
+
Repeat rows with matching column proportions so tabular data keeps a stable footprint while loading.
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<div class="flex w-full max-w-sm flex-col gap-2">
|
|
101
|
+
@for (row of tableRows; track row) {
|
|
102
|
+
<div class="flex gap-4">
|
|
103
|
+
<ui-skeleton class="h-4 flex-1" />
|
|
104
|
+
<ui-skeleton class="h-4 w-24" />
|
|
105
|
+
<ui-skeleton class="h-4 w-20" />
|
|
106
|
+
</div>
|
|
107
|
+
}
|
|
108
|
+
</div>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### RTL
|
|
112
|
+
|
|
113
|
+
Skeleton is direction-agnostic. Put `dir="rtl"` on the wrapper when the placeholder should reserve right-to-left layout space.
|
|
114
|
+
|
|
115
|
+
```html
|
|
116
|
+
<div dir="rtl" lang="ar" class="flex items-center gap-4">
|
|
117
|
+
<ui-skeleton class="h-12 w-12 rounded-full" />
|
|
118
|
+
<div class="space-y-2">
|
|
119
|
+
<ui-skeleton class="h-4 w-62.5" />
|
|
120
|
+
<ui-skeleton class="h-4 w-50" />
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## API reference
|
|
126
|
+
|
|
127
|
+
### `SkeletonComponent`
|
|
128
|
+
|
|
129
|
+
| Input | Type | Default | Description |
|
|
130
|
+
| ------- | -------- | ------- | ----------------------------------------------------- |
|
|
131
|
+
| `class` | `string` | `''` | Supplies visible dimensions, shape, and extra layout. |
|
|
132
|
+
|
|
133
|
+
## Styling and theming
|
|
134
|
+
|
|
135
|
+
Base classes: `block animate-pulse rounded-md bg-muted`.
|
|
136
|
+
|
|
137
|
+
The component consumes the shared muted theme token through `bg-muted`. Pass utility classes for width, height, radius, flex behavior, margins, and responsive variants. Because the host is block-level, width and height utilities behave like they do on the shadcn React `<div>` implementation.
|
|
138
|
+
|
|
139
|
+
## Accessibility
|
|
140
|
+
|
|
141
|
+
`ui-skeleton` emits `aria-hidden="true"` because it is decorative loading chrome. Pair it with status text, a live region, or a busy state on the loaded region when the loading state needs to be announced.
|
|
142
|
+
|
|
143
|
+
Avoid replacing labels or meaningful headings with only skeletons for long periods. Keep the eventual content area stable and announce changes when data arrives.
|
|
144
|
+
|
|
145
|
+
## Keyboard interactions
|
|
146
|
+
|
|
147
|
+
Skeleton has no keyboard interaction. It should not receive focus and should not contain interactive content.
|
|
148
|
+
|
|
149
|
+
## Angular notes
|
|
150
|
+
|
|
151
|
+
- Import `SkeletonComponent` directly into the standalone component that renders the loading state.
|
|
152
|
+
- The `class` input is intentionally the main API so Angular examples stay close to shadcn utility-class composition.
|
|
153
|
+
- Use Angular control flow for repeated rows: `@for (row of tableRows; track row) { ... }`.
|
|
154
|
+
- Keep placeholder dimensions close to the loaded content to reduce layout shift.
|
|
155
|
+
|
|
156
|
+
## Source parity
|
|
157
|
+
|
|
158
|
+
This Angular implementation follows the shadcn Skeleton docs and examples for preview, usage, Avatar, Card, Text, Form, Table, and RTL. React `className` becomes Angular `class`, and the primitive renders as a block-level custom element so sizing utilities match the upstream `<div>` behavior.
|
package/slider/README.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Slider
|
|
2
|
+
|
|
3
|
+
Selects one or more numeric values from a bounded range.
|
|
4
|
+
|
|
5
|
+
This entrypoint now exports two related Angular surfaces:
|
|
6
|
+
|
|
7
|
+
- `ui-slider` via `SliderRootComponent` for shadcn-style single-thumb, range,
|
|
8
|
+
multiple-thumb, vertical, disabled, and RTL examples.
|
|
9
|
+
- `input[ui-slider]` via `SliderInputDirective` for browser-native range inputs
|
|
10
|
+
when labels and forms should stay on the native path.
|
|
11
|
+
|
|
12
|
+
## Import
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { SliderInputDirective, SliderRootComponent } from '@edsis/ui/slider';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Structure
|
|
19
|
+
|
|
20
|
+
Use `ui-slider` when you want the richer shadcn-style component.
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<ui-slider [value]="[75]" />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Keep `input[ui-slider]` when a plain native range input is still the best fit.
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<input type="range" ui-slider />
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Basic usage
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
const volume = signal<readonly number[]>([75]);
|
|
36
|
+
|
|
37
|
+
<ui-slider
|
|
38
|
+
aria-label="Volume"
|
|
39
|
+
[min]="0"
|
|
40
|
+
[max]="100"
|
|
41
|
+
[step]="1"
|
|
42
|
+
[value]="volume()"
|
|
43
|
+
(valueChange)="volume.set($event)"
|
|
44
|
+
class="w-full max-w-sm" />
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Common patterns
|
|
48
|
+
|
|
49
|
+
### Range
|
|
50
|
+
|
|
51
|
+
Two values render a range slider.
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
const priceRange = signal<readonly number[]>([25, 50]);
|
|
55
|
+
|
|
56
|
+
<ui-slider
|
|
57
|
+
aria-label="Price range"
|
|
58
|
+
min="0"
|
|
59
|
+
max="100"
|
|
60
|
+
step="5"
|
|
61
|
+
[value]="priceRange()"
|
|
62
|
+
(valueChange)="priceRange.set($event)"
|
|
63
|
+
[thumbLabels]="['Minimum price', 'Maximum price']" />
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Multiple thumbs
|
|
67
|
+
|
|
68
|
+
Three or more values render several thumbs in sorted order.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
const equalizer = signal<readonly number[]>([10, 20, 70]);
|
|
72
|
+
|
|
73
|
+
<ui-slider
|
|
74
|
+
aria-label="Equalizer"
|
|
75
|
+
min="0"
|
|
76
|
+
max="100"
|
|
77
|
+
step="10"
|
|
78
|
+
[value]="equalizer()"
|
|
79
|
+
(valueChange)="equalizer.set($event)"
|
|
80
|
+
[thumbLabels]="['Bass', 'Mid', 'Treble']" />
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Vertical
|
|
84
|
+
|
|
85
|
+
Set `orientation="vertical"` and provide an explicit height through `class`.
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<div class="flex items-center gap-6">
|
|
89
|
+
<ui-slider aria-label="Primary level" orientation="vertical" [value]="[50]" class="h-40" />
|
|
90
|
+
<ui-slider aria-label="Secondary level" orientation="vertical" [value]="[25]" class="h-40" />
|
|
91
|
+
</div>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Controlled slider
|
|
95
|
+
|
|
96
|
+
Drive the values from a signal when nearby UI should react immediately.
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
const temperatureRange = signal<readonly number[]>([30, 70]);
|
|
100
|
+
|
|
101
|
+
<ui-slider
|
|
102
|
+
aria-label="Temperature range"
|
|
103
|
+
min="0"
|
|
104
|
+
max="100"
|
|
105
|
+
step="5"
|
|
106
|
+
[value]="temperatureRange()"
|
|
107
|
+
(valueChange)="temperatureRange.set($event)"
|
|
108
|
+
[thumbLabels]="['Minimum temperature', 'Maximum temperature']" />
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Disabled state
|
|
112
|
+
|
|
113
|
+
```html
|
|
114
|
+
<ui-slider aria-label="Disabled notifications volume" [value]="[50]" disabled />
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### RTL
|
|
118
|
+
|
|
119
|
+
The component follows the surrounding document direction automatically.
|
|
120
|
+
|
|
121
|
+
```html
|
|
122
|
+
<section dir="rtl" lang="ar" class="w-full max-w-sm text-right">
|
|
123
|
+
<ui-slider aria-label="مستوى الصوت" [value]="[75]" class="w-full" />
|
|
124
|
+
</section>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Native input companion
|
|
128
|
+
|
|
129
|
+
Use the exported native directive when the browser-native range input is still
|
|
130
|
+
the best Angular fit for forms and `label[for]` wiring.
|
|
131
|
+
|
|
132
|
+
```html
|
|
133
|
+
<ui-label for="native-volume" class="mb-2 block">Volume</ui-label>
|
|
134
|
+
<input id="native-volume" type="range" ui-slider min="0" max="100" step="1" class="w-full max-w-sm" />
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## API reference
|
|
138
|
+
|
|
139
|
+
| Input or output | Type | Notes |
|
|
140
|
+
| ----------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------------------- |
|
|
141
|
+
| `value` | `readonly number[]` | Array of sorted thumb values. One item renders a single thumb. |
|
|
142
|
+
| `valueChange` | `readonly number[]` | Emits the next array whenever a thumb moves. |
|
|
143
|
+
| `min` | `number` | Lower bound for every thumb. |
|
|
144
|
+
| `max` | `number` | Upper bound for every thumb. |
|
|
145
|
+
| `step` | `number` | Drag and keyboard increment. |
|
|
146
|
+
| `orientation` | `'horizontal' \| 'vertical'` | Vertical sliders need an explicit height via `class`. |
|
|
147
|
+
| `disabled` | `boolean` | Disables drag and keyboard interaction. |
|
|
148
|
+
| `thumbLabels` | `readonly string[]` | Optional accessible labels for each thumb. |
|
|
149
|
+
| `aria-label` / `aria-labelledby` / `aria-describedby` | `string \| null` | Applied to thumb semantics. Prefer `thumbLabels` when several thumbs need distinct names. |
|
|
150
|
+
| `class` | `string` | Width and height utilities on the host component. |
|
|
151
|
+
|
|
152
|
+
`SliderInputDirective` keeps the native `<input type="range">` API and passes
|
|
153
|
+
through ordinary input attributes directly.
|
|
154
|
+
|
|
155
|
+
## Styling and theming
|
|
156
|
+
|
|
157
|
+
The rich `ui-slider` component uses:
|
|
158
|
+
|
|
159
|
+
- `--secondary` for the track.
|
|
160
|
+
- `--primary` for the active range.
|
|
161
|
+
- `--background` for the thumb surface.
|
|
162
|
+
- `--primary` for the thumb border.
|
|
163
|
+
- `--ring` for the focus-visible outline.
|
|
164
|
+
|
|
165
|
+
Apply width and height utilities through the host `class`, for example
|
|
166
|
+
`w-full`, `max-w-sm`, or `h-40` for vertical sliders.
|
|
167
|
+
|
|
168
|
+
The native input companion keeps its styling in [slider.component.css](./slider.component.css).
|
|
169
|
+
|
|
170
|
+
## Accessibility
|
|
171
|
+
|
|
172
|
+
- Each thumb exposes `role="slider"` with `aria-valuemin`, `aria-valuemax`,
|
|
173
|
+
`aria-valuenow`, and `aria-orientation`.
|
|
174
|
+
- Provide `thumbLabels` when the slider has several thumbs so each one has a
|
|
175
|
+
distinct accessible name.
|
|
176
|
+
- Use `aria-describedby` for helper text, units, or validation guidance.
|
|
177
|
+
- The focused thumb stays tabbable while sibling thumbs use roving `tabindex`.
|
|
178
|
+
- When you need browser-native label semantics, use `SliderInputDirective`
|
|
179
|
+
instead of forcing the rich component into a native-input role.
|
|
180
|
+
|
|
181
|
+
## Keyboard interactions
|
|
182
|
+
|
|
183
|
+
For `ui-slider`:
|
|
184
|
+
|
|
185
|
+
- Arrow keys adjust the value by `step`.
|
|
186
|
+
- `Page Up` and `Page Down` move by a larger increment.
|
|
187
|
+
- `Home` and `End` jump the active thumb to its local minimum or maximum bound.
|
|
188
|
+
- Pointer dragging and track clicks move the nearest thumb.
|
|
189
|
+
|
|
190
|
+
For `SliderInputDirective`, keyboard behavior follows the browser-native range
|
|
191
|
+
input model.
|
|
192
|
+
|
|
193
|
+
## Angular notes
|
|
194
|
+
|
|
195
|
+
- Prefer `ui-slider` when you need shadcn-style parity: range selection,
|
|
196
|
+
multiple thumbs, vertical layout, or explicit thumb labels.
|
|
197
|
+
- Prefer `SliderInputDirective` when the control should remain a real native
|
|
198
|
+
input inside Angular forms or a traditional field layout.
|
|
199
|
+
- The two exports are complementary rather than replacements for one another.
|
|
200
|
+
|
|
201
|
+
## Source parity
|
|
202
|
+
|
|
203
|
+
This Angular entrypoint now covers the main shadcn Radix slider examples:
|
|
204
|
+
single-thumb preview, range, multiple thumbs, vertical, controlled, disabled,
|
|
205
|
+
and RTL. The native `input[ui-slider]` directive remains intentionally exported
|
|
206
|
+
as an Angular companion for browser-native range inputs instead of disappearing
|
|
207
|
+
behind the richer component.
|