@ojiepermana/angular 21.3.3 → 22.0.1
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 +10 -6
- package/component/accordion/README.md +195 -0
- package/component/alert/README.md +182 -0
- package/component/alert-dialog/README.md +239 -0
- package/component/aspect-ratio/README.md +112 -0
- package/component/avatar/README.md +176 -0
- package/component/badge/README.md +133 -0
- package/component/breadcrumb/README.md +216 -0
- package/component/button/README.md +139 -0
- package/component/button-group/README.md +208 -0
- package/component/calendar/README.md +132 -0
- package/component/card/README.md +220 -0
- package/component/carousel/README.md +276 -0
- package/component/checkbox/README.md +149 -0
- package/component/collapsible/README.md +195 -0
- package/component/combobox/README.md +198 -0
- package/component/command/README.md +275 -0
- package/component/composer/README.md +235 -0
- package/component/composer/package.json +4 -0
- package/component/context-menu/README.md +267 -0
- package/component/date-picker/README.md +177 -0
- package/component/dialog/README.md +237 -0
- package/component/drawer/README.md +145 -0
- package/component/dropdown-menu/README.md +311 -0
- package/component/editor/README.md +136 -0
- package/component/editor/package.json +4 -0
- package/component/empty/README.md +183 -0
- package/component/empty/package.json +4 -0
- package/component/form/README.md +210 -0
- package/component/hover-card/README.md +146 -0
- package/component/hover-card/package.json +4 -0
- package/component/input/README.md +159 -0
- package/component/input-group/README.md +239 -0
- package/component/input-otp/README.md +278 -0
- package/component/input-otp/package.json +4 -0
- package/component/item/README.md +247 -0
- package/component/kanban/README.md +81 -0
- package/component/kanban/package.json +4 -0
- package/component/kbd/README.md +139 -0
- package/component/kbd/package.json +4 -0
- package/component/label/README.md +136 -0
- package/component/menubar/README.md +269 -0
- package/component/menubar/package.json +4 -0
- package/component/native-select/README.md +176 -0
- package/component/native-select/package.json +4 -0
- package/component/navigation-menu/README.md +160 -0
- package/component/navigation-menu/package.json +4 -0
- package/component/pagination/README.md +144 -0
- package/component/pillbox/README.md +67 -0
- package/component/pillbox/package.json +4 -0
- package/component/popover/README.md +43 -0
- package/component/progress/README.md +160 -0
- package/component/radio/README.md +209 -0
- package/component/resizable/README.md +168 -0
- package/component/resizable/package.json +4 -0
- package/component/scroll-area/README.md +143 -0
- package/component/select/README.md +174 -0
- package/component/separator/README.md +170 -0
- package/component/sheet/README.md +183 -0
- package/component/skeleton/README.md +158 -0
- package/component/slider/README.md +207 -0
- package/component/spinner/README.md +160 -0
- package/component/spinner/package.json +4 -0
- package/component/switch/README.md +166 -0
- package/component/table/README.md +291 -0
- package/component/tabs/README.md +219 -0
- package/component/textarea/README.md +154 -0
- package/component/timeline/README.md +94 -0
- package/component/timeline/package.json +4 -0
- package/component/toast/README.md +321 -0
- package/component/toggle/README.md +131 -0
- package/component/toggle/package.json +4 -0
- package/component/toggle-group/README.md +206 -0
- package/component/toggle-group/package.json +4 -0
- package/component/tooltip/README.md +211 -0
- package/fesm2022/ojiepermana-angular-component-accordion.mjs +45 -30
- package/fesm2022/ojiepermana-angular-component-accordion.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +95 -61
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-alert.mjs +30 -21
- package/fesm2022/ojiepermana-angular-component-alert.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +11 -7
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-avatar.mjs +50 -34
- package/fesm2022/ojiepermana-angular-component-avatar.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-badge.mjs +9 -6
- package/fesm2022/ojiepermana-angular-component-badge.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +49 -35
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-button-group.mjs +25 -17
- package/fesm2022/ojiepermana-angular-component-button-group.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-button.mjs +11 -7
- package/fesm2022/ojiepermana-angular-component-button.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-calendar.mjs +23 -13
- package/fesm2022/ojiepermana-angular-component-calendar.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-card.mjs +51 -36
- package/fesm2022/ojiepermana-angular-component-card.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-carousel.mjs +66 -42
- package/fesm2022/ojiepermana-angular-component-carousel.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-chart.mjs +494 -283
- package/fesm2022/ojiepermana-angular-component-chart.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs +23 -13
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs +28 -20
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-combobox.mjs +27 -18
- package/fesm2022/ojiepermana-angular-component-combobox.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-command.mjs +77 -52
- package/fesm2022/ojiepermana-angular-component-command.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-composer.mjs +352 -0
- package/fesm2022/ojiepermana-angular-component-composer.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-context-menu.mjs +9 -6
- package/fesm2022/ojiepermana-angular-component-context-menu.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs +34 -19
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-dialog.mjs +55 -38
- package/fesm2022/ojiepermana-angular-component-dialog.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-drawer.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +108 -74
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-editor.mjs +717 -0
- package/fesm2022/ojiepermana-angular-component-editor.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-empty.mjs +145 -0
- package/fesm2022/ojiepermana-angular-component-empty.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-form.mjs +200 -42
- package/fesm2022/ojiepermana-angular-component-form.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-hover-card.mjs +297 -0
- package/fesm2022/ojiepermana-angular-component-hover-card.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-input-group.mjs +48 -33
- package/fesm2022/ojiepermana-angular-component-input-group.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-input-otp.mjs +514 -0
- package/fesm2022/ojiepermana-angular-component-input-otp.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-input.mjs +7 -5
- package/fesm2022/ojiepermana-angular-component-input.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-item.mjs +76 -53
- package/fesm2022/ojiepermana-angular-component-item.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-kanban.mjs +314 -0
- package/fesm2022/ojiepermana-angular-component-kanban.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-kbd.mjs +55 -0
- package/fesm2022/ojiepermana-angular-component-kbd.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-label.mjs +9 -6
- package/fesm2022/ojiepermana-angular-component-label.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-menubar.mjs +308 -0
- package/fesm2022/ojiepermana-angular-component-menubar.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-native-select.mjs +67 -0
- package/fesm2022/ojiepermana-angular-component-native-select.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +413 -0
- package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-pagination.mjs +65 -31
- package/fesm2022/ojiepermana-angular-component-pagination.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-pillbox.mjs +812 -0
- package/fesm2022/ojiepermana-angular-component-pillbox.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-popover.mjs +18 -12
- package/fesm2022/ojiepermana-angular-component-popover.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-progress.mjs +17 -10
- package/fesm2022/ojiepermana-angular-component-progress.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-radio.mjs +47 -17
- package/fesm2022/ojiepermana-angular-component-radio.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-resizable.mjs +481 -0
- package/fesm2022/ojiepermana-angular-component-resizable.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +15 -9
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-select.mjs +71 -26
- package/fesm2022/ojiepermana-angular-component-select.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-separator.mjs +11 -7
- package/fesm2022/ojiepermana-angular-component-separator.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-sheet.mjs +91 -42
- package/fesm2022/ojiepermana-angular-component-sheet.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs +7 -5
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-slider.mjs +401 -7
- package/fesm2022/ojiepermana-angular-component-slider.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-spinner.mjs +60 -0
- package/fesm2022/ojiepermana-angular-component-spinner.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-switch.mjs +47 -15
- package/fesm2022/ojiepermana-angular-component-switch.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-table.mjs +56 -40
- package/fesm2022/ojiepermana-angular-component-table.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-tabs.mjs +58 -38
- package/fesm2022/ojiepermana-angular-component-tabs.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-textarea.mjs +8 -6
- package/fesm2022/ojiepermana-angular-component-textarea.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-timeline.mjs +237 -0
- package/fesm2022/ojiepermana-angular-component-timeline.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-toast.mjs +28 -4
- package/fesm2022/ojiepermana-angular-component-toast.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +289 -0
- package/fesm2022/ojiepermana-angular-component-toggle-group.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-toggle.mjs +82 -0
- package/fesm2022/ojiepermana-angular-component-toggle.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs +304 -6
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component-utils.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-layout-component.mjs +45 -24
- package/fesm2022/ojiepermana-angular-layout-component.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-layout-provider.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-layout-services.mjs +7 -5
- package/fesm2022/ojiepermana-angular-layout-services.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-layout-shell.mjs +3 -3
- package/fesm2022/ojiepermana-angular-layout-shell.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-layout-token-directive.mjs +9 -6
- package/fesm2022/ojiepermana-angular-layout-token-directive.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-layout-token.mjs.map +1 -1
- package/fesm2022/{ojiepermana-angular-layout-empty.mjs → ojiepermana-angular-layout-type-empty.mjs} +4 -4
- package/fesm2022/ojiepermana-angular-layout-type-empty.mjs.map +1 -0
- package/fesm2022/{ojiepermana-angular-layout-horizontal.mjs → ojiepermana-angular-layout-type-horizontal.mjs} +26 -17
- package/fesm2022/ojiepermana-angular-layout-type-horizontal.mjs.map +1 -0
- package/fesm2022/{ojiepermana-angular-layout-vertical.mjs → ojiepermana-angular-layout-type-vertical.mjs} +28 -18
- package/fesm2022/ojiepermana-angular-layout-type-vertical.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-layout.mjs +74 -50
- package/fesm2022/ojiepermana-angular-layout.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-navigation-demo-data.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-navigation-icon.mjs +11 -7
- package/fesm2022/ojiepermana-angular-navigation-icon.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-navigation-item.mjs +27 -16
- package/fesm2022/ojiepermana-angular-navigation-item.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-navigation-service.mjs +29 -20
- package/fesm2022/ojiepermana-angular-navigation-service.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-navigation-sidebar.mjs +71 -43
- package/fesm2022/ojiepermana-angular-navigation-sidebar.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-navigation-topbar.mjs +261 -24
- package/fesm2022/ojiepermana-angular-navigation-topbar.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-theme-provider.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-theme-services.mjs +19 -11
- package/fesm2022/ojiepermana-angular-theme-services.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-theme-token.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-theme.mjs +19 -11
- package/fesm2022/ojiepermana-angular-theme.mjs.map +1 -1
- package/generator/api/README.md +8 -5
- package/generator/api/bin/src/emit/client.js +4 -2
- package/generator/api/bin/src/writer/index.js +47 -5
- package/generator/guide/bin/schematics/build/index.js +3 -2
- package/generator/guide/bin/src/engine/component.js +2 -2
- package/generator/guide/bin/src/engine/index.js +3 -3
- package/generator/guide/bin/src/engine/render.js +10 -5
- package/layout/type/empty/package.json +4 -0
- package/layout/type/horizontal/package.json +4 -0
- package/layout/type/vertical/package.json +4 -0
- package/navigation/topbar/README.md +196 -0
- package/package.json +89 -25
- package/theme/README.md +110 -3
- package/theme/styles/integrations/material/autocomplete.css +178 -0
- package/theme/styles/integrations/material/button.css +468 -0
- package/theme/styles/integrations/material/dialog.css +152 -0
- package/theme/styles/integrations/material/select.css +175 -0
- package/theme/styles/integrations/material/slide-toggle.css +234 -0
- package/theme/styles/integrations/material/slider.css +194 -0
- package/theme/styles/integrations/material/tabs.css +229 -0
- package/theme/styles/integrations/material.css +70 -60
- package/types/ojiepermana-angular-component-combobox.d.ts +1 -2
- package/types/ojiepermana-angular-component-composer.d.ts +90 -0
- package/types/ojiepermana-angular-component-dropdown-menu.d.ts +2 -0
- package/types/ojiepermana-angular-component-editor.d.ts +123 -0
- package/types/ojiepermana-angular-component-empty.d.ts +50 -0
- package/types/ojiepermana-angular-component-form.d.ts +52 -3
- package/types/ojiepermana-angular-component-hover-card.d.ts +74 -0
- package/types/ojiepermana-angular-component-input-otp.d.ts +136 -0
- package/types/ojiepermana-angular-component-kanban.d.ts +70 -0
- package/types/ojiepermana-angular-component-kbd.d.ts +16 -0
- package/types/ojiepermana-angular-component-menubar.d.ts +67 -0
- package/types/ojiepermana-angular-component-native-select.d.ts +26 -0
- package/types/ojiepermana-angular-component-navigation-menu.d.ts +96 -0
- package/types/ojiepermana-angular-component-pagination.d.ts +10 -4
- package/types/ojiepermana-angular-component-pillbox.d.ts +157 -0
- package/types/ojiepermana-angular-component-radio.d.ts +7 -1
- package/types/ojiepermana-angular-component-resizable.d.ts +99 -0
- package/types/ojiepermana-angular-component-select.d.ts +17 -5
- package/types/ojiepermana-angular-component-sheet.d.ts +3 -1
- package/types/ojiepermana-angular-component-slider.d.ts +59 -1
- package/types/ojiepermana-angular-component-spinner.d.ts +13 -0
- package/types/ojiepermana-angular-component-switch.d.ts +13 -3
- package/types/ojiepermana-angular-component-timeline.d.ts +63 -0
- package/types/ojiepermana-angular-component-toast.d.ts +12 -3
- package/types/ojiepermana-angular-component-toggle-group.d.ts +89 -0
- package/types/ojiepermana-angular-component-toggle.d.ts +25 -0
- package/types/ojiepermana-angular-component-tooltip.d.ts +72 -5
- package/types/{ojiepermana-angular-layout-horizontal.d.ts → ojiepermana-angular-layout-type-horizontal.d.ts} +3 -3
- package/types/{ojiepermana-angular-layout-vertical.d.ts → ojiepermana-angular-layout-type-vertical.d.ts} +3 -3
- package/types/ojiepermana-angular-layout.d.ts +5 -5
- package/types/ojiepermana-angular-navigation-item.d.ts +1 -1
- package/types/ojiepermana-angular-navigation-service.d.ts +7 -7
- package/types/ojiepermana-angular-navigation-sidebar.d.ts +8 -8
- package/types/ojiepermana-angular-navigation-topbar.d.ts +24 -4
- package/types/ojiepermana-angular-navigation-types.d.ts +14 -8
- package/fesm2022/ojiepermana-angular-layout-empty.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout-horizontal.mjs.map +0 -1
- package/fesm2022/ojiepermana-angular-layout-vertical.mjs.map +0 -1
- package/layout/empty/package.json +0 -4
- package/layout/horizontal/package.json +0 -4
- package/layout/vertical/package.json +0 -4
- /package/types/{ojiepermana-angular-layout-empty.d.ts → ojiepermana-angular-layout-type-empty.d.ts} +0 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# Item
|
|
2
|
+
|
|
3
|
+
Displays a flexible content row with optional media, title, description, actions, header, and footer.
|
|
4
|
+
|
|
5
|
+
Use Item when you need to present content such as profile summaries, settings rows, list links, media rows, or menu-like entries without introducing form-field semantics.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import {
|
|
11
|
+
ItemActionsComponent,
|
|
12
|
+
ItemComponent,
|
|
13
|
+
ItemContentComponent,
|
|
14
|
+
ItemDescriptionComponent,
|
|
15
|
+
ItemFooterComponent,
|
|
16
|
+
ItemGroupComponent,
|
|
17
|
+
ItemHeaderComponent,
|
|
18
|
+
ItemMediaComponent,
|
|
19
|
+
ItemSeparatorComponent,
|
|
20
|
+
ItemTitleComponent,
|
|
21
|
+
} from '@ojiepermana/angular/component/item';
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
Use `<ui-item>` for the default host element. When the row should behave like a native link or button, apply `[ui-item]` directly to the semantic host instead of relying on React-style `asChild` composition.
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<ui-item variant="outline">
|
|
30
|
+
<ui-item-media variant="icon">
|
|
31
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
32
|
+
<path d="M12 5v14" />
|
|
33
|
+
<path d="M5 12h14" />
|
|
34
|
+
</svg>
|
|
35
|
+
</ui-item-media>
|
|
36
|
+
|
|
37
|
+
<ui-item-content>
|
|
38
|
+
<ui-item-title>Security alert</ui-item-title>
|
|
39
|
+
<ui-item-description>New login detected from an unknown device.</ui-item-description>
|
|
40
|
+
</ui-item-content>
|
|
41
|
+
|
|
42
|
+
<ui-item-actions>
|
|
43
|
+
<button ui-button variant="outline" size="sm" type="button">Review</button>
|
|
44
|
+
</ui-item-actions>
|
|
45
|
+
</ui-item>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Composition
|
|
49
|
+
|
|
50
|
+
The Angular structure follows the shadcn Item information architecture while translating React-specific patterns to Angular selectors and semantic hosts.
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
ItemGroup
|
|
54
|
+
└── Item
|
|
55
|
+
├── ItemHeader
|
|
56
|
+
├── ItemMedia
|
|
57
|
+
├── ItemContent
|
|
58
|
+
│ ├── ItemTitle
|
|
59
|
+
│ └── ItemDescription
|
|
60
|
+
├── ItemActions
|
|
61
|
+
└── ItemFooter
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Common patterns
|
|
65
|
+
|
|
66
|
+
### Variants
|
|
67
|
+
|
|
68
|
+
Use `variant="outline"` for bordered rows, `variant="muted"` for low-emphasis containers, and the default variant when the item should blend into the surrounding surface.
|
|
69
|
+
|
|
70
|
+
```html
|
|
71
|
+
<div class="flex max-w-md flex-col gap-4">
|
|
72
|
+
<ui-item class="px-4 py-3">
|
|
73
|
+
<ui-item-content>
|
|
74
|
+
<ui-item-title>Default item</ui-item-title>
|
|
75
|
+
<ui-item-description>Transparent background with no border.</ui-item-description>
|
|
76
|
+
</ui-item-content>
|
|
77
|
+
</ui-item>
|
|
78
|
+
|
|
79
|
+
<ui-item variant="outline">
|
|
80
|
+
<ui-item-content>
|
|
81
|
+
<ui-item-title>Outline item</ui-item-title>
|
|
82
|
+
<ui-item-description>Bordered treatment for cards and settings rows.</ui-item-description>
|
|
83
|
+
</ui-item-content>
|
|
84
|
+
</ui-item>
|
|
85
|
+
|
|
86
|
+
<ui-item variant="muted">
|
|
87
|
+
<ui-item-content>
|
|
88
|
+
<ui-item-title>Muted item</ui-item-title>
|
|
89
|
+
<ui-item-description>Soft background for secondary content.</ui-item-description>
|
|
90
|
+
</ui-item-content>
|
|
91
|
+
</ui-item>
|
|
92
|
+
</div>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Media modes
|
|
96
|
+
|
|
97
|
+
`ui-item-media` supports three common shadcn-style treatments.
|
|
98
|
+
|
|
99
|
+
- Default media for avatars or custom projected content.
|
|
100
|
+
- `variant="icon"` for compact icon chips.
|
|
101
|
+
- `variant="image"` for fixed-size artwork or thumbnails.
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<ui-item variant="outline">
|
|
105
|
+
<ui-item-media>
|
|
106
|
+
<ui-avatar>
|
|
107
|
+
<ui-avatar-image src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
108
|
+
<ui-avatar-fallback>CN</ui-avatar-fallback>
|
|
109
|
+
</ui-avatar>
|
|
110
|
+
</ui-item-media>
|
|
111
|
+
|
|
112
|
+
<ui-item-content>
|
|
113
|
+
<ui-item-title>shadcn</ui-item-title>
|
|
114
|
+
<ui-item-description>Example avatar content</ui-item-description>
|
|
115
|
+
</ui-item-content>
|
|
116
|
+
</ui-item>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Size
|
|
120
|
+
|
|
121
|
+
Set `size` on the root item to scale title and description typography plus the icon and image media wrappers.
|
|
122
|
+
|
|
123
|
+
```html
|
|
124
|
+
<ui-item variant="outline" size="default">...</ui-item>
|
|
125
|
+
<ui-item variant="outline" size="sm">...</ui-item>
|
|
126
|
+
<ui-item variant="outline" size="xs">...</ui-item>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Group with separators
|
|
130
|
+
|
|
131
|
+
Use `ui-item-group` with `ui-item-separator` when you need a vertically stacked list of related rows.
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<ui-item-group class="max-w-sm gap-0 rounded-xl border border-border">
|
|
135
|
+
<ui-item class="px-4 py-3">
|
|
136
|
+
<ui-item-content>
|
|
137
|
+
<ui-item-title>shadcn</ui-item-title>
|
|
138
|
+
<ui-item-description>shadcn@vercel.com</ui-item-description>
|
|
139
|
+
</ui-item-content>
|
|
140
|
+
</ui-item>
|
|
141
|
+
<ui-item-separator />
|
|
142
|
+
<ui-item class="px-4 py-3">
|
|
143
|
+
<ui-item-content>
|
|
144
|
+
<ui-item-title>evilrabbit</ui-item-title>
|
|
145
|
+
<ui-item-description>evilrabbit@vercel.com</ui-item-description>
|
|
146
|
+
</ui-item-content>
|
|
147
|
+
</ui-item>
|
|
148
|
+
</ui-item-group>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Link host
|
|
152
|
+
|
|
153
|
+
shadcn React uses `asChild` for anchors. In Angular, put `[ui-item]` on the anchor directly.
|
|
154
|
+
|
|
155
|
+
```html
|
|
156
|
+
<a ui-item href="/dashboard" variant="outline">
|
|
157
|
+
<ui-item-content>
|
|
158
|
+
<ui-item-title>Dashboard</ui-item-title>
|
|
159
|
+
<ui-item-description>Overview of your account and activity.</ui-item-description>
|
|
160
|
+
</ui-item-content>
|
|
161
|
+
<ui-item-actions>
|
|
162
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="size-4">
|
|
163
|
+
<path d="m9 18 6-6-6-6" />
|
|
164
|
+
</svg>
|
|
165
|
+
</ui-item-actions>
|
|
166
|
+
</a>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Dropdown composition
|
|
170
|
+
|
|
171
|
+
The shadcn Item dropdown example maps cleanly to the local menu primitives. Render `ui-item` inside a `ui-menu-item` when you want denser menu rows.
|
|
172
|
+
|
|
173
|
+
```html
|
|
174
|
+
<button ui-button variant="outline" [uiMenuTrigger]="peopleMenu">Select person</button>
|
|
175
|
+
|
|
176
|
+
<ng-template uiMenuContent #peopleMenu="uiMenuContent">
|
|
177
|
+
<ui-menu-surface class="w-64">
|
|
178
|
+
<ui-menu-label>People</ui-menu-label>
|
|
179
|
+
<ui-menu-separator />
|
|
180
|
+
|
|
181
|
+
<button ui-menu-item class="p-0">
|
|
182
|
+
<ui-item size="xs" class="w-full p-2">
|
|
183
|
+
<ui-item-content>
|
|
184
|
+
<ui-item-title>shadcn</ui-item-title>
|
|
185
|
+
<ui-item-description>shadcn@vercel.com</ui-item-description>
|
|
186
|
+
</ui-item-content>
|
|
187
|
+
</ui-item>
|
|
188
|
+
</button>
|
|
189
|
+
</ui-menu-surface>
|
|
190
|
+
</ng-template>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## API reference
|
|
194
|
+
|
|
195
|
+
### `ItemComponent`
|
|
196
|
+
|
|
197
|
+
| Input | Type | Default |
|
|
198
|
+
| --------- | ----------------------------------- | ----------- |
|
|
199
|
+
| `variant` | `'default' \| 'outline' \| 'muted'` | `'default'` |
|
|
200
|
+
| `size` | `'default' \| 'sm' \| 'xs'` | `'default'` |
|
|
201
|
+
| `class` | `string` | `''` |
|
|
202
|
+
|
|
203
|
+
### `ItemMediaComponent`
|
|
204
|
+
|
|
205
|
+
| Input | Type | Default |
|
|
206
|
+
| --------- | -------------------------------- | ----------- |
|
|
207
|
+
| `variant` | `'default' \| 'icon' \| 'image'` | `'default'` |
|
|
208
|
+
| `class` | `string` | `''` |
|
|
209
|
+
|
|
210
|
+
### Parts
|
|
211
|
+
|
|
212
|
+
- `ui-item-group` arranges related items in a vertical stack.
|
|
213
|
+
- `ui-item-separator` renders a full-width divider line between grouped rows.
|
|
214
|
+
- `ui-item-header` and `ui-item-footer` span the full width of the item.
|
|
215
|
+
- `ui-item-actions` stays aligned to the trailing edge with logical spacing, so RTL layouts remain correct.
|
|
216
|
+
|
|
217
|
+
## Styling and theming
|
|
218
|
+
|
|
219
|
+
The outline variant uses `border-border` instead of inheriting border color from text, which keeps dividers and item shells consistent with the rest of the library theme.
|
|
220
|
+
|
|
221
|
+
Pass `class` to the root or individual parts to tune spacing, borders, width, image treatment, or flex behavior. `ui-item-content` can be reused for secondary metadata by overriding it with classes such as `flex-none basis-auto items-end text-right`.
|
|
222
|
+
|
|
223
|
+
Powered by `class-variance-authority`. Re-exports: `itemVariants`, `itemMediaVariants`, `ItemVariant`, `ItemSize`, `ItemMediaVariant`.
|
|
224
|
+
|
|
225
|
+
## Accessibility
|
|
226
|
+
|
|
227
|
+
- Use a semantic anchor or button host when the row is interactive.
|
|
228
|
+
- Keep decorative icons and artwork `aria-hidden` or use empty `alt` text when nearby text already names the content.
|
|
229
|
+
- Do not place nested interactive controls inside an interactive anchor host. When the row contains independent actions, keep the host non-interactive and place buttons inside `ui-item-actions`.
|
|
230
|
+
|
|
231
|
+
## Keyboard interactions
|
|
232
|
+
|
|
233
|
+
- Non-interactive items are not focusable.
|
|
234
|
+
- Anchor and button hosts keep native Tab, Enter, and Space behavior.
|
|
235
|
+
- Embedded controls inside `ui-item-actions` follow the natural DOM tab order.
|
|
236
|
+
- When composed inside `ui-menu-item`, keyboard behavior comes from the menu primitives.
|
|
237
|
+
|
|
238
|
+
## Angular notes
|
|
239
|
+
|
|
240
|
+
- There is no `asChild` input in Angular. Use semantic hosts such as `<a ui-item>` or `<button ui-item>` directly.
|
|
241
|
+
- `size` and `variant` are Angular `input()` values on the root item.
|
|
242
|
+
- `ui-item-media` reads the parent item size automatically so icon and image wrappers stay in sync.
|
|
243
|
+
- Use `Field` or the local form primitives when the row contains an actual form control such as a checkbox, radio, input, or select.
|
|
244
|
+
|
|
245
|
+
## Source parity
|
|
246
|
+
|
|
247
|
+
This Angular implementation follows the shadcn Item information architecture and examples while translating React `asChild` composition to semantic hosts and mapping the dropdown example to the existing Angular menu primitives.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Kanban
|
|
2
|
+
|
|
3
|
+
Composable kanban board primitives inspired by Flux Kanban and implemented with local shadcn-style Angular patterns.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import {
|
|
9
|
+
KanbanCardComponent,
|
|
10
|
+
KanbanCardFooterComponent,
|
|
11
|
+
KanbanCardHeaderComponent,
|
|
12
|
+
KanbanColumnActionsComponent,
|
|
13
|
+
KanbanColumnCardsComponent,
|
|
14
|
+
KanbanColumnComponent,
|
|
15
|
+
KanbanColumnFooterComponent,
|
|
16
|
+
KanbanColumnHeaderComponent,
|
|
17
|
+
KanbanComponent,
|
|
18
|
+
} from '@ojiepermana/angular/component/kanban';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<ui-kanban>
|
|
25
|
+
<ui-kanban-column>
|
|
26
|
+
<ui-kanban-column-header heading="Planned" count="4" />
|
|
27
|
+
<ui-kanban-column-cards>
|
|
28
|
+
<ui-kanban-card heading="Update privacy policy in app" />
|
|
29
|
+
<button ui-kanban-card type="button" heading="Search suggestions are broken"></button>
|
|
30
|
+
</ui-kanban-column-cards>
|
|
31
|
+
</ui-kanban-column>
|
|
32
|
+
</ui-kanban>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Composition
|
|
36
|
+
|
|
37
|
+
- `ui-kanban` owns horizontal board layout and column width variables.
|
|
38
|
+
- `ui-kanban-column` frames one workflow stage.
|
|
39
|
+
- `ui-kanban-column-header` accepts `heading`, `subheading`, `count`, and `badge` inputs.
|
|
40
|
+
- `ui-kanban-column-actions` projects action buttons into the column header.
|
|
41
|
+
- `ui-kanban-column-cards` contains cards and handles vertical scrolling.
|
|
42
|
+
- `ui-kanban-column-footer` is for add-card forms or secondary actions.
|
|
43
|
+
- `ui-kanban-card` renders a static card; use `button[ui-kanban-card]` or `a[ui-kanban-card]` for clickable cards.
|
|
44
|
+
- `ui-kanban-card-header` and `ui-kanban-card-footer` project tags, metadata, avatars, or actions into a card.
|
|
45
|
+
|
|
46
|
+
## Inputs
|
|
47
|
+
|
|
48
|
+
### KanbanComponent
|
|
49
|
+
|
|
50
|
+
| Input | Type | Default | Description |
|
|
51
|
+
| ------------- | --------------------------- | ----------- | ----------------------------------------- |
|
|
52
|
+
| `columnWidth` | `'sm' \| 'default' \| 'lg'` | `'default'` | Sets the board column width CSS variable. |
|
|
53
|
+
| `dense` | `boolean` | `false` | Reduces column and card gaps. |
|
|
54
|
+
| `class` | `string` | `''` | Additional host classes. |
|
|
55
|
+
|
|
56
|
+
### KanbanColumnHeaderComponent
|
|
57
|
+
|
|
58
|
+
| Input | Type | Default | Description |
|
|
59
|
+
| ------------ | -------------------------- | ------- | --------------------------------------------- |
|
|
60
|
+
| `heading` | `string` | `''` | Primary column title. |
|
|
61
|
+
| `subheading` | `string` | `''` | Secondary column text. |
|
|
62
|
+
| `count` | `string \| number \| null` | `null` | Optional card count shown beside the heading. |
|
|
63
|
+
| `badge` | `string` | `''` | Optional badge text shown beside the heading. |
|
|
64
|
+
| `class` | `string` | `''` | Additional host classes. |
|
|
65
|
+
|
|
66
|
+
### KanbanCardComponent
|
|
67
|
+
|
|
68
|
+
| Input | Type | Default | Description |
|
|
69
|
+
| ---------- | --------- | ------- | -------------------------------------------------- |
|
|
70
|
+
| `heading` | `string` | `''` | Default card title when no custom body is needed. |
|
|
71
|
+
| `selected` | `boolean` | `false` | Marks a card as selected/current. |
|
|
72
|
+
| `disabled` | `boolean` | `false` | Disables interaction and applies disabled styling. |
|
|
73
|
+
| `class` | `string` | `''` | Additional host classes. |
|
|
74
|
+
|
|
75
|
+
## Accessibility
|
|
76
|
+
|
|
77
|
+
- Use `button[ui-kanban-card]` for cards that trigger an action.
|
|
78
|
+
- Provide `type="button"` on button cards inside forms.
|
|
79
|
+
- Keep card titles visible and descriptive.
|
|
80
|
+
- Give icon-only column actions an `aria-label`.
|
|
81
|
+
- Preserve DOM order to match the workflow order announced to assistive technology.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Kbd
|
|
2
|
+
|
|
3
|
+
Keyboard key primitive for shortcuts, inline command hints, and compact keycap groups.
|
|
4
|
+
|
|
5
|
+
Use Kbd when the UI needs to display the key or shortcut that triggers an action, not to capture keyboard input itself.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { KbdComponent, KbdGroupComponent } from '@ojiepermana/angular/component/kbd';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Composition
|
|
14
|
+
|
|
15
|
+
The Angular structure mirrors shadcn's `Kbd` and `KbdGroup` composition while keeping the host choice flexible.
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
kbd[ui-kbd] or ui-kbd
|
|
19
|
+
ui-kbd-group or [ui-kbd-group]
|
|
20
|
+
├── kbd[ui-kbd] or ui-kbd
|
|
21
|
+
└── kbd[ui-kbd] or ui-kbd
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Basic usage
|
|
25
|
+
|
|
26
|
+
Prefer a native `<kbd>` host when you want built-in keyboard-input semantics in the DOM.
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<p class="inline-flex items-center gap-2 text-sm text-muted-foreground">
|
|
30
|
+
Press <kbd ui-kbd>Ctrl</kbd> <kbd ui-kbd>K</kbd> to open search.
|
|
31
|
+
</p>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Common patterns
|
|
35
|
+
|
|
36
|
+
### Key groups
|
|
37
|
+
|
|
38
|
+
Use `ui-kbd-group` when several keycaps should read as one shortcut cluster or one family of related commands.
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<ui-kbd-group>
|
|
42
|
+
<kbd ui-kbd>Ctrl + B</kbd>
|
|
43
|
+
<kbd ui-kbd>Ctrl + K</kbd>
|
|
44
|
+
</ui-kbd-group>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Button companion
|
|
48
|
+
|
|
49
|
+
Use Kbd inside the button label when the shortcut is part of the visible affordance.
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<button ui-button type="button" variant="outline">
|
|
53
|
+
Accept
|
|
54
|
+
<kbd ui-kbd class="translate-x-0.5">⏎</kbd>
|
|
55
|
+
</button>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Input group shortcut hint
|
|
59
|
+
|
|
60
|
+
Pair Kbd with the existing input-group primitives for launcher shortcuts and command-palette patterns.
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<ui-input-group class="max-w-sm">
|
|
64
|
+
<input ui-input-group-input placeholder="Search..." />
|
|
65
|
+
<ui-input-group-addon>
|
|
66
|
+
<span aria-hidden="true">⌕</span>
|
|
67
|
+
</ui-input-group-addon>
|
|
68
|
+
<ui-input-group-addon align="inline-end">
|
|
69
|
+
<ui-kbd-group>
|
|
70
|
+
<kbd ui-kbd>⌘</kbd>
|
|
71
|
+
<kbd ui-kbd>K</kbd>
|
|
72
|
+
</ui-kbd-group>
|
|
73
|
+
</ui-input-group-addon>
|
|
74
|
+
</ui-input-group>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Tooltip mapping
|
|
78
|
+
|
|
79
|
+
The local tooltip primitive is a thin string-based wrapper around `matTooltip`, so rich tooltip content with embedded Kbd chips maps to plain tooltip text plus optional visible shortcut chips in adjacent markup.
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<button ui-button type="button" variant="outline" [uiTooltip]="'Save changes (S)'">Save</button>
|
|
83
|
+
<button ui-button type="button" variant="outline" [uiTooltip]="'Print document (Ctrl + P)'">Print</button>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### RTL
|
|
87
|
+
|
|
88
|
+
Set `dir="rtl"` on an ancestor container when the shortcut rows live in a right-to-left layout.
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<div dir="rtl" lang="ar" class="flex flex-col items-center gap-4">
|
|
92
|
+
<ui-kbd-group>
|
|
93
|
+
<kbd ui-kbd>⌘</kbd>
|
|
94
|
+
<kbd ui-kbd>⇧</kbd>
|
|
95
|
+
<kbd ui-kbd>⌥</kbd>
|
|
96
|
+
<kbd ui-kbd>⌃</kbd>
|
|
97
|
+
</ui-kbd-group>
|
|
98
|
+
|
|
99
|
+
<ui-kbd-group>
|
|
100
|
+
<kbd ui-kbd>Ctrl</kbd>
|
|
101
|
+
<span aria-hidden="true">+</span>
|
|
102
|
+
<kbd ui-kbd>B</kbd>
|
|
103
|
+
</ui-kbd-group>
|
|
104
|
+
</div>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## API reference
|
|
108
|
+
|
|
109
|
+
| Primitive | Input | Type | Default | Notes |
|
|
110
|
+
| ------------------- | ------- | -------- | ------- | --------------------------------------------- |
|
|
111
|
+
| `KbdComponent` | `class` | `string` | `''` | Extra Tailwind classes merged onto the keycap |
|
|
112
|
+
| `KbdGroupComponent` | `class` | `string` | `''` | Extra Tailwind classes merged onto the group |
|
|
113
|
+
|
|
114
|
+
## Styling and theming
|
|
115
|
+
|
|
116
|
+
`ui-kbd` uses `border-border`, `bg-background`, `text-foreground`, and the shared `rounded-md` radius token so it stays aligned with buttons, inputs, and tooltip surfaces.
|
|
117
|
+
|
|
118
|
+
The default typography is mono, compact, and non-selectable to match shadcn's keycap treatment without introducing a separate icon or badge variant system.
|
|
119
|
+
|
|
120
|
+
## Accessibility
|
|
121
|
+
|
|
122
|
+
- Prefer `<kbd ui-kbd>` when you want native keyboard-input semantics in the markup.
|
|
123
|
+
- Keep decorative separators such as `+` or `/` `aria-hidden` when the surrounding sentence already communicates the shortcut clearly.
|
|
124
|
+
- Kbd is presentational. The actionable control still needs the accessible name, tooltip text, and focus behavior.
|
|
125
|
+
|
|
126
|
+
## Keyboard interactions
|
|
127
|
+
|
|
128
|
+
Kbd and KbdGroup do not add keyboard behavior. Buttons, links, inputs, tooltip triggers, and menu items composed with them keep their native keyboard model.
|
|
129
|
+
|
|
130
|
+
## Angular notes
|
|
131
|
+
|
|
132
|
+
- There is no React-style `data-icon="inline-end"` API. Use the normal `class` input for spacing or alignment adjustments.
|
|
133
|
+
- Import neighboring primitives such as Button, Input Group, or Tooltip separately. The Kbd entrypoint stays intentionally focused.
|
|
134
|
+
|
|
135
|
+
## Source parity
|
|
136
|
+
|
|
137
|
+
This Angular slice covers the shadcn Kbd preview, grouped keycaps, button companion usage, input-group shortcut hints, RTL examples, and API/accessibility guidance.
|
|
138
|
+
|
|
139
|
+
The upstream tooltip example uses rich tooltip content with embedded keycaps. In this repo that maps to the existing string-based tooltip directive, so the shortcut lives in the tooltip message instead of projected tooltip markup.
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Label
|
|
2
|
+
|
|
3
|
+
Renders accessible labels for native form controls and provides the wrapper-label pattern for checkbox, radio, and switch rows where the entire copy block should toggle the control.
|
|
4
|
+
|
|
5
|
+
Use `ui-label` when a lightweight visible label is enough. For richer form-field layouts with descriptions, grouped sections, and generated id wiring, use the `form` entrypoint and `label[ui-form-label]` instead.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { LabelComponent } from '@ojiepermana/angular/component/label';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Composition
|
|
14
|
+
|
|
15
|
+
The label primitive supports three common structures:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
ui-label[for] + native control[id]
|
|
19
|
+
label[ui-label] + native control[id]
|
|
20
|
+
label[ui-label]
|
|
21
|
+
├── ui-checkbox | ui-radio | ui-switch
|
|
22
|
+
└── descriptive copy
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
For full form-field composition, map the shadcn `Field` guidance to `ui-form-field`, `label[ui-form-label]`, and `[uiFormControl]` from `@ojiepermana/angular/component/form`.
|
|
26
|
+
|
|
27
|
+
## Basic usage
|
|
28
|
+
|
|
29
|
+
Use `for` when the target control exposes a stable native `id`, such as an input or textarea.
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<div class="grid gap-2">
|
|
33
|
+
<ui-label for="email">Email address</ui-label>
|
|
34
|
+
<input ui-input id="email" type="email" placeholder="you@example.com" />
|
|
35
|
+
</div>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
You can also decorate a native label host when that fits the surrounding markup more naturally.
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<label ui-label for="email">Email address</label>
|
|
42
|
+
<input ui-input id="email" type="email" placeholder="you@example.com" />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Common patterns
|
|
46
|
+
|
|
47
|
+
### Checkbox, radio, and switch rows
|
|
48
|
+
|
|
49
|
+
When the entire row should toggle the control, wrap the control and copy in `label[ui-label]`. This is the closest Angular equivalent to the upstream shadcn checkbox-plus-label preview.
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<label ui-label class="inline-flex max-w-md items-start gap-3 rounded-xl border border-border p-4">
|
|
53
|
+
<ui-checkbox class="mt-0.5" />
|
|
54
|
+
<span class="grid gap-1 leading-none">
|
|
55
|
+
<span>Email me product updates</span>
|
|
56
|
+
<span class="text-sm font-normal leading-5 text-muted-foreground">
|
|
57
|
+
Wrap checkbox, radio, and switch rows in label[ui-label] when the whole row should toggle the control.
|
|
58
|
+
</span>
|
|
59
|
+
</span>
|
|
60
|
+
</label>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Label in Field
|
|
64
|
+
|
|
65
|
+
The shadcn docs route richer field composition to `Field`. In this library, use the `form` entrypoint instead.
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<ui-form-field class="max-w-md">
|
|
69
|
+
<label ui-form-label>Email address</label>
|
|
70
|
+
<input ui-input uiFormControl type="email" placeholder="you@example.com" />
|
|
71
|
+
<p ui-form-description>We will only use this address for account updates.</p>
|
|
72
|
+
</ui-form-field>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`label[ui-form-label]` automatically targets the generated control id from `[uiFormControl]`, so helper text and invalid state remain synchronized without manual `for` wiring.
|
|
76
|
+
|
|
77
|
+
### RTL
|
|
78
|
+
|
|
79
|
+
The label primitive is direction-agnostic. Apply `dir="rtl"` on a wrapper and reverse the row layout when the label and control should read from right to left.
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<div dir="rtl" lang="ar" class="max-w-md text-right">
|
|
83
|
+
<label ui-label class="flex flex-row-reverse items-start gap-3">
|
|
84
|
+
<ui-checkbox class="mt-0.5" />
|
|
85
|
+
<span class="grid gap-1 leading-none">
|
|
86
|
+
<span>قبول الشروط والأحكام</span>
|
|
87
|
+
<span class="text-sm font-normal leading-5 text-muted-foreground">
|
|
88
|
+
يظل نمط التسمية نفسه، فقط ضع الصف داخل حاوية تدعم الاتجاه من اليمين إلى اليسار.
|
|
89
|
+
</span>
|
|
90
|
+
</span>
|
|
91
|
+
</label>
|
|
92
|
+
</div>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## API reference
|
|
96
|
+
|
|
97
|
+
### `LabelComponent`
|
|
98
|
+
|
|
99
|
+
| Input | Type | Default |
|
|
100
|
+
| ------- | ---------------- | ------- |
|
|
101
|
+
| `for` | `string \| null` | `null` |
|
|
102
|
+
| `class` | `string` | `''` |
|
|
103
|
+
|
|
104
|
+
Selectors: `ui-label`, `label[ui-label]`
|
|
105
|
+
|
|
106
|
+
Related mapping: for shadcn `FieldLabel`, use `label[ui-form-label]` from `@ojiepermana/angular/component/form`.
|
|
107
|
+
|
|
108
|
+
## Styling and theming
|
|
109
|
+
|
|
110
|
+
Base classes: `text-sm font-medium leading-none text-foreground`.
|
|
111
|
+
|
|
112
|
+
- Pass `class` to tune spacing, layout, or typography for a specific label row.
|
|
113
|
+
- `peer-disabled:cursor-not-allowed peer-disabled:opacity-70` dims the label when a peer-marked control is disabled.
|
|
114
|
+
- Standard library theme tokens such as `text-foreground`, `text-muted-foreground`, `border-border`, and spacing utilities compose cleanly with the label host.
|
|
115
|
+
|
|
116
|
+
## Accessibility
|
|
117
|
+
|
|
118
|
+
- Set `for` only when the target control exposes a real native id.
|
|
119
|
+
- Wrap checkbox, radio, and switch rows in `label[ui-label]` instead of relying on `for` to reach an internal input element.
|
|
120
|
+
- Inside `ui-form-field`, prefer `label[ui-form-label]` so helper text and invalid state stay synchronized with `[uiFormControl]`.
|
|
121
|
+
- Keep label text specific so screen readers and voice-control software announce useful control names.
|
|
122
|
+
|
|
123
|
+
## Keyboard interactions
|
|
124
|
+
|
|
125
|
+
- Labels themselves are not the main keyboard target; focus moves to the associated control in normal tab order.
|
|
126
|
+
- Once the control has focus, keyboard behavior belongs to that control, such as `Space` toggling a checkbox.
|
|
127
|
+
|
|
128
|
+
## Angular notes
|
|
129
|
+
|
|
130
|
+
- Use `ui-label` or `label[ui-label]` for lightweight labeling only.
|
|
131
|
+
- Use the `form` entrypoint when the surface also needs descriptions, errors, grouped sections, or generated `for` wiring.
|
|
132
|
+
- The checkbox, radio, and switch families work best with wrapper labels because those controls own their internal focusable element.
|
|
133
|
+
|
|
134
|
+
## Source parity
|
|
135
|
+
|
|
136
|
+
This Angular slice keeps the shadcn Label guidance around installation, usage, field composition, RTL behavior, and API shape while mapping the upstream `Field` recommendation to the local `form` entrypoint and expressing checkbox-like examples with a wrapper-label pattern that fits the existing Angular primitives.
|