@ojiepermana/angular 22.1.11 → 22.1.13
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 +374 -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
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
# @ojiepermana/angular
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Accessible, tree-shakable Angular 22 design system from ojiepermana: UI components, charts, navigation shells, theme tokens, and an OpenAPI SDK generator.
|
|
4
|
+
|
|
5
|
+
The ojiepermana design system for Angular v22+, published as **one package**.
|
|
6
|
+
Components, charts, navigation shells, theme tokens, and the OpenAPI SDK
|
|
7
|
+
generator all live behind subpath entry points of this single install.
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
bun add @ojiepermana/angular
|
|
9
11
|
# or: npm install @ojiepermana/angular
|
|
10
12
|
```
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
| `@ojiepermana/angular
|
|
17
|
-
| `@ojiepermana/angular
|
|
18
|
-
| `@ojiepermana/angular
|
|
19
|
-
| `@ojiepermana/angular-theme` | Theme provider, tokens, and Tailwind v4 CSS |
|
|
20
|
-
| `@ojiepermana/angular-sdk` | OpenAPI → Angular SDK generator (schematics) |
|
|
14
|
+
| Subpath | What it provides |
|
|
15
|
+
| ---------------------------- | ------------------------------------------------------- |
|
|
16
|
+
| `@ojiepermana/angular/component` | UI components (button, dialog, table, …) + `icon` utils |
|
|
17
|
+
| `@ojiepermana/angular/chart` | Chart families built on `d3-scale`/`d3-shape` |
|
|
18
|
+
| `@ojiepermana/angular/navigation` | App shell / navigation container |
|
|
19
|
+
| `@ojiepermana/angular/theme` | Theme provider, tokens, and Tailwind v4 CSS |
|
|
20
|
+
| `@ojiepermana/angular/sdk` | OpenAPI → Angular SDK generator (schematics) |
|
|
21
21
|
|
|
22
22
|
## Peer dependencies
|
|
23
23
|
|
|
24
24
|
You must already have Angular v22+ in your app (`@angular/common`, `@angular/core`,
|
|
25
|
-
|
|
26
|
-
`@angular/
|
|
27
|
-
|
|
25
|
+
plus `@angular/router` and `rxjs`). `@angular/cdk`, `@angular/forms`, and
|
|
26
|
+
`@angular/platform-browser` are optional peers: install them when you use the
|
|
27
|
+
surfaces that need them.
|
|
28
28
|
|
|
29
29
|
**`@angular/material` is optional.** Only three components wrap Material and
|
|
30
30
|
therefore require it: **`select`**, **`date-picker`**, and **`calendar`**. Install
|
|
@@ -39,9 +39,8 @@ Material.
|
|
|
39
39
|
|
|
40
40
|
## Importing — `@ojiepermana/angular/<lib>/<entry>`
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
`@ojiepermana/angular-<lib>` entry point and is fully tree-shakeable.
|
|
42
|
+
Every component, chart, and service is reached through a nested subpath. Each
|
|
43
|
+
subpath is its own entry point and is fully tree-shakeable.
|
|
45
44
|
|
|
46
45
|
```ts
|
|
47
46
|
// Components — one entry point per component
|
|
@@ -56,10 +55,6 @@ import { BarChart } from '@ojiepermana/angular/chart/bar';
|
|
|
56
55
|
import { provideUiTheme } from '@ojiepermana/angular/theme/styles';
|
|
57
56
|
```
|
|
58
57
|
|
|
59
|
-
> The individual `@ojiepermana/angular-<lib>/<entry>` packages are still published
|
|
60
|
-
> and importable directly, but the `@ojiepermana/angular/...` namespace above is the
|
|
61
|
-
> recommended surface.
|
|
62
|
-
|
|
63
58
|
**Subpaths only in production.** The bare `@ojiepermana/angular` root barrel
|
|
64
59
|
re-exports the _entire_ design system (chart + component + navigation + sdk +
|
|
65
60
|
theme). Importing from it pulls everything into your bundle, so reserve it for
|
|
@@ -80,13 +75,12 @@ stylesheet (the CSS ships inside the package and is reachable by name):
|
|
|
80
75
|
|
|
81
76
|
```css
|
|
82
77
|
/* styles.css */
|
|
83
|
-
@import '@ojiepermana/angular
|
|
78
|
+
@import '@ojiepermana/angular/theme/styles/css/index.css'; /* base + all color + neutral palettes */
|
|
84
79
|
@import 'tailwindcss';
|
|
85
|
-
@import '@ojiepermana/angular
|
|
80
|
+
@import '@ojiepermana/angular/theme/styles/css/base/tailwind.css'; /* maps tokens → bg-primary, bg-brand, text-foreground, … */
|
|
86
81
|
```
|
|
87
82
|
|
|
88
|
-
|
|
89
|
-
automatically as a dependency.) Then register the provider:
|
|
83
|
+
Then register the provider:
|
|
90
84
|
|
|
91
85
|
```ts
|
|
92
86
|
import { provideUiTheme } from '@ojiepermana/angular/theme/styles';
|
|
@@ -108,6 +102,18 @@ provideUiTheme({ icons: { materialSymbols: true } });
|
|
|
108
102
|
For privacy / offline / strict-CSP setups, leave it off and self-host the font in
|
|
109
103
|
your own stylesheet instead.
|
|
110
104
|
|
|
105
|
+
## SDK schematics
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
ng add @ojiepermana/angular
|
|
109
|
+
ng generate @ojiepermana/angular:sdk
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Links
|
|
113
|
+
|
|
114
|
+
- Source: git+https://github.com/ojiepermana/angular.git
|
|
115
|
+
- Documentation: https://github.com/ojiepermana/angular#readme
|
|
116
|
+
|
|
111
117
|
## License
|
|
112
118
|
|
|
113
119
|
MIT. See the bundled `LICENSE` file.
|
package/chart/README.md
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# Chart
|
|
2
|
+
|
|
3
|
+
Angular chart primitives and chart families inspired by shadcn Chart.
|
|
4
|
+
|
|
5
|
+
In this repository, shadcn's single Chart page maps to the dedicated `/ui/chart/*` demo route group so each chart family can keep focused, production-like examples without forcing everything into one `/ui/shadcn/chart` page.
|
|
6
|
+
|
|
7
|
+
Use Chart for dashboards, KPI cards, trend comparisons, radial summaries, and interactive data views where one shared config should drive labels, colors, legends, and tooltip copy.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun add @ojiepermana/angular
|
|
13
|
+
npm install @ojiepermana/angular
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Import
|
|
17
|
+
|
|
18
|
+
Import shared primitives from the chart root entrypoint, then import the concrete chart family from its granular subpath.
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import {
|
|
22
|
+
ChartAxisX,
|
|
23
|
+
ChartAxisY,
|
|
24
|
+
ChartContainer,
|
|
25
|
+
ChartGrid,
|
|
26
|
+
ChartLegend,
|
|
27
|
+
ChartTooltip,
|
|
28
|
+
type ChartConfig,
|
|
29
|
+
} from '@ojiepermana/angular/chart';
|
|
30
|
+
import { BarChart } from '@ojiepermana/angular/chart/bar';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Supported chart entrypoints
|
|
34
|
+
|
|
35
|
+
| Import path | Selector | Best for |
|
|
36
|
+
| ------------------------------------ | -------------- | ----------------------------------------------------------------- |
|
|
37
|
+
| `@ojiepermana/angular/chart/bar` | `ChartBar` | grouped, stacked, horizontal, active, and mixed-color bar layouts |
|
|
38
|
+
| `@ojiepermana/angular/chart/line` | `ChartLine` | trends, comparisons, and zoomable time-series lines |
|
|
39
|
+
| `@ojiepermana/angular/chart/area` | `ChartArea` | filled trend bands, stacked areas, and expanded percent views |
|
|
40
|
+
| `@ojiepermana/angular/chart/pie` | `ChartPie` | part-to-whole slices and donut charts |
|
|
41
|
+
| `@ojiepermana/angular/chart/radar` | `ChartRadar` | multi-axis performance comparisons |
|
|
42
|
+
| `@ojiepermana/angular/chart/radial` | `ChartRadial` | progress rings, radial comparisons, and center-metric summaries |
|
|
43
|
+
| `@ojiepermana/angular/chart/scatter` | `ChartScatter` | XY correlation plots and point clouds |
|
|
44
|
+
|
|
45
|
+
## Composition
|
|
46
|
+
|
|
47
|
+
The Angular structure keeps the same high-level idea as shadcn Chart: define a shared chart config once, then compose a specific chart type with optional grid, axis, tooltip, legend, and center content.
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
Chart
|
|
51
|
+
├── ChartBar | ChartLine | ChartArea | ChartScatter
|
|
52
|
+
│ ├── svg:g[ChartGrid]
|
|
53
|
+
│ ├── svg:g[ChartAxisX]
|
|
54
|
+
│ ├── svg:g[ChartAxisY]
|
|
55
|
+
│ └── svg:g[ChartCrosshair] / svg:g[ChartBrush] (optional)
|
|
56
|
+
├── ChartPie | ChartRadial | ChartRadar
|
|
57
|
+
│ └── ChartPieCenter | ChartRadialCenter (optional)
|
|
58
|
+
├── ChartTooltip
|
|
59
|
+
├── ChartLegend
|
|
60
|
+
└── ChartZoomControls (optional)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
All child primitives read dimensions, series metadata, and scoped color tokens from `Chart`.
|
|
64
|
+
|
|
65
|
+
## Basic usage
|
|
66
|
+
|
|
67
|
+
Start with a readonly `ChartConfig`, keep the dataset in any shape that makes sense for your feature, and map the chart to the relevant keys.
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
const trafficChartConfig = {
|
|
71
|
+
desktop: { label: 'Desktop', color: 'var(--chart-1)' },
|
|
72
|
+
mobile: { label: 'Mobile', color: 'var(--chart-2)' },
|
|
73
|
+
} satisfies ChartConfig;
|
|
74
|
+
|
|
75
|
+
const trafficData = [
|
|
76
|
+
{ month: 'January', desktop: 186, mobile: 80 },
|
|
77
|
+
{ month: 'February', desktop: 305, mobile: 200 },
|
|
78
|
+
{ month: 'March', desktop: 237, mobile: 120 },
|
|
79
|
+
{ month: 'April', desktop: 73, mobile: 190 },
|
|
80
|
+
{ month: 'May', desktop: 209, mobile: 130 },
|
|
81
|
+
{ month: 'June', desktop: 214, mobile: 140 },
|
|
82
|
+
];
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<div class="w-full max-w-3xl">
|
|
87
|
+
<Chart [config]="trafficChartConfig" chartId="traffic-overview">
|
|
88
|
+
<ChartBar [data]="trafficData" xKey="month">
|
|
89
|
+
<svg:g ChartGrid></svg:g>
|
|
90
|
+
<svg:g ChartAxisX></svg:g>
|
|
91
|
+
<svg:g ChartAxisY></svg:g>
|
|
92
|
+
</ChartBar>
|
|
93
|
+
<ChartTooltip [data]="trafficData" xKey="month" />
|
|
94
|
+
<ChartLegend />
|
|
95
|
+
</Chart>
|
|
96
|
+
</div>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Common patterns
|
|
100
|
+
|
|
101
|
+
### First chart flow
|
|
102
|
+
|
|
103
|
+
The closest Angular equivalent to the upstream shadcn walkthrough is:
|
|
104
|
+
|
|
105
|
+
1. Define your dataset.
|
|
106
|
+
2. Define `ChartConfig` so labels and colors stay decoupled from the raw data.
|
|
107
|
+
3. Wrap the chart in `Chart`.
|
|
108
|
+
4. Add `svg:g[ChartGrid]`, axis directives, `ChartTooltip`, and `ChartLegend` only where they add value.
|
|
109
|
+
|
|
110
|
+
This keeps the chart family focused while still letting the shared primitives manage the common UI pieces.
|
|
111
|
+
|
|
112
|
+
### Swapping chart families
|
|
113
|
+
|
|
114
|
+
The same `ChartConfig` can back multiple chart families. In most cases you only swap the concrete chart import and the family-specific inputs.
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
import { AreaChart } from '@ojiepermana/angular/chart/area';
|
|
118
|
+
import { LineChart } from '@ojiepermana/angular/chart/line';
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
- `ChartLine` adds inputs such as `curve`, `showDots`, and `showValueLabels`.
|
|
122
|
+
- `ChartArea` adds `stacked`, `expanded`, `gradient`, and `curve`.
|
|
123
|
+
- `ChartBar` adds `orientation`, `variant`, `colorKey`, `activeKey`, and `activeValue`.
|
|
124
|
+
|
|
125
|
+
### Pie and radial summaries
|
|
126
|
+
|
|
127
|
+
For donut, pie, and radial progress layouts, use `nameKey` plus `valueKey` instead of `xKey`.
|
|
128
|
+
|
|
129
|
+
```html
|
|
130
|
+
<Chart [config]="browserConfig" aspect="aspect-square">
|
|
131
|
+
<ChartPie
|
|
132
|
+
[data]="browserData"
|
|
133
|
+
nameKey="browser"
|
|
134
|
+
valueKey="visitors"
|
|
135
|
+
[seriesKeys]="browserSeriesKeys"
|
|
136
|
+
[innerRadius]="64"
|
|
137
|
+
>
|
|
138
|
+
</ChartPie>
|
|
139
|
+
<ChartTooltip [data]="browserData" xKey="browser" valueKey="visitors" indicator="dot" />
|
|
140
|
+
<ChartLegend />
|
|
141
|
+
</Chart>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Tooltip formatting
|
|
145
|
+
|
|
146
|
+
`ChartTooltip` is where most presentational customization lives.
|
|
147
|
+
|
|
148
|
+
```html
|
|
149
|
+
<ChartTooltip
|
|
150
|
+
[data]="activityData"
|
|
151
|
+
xKey="date"
|
|
152
|
+
indicator="line"
|
|
153
|
+
labelKey="views"
|
|
154
|
+
[labelFormatter]="longDateFormatter"
|
|
155
|
+
[formatter]="compactNumberFormatter"
|
|
156
|
+
/>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Use `valueKey` for single-value radial and pie datasets, `hideLabel` when the card already provides the label context, and `indicator="none"` when you want a copy-first tooltip layout.
|
|
160
|
+
|
|
161
|
+
### Per-row colors and active emphasis
|
|
162
|
+
|
|
163
|
+
Use `colorKey` when the dataset itself carries a color token such as `fill`, and use `activeKey` plus `activeValue` when one category should be visually emphasized without rewriting the whole series config.
|
|
164
|
+
|
|
165
|
+
## API reference
|
|
166
|
+
|
|
167
|
+
### `ChartContainer`
|
|
168
|
+
|
|
169
|
+
| Input | Type | Default |
|
|
170
|
+
| --------- | ---------------- | ---------------- |
|
|
171
|
+
| `config` | `ChartConfig` | — |
|
|
172
|
+
| `aspect` | `string` | `'aspect-video'` |
|
|
173
|
+
| `chartId` | `string \| null` | auto-generated |
|
|
174
|
+
|
|
175
|
+
`ChartConfig` is a readonly record of series keys to labels, icons, colors, or theme-aware light/dark color maps.
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
type ChartConfig = Readonly<
|
|
179
|
+
Record<
|
|
180
|
+
string,
|
|
181
|
+
{
|
|
182
|
+
label?: string;
|
|
183
|
+
icon?: Type<unknown>;
|
|
184
|
+
color?: string;
|
|
185
|
+
theme?: Readonly<Record<'light' | 'dark', string>>;
|
|
186
|
+
}
|
|
187
|
+
>
|
|
188
|
+
>;
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Shared primitives
|
|
192
|
+
|
|
193
|
+
| Part | Key inputs | Notes |
|
|
194
|
+
| ------------------- | -------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
|
|
195
|
+
| `svg:g[ChartGrid]` | none | Adds cartesian grid lines behind bar, line, and area charts. |
|
|
196
|
+
| `svg:g[ChartAxisX]` | `tickCount`, `tickLine`, `tickFormat` | Categorical axis for cartesian layouts. |
|
|
197
|
+
| `svg:g[ChartAxisY]` | `tickCount`, `tickLine`, `tickFormat` | Numeric axis for cartesian layouts. |
|
|
198
|
+
| `ChartTooltip` | `data`, `xKey`, `valueKey`, `indicator`, `label`, `labelKey`, `labelFormatter`, `formatter`, `hideLabel` | Handles default tooltip layout plus custom template projection. |
|
|
199
|
+
| `ChartLegend` | none | Renders toggle buttons for visible series. |
|
|
200
|
+
| `ChartZoomControls` | none | Pair with zoomable line and scatter views. |
|
|
201
|
+
| `ChartPieCenter` | projected content | Centers labels or KPIs inside pie layouts. |
|
|
202
|
+
| `ChartRadialCenter` | projected content | Centers labels or KPIs inside radial layouts. |
|
|
203
|
+
|
|
204
|
+
### Chart families
|
|
205
|
+
|
|
206
|
+
| Selector | Key inputs |
|
|
207
|
+
| -------------- | --------------------------------------------------------------------------------------------------- |
|
|
208
|
+
| `ChartBar` | `data`, `xKey`, `orientation`, `variant`, `colorKey`, `activeKey`, `activeValue`, `showValueLabels` |
|
|
209
|
+
| `ChartLine` | `data`, `xKey`, `curve`, `showDots`, `dotRadius`, `showValueLabels` |
|
|
210
|
+
| `ChartArea` | `data`, `xKey`, `stacked`, `expanded`, `gradient`, `curve` |
|
|
211
|
+
| `ChartPie` | `data`, `nameKey`, `valueKey`, `seriesKeys`, `innerRadius`, `activeIndex`, `activeOffset` |
|
|
212
|
+
| `ChartRadar` | `data`, `axisKey`, `curve`, `levels`, `grid`, `showLabels`, `showDots` |
|
|
213
|
+
| `ChartRadial` | `data`, `nameKey`, `valueKey`, `seriesKeys`, `maxValue`, `showTrack`, `showValueLabels` |
|
|
214
|
+
| `ChartScatter` | `data`, `xKey`, `yKey`, `sizeKey`, `seriesKey`, `xDomain`, `yDomain` |
|
|
215
|
+
|
|
216
|
+
## Styling and theming
|
|
217
|
+
|
|
218
|
+
- Prefer CSS variables such as `var(--chart-1)` and `var(--chart-2)` in `ChartConfig`. This matches the current shadcn guidance and the theme tokens shipped by this library.
|
|
219
|
+
- `Chart` scopes generated `--color-<series>` variables to the chart instance, so tooltip rows, legends, and series shapes stay aligned.
|
|
220
|
+
- Use `theme: { light, dark }` on a series config entry when the chart needs different values per color scheme.
|
|
221
|
+
- Keep the parent container responsible for width, and use the `aspect` input when the default `aspect-video` does not match the layout.
|
|
222
|
+
- Use `colorKey` only when the dataset should override per-series colors with a row-specific token such as `fill`.
|
|
223
|
+
|
|
224
|
+
## Accessibility
|
|
225
|
+
|
|
226
|
+
- Chart hosts expose an `aria-label` summary describing the chart type, category count, and visible series.
|
|
227
|
+
- Every chart emits an equivalent screen-reader table for the displayed dataset.
|
|
228
|
+
- Interactive marks use one roving tab stop per chart; arrow keys reach the remaining marks without flooding the page's Tab order.
|
|
229
|
+
- `ChartTooltip` includes a polite live region so changing categories can be announced to assistive technology.
|
|
230
|
+
- `ChartLegend` uses native buttons with `aria-pressed` to reflect hidden and visible series state.
|
|
231
|
+
- Keep surrounding card copy descriptive so the chart has enough context when read outside its visual layout.
|
|
232
|
+
|
|
233
|
+
## Keyboard interactions
|
|
234
|
+
|
|
235
|
+
- `Tab` reaches one interactive mark per chart plus legend toggle buttons.
|
|
236
|
+
- Arrow keys move between marks; Home and End jump to the first and last mark.
|
|
237
|
+
- `Enter` and `Space` trigger the same click behavior as pointer activation on interactive marks.
|
|
238
|
+
- Focusing a supported data mark updates the shared active point so tooltip content stays reachable without hover.
|
|
239
|
+
|
|
240
|
+
## Angular notes
|
|
241
|
+
|
|
242
|
+
- Keep chart config objects readonly and signal-friendly. A top-level `const` or signal-backed computed config works well.
|
|
243
|
+
- Every chart family must live inside `Chart`; that container provides dimensions, series visibility state, and scoped color variables to descendants.
|
|
244
|
+
- Use an explicit `ChartId` when multiple charts of the same family appear on one page or when tests need a stable selector.
|
|
245
|
+
- The local shadcn mapping for Chart lives in the dedicated `/ui/chart` overview route with focused family demos under `/ui/chart/*`.
|
|
246
|
+
|
|
247
|
+
## Source parity
|
|
248
|
+
|
|
249
|
+
This Angular package follows the shadcn Chart information architecture and theming concepts, but it does not mirror the React API one-to-one.
|
|
250
|
+
|
|
251
|
+
- shadcn uses Recharts components directly and layers `ChartTooltipContent` and `ChartLegendContent` around them.
|
|
252
|
+
- This Angular library ships standalone chart families plus shared primitives, so you compose `Chart`, the relevant `chart-*`, `ChartTooltip`, and `ChartLegend` instead of wiring Recharts JSX.
|
|
253
|
+
- The dedicated `/ui/chart/*` route group is the intentional local mapping for shadcn Chart in this repo; no duplicate `/ui/shadcn/chart` page is required.
|
|
254
|
+
|
|
255
|
+
## Why the d3 types are runtime dependencies
|
|
256
|
+
|
|
257
|
+
`@types/d3-array`, `@types/d3-scale`, and `@types/d3-shape` sit in `dependencies`, not
|
|
258
|
+
`devDependencies`, and that is deliberate: d3's types appear in this package's PUBLISHED type
|
|
259
|
+
surface, so a consumer needs them installed to typecheck against it. In
|
|
260
|
+
`@ojiepermana/angular/chart/core` alone, `CategoryScale` is `ScaleBand<string>`, `ValueScale` is
|
|
261
|
+
`ScaleLinear<number, number>`, the cartesian context exposes `xScale`/`yScale` as signals of
|
|
262
|
+
`ScaleLinear`, and `bandTicks`/`linearTicks` take those scales as parameters.
|
|
263
|
+
|
|
264
|
+
Check it before moving them: build the library and look for `d3-` imports in
|
|
265
|
+
`dist/chart/types/*.d.ts`. If they ever stop appearing there, the types can drop to
|
|
266
|
+
`devDependencies`.
|
|
267
|
+
|
|
268
|
+
## Support and security
|
|
269
|
+
|
|
270
|
+
Angular 22.1–22.x CSR/browser usage is supported; SSR, prerendering, and hydration are not. See the
|
|
271
|
+
bundled `SUPPORT.md`. Report suspected vulnerabilities privately using the instructions in the
|
|
272
|
+
bundled `SECURITY.md`. This package is MIT licensed; see the bundled `LICENSE`.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# @ojiepermana/angular/component
|
|
2
|
+
|
|
3
|
+
Library ini berada di `library/component` dan diterbitkan sebagai subpath `component` dari paket tunggal `@ojiepermana/angular`.
|
|
4
|
+
|
|
5
|
+
Library ini menggunakan pola secondary entry point per folder. Import yang disarankan adalah langsung ke subpath yang dibutuhkan, misalnya `@ojiepermana/angular/component/button` atau `@ojiepermana/angular/chart/bar`.
|
|
6
|
+
|
|
7
|
+
## Build
|
|
8
|
+
|
|
9
|
+
Paket dibangun sebagai satu kesatuan:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun run ng -- build @ojiepermana/angular
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Nama project di `angular.json` adalah `angular-component`. Artefak build akan ditulis ke `dist/component`.
|
|
16
|
+
|
|
17
|
+
## Penggunaan Lokal
|
|
18
|
+
|
|
19
|
+
Untuk import dari workspace ini, gunakan path berikut:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
@ojiepermana/angular/component
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Untuk komponen atau utilitas spesifik, gunakan subpath secondary entry point:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
@ojiepermana/angular/component/button
|
|
29
|
+
@ojiepermana/angular/chart/bar
|
|
30
|
+
@ojiepermana/angular/component/icon
|
|
31
|
+
@ojiepermana/angular/theme/styles
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Untuk helper, gunakan entry point terfokus agar helper murni tidak menarik
|
|
35
|
+
runtime overlay:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { cn, injectUniqueId } from '@ojiepermana/angular/component/utils/core';
|
|
39
|
+
import { connectedPositionFor } from '@ojiepermana/angular/component/utils/overlay';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`@ojiepermana/angular/component/utils` tetap tersedia sebagai compatibility
|
|
43
|
+
barrel, tetapi kode baru sebaiknya memilih `utils/core` atau `utils/overlay`.
|
|
44
|
+
|
|
45
|
+
## Unit Test
|
|
46
|
+
|
|
47
|
+
Jalankan unit test library dengan perintah berikut:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
bun run ng -- test angular-component
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Runner test di workspace ini menggunakan Vitest melalui Angular build tooling.
|
|
54
|
+
|
|
55
|
+
## Konvensi Selector
|
|
56
|
+
|
|
57
|
+
Aturan baku agar semua tim memakai mental model yang sama:
|
|
58
|
+
|
|
59
|
+
| Jenis primitif | Selector | Contoh |
|
|
60
|
+
| ------------------------------------------------------------------------- | ---------------------------- | ---------------------------------- |
|
|
61
|
+
| Menempel ke elemen HTML semantik (button, input, label, textarea, select) | Attribute selector | `<button Button>`, `<input Input>` |
|
|
62
|
+
| Container/komposit tanpa padanan elemen native | Element selector | `<Card>`, `<Dialog>`, `<Tabs>` |
|
|
63
|
+
| Behavior tanpa render (trigger, content marker) | Directive `[Xxx]` PascalCase | `[PopoverTrigger]`, `[Tooltip]` |
|
|
64
|
+
|
|
65
|
+
Beberapa komponen menyediakan keduanya (`Label, label[Label]`) untuk
|
|
66
|
+
markup fleksibel — gunakan bentuk attribute bila elemen native tersedia karena
|
|
67
|
+
semantik & aksesibilitasnya gratis dari browser.
|
|
68
|
+
|
|
69
|
+
## Dependensi runtime
|
|
70
|
+
|
|
71
|
+
- `@angular/cdk` adalah **dependency langsung** paket ini (overlay/portal/a11y
|
|
72
|
+
dipakai oleh banyak komponen), jadi ikut terinstal otomatis — tidak ada lagi
|
|
73
|
+
error `Cannot find module '@angular/cdk/overlay'`.
|
|
74
|
+
- `@angular/common`, `@angular/core`, `@angular/forms`,
|
|
75
|
+
`@angular/platform-browser`, dan `rxjs` tetap peer dependency (disediakan oleh
|
|
76
|
+
aplikasi Angular Anda).
|
|
77
|
+
|
|
78
|
+
## Status Dependensi @angular/material
|
|
79
|
+
|
|
80
|
+
`@angular/material` masih menjadi peer dependency opsional untuk
|
|
81
|
+
`SelectField`, yang kembali menggunakan `MatSelect` dan `MatOption`. `Calendar`
|
|
82
|
+
dan `DatePicker` tetap memakai primitif native/CDK, sehingga consumer yang tidak
|
|
83
|
+
mengimpor `SelectField` tidak perlu memasang Material.
|
|
84
|
+
|
|
85
|
+
## Support and security
|
|
86
|
+
|
|
87
|
+
Angular 22.1–22.x CSR/browser usage is supported; SSR, prerendering, and hydration are not. See the
|
|
88
|
+
bundled `SUPPORT.md`. Report suspected vulnerabilities privately using the instructions in the
|
|
89
|
+
bundled `SECURITY.md`. This package is MIT licensed; see the bundled `LICENSE`.
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# Accordion
|
|
2
|
+
|
|
3
|
+
Displays a vertically stacked set of interactive headings that reveal one or more content panels.
|
|
4
|
+
|
|
5
|
+
Use Accordion for FAQ blocks, settings groups, and progressive disclosure where content should stay in the same page flow.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import {
|
|
11
|
+
AccordionComponent,
|
|
12
|
+
AccordionContentComponent,
|
|
13
|
+
AccordionItemComponent,
|
|
14
|
+
AccordionTriggerComponent,
|
|
15
|
+
} from '@ojiepermana/angular/component/accordion';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Composition
|
|
19
|
+
|
|
20
|
+
The Angular structure mirrors the shadcn and Radix composition while using Angular selectors and a native button trigger.
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
Accordion
|
|
24
|
+
├── AccordionItem
|
|
25
|
+
│ ├── button[AccordionTrigger]
|
|
26
|
+
│ └── AccordionContent
|
|
27
|
+
└── AccordionItem
|
|
28
|
+
├── button[AccordionTrigger]
|
|
29
|
+
└── AccordionContent
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Basic usage
|
|
33
|
+
|
|
34
|
+
Use `Accordion` as the root, wrap each section in `AccordionItem`, place the clickable heading on a native button with `AccordionTrigger`, and project body copy into `AccordionContent`.
|
|
35
|
+
|
|
36
|
+
Bind `[(value)]` when the parent should control the open state or seed a default open item.
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<Accordion [(value)]="openItem" type="single" class="w-full max-w-xl">
|
|
40
|
+
<AccordionItem value="item-1">
|
|
41
|
+
<button AccordionTrigger>Is it accessible?</button>
|
|
42
|
+
<AccordionContent>
|
|
43
|
+
Yes. The trigger and content follow the expected accordion ARIA wiring.
|
|
44
|
+
</AccordionContent>
|
|
45
|
+
</AccordionItem>
|
|
46
|
+
</Accordion>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Common patterns
|
|
50
|
+
|
|
51
|
+
### Single-open FAQ
|
|
52
|
+
|
|
53
|
+
Use `type="single"` when only one item should stay open at a time.
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
const basicOpen = signal<string | string[] | null>('item-1');
|
|
57
|
+
|
|
58
|
+
<Accordion [(value)]="basicOpen" type="single" class="max-w-lg">
|
|
59
|
+
<AccordionItem value="item-1">...</AccordionItem>
|
|
60
|
+
<AccordionItem value="item-2">...</AccordionItem>
|
|
61
|
+
<AccordionItem value="item-3">...</AccordionItem>
|
|
62
|
+
</Accordion>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Multiple open sections
|
|
66
|
+
|
|
67
|
+
Use `type="multiple"` when more than one panel should stay open. The bound value becomes a `string[]`.
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
const multipleOpen = signal<string[] | null>(['notifications']);
|
|
71
|
+
|
|
72
|
+
<Accordion [(value)]="multipleOpen" type="multiple" class="max-w-lg">
|
|
73
|
+
<AccordionItem value="notifications">...</AccordionItem>
|
|
74
|
+
<AccordionItem value="privacy">...</AccordionItem>
|
|
75
|
+
<AccordionItem value="billing">...</AccordionItem>
|
|
76
|
+
</Accordion>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Disabled items
|
|
80
|
+
|
|
81
|
+
Disable an individual item with `[disabled]="true"` on `AccordionItem`.
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
const disabledOpen = signal<string | string[] | null>('history');
|
|
85
|
+
|
|
86
|
+
<Accordion [(value)]="disabledOpen" type="single" class="w-full">
|
|
87
|
+
<AccordionItem value="history">...</AccordionItem>
|
|
88
|
+
<AccordionItem value="premium" [disabled]="true">...</AccordionItem>
|
|
89
|
+
<AccordionItem value="email">...</AccordionItem>
|
|
90
|
+
</Accordion>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Bordered list
|
|
94
|
+
|
|
95
|
+
Add borders on the root and the items when the accordion should read like a boxed settings list.
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
const borderOpen = signal<string | string[] | null>('billing');
|
|
99
|
+
|
|
100
|
+
<Accordion [(value)]="borderOpen" type="single" class="max-w-lg rounded-lg border">
|
|
101
|
+
<AccordionItem value="billing" class="border-b px-4 last:border-b-0">...</AccordionItem>
|
|
102
|
+
<AccordionItem value="security" class="border-b px-4 last:border-b-0">...</AccordionItem>
|
|
103
|
+
<AccordionItem value="integrations" class="border-b px-4 last:border-b-0">...</AccordionItem>
|
|
104
|
+
</Accordion>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Inside a card
|
|
108
|
+
|
|
109
|
+
Accordion works well inside `Card` when the disclosure belongs to a larger billing or account surface.
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
const cardOpen = signal<string | string[] | null>('plans');
|
|
113
|
+
|
|
114
|
+
<Card class="w-full max-w-sm">
|
|
115
|
+
<CardHeader>
|
|
116
|
+
<CardTitle>Subscription and billing</CardTitle>
|
|
117
|
+
<CardDescription>Common questions about plans, payments, and cancellations.</CardDescription>
|
|
118
|
+
</CardHeader>
|
|
119
|
+
<CardContent>
|
|
120
|
+
<Accordion [(value)]="cardOpen" type="single">
|
|
121
|
+
<AccordionItem value="plans">...</AccordionItem>
|
|
122
|
+
<AccordionItem value="billing">...</AccordionItem>
|
|
123
|
+
<AccordionItem value="cancel">...</AccordionItem>
|
|
124
|
+
</Accordion>
|
|
125
|
+
</CardContent>
|
|
126
|
+
</Card>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### RTL
|
|
130
|
+
|
|
131
|
+
For right-to-left interfaces, set `dir="rtl"` on a wrapping container or manage direction globally in the app shell. The Accordion structure itself does not change.
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<section dir="rtl" lang="ar" class="max-w-md text-right">
|
|
135
|
+
<Accordion [(value)]="rtlOpen" type="single">
|
|
136
|
+
<AccordionItem value="item-1">...</AccordionItem>
|
|
137
|
+
<AccordionItem value="item-2">...</AccordionItem>
|
|
138
|
+
<AccordionItem value="item-3">...</AccordionItem>
|
|
139
|
+
</Accordion>
|
|
140
|
+
</section>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## API reference
|
|
144
|
+
|
|
145
|
+
### `AccordionComponent`
|
|
146
|
+
|
|
147
|
+
| Input | Type | Default |
|
|
148
|
+
| --------------- | ---------------------------- | ---------- |
|
|
149
|
+
| `type` | `'single' \| 'multiple'` | `'single'` |
|
|
150
|
+
| `collapsible` | `boolean` | `true` |
|
|
151
|
+
| `value` (model) | `string \| string[] \| null` | `null` |
|
|
152
|
+
| `class` | `string` | `''` |
|
|
153
|
+
|
|
154
|
+
### `AccordionItemComponent`
|
|
155
|
+
|
|
156
|
+
| Input | Type | Default |
|
|
157
|
+
| ---------- | --------- | ------- |
|
|
158
|
+
| `value` | `string` | — |
|
|
159
|
+
| `disabled` | `boolean` | `false` |
|
|
160
|
+
| `class` | `string` | `''` |
|
|
161
|
+
|
|
162
|
+
### Parts
|
|
163
|
+
|
|
164
|
+
- `button[AccordionTrigger]` renders the interactive heading and manages `aria-controls` plus `aria-expanded`.
|
|
165
|
+
- `AccordionContent` renders the panel region and links back to the trigger with `aria-labelledby`.
|
|
166
|
+
- Lower-level primitive behavior is based on the Radix Accordion pattern: <https://www.radix-ui.com/primitives/docs/components/accordion#api-reference>.
|
|
167
|
+
|
|
168
|
+
## Styling and theming
|
|
169
|
+
|
|
170
|
+
Pass `class` to the root or item parts to tune width, spacing, borders, and embedded-card layouts.
|
|
171
|
+
|
|
172
|
+
The component follows the shared library theme tokens, so standard utility classes such as `border`, `rounded-lg`, `bg-card`, `text-foreground`, and spacing utilities work as expected.
|
|
173
|
+
|
|
174
|
+
## Accessibility
|
|
175
|
+
|
|
176
|
+
- Trigger has `aria-expanded` and `aria-controls` pointing at the content id.
|
|
177
|
+
- Content has `role="region"` and `aria-labelledby` pointing back at the trigger id.
|
|
178
|
+
- `disabled` items remain visible but non-interactive and are marked with `aria-disabled`.
|
|
179
|
+
- Keep trigger text descriptive and avoid placing nested interactive controls inside the trigger button.
|
|
180
|
+
|
|
181
|
+
## Keyboard interactions
|
|
182
|
+
|
|
183
|
+
- Native button activation covers Enter and Space.
|
|
184
|
+
- Tab order follows the DOM order of the triggers and content.
|
|
185
|
+
|
|
186
|
+
## Angular notes
|
|
187
|
+
|
|
188
|
+
- The component uses Angular signal-based `model()` binding for `value`.
|
|
189
|
+
- For `type="single"`, the value is a `string | null`.
|
|
190
|
+
- For `type="multiple"`, the value is a `string[] | null`.
|
|
191
|
+
- Seed the initial open state with a signal rather than a separate `defaultValue` prop.
|
|
192
|
+
|
|
193
|
+
## Source parity
|
|
194
|
+
|
|
195
|
+
This Angular implementation follows the shadcn Accordion concepts while translating the examples to Angular selectors, standalone imports, and signal-friendly bindings.
|