@ojiepermana/angular 22.1.11 → 22.1.12
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 +32 -26
- package/chart/README.md +272 -0
- package/component/README.md +89 -0
- package/component/accordion/README.md +195 -0
- package/component/alert/README.md +184 -0
- package/component/alert-dialog/README.md +255 -0
- package/component/aspect-ratio/README.md +116 -0
- package/component/avatar/README.md +182 -0
- package/component/badge/README.md +143 -0
- package/component/breadcrumb/README.md +223 -0
- package/component/button/README.md +141 -0
- package/component/button-group/README.md +214 -0
- package/component/calendar/README.md +137 -0
- package/component/card/README.md +232 -0
- package/component/carousel/README.md +276 -0
- package/component/checkbox/README.md +153 -0
- package/component/collapsible/README.md +216 -0
- package/component/combobox/README.md +202 -0
- package/component/command/README.md +287 -0
- package/component/composer/README.md +241 -0
- package/component/context-menu/README.md +268 -0
- package/component/date-picker/README.md +202 -0
- package/component/dialog/README.md +276 -0
- package/component/drawer/README.md +147 -0
- package/component/dropdown-menu/README.md +336 -0
- package/component/editor/README.md +152 -0
- package/component/empty/README.md +193 -0
- package/component/form/README.md +216 -0
- package/component/hover-card/README.md +150 -0
- package/component/icon/README.md +25 -0
- package/component/input/README.md +160 -0
- package/component/input-group/README.md +245 -0
- package/component/input-otp/README.md +331 -0
- package/component/item/README.md +254 -0
- package/component/kanban/README.md +81 -0
- package/component/kbd/README.md +141 -0
- package/component/label/README.md +137 -0
- package/component/menubar/README.md +270 -0
- package/component/native-select/README.md +176 -0
- package/component/navigation-menu/README.md +165 -0
- package/component/pagination/README.md +151 -0
- package/component/pillbox/README.md +68 -0
- package/component/popover/README.md +54 -0
- package/component/progress/README.md +160 -0
- package/component/radio/README.md +212 -0
- package/component/resizable/README.md +178 -0
- package/component/scroll-area/README.md +150 -0
- package/component/select/README.md +228 -0
- package/component/separator/README.md +175 -0
- package/component/sheet/README.md +190 -0
- package/component/skeleton/README.md +158 -0
- package/component/slider/README.md +207 -0
- package/component/spinner/README.md +160 -0
- package/component/switch/README.md +170 -0
- package/component/table/README.md +292 -0
- package/component/tabs/README.md +220 -0
- package/component/textarea/README.md +169 -0
- package/component/timeline/README.md +94 -0
- package/component/toast/README.md +173 -0
- package/component/toggle/README.md +133 -0
- package/component/toggle-group/README.md +234 -0
- package/component/tooltip/README.md +230 -0
- package/fesm2022/ojiepermana-angular-chart-area.mjs +289 -3
- package/fesm2022/ojiepermana-angular-chart-bar.mjs +722 -3
- package/fesm2022/ojiepermana-angular-chart-core.mjs +1482 -3
- package/fesm2022/ojiepermana-angular-chart-line.mjs +294 -3
- package/fesm2022/ojiepermana-angular-chart-pie.mjs +291 -3
- package/fesm2022/ojiepermana-angular-chart-primitives.mjs +1301 -3
- package/fesm2022/ojiepermana-angular-chart-radar.mjs +421 -3
- package/fesm2022/ojiepermana-angular-chart-radial.mjs +295 -3
- package/fesm2022/ojiepermana-angular-chart-scatter.mjs +306 -3
- package/fesm2022/ojiepermana-angular-chart.mjs +12 -3
- package/fesm2022/ojiepermana-angular-component-accordion.mjs +267 -3
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +359 -3
- package/fesm2022/ojiepermana-angular-component-alert.mjs +101 -3
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +31 -3
- package/fesm2022/ojiepermana-angular-component-avatar.mjs +139 -3
- package/fesm2022/ojiepermana-angular-component-badge.mjs +57 -3
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +192 -3
- package/fesm2022/ojiepermana-angular-component-button-group.mjs +95 -3
- package/fesm2022/ojiepermana-angular-component-button.mjs +73 -3
- package/fesm2022/ojiepermana-angular-component-calendar.mjs +718 -3
- package/fesm2022/ojiepermana-angular-component-card.mjs +167 -3
- package/fesm2022/ojiepermana-angular-component-carousel.mjs +326 -3
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs +190 -3
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs +117 -3
- package/fesm2022/ojiepermana-angular-component-combobox.mjs +327 -3
- package/fesm2022/ojiepermana-angular-component-command.mjs +351 -3
- package/fesm2022/ojiepermana-angular-component-composer.mjs +359 -3
- package/fesm2022/ojiepermana-angular-component-context-menu.mjs +158 -3
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs +482 -3
- package/fesm2022/ojiepermana-angular-component-dialog.mjs +400 -3
- package/fesm2022/ojiepermana-angular-component-drawer.mjs +1 -3
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +689 -3
- package/fesm2022/ojiepermana-angular-component-editor.mjs +511 -3
- package/fesm2022/ojiepermana-angular-component-empty.mjs +134 -3
- package/fesm2022/ojiepermana-angular-component-form.mjs +438 -3
- package/fesm2022/ojiepermana-angular-component-hover-card.mjs +273 -3
- package/fesm2022/ojiepermana-angular-component-icon.mjs +139 -3
- package/fesm2022/ojiepermana-angular-component-input-group.mjs +176 -3
- package/fesm2022/ojiepermana-angular-component-input-otp.mjs +550 -3
- package/fesm2022/ojiepermana-angular-component-input.mjs +52 -3
- package/fesm2022/ojiepermana-angular-component-item.mjs +264 -3
- package/fesm2022/ojiepermana-angular-component-kanban.mjs +310 -3
- package/fesm2022/ojiepermana-angular-component-kbd.mjs +48 -3
- package/fesm2022/ojiepermana-angular-component-label.mjs +27 -3
- package/fesm2022/ojiepermana-angular-component-menubar.mjs +327 -3
- package/fesm2022/ojiepermana-angular-component-native-select.mjs +62 -3
- package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +378 -3
- package/fesm2022/ojiepermana-angular-component-pagination.mjs +238 -3
- package/fesm2022/ojiepermana-angular-component-pillbox.mjs +999 -3
- package/fesm2022/ojiepermana-angular-component-popover.mjs +201 -3
- package/fesm2022/ojiepermana-angular-component-progress.mjs +57 -3
- package/fesm2022/ojiepermana-angular-component-radio.mjs +180 -3
- package/fesm2022/ojiepermana-angular-component-resizable.mjs +493 -3
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +51 -3
- package/fesm2022/ojiepermana-angular-component-segmented-control.mjs +227 -3
- package/fesm2022/ojiepermana-angular-component-select.mjs +609 -3
- package/fesm2022/ojiepermana-angular-component-separator.mjs +31 -3
- package/fesm2022/ojiepermana-angular-component-sheet.mjs +407 -3
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs +25 -3
- package/fesm2022/ojiepermana-angular-component-slider.mjs +456 -3
- package/fesm2022/ojiepermana-angular-component-spinner.mjs +56 -3
- package/fesm2022/ojiepermana-angular-component-switch.mjs +145 -3
- package/fesm2022/ojiepermana-angular-component-table.mjs +155 -3
- package/fesm2022/ojiepermana-angular-component-tabs.mjs +315 -3
- package/fesm2022/ojiepermana-angular-component-textarea.mjs +46 -3
- package/fesm2022/ojiepermana-angular-component-timeline.mjs +237 -3
- package/fesm2022/ojiepermana-angular-component-toast.mjs +241 -3
- package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +290 -3
- package/fesm2022/ojiepermana-angular-component-toggle.mjs +76 -3
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs +519 -3
- package/fesm2022/ojiepermana-angular-component-utils-core.mjs +310 -3
- package/fesm2022/ojiepermana-angular-component-utils-overlay.mjs +62 -3
- package/fesm2022/ojiepermana-angular-component-utils-scale.mjs +34 -3
- package/fesm2022/ojiepermana-angular-component-utils.mjs +3 -2
- package/fesm2022/ojiepermana-angular-component.mjs +4 -4
- package/fesm2022/ojiepermana-angular-navigation-core.mjs +21 -3
- package/fesm2022/ojiepermana-angular-navigation-icon.mjs +20 -3
- package/fesm2022/ojiepermana-angular-navigation-navigation-badge-count.component-CDBxQ8rk.mjs +91 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-dockbar-menu.component-DBQHdvGa.mjs +512 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-entry-grid.component-Cd-jh6tg.mjs +623 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-flyout-menu.component-BCGvhoYj.mjs +404 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-horizontal.component-Dk_03e-6.mjs +466 -0
- package/fesm2022/ojiepermana-angular-navigation-ojiepermana-angular-navigation-DNKU6viC.mjs +2642 -0
- package/fesm2022/ojiepermana-angular-navigation-service.mjs +725 -3
- package/fesm2022/ojiepermana-angular-navigation-types.mjs +65 -4
- package/fesm2022/ojiepermana-angular-navigation.mjs +4 -10
- package/fesm2022/ojiepermana-angular-sdk.mjs +204 -4
- package/fesm2022/ojiepermana-angular-theme-component-settings.mjs +1387 -3
- package/fesm2022/ojiepermana-angular-theme-layout-services.mjs +331 -3
- package/fesm2022/ojiepermana-angular-theme-layout-types.mjs +45 -4
- package/fesm2022/ojiepermana-angular-theme-layout-wrapper.mjs +1044 -3
- package/fesm2022/ojiepermana-angular-theme-layout.mjs +729 -3
- package/fesm2022/ojiepermana-angular-theme-page-core.mjs +381 -3
- package/fesm2022/ojiepermana-angular-theme-page-filter.mjs +267 -3
- package/fesm2022/ojiepermana-angular-theme-page-root.mjs +361 -3
- package/fesm2022/ojiepermana-angular-theme-page-side.mjs +198 -3
- package/fesm2022/ojiepermana-angular-theme-page-slots.mjs +110 -3
- package/fesm2022/ojiepermana-angular-theme-page.mjs +7 -2
- package/fesm2022/ojiepermana-angular-theme-shell-services.mjs +338 -3
- package/fesm2022/ojiepermana-angular-theme-shell-types.mjs +160 -4
- package/fesm2022/ojiepermana-angular-theme-shell.mjs +811 -3
- package/fesm2022/ojiepermana-angular-theme-styles.mjs +783 -3
- package/fesm2022/ojiepermana-angular-theme.mjs +4 -4
- package/fesm2022/ojiepermana-angular.mjs +6 -11
- package/navigation/README.md +374 -0
- package/package.json +81 -20
- package/sdk/README.md +212 -0
- package/sdk/schematics/collection.json +20 -0
- package/sdk/schematics/init/index.js +83 -0
- package/sdk/schematics/init/schema.json +19 -0
- package/sdk/schematics/ng-add/index.js +147 -0
- package/sdk/schematics/ng-add/schema.json +14 -0
- package/sdk/schematics/package.json +3 -0
- package/sdk/schematics/sdk/index.js +175 -0
- package/sdk/schematics/sdk/schema.json +19 -0
- package/sdk/sdk.config.example.json +24 -0
- package/sdk/src/config/loader.js +43 -0
- package/sdk/src/config/schema.js +59 -0
- package/sdk/src/emit/client.js +251 -0
- package/sdk/src/emit/metadata.js +310 -0
- package/sdk/src/emit/models.js +104 -0
- package/sdk/src/emit/navigation.js +56 -0
- package/sdk/src/emit/operations.js +118 -0
- package/sdk/src/emit/public-api.js +54 -0
- package/sdk/src/emit/services.js +110 -0
- package/sdk/src/engine.js +67 -0
- package/sdk/src/layout/per-domain.js +360 -0
- package/sdk/src/package.json +3 -0
- package/sdk/src/parser/bundle.js +25 -0
- package/sdk/src/parser/ir.js +429 -0
- package/sdk/src/parser/types.js +7 -0
- package/sdk/src/render/template.js +152 -0
- package/sdk/src/writer/index.js +286 -0
- package/theme/README.md +126 -0
- package/theme/component/settings/README.md +135 -0
- package/theme/layout/README.md +539 -0
- package/theme/page/README.md +453 -0
- package/theme/shell/README.md +340 -0
- package/theme/styles/README.md +178 -0
- package/theme/styles/css/base/components.css +553 -0
- package/theme/styles/css/base/index.css +14 -0
- package/theme/styles/css/base/package.css +9 -0
- package/theme/styles/css/base/prefers-dark.css +86 -0
- package/theme/styles/css/base/print.css +62 -0
- package/theme/styles/css/base/status.css +38 -0
- package/theme/styles/css/base/tailwind.css +165 -0
- package/theme/styles/css/base/theme.css +373 -0
- package/theme/styles/css/base/tokens.css +361 -0
- package/theme/styles/css/color/amber.css +72 -0
- package/theme/styles/css/color/blue.css +72 -0
- package/theme/styles/css/color/brand.css +38 -0
- package/theme/styles/css/color/cyan.css +72 -0
- package/theme/styles/css/color/emerald.css +72 -0
- package/theme/styles/css/color/fuchsia.css +72 -0
- package/theme/styles/css/color/green.css +72 -0
- package/theme/styles/css/color/index.css +19 -0
- package/theme/styles/css/color/indigo.css +72 -0
- package/theme/styles/css/color/lime.css +72 -0
- package/theme/styles/css/color/orange.css +72 -0
- package/theme/styles/css/color/pink.css +72 -0
- package/theme/styles/css/color/purple.css +72 -0
- package/theme/styles/css/color/red.css +72 -0
- package/theme/styles/css/color/rose.css +72 -0
- package/theme/styles/css/color/sky.css +72 -0
- package/theme/styles/css/color/teal.css +72 -0
- package/theme/styles/css/color/violet.css +72 -0
- package/theme/styles/css/color/yellow.css +72 -0
- package/theme/styles/css/index.css +18 -0
- package/theme/styles/css/neutral/gray.css +63 -0
- package/theme/styles/css/neutral/index.css +11 -0
- package/theme/styles/css/neutral/mauve.css +63 -0
- package/theme/styles/css/neutral/mist.css +63 -0
- package/theme/styles/css/neutral/neutral.css +63 -0
- package/theme/styles/css/neutral/olive.css +63 -0
- package/theme/styles/css/neutral/slate.css +63 -0
- package/theme/styles/css/neutral/stone.css +63 -0
- package/theme/styles/css/neutral/taupe.css +63 -0
- package/theme/styles/css/neutral/zinc.css +63 -0
- package/theme/styles/css/radius/index.css +30 -0
- package/theme/styles/css/space/index.css +20 -0
- package/types/ojiepermana-angular-chart-area.d.ts +76 -1
- package/types/ojiepermana-angular-chart-bar.d.ts +201 -1
- package/types/ojiepermana-angular-chart-core.d.ts +811 -1
- package/types/ojiepermana-angular-chart-line.d.ts +75 -1
- package/types/ojiepermana-angular-chart-pie.d.ts +131 -1
- package/types/ojiepermana-angular-chart-primitives.d.ts +291 -1
- package/types/ojiepermana-angular-chart-radar.d.ts +116 -1
- package/types/ojiepermana-angular-chart-radial.d.ts +116 -1
- package/types/ojiepermana-angular-chart-scatter.d.ts +125 -1
- package/types/ojiepermana-angular-chart.d.ts +2 -1
- package/types/ojiepermana-angular-component-accordion.d.ts +85 -1
- package/types/ojiepermana-angular-component-alert-dialog.d.ts +140 -1
- package/types/ojiepermana-angular-component-alert.d.ts +42 -1
- package/types/ojiepermana-angular-component-aspect-ratio.d.ts +12 -1
- package/types/ojiepermana-angular-component-avatar.d.ts +56 -1
- package/types/ojiepermana-angular-component-badge.d.ts +24 -1
- package/types/ojiepermana-angular-component-breadcrumb.d.ts +46 -1
- package/types/ojiepermana-angular-component-button-group.d.ts +26 -1
- package/types/ojiepermana-angular-component-button.d.ts +27 -1
- package/types/ojiepermana-angular-component-calendar.d.ts +111 -1
- package/types/ojiepermana-angular-component-card.d.ts +69 -1
- package/types/ojiepermana-angular-component-carousel.d.ts +86 -1
- package/types/ojiepermana-angular-component-checkbox.d.ts +42 -1
- package/types/ojiepermana-angular-component-collapsible.d.ts +42 -1
- package/types/ojiepermana-angular-component-combobox.d.ts +60 -1
- package/types/ojiepermana-angular-component-command.d.ts +130 -1
- package/types/ojiepermana-angular-component-composer.d.ts +90 -1
- package/types/ojiepermana-angular-component-context-menu.d.ts +54 -1
- package/types/ojiepermana-angular-component-date-picker.d.ts +109 -1
- package/types/ojiepermana-angular-component-dialog.d.ts +136 -1
- package/types/ojiepermana-angular-component-drawer.d.ts +1 -1
- package/types/ojiepermana-angular-component-dropdown-menu.d.ts +248 -1
- package/types/ojiepermana-angular-component-editor.d.ts +135 -1
- package/types/ojiepermana-angular-component-empty.d.ts +50 -1
- package/types/ojiepermana-angular-component-form.d.ts +159 -1
- package/types/ojiepermana-angular-component-hover-card.d.ts +75 -1
- package/types/ojiepermana-angular-component-icon.d.ts +89 -1
- package/types/ojiepermana-angular-component-input-group.d.ts +51 -1
- package/types/ojiepermana-angular-component-input-otp.d.ts +155 -1
- package/types/ojiepermana-angular-component-input.d.ts +21 -1
- package/types/ojiepermana-angular-component-item.d.ts +93 -1
- package/types/ojiepermana-angular-component-kanban.d.ts +70 -1
- package/types/ojiepermana-angular-component-kbd.d.ts +16 -1
- package/types/ojiepermana-angular-component-label.d.ts +11 -1
- package/types/ojiepermana-angular-component-menubar.d.ts +93 -1
- package/types/ojiepermana-angular-component-native-select.d.ts +26 -1
- package/types/ojiepermana-angular-component-navigation-menu.d.ts +104 -1
- package/types/ojiepermana-angular-component-pagination.d.ts +33 -1
- package/types/ojiepermana-angular-component-pillbox.d.ts +222 -1
- package/types/ojiepermana-angular-component-popover.d.ts +66 -1
- package/types/ojiepermana-angular-component-progress.d.ts +17 -1
- package/types/ojiepermana-angular-component-radio.d.ts +60 -1
- package/types/ojiepermana-angular-component-resizable.d.ts +117 -1
- package/types/ojiepermana-angular-component-scroll-area.d.ts +19 -1
- package/types/ojiepermana-angular-component-segmented-control.d.ts +58 -1
- package/types/ojiepermana-angular-component-select.d.ts +122 -1
- package/types/ojiepermana-angular-component-separator.d.ts +14 -1
- package/types/ojiepermana-angular-component-sheet.d.ts +130 -1
- package/types/ojiepermana-angular-component-skeleton.d.ts +10 -1
- package/types/ojiepermana-angular-component-slider.d.ts +83 -1
- package/types/ojiepermana-angular-component-spinner.d.ts +13 -1
- package/types/ojiepermana-angular-component-switch.d.ts +44 -1
- package/types/ojiepermana-angular-component-table.d.ts +57 -1
- package/types/ojiepermana-angular-component-tabs.d.ts +124 -1
- package/types/ojiepermana-angular-component-textarea.d.ts +17 -1
- package/types/ojiepermana-angular-component-timeline.d.ts +64 -1
- package/types/ojiepermana-angular-component-toast.d.ts +64 -1
- package/types/ojiepermana-angular-component-toggle-group.d.ts +90 -1
- package/types/ojiepermana-angular-component-toggle.d.ts +25 -1
- package/types/ojiepermana-angular-component-tooltip.d.ts +143 -1
- package/types/ojiepermana-angular-component-utils-core.d.ts +184 -1
- package/types/ojiepermana-angular-component-utils-overlay.d.ts +21 -1
- package/types/ojiepermana-angular-component-utils-scale.d.ts +19 -1
- package/types/ojiepermana-angular-component-utils.d.ts +2 -1
- package/types/ojiepermana-angular-component.d.ts +2 -1
- package/types/ojiepermana-angular-navigation-core.d.ts +59 -1
- package/types/ojiepermana-angular-navigation-icon.d.ts +12 -1
- package/types/ojiepermana-angular-navigation-service.d.ts +116 -1
- package/types/ojiepermana-angular-navigation-types.d.ts +144 -1
- package/types/ojiepermana-angular-navigation.d.ts +507 -1
- package/types/ojiepermana-angular-sdk.d.ts +89 -1
- package/types/ojiepermana-angular-theme-component-settings.d.ts +154 -1
- package/types/ojiepermana-angular-theme-layout-services.d.ts +147 -1
- package/types/ojiepermana-angular-theme-layout-types.d.ts +40 -1
- package/types/ojiepermana-angular-theme-layout-wrapper.d.ts +299 -1
- package/types/ojiepermana-angular-theme-layout.d.ts +129 -1
- package/types/ojiepermana-angular-theme-page-core.d.ts +157 -1
- package/types/ojiepermana-angular-theme-page-filter.d.ts +77 -1
- package/types/ojiepermana-angular-theme-page-root.d.ts +88 -1
- package/types/ojiepermana-angular-theme-page-side.d.ts +50 -1
- package/types/ojiepermana-angular-theme-page-slots.d.ts +40 -1
- package/types/ojiepermana-angular-theme-page.d.ts +5 -1
- package/types/ojiepermana-angular-theme-shell-services.d.ts +193 -1
- package/types/ojiepermana-angular-theme-shell-types.d.ts +105 -1
- package/types/ojiepermana-angular-theme-shell.d.ts +100 -1
- package/types/ojiepermana-angular-theme-styles.d.ts +319 -1
- package/types/ojiepermana-angular-theme.d.ts +2 -1
- package/types/ojiepermana-angular.d.ts +5 -5
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Timeline
|
|
2
|
+
|
|
3
|
+
Display a series of events or steps in a vertical or horizontal timeline.
|
|
4
|
+
|
|
5
|
+
This component is conceptually inspired by Flux Timeline. The Angular API, slot names, styling tokens, and examples are implemented for this library's shadcn-style component system.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import {
|
|
11
|
+
TimelineBlockComponent,
|
|
12
|
+
TimelineComponent,
|
|
13
|
+
TimelineContentComponent,
|
|
14
|
+
TimelineIndicatorComponent,
|
|
15
|
+
TimelineItemComponent,
|
|
16
|
+
TimelineSubgridComponent,
|
|
17
|
+
} from '@ojiepermana/angular/component/timeline';
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<Timeline>
|
|
24
|
+
<TimelineItem status="complete">
|
|
25
|
+
<TimelineIndicator>1</TimelineIndicator>
|
|
26
|
+
<TimelineContent>
|
|
27
|
+
<h3 class="text-sm font-medium">Submit</h3>
|
|
28
|
+
<p class="text-muted-foreground">Complete the form and provide all necessary assets.</p>
|
|
29
|
+
</TimelineContent>
|
|
30
|
+
</TimelineItem>
|
|
31
|
+
</Timeline>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Composition
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
Timeline
|
|
38
|
+
|-- TimelineItem
|
|
39
|
+
| |-- TimelineIndicator
|
|
40
|
+
| `-- TimelineContent
|
|
41
|
+
|-- TimelineItem
|
|
42
|
+
| `-- TimelineBlock
|
|
43
|
+
| `-- TimelineSubgrid
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Horizontal Status
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<Timeline horizontal>
|
|
50
|
+
<TimelineItem status="complete">
|
|
51
|
+
<TimelineIndicator>1</TimelineIndicator>
|
|
52
|
+
<TimelineContent>Order confirmed</TimelineContent>
|
|
53
|
+
</TimelineItem>
|
|
54
|
+
<TimelineItem status="current">
|
|
55
|
+
<TimelineIndicator>2</TimelineIndicator>
|
|
56
|
+
<TimelineContent>On its way</TimelineContent>
|
|
57
|
+
</TimelineItem>
|
|
58
|
+
<TimelineItem status="incomplete">
|
|
59
|
+
<TimelineIndicator>3</TimelineIndicator>
|
|
60
|
+
<TimelineContent>Delivered</TimelineContent>
|
|
61
|
+
</TimelineItem>
|
|
62
|
+
</Timeline>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Inputs
|
|
66
|
+
|
|
67
|
+
| Part | Input | Type | Default |
|
|
68
|
+
| ---------------------------- | ------------ | ------------------------------------ | ---------- |
|
|
69
|
+
| `TimelineComponent` | `horizontal` | `boolean` | `false` |
|
|
70
|
+
| `TimelineComponent` | `align` | `start \| baseline \| center \| end` | `center` |
|
|
71
|
+
| `TimelineComponent` | `size` | `default \| lg` | `default` |
|
|
72
|
+
| `TimelineItemComponent` | `status` | `complete \| current \| incomplete` | `null` |
|
|
73
|
+
| `TimelineItemComponent` | `align` | `start \| baseline \| center \| end` | root value |
|
|
74
|
+
| `TimelineItemComponent` | `size` | `default \| lg` | root value |
|
|
75
|
+
| `TimelineIndicatorComponent` | `variant` | `default \| bare` | `default` |
|
|
76
|
+
| `TimelineIndicatorComponent` | `status` | `complete \| current \| incomplete` | item value |
|
|
77
|
+
| `TimelineIndicatorComponent` | `color` | standard color token | `null` |
|
|
78
|
+
|
|
79
|
+
## Spacing
|
|
80
|
+
|
|
81
|
+
The root exposes CSS variables for spacing and indicator sizing.
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<Timeline class="[--timeline-item-gap:3rem] [--timeline-content-gap:1rem]">
|
|
85
|
+
<!-- timeline items -->
|
|
86
|
+
</Timeline>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Accessibility
|
|
90
|
+
|
|
91
|
+
- Use semantic headings and text inside `TimelineContent`.
|
|
92
|
+
- Give icon-only indicators an accessible label when the icon communicates meaning.
|
|
93
|
+
- Keep chronological order in DOM order for screen readers.
|
|
94
|
+
- Do not rely on color alone; pair status indicators with text content.
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Toast
|
|
2
|
+
|
|
3
|
+
Imperative, dependency-free notification service that renders toasts into a live region (`role="status"`, `aria-live="polite"`) with shadcn styling and a Sonner-style API surface.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { ToastService } from '@ojiepermana/angular/component/toast';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Application Setup
|
|
12
|
+
|
|
13
|
+
No special bootstrap providers are required. `ToastService` is a dependency-free, `providedIn: 'root'` service that injects `DOCUMENT` and renders its own live-region container, so you can inject and use it directly.
|
|
14
|
+
|
|
15
|
+
## Basic Usage
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { inject } from '@angular/core';
|
|
19
|
+
import { ToastService } from '@ojiepermana/angular/component/toast';
|
|
20
|
+
|
|
21
|
+
export class SaveButtonComponent {
|
|
22
|
+
private readonly toast = inject(ToastService);
|
|
23
|
+
|
|
24
|
+
save(): void {
|
|
25
|
+
this.toast.success({
|
|
26
|
+
title: 'Saved',
|
|
27
|
+
description: 'Your changes have been saved.',
|
|
28
|
+
action: 'Undo',
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
fail(): void {
|
|
33
|
+
this.toast.error({ title: 'Upload failed', description: 'Check your connection.' });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Common Patterns
|
|
39
|
+
|
|
40
|
+
### Variants
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
this.toast.show({ title: 'Draft created' });
|
|
44
|
+
this.toast.success({ title: 'Invoice paid' });
|
|
45
|
+
this.toast.info({ title: 'Deploy starts in 10 minutes' });
|
|
46
|
+
this.toast.warning({ title: 'Storage is almost full' });
|
|
47
|
+
this.toast.error({ title: 'Payment failed' });
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Position
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
this.toast.show({
|
|
54
|
+
title: 'Event has been created',
|
|
55
|
+
horizontalPosition: 'start',
|
|
56
|
+
verticalPosition: 'top',
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Persistent action
|
|
61
|
+
|
|
62
|
+
For an important action, keep the toast open (`durationMs: null`) and handle the result from the returned `ToastRef`.
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
const ref = this.toast.show({
|
|
66
|
+
title: 'Event archived',
|
|
67
|
+
description: 'Restore it from the calendar within the next minute.',
|
|
68
|
+
action: 'Undo',
|
|
69
|
+
durationMs: null,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
void ref.afterDismissed.then(({ dismissedByAction }) => {
|
|
73
|
+
if (dismissedByAction) {
|
|
74
|
+
this.toast.info({
|
|
75
|
+
title: 'Archive cancelled',
|
|
76
|
+
description: 'The event is back on the calendar.',
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Promise State
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
void this.toast.promise(() => this.createEvent(), {
|
|
86
|
+
loading: 'Loading...',
|
|
87
|
+
success: (event) => `${event.name} has been created`,
|
|
88
|
+
error: 'Error',
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The loading toast uses `durationMs: null` internally so it stays visible until the promise settles.
|
|
93
|
+
|
|
94
|
+
## API Reference
|
|
95
|
+
|
|
96
|
+
### `ToastService`
|
|
97
|
+
|
|
98
|
+
| Method | Returns |
|
|
99
|
+
| ---------------------------------- | ------------ |
|
|
100
|
+
| `show(options: ToastOptions)` | `ToastRef` |
|
|
101
|
+
| `success(options)` | `ToastRef` |
|
|
102
|
+
| `info(options)` | `ToastRef` |
|
|
103
|
+
| `warning(options)` | `ToastRef` |
|
|
104
|
+
| `error(options)` | `ToastRef` |
|
|
105
|
+
| `promise(taskOrFactory, messages)` | `Promise<T>` |
|
|
106
|
+
| `dismiss()` | `void` |
|
|
107
|
+
|
|
108
|
+
### `ToastRef`
|
|
109
|
+
|
|
110
|
+
| Member | Type | Notes |
|
|
111
|
+
| ---------------- | ----------------------------------------- | ----------------------------------------------------- |
|
|
112
|
+
| `dismiss()` | `void` | Dismisses this toast. |
|
|
113
|
+
| `afterDismissed` | `Promise<{ dismissedByAction: boolean }>` | Resolves with `dismissedByAction: true` via `action`. |
|
|
114
|
+
|
|
115
|
+
### `ToastOptions`
|
|
116
|
+
|
|
117
|
+
| Field | Type | Default |
|
|
118
|
+
| -------------------- | ---------------------------------------------------------------- | ------------------------ |
|
|
119
|
+
| `title` | `string` | — |
|
|
120
|
+
| `description` | `string` | — |
|
|
121
|
+
| `action` | `string` | — |
|
|
122
|
+
| `dismissLabel` | `string` | `'Dismiss notification'` |
|
|
123
|
+
| `variant` | `'default' \| 'destructive' \| 'success' \| 'info' \| 'warning'` | `'default'` |
|
|
124
|
+
| `durationMs` | `number \| null` | `5000` |
|
|
125
|
+
| `pauseOnInteraction` | `boolean` | `true` |
|
|
126
|
+
| `horizontalPosition` | `'start' \| 'center' \| 'end' \| 'left' \| 'right'` | `'end'` |
|
|
127
|
+
| `verticalPosition` | `'top' \| 'bottom'` | `'bottom'` |
|
|
128
|
+
|
|
129
|
+
Set `durationMs` to `null` when the toast should stay visible until `dismiss()` is called.
|
|
130
|
+
|
|
131
|
+
### `ToastPromiseMessages<T>`
|
|
132
|
+
|
|
133
|
+
| Field | Type | Notes |
|
|
134
|
+
| --------- | ---------------------------------------- | ----------------------------------------- |
|
|
135
|
+
| `loading` | `string` | Title shown while the promise is pending. |
|
|
136
|
+
| `success` | `string \| ((value: T) => string)` | Title shown when the promise resolves. |
|
|
137
|
+
| `error` | `string \| ((error: unknown) => string)` | Title shown when the promise rejects. |
|
|
138
|
+
|
|
139
|
+
## Styling And Theming
|
|
140
|
+
|
|
141
|
+
The service applies `toast-panel` plus `toast-<variant>` classes to each toast `<div>`.
|
|
142
|
+
|
|
143
|
+
- `default` keeps the `background`/`foreground` tokens from the active theme.
|
|
144
|
+
- `success`, `info`, and `warning` map to the semantic status tokens
|
|
145
|
+
(`bg-success text-success-foreground`, and the same shape for the other two).
|
|
146
|
+
Those tokens are generated with a measured WCAG AA contrast guarantee, so every
|
|
147
|
+
variant stays readable in both modes without any override.
|
|
148
|
+
- `destructive` (used by `error()`) maps to the destructive tokens.
|
|
149
|
+
|
|
150
|
+
If you need to override a variant, target the toast class directly:
|
|
151
|
+
|
|
152
|
+
```css
|
|
153
|
+
.toast-panel.toast-warning {
|
|
154
|
+
background-color: hsl(var(--warning));
|
|
155
|
+
color: hsl(var(--warning-foreground));
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Accessibility
|
|
160
|
+
|
|
161
|
+
The service renders toasts into a `role="status"`, `aria-live="polite"` live region so screen readers announce them automatically. Timers pause while the pointer or keyboard focus is inside a toast, and every toast includes a labelled dismiss button.
|
|
162
|
+
|
|
163
|
+
## Keyboard interactions
|
|
164
|
+
|
|
165
|
+
The toast body itself is not a roving-focus widget. Tab reaches the optional action and dismiss buttons; focus pauses auto-dismiss until it leaves the toast.
|
|
166
|
+
|
|
167
|
+
## Angular Notes
|
|
168
|
+
|
|
169
|
+
Inject the service where the interaction starts instead of creating a global host component. Toasts stack in the live-region container, and `promise()` dismisses the loading toast before showing its success or error follow-up.
|
|
170
|
+
|
|
171
|
+
## Source Parity
|
|
172
|
+
|
|
173
|
+
This entrypoint is the local Angular mapping for shadcn Sonner as well as the simpler toast examples in the demo. It intentionally preserves the imperative API mental model, variant coverage, and placement controls while staying honest about the implementation boundary: the runtime surface is a focused, dependency-free live-region renderer, not Sonner's full multi-toast viewport.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Toggle
|
|
2
|
+
|
|
3
|
+
A two-state button that can be either on or off.
|
|
4
|
+
|
|
5
|
+
Use Toggle for persistent formatting, bookmarking, pinning, or filter state where a pressed button is the right semantic pattern.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { ToggleComponent } from '@ojiepermana/angular/component/toggle';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Composition
|
|
14
|
+
|
|
15
|
+
The Angular surface keeps the same single-host shape as shadcn and Radix while mapping it to a native button selector.
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
button[Toggle]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Basic usage
|
|
22
|
+
|
|
23
|
+
Bind `[(pressed)]` when the parent should observe or control the state. The host always renders as a native button with `aria-pressed`.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
readonly bookmarked = signal(false);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<button Toggle aria-label="Toggle bookmark" [(pressed)]="bookmarked" variant="outline" size="sm">
|
|
31
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
32
|
+
<path d="M6 4.75c0-.41.34-.75.75-.75h10.5c.41 0 .75.34.75.75V20l-6-3.5L6 20V4.75Z" />
|
|
33
|
+
</svg>
|
|
34
|
+
Bookmark
|
|
35
|
+
</button>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Common patterns
|
|
39
|
+
|
|
40
|
+
### Outline variant
|
|
41
|
+
|
|
42
|
+
Use `variant="outline"` when the toggle should read like a bordered tool button.
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<button Toggle aria-label="Toggle italic" variant="outline">Italic</button>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### With text
|
|
49
|
+
|
|
50
|
+
Project an icon and visible text when the label should stay on screen.
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<button Toggle aria-label="Toggle italic">
|
|
54
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
55
|
+
<path d="M10 4h8" />
|
|
56
|
+
<path d="M6 20h8" />
|
|
57
|
+
<path d="M14 4 10 20" />
|
|
58
|
+
</svg>
|
|
59
|
+
Italic
|
|
60
|
+
</button>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Sizes
|
|
64
|
+
|
|
65
|
+
The toggle supports the shadcn size names `sm`, `default`, and `lg`.
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<button Toggle size="sm" variant="outline" aria-label="Toggle small">Small</button>
|
|
69
|
+
<button Toggle size="default" variant="outline" aria-label="Toggle default">Default</button>
|
|
70
|
+
<button Toggle size="lg" variant="outline" aria-label="Toggle large">Large</button>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Disabled state
|
|
74
|
+
|
|
75
|
+
Set `[disabled]="true"` when the control should remain visible but unavailable.
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<button Toggle aria-label="Toggle bookmark" [disabled]="true">Bookmark</button>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### RTL
|
|
82
|
+
|
|
83
|
+
Direction comes from the surrounding layout. The API stays the same.
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<div dir="rtl" lang="ar" class="text-right">
|
|
87
|
+
<button Toggle aria-label="تبديل الإشارة المرجعية" variant="outline" size="sm">
|
|
88
|
+
إشارة مرجعية
|
|
89
|
+
</button>
|
|
90
|
+
</div>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## API reference
|
|
94
|
+
|
|
95
|
+
| Input or model | Type | Default |
|
|
96
|
+
| -------------- | --------------------------- | ----------- |
|
|
97
|
+
| `pressed` | `boolean` | `false` |
|
|
98
|
+
| `disabled` | `boolean` | `false` |
|
|
99
|
+
| `variant` | `'default' \| 'outline'` | `'default'` |
|
|
100
|
+
| `size` | `'sm' \| 'default' \| 'lg'` | `'default'` |
|
|
101
|
+
| `class` | `string` | `''` |
|
|
102
|
+
|
|
103
|
+
Host: `button[Toggle]`.
|
|
104
|
+
|
|
105
|
+
The host exposes `aria-pressed`, `data-state="on|off"`, `data-variant`, `data-size`, and `data-disabled` for styling and testing hooks.
|
|
106
|
+
|
|
107
|
+
## Styling and theming
|
|
108
|
+
|
|
109
|
+
The primitive uses the shared library color tokens for `foreground`, `accent`, `muted`, `input`, and `ring`.
|
|
110
|
+
|
|
111
|
+
Use `class` to add width, shape, or layout utilities such as `rounded-full`, `w-full`, or responsive flex helpers.
|
|
112
|
+
|
|
113
|
+
## Accessibility
|
|
114
|
+
|
|
115
|
+
- `button[Toggle]` keeps the native button semantics and adds `aria-pressed` for the two-state pattern.
|
|
116
|
+
- Provide an `aria-label` for icon-only toggles.
|
|
117
|
+
- Use Toggle for persistent on/off state. If the control changes application state like a checkbox field, prefer the dedicated switch or checkbox primitive.
|
|
118
|
+
- Disabled toggles remain visible but non-interactive.
|
|
119
|
+
|
|
120
|
+
## Keyboard interactions
|
|
121
|
+
|
|
122
|
+
- Native button behavior covers Tab focus plus Enter and Space activation.
|
|
123
|
+
- Pressing Enter or Space toggles the `pressed` model through the native click event.
|
|
124
|
+
|
|
125
|
+
## Angular notes
|
|
126
|
+
|
|
127
|
+
- Import `ToggleComponent` into the standalone component that renders the host.
|
|
128
|
+
- `[(pressed)]` is the Angular replacement for React's `pressed` and `onPressedChange` pairing.
|
|
129
|
+
- The host always defaults to `type="button"` so it does not submit ancestor forms accidentally.
|
|
130
|
+
|
|
131
|
+
## Source parity
|
|
132
|
+
|
|
133
|
+
This Angular implementation follows the shadcn Toggle information architecture, variants, sizes, and RTL guidance while translating the runtime API to a native button host with signal-friendly two-way binding.
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# Toggle Group
|
|
2
|
+
|
|
3
|
+
A set of two-state buttons that can be toggled on or off with either single or multiple selection.
|
|
4
|
+
|
|
5
|
+
Use Toggle Group for formatting toolbars, persistent filters, view-mode switches, or any compact control cluster where each item represents a pressed state instead of an immediate action.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import {
|
|
11
|
+
ToggleGroupComponent,
|
|
12
|
+
ToggleGroupItemDirective,
|
|
13
|
+
} from '@ojiepermana/angular/component/toggle-group';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Composition
|
|
17
|
+
|
|
18
|
+
The Angular structure keeps the same root-plus-items shape as shadcn and Radix while translating the API to strongly typed Angular bindings.
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
ToggleGroup
|
|
22
|
+
├── button[ToggleGroupItem]
|
|
23
|
+
└── button[ToggleGroupItem]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Basic usage
|
|
27
|
+
|
|
28
|
+
Use `[(value)]` for single-select groups and `[(values)]` for multi-select groups.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
readonly alignment = signal<string | null>('center');
|
|
32
|
+
readonly styles = signal<string[]>(['bold']);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<ToggleGroup type="single" [(value)]="alignment" variant="outline" aria-label="Text alignment">
|
|
37
|
+
<button ToggleGroupItem value="left" aria-label="Left aligned">Left</button>
|
|
38
|
+
<button ToggleGroupItem value="center" aria-label="Center aligned">Center</button>
|
|
39
|
+
<button ToggleGroupItem value="right" aria-label="Right aligned">Right</button>
|
|
40
|
+
</ToggleGroup>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<ToggleGroup type="multiple" [(values)]="styles" variant="outline" aria-label="Text styles">
|
|
45
|
+
<button ToggleGroupItem value="bold" aria-label="Bold">Bold</button>
|
|
46
|
+
<button ToggleGroupItem value="italic" aria-label="Italic">Italic</button>
|
|
47
|
+
<button ToggleGroupItem value="underline" aria-label="Underline">Underline</button>
|
|
48
|
+
</ToggleGroup>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Common patterns
|
|
52
|
+
|
|
53
|
+
### Outline
|
|
54
|
+
|
|
55
|
+
Use `variant="outline"` when the group should read like a bordered toolbar or filter control.
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<ToggleGroup type="single" [(value)]="filter" variant="outline" aria-label="Message filters">
|
|
59
|
+
<button ToggleGroupItem value="all">All</button>
|
|
60
|
+
<button ToggleGroupItem value="missed">Missed</button>
|
|
61
|
+
</ToggleGroup>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Size
|
|
65
|
+
|
|
66
|
+
Set `size` on the root so every child item scales together.
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<ToggleGroup
|
|
70
|
+
type="single"
|
|
71
|
+
[(value)]="alignment"
|
|
72
|
+
variant="outline"
|
|
73
|
+
size="lg"
|
|
74
|
+
aria-label="Large alignment"
|
|
75
|
+
>
|
|
76
|
+
<button ToggleGroupItem value="left">Left</button>
|
|
77
|
+
<button ToggleGroupItem value="center">Center</button>
|
|
78
|
+
<button ToggleGroupItem value="right">Right</button>
|
|
79
|
+
</ToggleGroup>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Spacing
|
|
83
|
+
|
|
84
|
+
Spacing defaults to `2`, matching the current shadcn docs. Use `spacing="0"` for connected items or larger values for looser toolbars.
|
|
85
|
+
|
|
86
|
+
```html
|
|
87
|
+
<ToggleGroup
|
|
88
|
+
type="single"
|
|
89
|
+
[(value)]="alignment"
|
|
90
|
+
variant="outline"
|
|
91
|
+
spacing="0"
|
|
92
|
+
aria-label="Connected alignment"
|
|
93
|
+
>
|
|
94
|
+
<button ToggleGroupItem value="left">Left</button>
|
|
95
|
+
<button ToggleGroupItem value="center">Center</button>
|
|
96
|
+
<button ToggleGroupItem value="right">Right</button>
|
|
97
|
+
</ToggleGroup>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Vertical orientation
|
|
101
|
+
|
|
102
|
+
Use `orientation="vertical"` to stack items while keeping the same roving-focus keyboard behavior.
|
|
103
|
+
|
|
104
|
+
```html
|
|
105
|
+
<ToggleGroup
|
|
106
|
+
type="multiple"
|
|
107
|
+
[(values)]="styles"
|
|
108
|
+
orientation="vertical"
|
|
109
|
+
spacing="1"
|
|
110
|
+
aria-label="Text styles"
|
|
111
|
+
>
|
|
112
|
+
<button ToggleGroupItem value="bold" aria-label="Toggle bold">Bold</button>
|
|
113
|
+
<button ToggleGroupItem value="italic" aria-label="Toggle italic">Italic</button>
|
|
114
|
+
<button ToggleGroupItem value="underline" aria-label="Toggle underline">Underline</button>
|
|
115
|
+
</ToggleGroup>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Disabled group
|
|
119
|
+
|
|
120
|
+
Disable the root when the whole cluster is unavailable.
|
|
121
|
+
|
|
122
|
+
```html
|
|
123
|
+
<ToggleGroup
|
|
124
|
+
type="multiple"
|
|
125
|
+
[(values)]="styles"
|
|
126
|
+
variant="outline"
|
|
127
|
+
[disabled]="true"
|
|
128
|
+
aria-label="Unavailable text styles"
|
|
129
|
+
>
|
|
130
|
+
<button ToggleGroupItem value="bold">Bold</button>
|
|
131
|
+
<button ToggleGroupItem value="italic">Italic</button>
|
|
132
|
+
<button ToggleGroupItem value="underline">Underline</button>
|
|
133
|
+
</ToggleGroup>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Custom controlled state
|
|
137
|
+
|
|
138
|
+
The selected value can drive any Angular signal, such as font weight, filters, or an editor mode.
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
readonly fontWeight = signal<string | null>('normal');
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
```html
|
|
145
|
+
<ToggleGroup
|
|
146
|
+
type="single"
|
|
147
|
+
[(value)]="fontWeight"
|
|
148
|
+
variant="outline"
|
|
149
|
+
size="lg"
|
|
150
|
+
aria-label="Font weight"
|
|
151
|
+
>
|
|
152
|
+
<button ToggleGroupItem value="light" class="min-w-24">Light</button>
|
|
153
|
+
<button ToggleGroupItem value="normal" class="min-w-24">Normal</button>
|
|
154
|
+
<button ToggleGroupItem value="medium" class="min-w-24">Medium</button>
|
|
155
|
+
<button ToggleGroupItem value="bold" class="min-w-24">Bold</button>
|
|
156
|
+
</ToggleGroup>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### RTL
|
|
160
|
+
|
|
161
|
+
Direction comes from the surrounding layout. Horizontal arrow navigation respects the active text direction automatically.
|
|
162
|
+
|
|
163
|
+
```html
|
|
164
|
+
<div dir="rtl" lang="ar" class="text-right">
|
|
165
|
+
<ToggleGroup type="single" [(value)]="view" variant="outline" aria-label="طريقة العرض">
|
|
166
|
+
<button ToggleGroupItem value="list">قائمة</button>
|
|
167
|
+
<button ToggleGroupItem value="grid">شبكة</button>
|
|
168
|
+
<button ToggleGroupItem value="cards">بطاقات</button>
|
|
169
|
+
</ToggleGroup>
|
|
170
|
+
</div>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## API reference
|
|
174
|
+
|
|
175
|
+
### `ToggleGroupComponent`
|
|
176
|
+
|
|
177
|
+
| Input or model | Type | Default |
|
|
178
|
+
| -------------- | ---------------------------- | -------------- |
|
|
179
|
+
| `type` | `'single' \| 'multiple'` | required |
|
|
180
|
+
| `value` | `string \| null` | `null` |
|
|
181
|
+
| `values` | `string[]` | `[]` |
|
|
182
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` |
|
|
183
|
+
| `variant` | `'default' \| 'outline'` | `'default'` |
|
|
184
|
+
| `size` | `'sm' \| 'default' \| 'lg'` | `'default'` |
|
|
185
|
+
| `spacing` | `0 \| 1 \| 2 \| 3 \| 4` | `2` |
|
|
186
|
+
| `loop` | `boolean` | `true` |
|
|
187
|
+
| `disabled` | `boolean` | `false` |
|
|
188
|
+
| `dir` | `'ltr' \| 'rtl' \| null` | `null` |
|
|
189
|
+
| `class` | `string` | `''` |
|
|
190
|
+
|
|
191
|
+
### `ToggleGroupItemDirective`
|
|
192
|
+
|
|
193
|
+
| Input | Type | Default |
|
|
194
|
+
| ---------- | --------- | ------- |
|
|
195
|
+
| `value` | `string` | — |
|
|
196
|
+
| `disabled` | `boolean` | `false` |
|
|
197
|
+
| `class` | `string` | `''` |
|
|
198
|
+
|
|
199
|
+
Host: `button[ToggleGroupItem]`.
|
|
200
|
+
|
|
201
|
+
The item host exposes `aria-pressed`, `data-state="on|off"`, `data-variant`, `data-size`, `data-orientation`, and `data-disabled` for styling and testing hooks.
|
|
202
|
+
|
|
203
|
+
## Styling and theming
|
|
204
|
+
|
|
205
|
+
- Toggle Group items intentionally share the same `variant` and `size` contract as the standalone Toggle primitive, so grouped toolbars and standalone toggles stay visually aligned.
|
|
206
|
+
- Use `spacing` for inter-item layout. When `spacing="0"`, the root collapses adjacent radius and borders so outline items read as a connected control.
|
|
207
|
+
- Use `class` on the root or an item for width, alignment, or card-like custom presentations.
|
|
208
|
+
|
|
209
|
+
## Accessibility
|
|
210
|
+
|
|
211
|
+
- `ToggleGroup` renders `role="group"`; provide `aria-label` or `aria-labelledby` when the cluster needs an accessible name.
|
|
212
|
+
- `button[ToggleGroupItem]` keeps native button semantics and exposes `aria-pressed` for the two-state pattern.
|
|
213
|
+
- Add an `aria-label` to icon-only items.
|
|
214
|
+
- Disabled items stay visible and are skipped by the group keyboard navigation.
|
|
215
|
+
|
|
216
|
+
## Keyboard interactions
|
|
217
|
+
|
|
218
|
+
- Tab moves focus to the pressed item or the first enabled item in the group.
|
|
219
|
+
- Enter and Space activate or deactivate the current item through the native button click.
|
|
220
|
+
- Arrow keys move focus through the group.
|
|
221
|
+
- `Home` and `End` jump to the first or last enabled item.
|
|
222
|
+
- Horizontal arrow movement respects RTL direction.
|
|
223
|
+
|
|
224
|
+
## Angular notes
|
|
225
|
+
|
|
226
|
+
- Use `[(value)]` in single mode and `[(values)]` in multiple mode instead of overloading one input with two types.
|
|
227
|
+
- The item host selector is `button[ToggleGroupItem]`; consumers do not add `Toggle` separately.
|
|
228
|
+
- The root owns roving focus, so consumer templates do not need extra CDK focus utilities.
|
|
229
|
+
|
|
230
|
+
## Source parity
|
|
231
|
+
|
|
232
|
+
This Angular implementation follows the current shadcn Toggle Group docs for outline styling, size scaling, spacing, vertical orientation, disabled groups, custom controlled state, RTL behavior, and the Radix roving-focus keyboard contract.
|
|
233
|
+
|
|
234
|
+
The intentional Angular deviation is the binding split between `value` and `values`, which keeps signal types explicit for single and multiple modes.
|