@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,214 @@
|
|
|
1
|
+
# Button Group
|
|
2
|
+
|
|
3
|
+
Groups related action buttons, text pills, inputs, and nested control clusters into a single visual control boundary.
|
|
4
|
+
|
|
5
|
+
Use Button Group for toolbars, split actions, search bars, and compact action clusters where neighboring controls should read as one control family rather than isolated buttons.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { ButtonComponent } from '@ojiepermana/angular/component/button';
|
|
11
|
+
import {
|
|
12
|
+
ButtonGroupComponent,
|
|
13
|
+
ButtonGroupSeparatorComponent,
|
|
14
|
+
ButtonGroupTextComponent,
|
|
15
|
+
} from '@ojiepermana/angular/component/button-group';
|
|
16
|
+
import { InputComponent } from '@ojiepermana/angular/component/input';
|
|
17
|
+
import {
|
|
18
|
+
InputGroupAddonComponent,
|
|
19
|
+
InputGroupComponent,
|
|
20
|
+
InputGroupInputComponent,
|
|
21
|
+
InputGroupTextComponent,
|
|
22
|
+
} from '@ojiepermana/angular/component/input-group';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Composition
|
|
26
|
+
|
|
27
|
+
The Angular structure mirrors the shadcn composition while translating `asChild` to normal Angular content projection.
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
ButtonGroup
|
|
31
|
+
├── button[Button] or a[Button]
|
|
32
|
+
├── input[Input] or textarea[Textarea]
|
|
33
|
+
├── ButtonGroupText
|
|
34
|
+
├── ButtonGroupSeparator
|
|
35
|
+
└── ButtonGroup
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Basic usage
|
|
39
|
+
|
|
40
|
+
Label the group with `aria-label` or `aria-labelledby` whenever the buttons act as a single tool cluster.
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<ButtonGroup aria-label="Search actions" class="w-full max-w-md">
|
|
44
|
+
<input Input placeholder="Search..." />
|
|
45
|
+
<button Button type="button" variant="outline" aria-label="Run search">Search</button>
|
|
46
|
+
</ButtonGroup>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Common patterns
|
|
50
|
+
|
|
51
|
+
### Orientation
|
|
52
|
+
|
|
53
|
+
Use `orientation="vertical"` when the group should stack actions instead of lining them up horizontally.
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<ButtonGroup orientation="vertical" aria-label="Zoom controls" class="h-fit">
|
|
57
|
+
<button Button type="button" variant="outline" size="icon">+</button>
|
|
58
|
+
<button Button type="button" variant="outline" size="icon">-</button>
|
|
59
|
+
</ButtonGroup>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Text and field pairing
|
|
63
|
+
|
|
64
|
+
`ButtonGroupText` is the Angular translation of shadcn's `ButtonGroupText`. Project any semantic content inside it, including a native label.
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<ButtonGroup class="w-full max-w-lg">
|
|
68
|
+
<ButtonGroupText>
|
|
69
|
+
<label for="project-name">Project</label>
|
|
70
|
+
</ButtonGroupText>
|
|
71
|
+
<input Input id="project-name" placeholder="Type a name..." />
|
|
72
|
+
</ButtonGroup>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Separator
|
|
76
|
+
|
|
77
|
+
Use `ButtonGroupSeparator` when filled or secondary buttons still need a visible division.
|
|
78
|
+
|
|
79
|
+
```html
|
|
80
|
+
<ButtonGroup aria-label="Clipboard actions">
|
|
81
|
+
<button Button type="button" variant="secondary" size="sm">Copy</button>
|
|
82
|
+
<ButtonGroupSeparator />
|
|
83
|
+
<button Button type="button" variant="secondary" size="sm">Paste</button>
|
|
84
|
+
</ButtonGroup>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Split action
|
|
88
|
+
|
|
89
|
+
Split buttons are just two neighboring buttons with a separator between the primary action and the disclosure or icon action.
|
|
90
|
+
|
|
91
|
+
```html
|
|
92
|
+
<ButtonGroup aria-label="Create actions">
|
|
93
|
+
<button Button type="button" variant="secondary">Create</button>
|
|
94
|
+
<ButtonGroupSeparator />
|
|
95
|
+
<button Button type="button" variant="secondary" size="icon" aria-label="Open create menu">
|
|
96
|
+
+
|
|
97
|
+
</button>
|
|
98
|
+
</ButtonGroup>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Search input
|
|
102
|
+
|
|
103
|
+
Button Group works directly with the local `Input` primitive because both controls own their border on the host element.
|
|
104
|
+
|
|
105
|
+
```html
|
|
106
|
+
<ButtonGroup aria-label="Repository search" class="w-full max-w-lg">
|
|
107
|
+
<input Input placeholder="Search repositories..." />
|
|
108
|
+
<button Button type="button" variant="outline" aria-label="Search">Search</button>
|
|
109
|
+
</ButtonGroup>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Nested groups
|
|
113
|
+
|
|
114
|
+
Nest `ButtonGroup` when you want separate clusters with spacing between them while keeping each inner cluster visually fused.
|
|
115
|
+
|
|
116
|
+
```html
|
|
117
|
+
<ButtonGroup aria-label="Message composer" class="w-full max-w-xl">
|
|
118
|
+
<ButtonGroup>
|
|
119
|
+
<button Button type="button" variant="outline" size="icon" aria-label="Add attachment">
|
|
120
|
+
+
|
|
121
|
+
</button>
|
|
122
|
+
</ButtonGroup>
|
|
123
|
+
|
|
124
|
+
<ButtonGroup class="min-w-0 flex-1">
|
|
125
|
+
<InputGroup>
|
|
126
|
+
<input InputGroupInput placeholder="Send a message..." />
|
|
127
|
+
<InputGroupAddon align="inline-end">
|
|
128
|
+
<InputGroupText>⌘↵</InputGroupText>
|
|
129
|
+
</InputGroupAddon>
|
|
130
|
+
</InputGroup>
|
|
131
|
+
</ButtonGroup>
|
|
132
|
+
</ButtonGroup>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Popover companion
|
|
136
|
+
|
|
137
|
+
Use a neighboring popover trigger when the primary button opens a short follow-up form or assistant prompt.
|
|
138
|
+
|
|
139
|
+
```html
|
|
140
|
+
<ButtonGroup aria-label="Copilot actions">
|
|
141
|
+
<button Button type="button" variant="outline">Copilot</button>
|
|
142
|
+
<button Button type="button" variant="outline" size="icon" aria-label="Open Copilot options">
|
|
143
|
+
⋯
|
|
144
|
+
</button>
|
|
145
|
+
</ButtonGroup>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## API reference
|
|
149
|
+
|
|
150
|
+
### `ButtonGroupComponent`
|
|
151
|
+
|
|
152
|
+
| Input | Type | Default |
|
|
153
|
+
| ------------- | ---------------------------- | -------------- |
|
|
154
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` |
|
|
155
|
+
| `class` | `string` | `''` |
|
|
156
|
+
|
|
157
|
+
Host behavior:
|
|
158
|
+
|
|
159
|
+
- Renders `role="group"`.
|
|
160
|
+
- Adds `data-orientation` and `data-slot="button-group"`.
|
|
161
|
+
- Collapses adjoining corner radius and internal border width with RTL-safe logical properties.
|
|
162
|
+
|
|
163
|
+
### `ButtonGroupSeparatorComponent`
|
|
164
|
+
|
|
165
|
+
| Input | Type | Default |
|
|
166
|
+
| ------------- | ---------------------------- | ------------ |
|
|
167
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'vertical'` |
|
|
168
|
+
| `class` | `string` | `''` |
|
|
169
|
+
|
|
170
|
+
### `ButtonGroupTextComponent`
|
|
171
|
+
|
|
172
|
+
| Input | Type | Default |
|
|
173
|
+
| ------- | -------- | ------- |
|
|
174
|
+
| `class` | `string` | `''` |
|
|
175
|
+
|
|
176
|
+
Angular mapping note: there is no `asChild` input. Project the semantic element you need, such as `<label>` or `<span>`, inside `ButtonGroupText`.
|
|
177
|
+
|
|
178
|
+
## Styling and theming
|
|
179
|
+
|
|
180
|
+
- The root collapses adjacent corners and borders with logical start/end utilities so the same component works in LTR and RTL layouts.
|
|
181
|
+
- Nested `ButtonGroup` children automatically create spacing between groups while preserving the fused inner boundaries of each nested group.
|
|
182
|
+
- `ButtonGroupText` uses `border-border`, `bg-muted`, and shared radius tokens so it matches the rest of the component package.
|
|
183
|
+
- `Input` and `InputGroup` compose cleanly inside Button Group because their border and radius live on the visible host. The current Material-backed `SelectField` does not expose the same host-level border contract yet, so the upstream Select example is intentionally not shipped as a parity demo.
|
|
184
|
+
|
|
185
|
+
## Accessibility
|
|
186
|
+
|
|
187
|
+
- `ButtonGroup` renders with `role="group"`; provide an accessible name with `aria-label` or `aria-labelledby` when the controls act as one tool cluster.
|
|
188
|
+
- Button Group is for actions. If the clustered controls represent pressed or selected state, use a toggle-group style pattern instead.
|
|
189
|
+
- Add `aria-label` to icon-only buttons inside the group.
|
|
190
|
+
- `ButtonGroupText` is non-interactive content. Keep labels, helper text, or status copy inside it and leave action handling to the actual button or input controls.
|
|
191
|
+
|
|
192
|
+
## Keyboard interactions
|
|
193
|
+
|
|
194
|
+
- Tab order follows the DOM order of the projected controls.
|
|
195
|
+
- Native buttons keep their built-in Enter and Space activation behavior.
|
|
196
|
+
- Inputs and textareas keep their native editing behavior.
|
|
197
|
+
- Popover and menu triggers inside a group keep the keyboard behavior of their own directives; the group container does not intercept those interactions.
|
|
198
|
+
|
|
199
|
+
## Button Group vs Toggle Group
|
|
200
|
+
|
|
201
|
+
- Use Button Group when each item performs an immediate action.
|
|
202
|
+
- Use Toggle Group when each item represents persistent pressed, selected, or filter state.
|
|
203
|
+
|
|
204
|
+
## Angular notes
|
|
205
|
+
|
|
206
|
+
- Import `ButtonGroupComponent` plus only the child primitives you render on the page.
|
|
207
|
+
- There is no React-style `asChild` prop. Angular templates already let you choose the semantic element directly.
|
|
208
|
+
- Use nested `ButtonGroup` elements for spacing between related clusters rather than adding gap utilities to a single fused group.
|
|
209
|
+
|
|
210
|
+
## Source parity
|
|
211
|
+
|
|
212
|
+
This Angular implementation follows the shadcn Button Group surface with a grouped root, text pill, separator, nested-group spacing, dropdown and popover composition, and RTL-friendly border collapsing.
|
|
213
|
+
|
|
214
|
+
The main documented deviation is the upstream Select example: the local `SelectField` remains Material-backed, so it is better composed next to the group in surrounding layout for now instead of being presented as a fused host-level group item.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Calendar
|
|
2
|
+
|
|
3
|
+
Inline single-date calendar built on Angular Material `MatCalendar` and wrapped with shadcn-style theme tokens.
|
|
4
|
+
|
|
5
|
+
Use Calendar when the date grid should stay visible in the page. Use `DatePickerComponent` when the same selection should live behind an input and popover trigger.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { CalendarComponent } from '@ojiepermana/angular/component/calendar';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Date adapter
|
|
14
|
+
|
|
15
|
+
The component self-provides a native `DateAdapter`, so it works out of the box in any
|
|
16
|
+
consumer — including when federated into a host app that never wired one. You only need
|
|
17
|
+
to add a date adapter at the application root if you want a non-native one or a custom
|
|
18
|
+
locale (`MAT_DATE_LOCALE` flows in from the parent injector):
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
// app.config.ts — optional, only for a custom adapter/locale
|
|
22
|
+
import { provideNativeDateAdapter } from '@angular/material/core';
|
|
23
|
+
|
|
24
|
+
export const appConfig = {
|
|
25
|
+
providers: [provideNativeDateAdapter()],
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
Bind `[(value)]` to a `Date | null` signal or component field. Use `startAt` when the first visible month should differ from the selected value.
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<Calendar [(value)]="selectedDate" [startAt]="selectedDate()" />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
protected readonly selectedDate = signal<Date | null>(new Date(2026, 4, 22));
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Common patterns
|
|
42
|
+
|
|
43
|
+
### Constrained range
|
|
44
|
+
|
|
45
|
+
Use `min` and `max` to disable dates outside an allowed window.
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<Calendar [(value)]="billingDate" [min]="minDate" [max]="maxDate" [startAt]="billingDate()" />
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
protected readonly billingDate = signal<Date | null>(new Date(2026, 4, 15));
|
|
53
|
+
protected readonly minDate = new Date(2026, 4, 5);
|
|
54
|
+
protected readonly maxDate = new Date(2026, 4, 25);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Disabled or booked dates
|
|
58
|
+
|
|
59
|
+
Pass a `dateFilter` function. Angular Material expects the function to return `true` for selectable dates and `false` for disabled dates.
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<Calendar [(value)]="visitDate" [dateFilter]="availableDateFilter" [startAt]="visitDate()" />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
protected readonly bookedDates = [new Date(2026, 1, 12), new Date(2026, 1, 13)];
|
|
67
|
+
|
|
68
|
+
protected readonly availableDateFilter = (candidate: Date | null): boolean =>
|
|
69
|
+
!!candidate && !this.bookedDates.some((bookedDate) => this.isSameDay(bookedDate, candidate));
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Presets
|
|
73
|
+
|
|
74
|
+
Compose preset buttons around the calendar and update the same `value` model.
|
|
75
|
+
|
|
76
|
+
```html
|
|
77
|
+
<Calendar [(value)]="presetDate" [startAt]="presetDate()" class="border-0" />
|
|
78
|
+
|
|
79
|
+
<button Button type="button" variant="outline" size="sm" (click)="selectPreset(7)">
|
|
80
|
+
In a week
|
|
81
|
+
</button>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Date and time
|
|
85
|
+
|
|
86
|
+
Calendar owns the date. Native time inputs or `InputGroupComponent` can own the time value next to it.
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<Calendar [(value)]="meetingDate" [startAt]="meetingDate()" />
|
|
90
|
+
|
|
91
|
+
<InputGroup>
|
|
92
|
+
<input InputGroupInput type="time" [value]="startTime()" (input)="updateStartTime($event)" />
|
|
93
|
+
</InputGroup>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## API reference
|
|
97
|
+
|
|
98
|
+
| Input / Model | Type | Default |
|
|
99
|
+
| ------------- | ----------------------------------- | --------- |
|
|
100
|
+
| `value` | `Date \| null` | `null` |
|
|
101
|
+
| `min` | `Date \| null` | `null` |
|
|
102
|
+
| `max` | `Date \| null` | `null` |
|
|
103
|
+
| `startAt` | `Date \| null` | `null` |
|
|
104
|
+
| `startView` | `'month' \| 'year' \| 'multi-year'` | `'month'` |
|
|
105
|
+
| `dateFilter` | `(date: Date \| null) => boolean` | `null` |
|
|
106
|
+
| `disabled` | `boolean` | `false` |
|
|
107
|
+
| `class` | `string` | `''` |
|
|
108
|
+
|
|
109
|
+
Implements `ControlValueAccessor` — usable with `[(ngModel)]` and reactive forms.
|
|
110
|
+
|
|
111
|
+
## Styling and theming
|
|
112
|
+
|
|
113
|
+
The host uses `--border`, `--background`, `--foreground`, and `--radius`. Pass `class` for layout utilities such as `shadow-sm`, `border-0`, or `[--calendar-width:20rem]`.
|
|
114
|
+
|
|
115
|
+
The inner Material calendar keeps Angular Material's a11y and navigation behavior while sitting inside the shadcn token wrapper. Use `DatePickerComponent` for popover input flows; this primitive intentionally stays inline.
|
|
116
|
+
|
|
117
|
+
## Accessibility
|
|
118
|
+
|
|
119
|
+
`MatCalendar` supplies the ARIA grid semantics, focus management, active date state, and disabled date handling. Provide a visible label or surrounding section heading when the calendar appears in a form-like surface.
|
|
120
|
+
|
|
121
|
+
## Keyboard interactions
|
|
122
|
+
|
|
123
|
+
- Arrow keys move between dates.
|
|
124
|
+
- Page Up and Page Down move by month.
|
|
125
|
+
- Home and End move to the start or end of the row.
|
|
126
|
+
- Enter selects the focused date.
|
|
127
|
+
|
|
128
|
+
## Angular notes
|
|
129
|
+
|
|
130
|
+
- A native date adapter is built in; provide one at app bootstrap only for a custom adapter/locale.
|
|
131
|
+
- `dateFilter` returns `true` for enabled dates, unlike some predicate APIs that return `true` for blocked dates.
|
|
132
|
+
- `disabled` marks the host as inert and updates the CVA disabled state.
|
|
133
|
+
- This component is a single-date primitive. Range selection is best modeled as a separate range primitive or by composing two calendars with application state.
|
|
134
|
+
|
|
135
|
+
## Source parity
|
|
136
|
+
|
|
137
|
+
The shadcn Calendar is built on React DayPicker. This Angular implementation maps the same inline calendar concept to `MatCalendar`, standalone imports, signal-friendly `[(value)]` binding, `min` and `max` constraints, `dateFilter` disabled dates, preset composition, and RTL-friendly container usage.
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# Card
|
|
2
|
+
|
|
3
|
+
Displays a card with header, content, footer, an optional header action, and a compact size variant.
|
|
4
|
+
|
|
5
|
+
Use Card for login panels, billing summaries, media/event highlights, and other grouped surfaces that need a clear title plus supporting actions.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import {
|
|
11
|
+
CardActionComponent,
|
|
12
|
+
CardComponent,
|
|
13
|
+
CardContentComponent,
|
|
14
|
+
CardDescriptionComponent,
|
|
15
|
+
CardFooterComponent,
|
|
16
|
+
CardHeaderComponent,
|
|
17
|
+
CardTitleComponent,
|
|
18
|
+
} from '@ojiepermana/angular/component/card';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Composition
|
|
22
|
+
|
|
23
|
+
The Angular structure matches the current shadcn card hierarchy while using Angular selectors.
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
Card
|
|
27
|
+
├── CardHeader
|
|
28
|
+
│ ├── CardTitle
|
|
29
|
+
│ ├── CardDescription
|
|
30
|
+
│ └── CardAction
|
|
31
|
+
├── CardContent
|
|
32
|
+
└── CardFooter
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Basic usage
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<Card class="w-full max-w-sm">
|
|
39
|
+
<CardHeader>
|
|
40
|
+
<CardTitle>Card Title</CardTitle>
|
|
41
|
+
<CardDescription>Card Description</CardDescription>
|
|
42
|
+
<CardAction>
|
|
43
|
+
<button Button variant="link" size="sm">Action</button>
|
|
44
|
+
</CardAction>
|
|
45
|
+
</CardHeader>
|
|
46
|
+
|
|
47
|
+
<CardContent>
|
|
48
|
+
<p>Card Content</p>
|
|
49
|
+
</CardContent>
|
|
50
|
+
|
|
51
|
+
<CardFooter>
|
|
52
|
+
<p>Card Footer</p>
|
|
53
|
+
</CardFooter>
|
|
54
|
+
</Card>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Common patterns
|
|
58
|
+
|
|
59
|
+
### Login card
|
|
60
|
+
|
|
61
|
+
The current shadcn preview uses the card as a login surface. In Angular, compose the card with button, input, and label primitives directly.
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<Card class="w-full max-w-sm">
|
|
65
|
+
<CardHeader>
|
|
66
|
+
<CardTitle>Login to your account</CardTitle>
|
|
67
|
+
<CardDescription>Enter your email below to login to your account</CardDescription>
|
|
68
|
+
<CardAction>
|
|
69
|
+
<button Button variant="link" size="sm">Sign Up</button>
|
|
70
|
+
</CardAction>
|
|
71
|
+
</CardHeader>
|
|
72
|
+
|
|
73
|
+
<CardContent>
|
|
74
|
+
<form class="grid gap-6">
|
|
75
|
+
<div class="grid gap-2">
|
|
76
|
+
<label Label for="email">Email</label>
|
|
77
|
+
<input Input id="email" type="email" placeholder="m@example.com" required />
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div class="grid gap-2">
|
|
81
|
+
<div class="flex items-center">
|
|
82
|
+
<label Label for="password">Password</label>
|
|
83
|
+
<a
|
|
84
|
+
href="#forgot-password"
|
|
85
|
+
class="ms-auto inline-block text-sm underline-offset-4 hover:underline"
|
|
86
|
+
>
|
|
87
|
+
Forgot your password?
|
|
88
|
+
</a>
|
|
89
|
+
</div>
|
|
90
|
+
<input Input id="password" type="password" required />
|
|
91
|
+
</div>
|
|
92
|
+
</form>
|
|
93
|
+
</CardContent>
|
|
94
|
+
|
|
95
|
+
<CardFooter class="flex-col gap-2">
|
|
96
|
+
<button Button class="w-full">Login</button>
|
|
97
|
+
<button Button variant="outline" class="w-full">Login with Google</button>
|
|
98
|
+
</CardFooter>
|
|
99
|
+
</Card>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Small size
|
|
103
|
+
|
|
104
|
+
Use `size="sm"` on the root card when the surface should feel denser. The compact size cascades to header spacing, content padding, footer padding, and heading/body typography.
|
|
105
|
+
|
|
106
|
+
```html
|
|
107
|
+
<Card size="sm" class="w-full max-w-sm">
|
|
108
|
+
<CardHeader>
|
|
109
|
+
<CardTitle>Small Card</CardTitle>
|
|
110
|
+
<CardDescription>This card uses the small size variant.</CardDescription>
|
|
111
|
+
</CardHeader>
|
|
112
|
+
<CardContent>
|
|
113
|
+
<p class="text-sm text-muted-foreground">
|
|
114
|
+
Compact spacing for dense dashboards or inset panels.
|
|
115
|
+
</p>
|
|
116
|
+
</CardContent>
|
|
117
|
+
<CardFooter>
|
|
118
|
+
<button Button variant="outline" size="sm" class="w-full">Action</button>
|
|
119
|
+
</CardFooter>
|
|
120
|
+
</Card>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Image card
|
|
124
|
+
|
|
125
|
+
Add media before the header when the card introduces an event, article, or campaign. `CardAction` still sits in the top-right of the header and can host a badge or button.
|
|
126
|
+
|
|
127
|
+
```html
|
|
128
|
+
<Card class="relative w-full max-w-sm overflow-hidden">
|
|
129
|
+
<div
|
|
130
|
+
aria-hidden="true"
|
|
131
|
+
class="pointer-events-none absolute inset-x-0 top-0 z-30 aspect-video bg-black/35"
|
|
132
|
+
></div>
|
|
133
|
+
<img
|
|
134
|
+
src="https://avatar.vercel.sh/shadcn1"
|
|
135
|
+
alt="Event cover"
|
|
136
|
+
class="relative z-20 aspect-video w-full object-cover brightness-75 grayscale"
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
<CardHeader>
|
|
140
|
+
<CardAction>
|
|
141
|
+
<Badge variant="secondary">Featured</Badge>
|
|
142
|
+
</CardAction>
|
|
143
|
+
<CardTitle>Design systems meetup</CardTitle>
|
|
144
|
+
<CardDescription>
|
|
145
|
+
A practical talk on component APIs, accessibility, and shipping faster.
|
|
146
|
+
</CardDescription>
|
|
147
|
+
</CardHeader>
|
|
148
|
+
|
|
149
|
+
<CardFooter>
|
|
150
|
+
<button Button class="w-full">View event</button>
|
|
151
|
+
</CardFooter>
|
|
152
|
+
</Card>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### RTL
|
|
156
|
+
|
|
157
|
+
Set `dir="rtl"` on the card host or a wrapper when the surrounding interface runs right to left. The composition stays the same.
|
|
158
|
+
|
|
159
|
+
```html
|
|
160
|
+
<Card dir="rtl" lang="ar" class="w-full max-w-sm text-right">
|
|
161
|
+
<CardHeader>
|
|
162
|
+
<CardTitle>تسجيل الدخول إلى حسابك</CardTitle>
|
|
163
|
+
<CardDescription>أدخل بريدك الإلكتروني أدناه لتسجيل الدخول إلى حسابك</CardDescription>
|
|
164
|
+
<CardAction>
|
|
165
|
+
<button Button variant="link" size="sm">إنشاء حساب</button>
|
|
166
|
+
</CardAction>
|
|
167
|
+
</CardHeader>
|
|
168
|
+
<CardContent>
|
|
169
|
+
<!-- same form fields as the login example -->
|
|
170
|
+
</CardContent>
|
|
171
|
+
<CardFooter class="flex-col gap-2">
|
|
172
|
+
<button Button class="w-full">تسجيل الدخول</button>
|
|
173
|
+
<button Button variant="outline" class="w-full">تسجيل الدخول باستخدام Google</button>
|
|
174
|
+
</CardFooter>
|
|
175
|
+
</Card>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## API reference
|
|
179
|
+
|
|
180
|
+
### `CardComponent`
|
|
181
|
+
|
|
182
|
+
| Input | Type | Default |
|
|
183
|
+
| ------- | ------------------- | ----------- |
|
|
184
|
+
| `size` | `"default" \| "sm"` | `'default'` |
|
|
185
|
+
| `class` | `string` | `''` |
|
|
186
|
+
|
|
187
|
+
The selected size is also exposed on the host as `data-size`, which can be used for styling overrides.
|
|
188
|
+
|
|
189
|
+
### Parts
|
|
190
|
+
|
|
191
|
+
| Part | Selector | Notes |
|
|
192
|
+
| -------------------------- | ------------------------ | ----------------------------------------------------------------------- |
|
|
193
|
+
| `CardHeaderComponent` | `CardHeader` | Header grid that places `CardAction` in the top-right corner. |
|
|
194
|
+
| `CardTitleComponent` | `CardTitle, [CardTitle]` | Semantic heading; `level` defaults to 3 or follows a native h1-h6 host. |
|
|
195
|
+
| `CardDescriptionComponent` | `CardDescription` | Supporting text under the title. |
|
|
196
|
+
| `CardActionComponent` | `CardAction` | Optional slot for badges, links, or buttons in the header. |
|
|
197
|
+
| `CardContentComponent` | `CardContent` | Main body area. |
|
|
198
|
+
| `CardFooterComponent` | `CardFooter` | Bottom action row or secondary metadata. |
|
|
199
|
+
|
|
200
|
+
All card parts also accept a `class` input.
|
|
201
|
+
|
|
202
|
+
## Styling and theming
|
|
203
|
+
|
|
204
|
+
The root card uses the shared theme tokens `border-border`, `bg-card`, and `text-card-foreground` plus `shadow-sm`.
|
|
205
|
+
|
|
206
|
+
Pass `class` to the root or any part to layer width, layout, spacing, media overflow, or custom action alignment without changing the primitive structure.
|
|
207
|
+
|
|
208
|
+
The `size` input is the primary spacing control. Switching to `sm` reduces header spacing, content/footer padding, and title/description typography together.
|
|
209
|
+
|
|
210
|
+
## Accessibility
|
|
211
|
+
|
|
212
|
+
- Keep the card root non-interactive. Put clicks on native buttons or anchors inside the card.
|
|
213
|
+
- Use a native heading with `[CardTitle]`, or set `[level]` on `<CardTitle>`, so the title fits the surrounding heading hierarchy.
|
|
214
|
+
- Label every form field inside `CardContent`.
|
|
215
|
+
- Provide meaningful alt text for media cards unless the image is purely decorative.
|
|
216
|
+
- Do not rely on the card border or shadow alone to communicate state.
|
|
217
|
+
|
|
218
|
+
## Keyboard interactions
|
|
219
|
+
|
|
220
|
+
- The card primitives themselves are passive layout containers and do not enter the tab order.
|
|
221
|
+
- Buttons, anchors, and inputs projected into the card keep their native Tab, Enter, and Space behavior.
|
|
222
|
+
- `CardAction` does not alter focus order; it only positions header content visually.
|
|
223
|
+
|
|
224
|
+
## Angular notes
|
|
225
|
+
|
|
226
|
+
- `size` is declared only on `Card` and cascades to descendant part spacing and typography.
|
|
227
|
+
- `CardAction` is the Angular equivalent of the current shadcn `CardAction` slot.
|
|
228
|
+
- The login and RTL examples compose `ButtonComponent`, `InputComponent`, and `LabelComponent` directly with the card primitives.
|
|
229
|
+
|
|
230
|
+
## Source parity
|
|
231
|
+
|
|
232
|
+
This Angular implementation follows the current shadcn card docs, including `CardAction`, `size="sm"`, media cards, and the RTL login example, while translating the structure to Angular selectors and native controls.
|