@edsis/angular 22.1.6 → 22.2.10
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/LICENSE +21 -0
- package/README.md +87 -399
- package/SECURITY.md +18 -0
- package/SUPPORT.md +15 -0
- package/chart/README.md +275 -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 +125 -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 +146 -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 +52 -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/edsis-angular-chart-area.mjs +508 -0
- package/fesm2022/edsis-angular-chart-bar.mjs +946 -0
- package/fesm2022/edsis-angular-chart-core.mjs +1319 -0
- package/fesm2022/edsis-angular-chart-line.mjs +544 -0
- package/fesm2022/edsis-angular-chart-pie.mjs +531 -0
- package/fesm2022/edsis-angular-chart-primitives.mjs +1647 -0
- package/fesm2022/edsis-angular-chart-radar.mjs +693 -0
- package/fesm2022/edsis-angular-chart-radial.mjs +542 -0
- package/fesm2022/edsis-angular-chart-scatter.mjs +486 -0
- package/fesm2022/edsis-angular-chart.mjs +3 -0
- package/fesm2022/edsis-angular-component-accordion.mjs +513 -0
- package/fesm2022/edsis-angular-component-alert-dialog.mjs +1001 -0
- package/fesm2022/edsis-angular-component-alert.mjs +268 -0
- package/fesm2022/edsis-angular-component-aspect-ratio.mjs +80 -0
- package/fesm2022/edsis-angular-component-avatar.mjs +410 -0
- package/fesm2022/edsis-angular-component-badge.mjs +111 -0
- package/fesm2022/edsis-angular-component-breadcrumb.mjs +464 -0
- package/fesm2022/edsis-angular-component-button-group.mjs +252 -0
- package/fesm2022/edsis-angular-component-button.mjs +155 -0
- package/fesm2022/edsis-angular-component-calendar.mjs +835 -0
- package/fesm2022/edsis-angular-component-card.mjs +460 -0
- package/fesm2022/edsis-angular-component-carousel.mjs +700 -0
- package/fesm2022/edsis-angular-component-checkbox.mjs +398 -0
- package/fesm2022/edsis-angular-component-collapsible.mjs +305 -0
- package/fesm2022/edsis-angular-component-combobox.mjs +544 -0
- package/fesm2022/edsis-angular-component-command.mjs +815 -0
- package/fesm2022/edsis-angular-component-composer.mjs +840 -0
- package/fesm2022/edsis-angular-component-context-menu.mjs +197 -0
- package/fesm2022/edsis-angular-component-date-picker.mjs +798 -0
- package/fesm2022/edsis-angular-component-dialog.mjs +798 -0
- package/fesm2022/edsis-angular-component-drawer.mjs +1 -0
- package/fesm2022/edsis-angular-component-dropdown-menu.mjs +1259 -0
- package/fesm2022/edsis-angular-component-editor.mjs +1000 -0
- package/fesm2022/edsis-angular-component-empty.mjs +351 -0
- package/fesm2022/edsis-angular-component-form.mjs +821 -0
- package/fesm2022/edsis-angular-component-hover-card.mjs +486 -0
- package/fesm2022/edsis-angular-component-icon.mjs +253 -0
- package/fesm2022/edsis-angular-component-input-group.mjs +453 -0
- package/fesm2022/edsis-angular-component-input-otp.mjs +957 -0
- package/fesm2022/edsis-angular-component-input.mjs +87 -0
- package/fesm2022/edsis-angular-component-item.mjs +720 -0
- package/fesm2022/edsis-angular-component-kanban.mjs +812 -0
- package/fesm2022/edsis-angular-component-kbd.mjs +124 -0
- package/fesm2022/edsis-angular-component-label.mjs +82 -0
- package/fesm2022/edsis-angular-component-menubar.mjs +481 -0
- package/fesm2022/edsis-angular-component-native-select.mjs +168 -0
- package/fesm2022/edsis-angular-component-navigation-menu.mjs +685 -0
- package/fesm2022/edsis-angular-component-pagination.mjs +425 -0
- package/fesm2022/edsis-angular-component-pillbox.mjs +1679 -0
- package/fesm2022/edsis-angular-component-popover.mjs +292 -0
- package/fesm2022/edsis-angular-component-progress.mjs +184 -0
- package/fesm2022/edsis-angular-component-radio.mjs +491 -0
- package/fesm2022/edsis-angular-component-resizable.mjs +703 -0
- package/fesm2022/edsis-angular-component-scroll-area.mjs +133 -0
- package/fesm2022/edsis-angular-component-segmented-control.mjs +408 -0
- package/fesm2022/edsis-angular-component-select.mjs +743 -0
- package/fesm2022/edsis-angular-component-separator.mjs +102 -0
- package/fesm2022/edsis-angular-component-sheet.mjs +874 -0
- package/fesm2022/edsis-angular-component-skeleton.mjs +62 -0
- package/fesm2022/edsis-angular-component-slider.mjs +676 -0
- package/fesm2022/edsis-angular-component-spinner.mjs +157 -0
- package/fesm2022/edsis-angular-component-switch.mjs +361 -0
- package/fesm2022/edsis-angular-component-table.mjs +446 -0
- package/fesm2022/edsis-angular-component-tabs.mjs +592 -0
- package/fesm2022/edsis-angular-component-textarea.mjs +85 -0
- package/fesm2022/edsis-angular-component-timeline.mjs +619 -0
- package/fesm2022/edsis-angular-component-toast.mjs +231 -0
- package/fesm2022/edsis-angular-component-toggle-group.mjs +579 -0
- package/fesm2022/edsis-angular-component-toggle.mjs +189 -0
- package/fesm2022/edsis-angular-component-tooltip.mjs +804 -0
- package/fesm2022/edsis-angular-component-utils-core.mjs +181 -0
- package/fesm2022/edsis-angular-component-utils-overlay.mjs +54 -0
- package/fesm2022/edsis-angular-component-utils-scale.mjs +76 -0
- package/fesm2022/edsis-angular-component-utils.mjs +2 -0
- package/fesm2022/edsis-angular-component.mjs +0 -0
- package/fesm2022/edsis-angular-navigation-core.mjs +15 -0
- package/fesm2022/edsis-angular-navigation-icon.mjs +35 -0
- package/fesm2022/edsis-angular-navigation-navigation-badge-count.component-D70Ju6_f.mjs +234 -0
- package/fesm2022/edsis-angular-navigation-navigation-dockbar-menu.component-BaFnh48V.mjs +834 -0
- package/fesm2022/edsis-angular-navigation-navigation-entry-grid.component-D39W0FQZ.mjs +823 -0
- package/fesm2022/edsis-angular-navigation-navigation-flyout-menu.component-CpmsY8hb.mjs +670 -0
- package/fesm2022/edsis-angular-navigation-navigation-horizontal.component-D35IfX6r.mjs +689 -0
- package/fesm2022/edsis-angular-navigation-navigation-item.component-X6JFy-ya.mjs +1522 -0
- package/fesm2022/edsis-angular-navigation-navigation-list.component-D6Ms8H5g.mjs +346 -0
- package/fesm2022/edsis-angular-navigation-service.mjs +558 -0
- package/fesm2022/edsis-angular-navigation-types.mjs +151 -0
- package/fesm2022/edsis-angular-navigation.mjs +3338 -0
- package/fesm2022/edsis-angular-sdk.mjs +100 -0
- package/fesm2022/edsis-angular-theme-component-settings.mjs +1863 -0
- package/fesm2022/edsis-angular-theme-layout-services.mjs +252 -0
- package/fesm2022/edsis-angular-theme-layout-types.mjs +45 -0
- package/fesm2022/edsis-angular-theme-layout-wrapper.mjs +2568 -0
- package/fesm2022/edsis-angular-theme-layout.mjs +1089 -0
- package/fesm2022/edsis-angular-theme-on-fill.mjs +89 -0
- package/fesm2022/edsis-angular-theme-page-core.mjs +315 -0
- package/fesm2022/edsis-angular-theme-page-filter.mjs +409 -0
- package/fesm2022/edsis-angular-theme-page-overview.mjs +88 -0
- package/fesm2022/edsis-angular-theme-page-root.mjs +693 -0
- package/fesm2022/edsis-angular-theme-page-side.mjs +342 -0
- package/fesm2022/edsis-angular-theme-page-slots.mjs +258 -0
- package/fesm2022/edsis-angular-theme-page.mjs +7 -0
- package/fesm2022/edsis-angular-theme-shell-services.mjs +231 -0
- package/fesm2022/edsis-angular-theme-shell-types.mjs +102 -0
- package/fesm2022/edsis-angular-theme-shell.mjs +1352 -0
- package/fesm2022/edsis-angular-theme-styles.mjs +605 -0
- package/fesm2022/edsis-angular-theme.mjs +0 -0
- package/fesm2022/edsis-angular.mjs +5 -8
- package/navigation/README.md +576 -0
- package/package.json +481 -52
- 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 +120 -0
- package/theme/component/settings/README.md +154 -0
- package/theme/layout/README.md +604 -0
- package/theme/page/README.md +505 -0
- package/theme/shell/README.md +344 -0
- package/theme/styles/README.md +251 -0
- package/theme/styles/css/base/components.css +577 -0
- package/theme/styles/css/base/index.css +14 -0
- package/theme/styles/css/base/on-fill.css +153 -0
- package/theme/styles/css/base/package.css +10 -0
- package/theme/styles/css/base/prefers-dark.css +81 -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 +208 -0
- package/theme/styles/css/base/theme.css +306 -0
- package/theme/styles/css/base/tokens.css +388 -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/fonts.css +85 -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/edsis-angular-chart-area.d.ts +139 -0
- package/types/edsis-angular-chart-bar.d.ts +291 -0
- package/types/edsis-angular-chart-core.d.ts +824 -0
- package/types/edsis-angular-chart-line.d.ts +148 -0
- package/types/edsis-angular-chart-pie.d.ts +207 -0
- package/types/edsis-angular-chart-primitives.d.ts +360 -0
- package/types/edsis-angular-chart-radar.d.ts +198 -0
- package/types/edsis-angular-chart-radial.d.ts +187 -0
- package/types/edsis-angular-chart-scatter.d.ts +181 -0
- package/types/edsis-angular-chart.d.ts +3 -0
- package/types/edsis-angular-component-accordion.d.ts +139 -0
- package/types/edsis-angular-component-alert-dialog.d.ts +288 -0
- package/types/edsis-angular-component-alert.d.ts +72 -0
- package/types/edsis-angular-component-aspect-ratio.d.ts +20 -0
- package/types/edsis-angular-component-avatar.d.ts +111 -0
- package/types/edsis-angular-component-badge.d.ts +36 -0
- package/types/edsis-angular-component-breadcrumb.d.ts +85 -0
- package/types/edsis-angular-component-button-group.d.ts +50 -0
- package/types/edsis-angular-component-button.d.ts +44 -0
- package/types/edsis-angular-component-calendar.d.ts +150 -0
- package/types/edsis-angular-component-card.d.ts +123 -0
- package/types/edsis-angular-component-carousel.d.ts +155 -0
- package/types/edsis-angular-component-checkbox.d.ts +100 -0
- package/types/edsis-angular-component-collapsible.d.ts +68 -0
- package/types/edsis-angular-component-combobox.d.ts +105 -0
- package/types/edsis-angular-component-command.d.ts +215 -0
- package/types/edsis-angular-component-composer.d.ts +190 -0
- package/types/edsis-angular-component-context-menu.d.ts +64 -0
- package/types/edsis-angular-component-date-picker.d.ts +199 -0
- package/types/edsis-angular-component-dialog.d.ts +231 -0
- package/types/edsis-angular-component-drawer.d.ts +2 -0
- package/types/edsis-angular-component-dropdown-menu.d.ts +370 -0
- package/types/edsis-angular-component-editor.d.ts +234 -0
- package/types/edsis-angular-component-empty.d.ts +85 -0
- package/types/edsis-angular-component-form.d.ts +223 -0
- package/types/edsis-angular-component-hover-card.d.ts +133 -0
- package/types/edsis-angular-component-icon.d.ts +90 -0
- package/types/edsis-angular-component-input-group.d.ts +98 -0
- package/types/edsis-angular-component-input-otp.d.ts +249 -0
- package/types/edsis-angular-component-input.d.ts +31 -0
- package/types/edsis-angular-component-item.d.ts +169 -0
- package/types/edsis-angular-component-kanban.d.ts +165 -0
- package/types/edsis-angular-component-kbd.d.ts +25 -0
- package/types/edsis-angular-component-label.d.ts +19 -0
- package/types/edsis-angular-component-menubar.d.ts +123 -0
- package/types/edsis-angular-component-native-select.d.ts +39 -0
- package/types/edsis-angular-component-navigation-menu.d.ts +163 -0
- package/types/edsis-angular-component-pagination.d.ts +83 -0
- package/types/edsis-angular-component-pillbox.d.ts +380 -0
- package/types/edsis-angular-component-popover.d.ts +96 -0
- package/types/edsis-angular-component-progress.d.ts +45 -0
- package/types/edsis-angular-component-radio.d.ts +137 -0
- package/types/edsis-angular-component-resizable.d.ts +166 -0
- package/types/edsis-angular-component-scroll-area.d.ts +37 -0
- package/types/edsis-angular-component-segmented-control.d.ts +102 -0
- package/types/edsis-angular-component-select.d.ts +138 -0
- package/types/edsis-angular-component-separator.d.ts +26 -0
- package/types/edsis-angular-component-sheet.d.ts +240 -0
- package/types/edsis-angular-component-skeleton.d.ts +13 -0
- package/types/edsis-angular-component-slider.d.ts +148 -0
- package/types/edsis-angular-component-spinner.d.ts +31 -0
- package/types/edsis-angular-component-switch.d.ts +101 -0
- package/types/edsis-angular-component-table.d.ts +109 -0
- package/types/edsis-angular-component-tabs.d.ts +183 -0
- package/types/edsis-angular-component-textarea.d.ts +27 -0
- package/types/edsis-angular-component-timeline.d.ts +146 -0
- package/types/edsis-angular-component-toast.d.ts +60 -0
- package/types/edsis-angular-component-toggle-group.d.ts +161 -0
- package/types/edsis-angular-component-toggle.d.ts +47 -0
- package/types/edsis-angular-component-tooltip.d.ts +233 -0
- package/types/edsis-angular-component-utils-core.d.ts +175 -0
- package/types/edsis-angular-component-utils-overlay.d.ts +17 -0
- package/types/edsis-angular-component-utils-scale.d.ts +27 -0
- package/types/edsis-angular-component-utils.d.ts +2 -0
- package/types/edsis-angular-component.d.ts +1 -0
- package/types/edsis-angular-navigation-core.d.ts +55 -0
- package/types/edsis-angular-navigation-icon.d.ts +9 -0
- package/types/edsis-angular-navigation-service.d.ts +121 -0
- package/types/edsis-angular-navigation-types.d.ts +185 -0
- package/types/edsis-angular-navigation.d.ts +862 -0
- package/types/edsis-angular-sdk.d.ts +87 -0
- package/types/edsis-angular-theme-component-settings.d.ts +205 -0
- package/types/edsis-angular-theme-layout-services.d.ts +143 -0
- package/types/edsis-angular-theme-layout-types.d.ts +36 -0
- package/types/edsis-angular-theme-layout-wrapper.d.ts +670 -0
- package/types/edsis-angular-theme-layout.d.ts +218 -0
- package/types/edsis-angular-theme-on-fill.d.ts +45 -0
- package/types/edsis-angular-theme-page-core.d.ts +151 -0
- package/types/edsis-angular-theme-page-filter.d.ts +127 -0
- package/types/edsis-angular-theme-page-overview.d.ts +28 -0
- package/types/edsis-angular-theme-page-root.d.ts +172 -0
- package/types/edsis-angular-theme-page-side.d.ts +90 -0
- package/types/edsis-angular-theme-page-slots.d.ts +61 -0
- package/types/edsis-angular-theme-page.d.ts +7 -0
- package/types/edsis-angular-theme-shell-services.d.ts +188 -0
- package/types/edsis-angular-theme-shell-types.d.ts +102 -0
- package/types/edsis-angular-theme-shell.d.ts +178 -0
- package/types/edsis-angular-theme-styles.d.ts +328 -0
- package/types/edsis-angular-theme.d.ts +1 -0
- package/types/edsis-angular.d.ts +5 -2
- package/fesm2022/edsis-angular-block-shell.mjs +0 -1329
- package/fesm2022/edsis-angular-block-shell.mjs.map +0 -1
- package/fesm2022/edsis-angular-block-themes.mjs +0 -1007
- package/fesm2022/edsis-angular-block-themes.mjs.map +0 -1
- package/fesm2022/edsis-angular-module-auth.mjs +0 -2582
- package/fesm2022/edsis-angular-module-auth.mjs.map +0 -1
- package/fesm2022/edsis-angular-platform-mfe.mjs +0 -329
- package/fesm2022/edsis-angular-platform-mfe.mjs.map +0 -1
- package/fesm2022/edsis-angular-services-runtime.mjs +0 -385
- package/fesm2022/edsis-angular-services-runtime.mjs.map +0 -1
- package/fesm2022/edsis-angular.mjs.map +0 -1
- package/types/edsis-angular-block-shell.d.ts +0 -190
- package/types/edsis-angular-block-themes.d.ts +0 -94
- package/types/edsis-angular-module-auth.d.ts +0 -533
- package/types/edsis-angular-platform-mfe.d.ts +0 -126
- package/types/edsis-angular-services-runtime.d.ts +0 -118
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
import { DOCUMENT } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { DestroyRef, InjectionToken, Service, computed, effect, inject, makeEnvironmentProviders, provideEnvironmentInitializer, signal } from "@angular/core";
|
|
4
|
+
import { documentLocalStorage } from "@edsis/angular/component/utils/core";
|
|
5
|
+
function persistedSignal(options) {
|
|
6
|
+
const documentRef = options.documentRef !== void 0 ? options.documentRef : inject(DOCUMENT, { optional: true });
|
|
7
|
+
const storage = documentLocalStorage(documentRef);
|
|
8
|
+
const state = signal(options.parse(storage.read(options.key)), ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
9
|
+
effect(() => {
|
|
10
|
+
const serialized = options.serialize(state());
|
|
11
|
+
if (serialized === null) storage.remove(options.key);
|
|
12
|
+
else storage.write(options.key, serialized);
|
|
13
|
+
});
|
|
14
|
+
return state;
|
|
15
|
+
}
|
|
16
|
+
function htmlAttributeEffect(options) {
|
|
17
|
+
const documentRef = options.documentRef !== void 0 ? options.documentRef : inject(DOCUMENT, { optional: true });
|
|
18
|
+
const attributes = typeof options.attribute === "string" ? [options.attribute] : options.attribute;
|
|
19
|
+
effect(() => {
|
|
20
|
+
const value = options.source();
|
|
21
|
+
const element = documentRef?.documentElement;
|
|
22
|
+
if (!element) return;
|
|
23
|
+
for (const attribute of attributes) if (value === null) element.removeAttribute(attribute);
|
|
24
|
+
else element.setAttribute(attribute, value);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function htmlStylePropertyEffect(options) {
|
|
28
|
+
const documentRef = options.documentRef !== void 0 ? options.documentRef : inject(DOCUMENT, { optional: true });
|
|
29
|
+
effect(() => {
|
|
30
|
+
const properties = options.source();
|
|
31
|
+
const element = documentRef?.documentElement;
|
|
32
|
+
if (!element) return;
|
|
33
|
+
for (const [property, value] of Object.entries(properties)) if (value === null) element.style.removeProperty(property);
|
|
34
|
+
else element.style.setProperty(property, value);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function persistedHtmlAttributeSignal(options) {
|
|
38
|
+
const documentRef = options.documentRef !== void 0 ? options.documentRef : inject(DOCUMENT, { optional: true });
|
|
39
|
+
const state = persistedSignal({
|
|
40
|
+
key: options.key,
|
|
41
|
+
documentRef,
|
|
42
|
+
parse: (raw) => {
|
|
43
|
+
const stored = raw !== null && raw !== "" ? raw : null;
|
|
44
|
+
return options.normalize(stored ?? options.normalize(options.initial));
|
|
45
|
+
},
|
|
46
|
+
serialize: (value) => value
|
|
47
|
+
});
|
|
48
|
+
const resolveAttributeValue = options.resolveAttributeValue;
|
|
49
|
+
const attributeValue = resolveAttributeValue ? computed(() => resolveAttributeValue(state())) : computed(() => state());
|
|
50
|
+
htmlAttributeEffect({
|
|
51
|
+
attribute: options.attribute,
|
|
52
|
+
source: () => attributeValue(),
|
|
53
|
+
documentRef
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
value: state.asReadonly(),
|
|
57
|
+
attributeValue,
|
|
58
|
+
set: (next) => state.set(next)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function prefersDarkSignal(documentRef) {
|
|
62
|
+
const mediaQueryList = (documentRef !== void 0 ? documentRef : inject(DOCUMENT, { optional: true }))?.defaultView?.matchMedia?.("(prefers-color-scheme: dark)") ?? null;
|
|
63
|
+
const state = signal(mediaQueryList?.matches ?? false, ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
64
|
+
if (mediaQueryList) {
|
|
65
|
+
const onChange = (event) => state.set(event.matches);
|
|
66
|
+
mediaQueryList.addEventListener("change", onChange);
|
|
67
|
+
inject(DestroyRef).onDestroy(() => mediaQueryList.removeEventListener("change", onChange));
|
|
68
|
+
}
|
|
69
|
+
return state.asReadonly();
|
|
70
|
+
}
|
|
71
|
+
const TEXT_CONTRAST_MIN = 4.5;
|
|
72
|
+
const NUMBER = String.raw`[+-]?(?:\d+(?:\.\d+)?|\.\d+)`;
|
|
73
|
+
const SEPARATOR = String.raw`(?:\s*,\s*|\s+)`;
|
|
74
|
+
const HSL_TRIPLET = new RegExp(`^\\s*(${NUMBER})(deg|grad|rad|turn)?${SEPARATOR}(${NUMBER})%${SEPARATOR}(${NUMBER})%\\s*$`, "i");
|
|
75
|
+
const HEX_COLOR = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
76
|
+
const DEGREES_PER_UNIT = {
|
|
77
|
+
deg: 1,
|
|
78
|
+
grad: .9,
|
|
79
|
+
rad: 180 / Math.PI,
|
|
80
|
+
turn: 360
|
|
81
|
+
};
|
|
82
|
+
const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
83
|
+
const normalizeHue = (hue) => (hue % 360 + 360) % 360;
|
|
84
|
+
function parseHslTriplet(value) {
|
|
85
|
+
const match = HSL_TRIPLET.exec(value);
|
|
86
|
+
if (!match) return null;
|
|
87
|
+
const [h, s, l] = [
|
|
88
|
+
Number(match[1]),
|
|
89
|
+
Number(match[3]),
|
|
90
|
+
Number(match[4])
|
|
91
|
+
];
|
|
92
|
+
if (![
|
|
93
|
+
h,
|
|
94
|
+
s,
|
|
95
|
+
l
|
|
96
|
+
].every(Number.isFinite)) return null;
|
|
97
|
+
return {
|
|
98
|
+
h: normalizeHue(h * DEGREES_PER_UNIT[match[2]?.toLowerCase() ?? "deg"]),
|
|
99
|
+
s,
|
|
100
|
+
l
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function formatHslTriplet({ h, s, l }) {
|
|
104
|
+
return `${h} ${clamp(Math.round(s), 0, 100)}% ${clamp(Math.round(l), 0, 100)}%`;
|
|
105
|
+
}
|
|
106
|
+
function hexToHslTriplet(value) {
|
|
107
|
+
const exact = hexToHsl(value);
|
|
108
|
+
return exact ? formatHslTriplet({
|
|
109
|
+
h: Math.round(exact.h),
|
|
110
|
+
s: exact.s,
|
|
111
|
+
l: exact.l
|
|
112
|
+
}) : null;
|
|
113
|
+
}
|
|
114
|
+
function hexToHsl(value) {
|
|
115
|
+
const match = HEX_COLOR.exec(value.trim());
|
|
116
|
+
if (!match) return null;
|
|
117
|
+
const digits = match[1];
|
|
118
|
+
const expanded = digits.length === 3 ? digits.split("").map((digit) => digit + digit).join("") : digits;
|
|
119
|
+
const [red, green, blue] = [
|
|
120
|
+
0,
|
|
121
|
+
2,
|
|
122
|
+
4
|
|
123
|
+
].map((offset) => Number.parseInt(expanded.slice(offset, offset + 2), 16) / 255);
|
|
124
|
+
const largest = Math.max(red, green, blue);
|
|
125
|
+
const smallest = Math.min(red, green, blue);
|
|
126
|
+
const delta = largest - smallest;
|
|
127
|
+
const lightness = (largest + smallest) / 2;
|
|
128
|
+
let hue = 0;
|
|
129
|
+
if (delta !== 0) {
|
|
130
|
+
if (largest === red) hue = 60 * (((green - blue) / delta + 6) % 6);
|
|
131
|
+
else if (largest === green) hue = 60 * ((blue - red) / delta + 2);
|
|
132
|
+
else hue = 60 * ((red - green) / delta + 4);
|
|
133
|
+
}
|
|
134
|
+
const saturation = delta === 0 ? 0 : delta / (1 - Math.abs(2 * lightness - 1));
|
|
135
|
+
return {
|
|
136
|
+
h: hue,
|
|
137
|
+
s: saturation * 100,
|
|
138
|
+
l: lightness * 100
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function hslToRgb({ h, s, l }) {
|
|
142
|
+
const saturation = clamp(s, 0, 100) / 100;
|
|
143
|
+
const lightness = clamp(l, 0, 100) / 100;
|
|
144
|
+
const k = (n) => (n + h / 30) % 12;
|
|
145
|
+
const a = saturation * Math.min(lightness, 1 - lightness);
|
|
146
|
+
const channel = (n) => lightness - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
|
|
147
|
+
return [
|
|
148
|
+
channel(0),
|
|
149
|
+
channel(8),
|
|
150
|
+
channel(4)
|
|
151
|
+
];
|
|
152
|
+
}
|
|
153
|
+
const toLinear = (channel) => channel <= .03928 ? channel / 12.92 : Math.pow((channel + .055) / 1.055, 2.4);
|
|
154
|
+
const toPainted = (channel) => Math.round(clamp(channel, 0, 1) * 255) / 255;
|
|
155
|
+
function relativeLuminance(triplet) {
|
|
156
|
+
const parsed = parseHslTriplet(triplet);
|
|
157
|
+
if (!parsed) return 0;
|
|
158
|
+
const [r, g, b] = hslToRgb(parsed).map(toPainted);
|
|
159
|
+
return .2126 * toLinear(r) + .7152 * toLinear(g) + .0722 * toLinear(b);
|
|
160
|
+
}
|
|
161
|
+
function contrastRatio(a, b) {
|
|
162
|
+
const ya = relativeLuminance(a);
|
|
163
|
+
const yb = relativeLuminance(b);
|
|
164
|
+
return (Math.max(ya, yb) + .05) / (Math.min(ya, yb) + .05);
|
|
165
|
+
}
|
|
166
|
+
function solveLightnessNearest(options) {
|
|
167
|
+
const target = options.min + (options.margin ?? .02);
|
|
168
|
+
const start = Math.round(clamp(options.from, 0, 100));
|
|
169
|
+
for (let delta = 0; delta <= 100; delta += 1) for (const candidate of delta === 0 ? [start] : [start - delta, start + delta]) {
|
|
170
|
+
if (candidate < 0 || candidate > 100) continue;
|
|
171
|
+
const triplet = formatHslTriplet({
|
|
172
|
+
h: options.h,
|
|
173
|
+
s: options.s,
|
|
174
|
+
l: candidate
|
|
175
|
+
});
|
|
176
|
+
if (options.against.every((background) => contrastRatio(triplet, background) >= target)) return triplet;
|
|
177
|
+
}
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
const ON_FILL_INK = Object.freeze({
|
|
181
|
+
light: "0 0% 12%",
|
|
182
|
+
dark: "0 0% 10%"
|
|
183
|
+
});
|
|
184
|
+
const ON_FILL_WHITE = "0 0% 100%";
|
|
185
|
+
function pickFillForeground(fill, dark, min = TEXT_CONTRAST_MIN) {
|
|
186
|
+
const lightRatio = contrastRatio(ON_FILL_WHITE, fill);
|
|
187
|
+
const darkRatio = contrastRatio(dark, fill);
|
|
188
|
+
const preferred = lightRatio >= darkRatio ? ON_FILL_WHITE : dark;
|
|
189
|
+
if (Math.max(lightRatio, darkRatio) >= min) return preferred;
|
|
190
|
+
const ink = parseHslTriplet(dark);
|
|
191
|
+
return solveLightnessNearest({
|
|
192
|
+
h: ink.h,
|
|
193
|
+
s: ink.s,
|
|
194
|
+
against: [fill],
|
|
195
|
+
min,
|
|
196
|
+
from: ink.l
|
|
197
|
+
}) ?? formatHslTriplet({
|
|
198
|
+
h: ink.h,
|
|
199
|
+
s: ink.s,
|
|
200
|
+
l: 0
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
function toFillTriplet(fill) {
|
|
204
|
+
const parsed = parseHslTriplet(fill);
|
|
205
|
+
if (parsed) return `${parsed.h} ${parsed.s}% ${parsed.l}%`;
|
|
206
|
+
const hex = hexToHsl(fill);
|
|
207
|
+
return hex ? `${hex.h} ${hex.s}% ${hex.l}%` : null;
|
|
208
|
+
}
|
|
209
|
+
function foregroundFor(fill, mode = "light") {
|
|
210
|
+
if (typeof fill !== "string") return null;
|
|
211
|
+
const triplet = toFillTriplet(fill.trim());
|
|
212
|
+
if (!triplet) return null;
|
|
213
|
+
return pickFillForeground(triplet, ON_FILL_INK[mode === "dark" ? "dark" : "light"]);
|
|
214
|
+
}
|
|
215
|
+
const THEME_OPTIONS = new InjectionToken("THEME_OPTIONS");
|
|
216
|
+
const THEME_MODES = [
|
|
217
|
+
"light",
|
|
218
|
+
"dark",
|
|
219
|
+
"system"
|
|
220
|
+
];
|
|
221
|
+
const RESOLVED_THEME_MODES = ["light", "dark"];
|
|
222
|
+
const THEME_COLORS = [
|
|
223
|
+
"base",
|
|
224
|
+
"red",
|
|
225
|
+
"orange",
|
|
226
|
+
"amber",
|
|
227
|
+
"yellow",
|
|
228
|
+
"lime",
|
|
229
|
+
"green",
|
|
230
|
+
"emerald",
|
|
231
|
+
"teal",
|
|
232
|
+
"cyan",
|
|
233
|
+
"sky",
|
|
234
|
+
"blue",
|
|
235
|
+
"indigo",
|
|
236
|
+
"violet",
|
|
237
|
+
"purple",
|
|
238
|
+
"fuchsia",
|
|
239
|
+
"pink",
|
|
240
|
+
"rose",
|
|
241
|
+
"brand"
|
|
242
|
+
];
|
|
243
|
+
const THEME_NEUTRALS = [
|
|
244
|
+
"base",
|
|
245
|
+
"slate",
|
|
246
|
+
"gray",
|
|
247
|
+
"zinc",
|
|
248
|
+
"neutral",
|
|
249
|
+
"stone",
|
|
250
|
+
"mauve",
|
|
251
|
+
"olive",
|
|
252
|
+
"mist",
|
|
253
|
+
"taupe"
|
|
254
|
+
];
|
|
255
|
+
const THEME_RADII = [
|
|
256
|
+
"none",
|
|
257
|
+
"xs",
|
|
258
|
+
"sm",
|
|
259
|
+
"md",
|
|
260
|
+
"xl",
|
|
261
|
+
"full"
|
|
262
|
+
];
|
|
263
|
+
const THEME_SPACES = ["compact", "normal"];
|
|
264
|
+
const DEFAULT_THEME_MODE = "system";
|
|
265
|
+
const DEFAULT_THEME_COLOR = "base";
|
|
266
|
+
const DEFAULT_THEME_NEUTRAL = "base";
|
|
267
|
+
const DEFAULT_THEME_RADIUS = "md";
|
|
268
|
+
const DEFAULT_THEME_SPACE = "normal";
|
|
269
|
+
const THEME_MODE_STORAGE_KEY = "theme-mode";
|
|
270
|
+
const THEME_COLOR_STORAGE_KEY = "theme-color";
|
|
271
|
+
const THEME_NEUTRAL_STORAGE_KEY = "theme-neutral";
|
|
272
|
+
const THEME_BRAND_STORAGE_KEY = "theme-brand";
|
|
273
|
+
const THEME_RADIUS_STORAGE_KEY = "theme-radius";
|
|
274
|
+
const THEME_SPACE_STORAGE_KEY = "theme-space";
|
|
275
|
+
function isThemeMode(value) {
|
|
276
|
+
return typeof value === "string" && THEME_MODES.includes(value);
|
|
277
|
+
}
|
|
278
|
+
function isResolvedThemeMode(value) {
|
|
279
|
+
return typeof value === "string" && RESOLVED_THEME_MODES.includes(value);
|
|
280
|
+
}
|
|
281
|
+
function isThemeColor(value) {
|
|
282
|
+
return typeof value === "string" && THEME_COLORS.includes(value);
|
|
283
|
+
}
|
|
284
|
+
function isThemeNeutral(value) {
|
|
285
|
+
return typeof value === "string" && THEME_NEUTRALS.includes(value);
|
|
286
|
+
}
|
|
287
|
+
function isThemeRadius(value) {
|
|
288
|
+
return typeof value === "string" && THEME_RADII.includes(value);
|
|
289
|
+
}
|
|
290
|
+
function isThemeSpace(value) {
|
|
291
|
+
return typeof value === "string" && THEME_SPACES.includes(value);
|
|
292
|
+
}
|
|
293
|
+
function normalizeThemeMode(value) {
|
|
294
|
+
return isThemeMode(value) ? value : DEFAULT_THEME_MODE;
|
|
295
|
+
}
|
|
296
|
+
function normalizeThemeColor(value) {
|
|
297
|
+
return isThemeColor(value) ? value : DEFAULT_THEME_COLOR;
|
|
298
|
+
}
|
|
299
|
+
function normalizeThemeNeutral(value) {
|
|
300
|
+
return isThemeNeutral(value) ? value : DEFAULT_THEME_NEUTRAL;
|
|
301
|
+
}
|
|
302
|
+
function normalizeThemeRadius(value) {
|
|
303
|
+
return isThemeRadius(value) ? value : "md";
|
|
304
|
+
}
|
|
305
|
+
function normalizeThemeSpace(value) {
|
|
306
|
+
return isThemeSpace(value) ? value : DEFAULT_THEME_SPACE;
|
|
307
|
+
}
|
|
308
|
+
const UNMEASURABLE_BRAND_FOREGROUND = "0 0% 100%";
|
|
309
|
+
const RING_BACKGROUNDS = {
|
|
310
|
+
light: "0 0% 100%",
|
|
311
|
+
dark: "0 0% 5%"
|
|
312
|
+
};
|
|
313
|
+
function toBrandTriplet(color) {
|
|
314
|
+
const trimmed = color.trim();
|
|
315
|
+
const parsed = parseHslTriplet(trimmed);
|
|
316
|
+
return parsed ? formatHslTriplet(parsed) : hexToHslTriplet(trimmed);
|
|
317
|
+
}
|
|
318
|
+
function hardenBrand(brand) {
|
|
319
|
+
const color = toBrandTriplet(brand.color);
|
|
320
|
+
if (!color) return {
|
|
321
|
+
color: brand.color,
|
|
322
|
+
foreground: brand.foreground ?? UNMEASURABLE_BRAND_FOREGROUND
|
|
323
|
+
};
|
|
324
|
+
const chosen = foregroundFor(color, "light");
|
|
325
|
+
const explicit = brand.foreground;
|
|
326
|
+
if (explicit !== void 0 && parseHslTriplet(explicit) && contrastRatio(explicit, color) >= 4.5) return {
|
|
327
|
+
color,
|
|
328
|
+
foreground: explicit
|
|
329
|
+
};
|
|
330
|
+
return {
|
|
331
|
+
color,
|
|
332
|
+
foreground: chosen
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
function brandRing(color, background) {
|
|
336
|
+
const parsed = parseHslTriplet(color);
|
|
337
|
+
if (!parsed) return null;
|
|
338
|
+
if (contrastRatio(color, background) >= 3) return color;
|
|
339
|
+
return solveLightnessNearest({
|
|
340
|
+
h: parsed.h,
|
|
341
|
+
s: parsed.s,
|
|
342
|
+
against: [background],
|
|
343
|
+
min: 3,
|
|
344
|
+
from: parsed.l
|
|
345
|
+
}) ?? color;
|
|
346
|
+
}
|
|
347
|
+
function brandPatternHueSaturation(color) {
|
|
348
|
+
const parsed = parseHslTriplet(color);
|
|
349
|
+
return parsed ? `${parsed.h} ${parsed.s}%` : null;
|
|
350
|
+
}
|
|
351
|
+
var ThemeBrandService = class ThemeBrandService {
|
|
352
|
+
options = inject(THEME_OPTIONS, { optional: true });
|
|
353
|
+
brandState = persistedSignal({
|
|
354
|
+
key: THEME_BRAND_STORAGE_KEY,
|
|
355
|
+
parse: (raw) => this.parseStored(raw) ?? this.normalizeOption(this.options?.brand),
|
|
356
|
+
serialize: (brand) => brand ? JSON.stringify(brand) : null
|
|
357
|
+
});
|
|
358
|
+
brand = this.brandState.asReadonly();
|
|
359
|
+
constructor() {
|
|
360
|
+
htmlStylePropertyEffect({ source: () => this.brandProperties(this.brandState()) });
|
|
361
|
+
}
|
|
362
|
+
setBrand(color, foreground) {
|
|
363
|
+
this.brandState.set(hardenBrand({
|
|
364
|
+
color,
|
|
365
|
+
foreground
|
|
366
|
+
}));
|
|
367
|
+
}
|
|
368
|
+
clearBrand() {
|
|
369
|
+
this.brandState.set(null);
|
|
370
|
+
}
|
|
371
|
+
normalizeOption(brand) {
|
|
372
|
+
if (!brand) return null;
|
|
373
|
+
if (typeof brand === "string") return hardenBrand({ color: brand });
|
|
374
|
+
return hardenBrand({
|
|
375
|
+
color: brand.color,
|
|
376
|
+
foreground: brand.foreground
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
brandProperties(brand) {
|
|
380
|
+
if (!brand) return {
|
|
381
|
+
"--brand": null,
|
|
382
|
+
"--brand-foreground": null,
|
|
383
|
+
"--brand-pattern-hs": null,
|
|
384
|
+
"--brand-ring-light": null,
|
|
385
|
+
"--brand-ring-dark": null
|
|
386
|
+
};
|
|
387
|
+
return {
|
|
388
|
+
"--brand": brand.color,
|
|
389
|
+
"--brand-foreground": brand.foreground,
|
|
390
|
+
"--brand-pattern-hs": brandPatternHueSaturation(brand.color),
|
|
391
|
+
"--brand-ring-light": brandRing(brand.color, RING_BACKGROUNDS.light),
|
|
392
|
+
"--brand-ring-dark": brandRing(brand.color, RING_BACKGROUNDS.dark)
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
parseStored(raw) {
|
|
396
|
+
if (!raw) return null;
|
|
397
|
+
try {
|
|
398
|
+
const parsed = JSON.parse(raw);
|
|
399
|
+
if (typeof parsed?.color !== "string") return null;
|
|
400
|
+
return hardenBrand({
|
|
401
|
+
color: parsed.color,
|
|
402
|
+
foreground: typeof parsed.foreground === "string" ? parsed.foreground : void 0
|
|
403
|
+
});
|
|
404
|
+
} catch {
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
409
|
+
minVersion: "12.0.0",
|
|
410
|
+
version: "22.2.4",
|
|
411
|
+
ngImport: i0,
|
|
412
|
+
type: ThemeBrandService,
|
|
413
|
+
deps: [],
|
|
414
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
415
|
+
});
|
|
416
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
417
|
+
minVersion: "22.0.0",
|
|
418
|
+
version: "22.2.4",
|
|
419
|
+
ngImport: i0,
|
|
420
|
+
type: ThemeBrandService
|
|
421
|
+
});
|
|
422
|
+
};
|
|
423
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
424
|
+
minVersion: "12.0.0",
|
|
425
|
+
version: "22.2.4",
|
|
426
|
+
ngImport: i0,
|
|
427
|
+
type: ThemeBrandService,
|
|
428
|
+
decorators: [{ type: Service }],
|
|
429
|
+
ctorParameters: () => []
|
|
430
|
+
});
|
|
431
|
+
var ThemeColorService = class ThemeColorService {
|
|
432
|
+
options = inject(THEME_OPTIONS, { optional: true });
|
|
433
|
+
colorAxis = persistedHtmlAttributeSignal({
|
|
434
|
+
key: THEME_COLOR_STORAGE_KEY,
|
|
435
|
+
attribute: "theme-color",
|
|
436
|
+
normalize: normalizeThemeColor,
|
|
437
|
+
initial: this.options?.color ?? (this.options?.brand ? "brand" : void 0)
|
|
438
|
+
});
|
|
439
|
+
neutralAxis = persistedHtmlAttributeSignal({
|
|
440
|
+
key: THEME_NEUTRAL_STORAGE_KEY,
|
|
441
|
+
attribute: "theme-neutral",
|
|
442
|
+
normalize: normalizeThemeNeutral,
|
|
443
|
+
initial: this.options?.neutral
|
|
444
|
+
});
|
|
445
|
+
color = this.colorAxis.value;
|
|
446
|
+
neutral = this.neutralAxis.value;
|
|
447
|
+
setColor(color) {
|
|
448
|
+
this.colorAxis.set(color);
|
|
449
|
+
}
|
|
450
|
+
setNeutral(neutral) {
|
|
451
|
+
this.neutralAxis.set(neutral);
|
|
452
|
+
}
|
|
453
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
454
|
+
minVersion: "12.0.0",
|
|
455
|
+
version: "22.2.4",
|
|
456
|
+
ngImport: i0,
|
|
457
|
+
type: ThemeColorService,
|
|
458
|
+
deps: [],
|
|
459
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
460
|
+
});
|
|
461
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
462
|
+
minVersion: "22.0.0",
|
|
463
|
+
version: "22.2.4",
|
|
464
|
+
ngImport: i0,
|
|
465
|
+
type: ThemeColorService
|
|
466
|
+
});
|
|
467
|
+
};
|
|
468
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
469
|
+
minVersion: "12.0.0",
|
|
470
|
+
version: "22.2.4",
|
|
471
|
+
ngImport: i0,
|
|
472
|
+
type: ThemeColorService,
|
|
473
|
+
decorators: [{ type: Service }]
|
|
474
|
+
});
|
|
475
|
+
var ThemeModeService = class ThemeModeService {
|
|
476
|
+
options = inject(THEME_OPTIONS, { optional: true });
|
|
477
|
+
systemPrefersDark = prefersDarkSignal();
|
|
478
|
+
axis = persistedHtmlAttributeSignal({
|
|
479
|
+
key: THEME_MODE_STORAGE_KEY,
|
|
480
|
+
attribute: ["theme-mode", "data-mode"],
|
|
481
|
+
normalize: normalizeThemeMode,
|
|
482
|
+
initial: this.options?.mode,
|
|
483
|
+
resolveAttributeValue: (mode) => mode === "system" ? this.systemPrefersDark() ? "dark" : "light" : mode
|
|
484
|
+
});
|
|
485
|
+
mode = this.axis.value;
|
|
486
|
+
resolvedMode = computed(() => this.axis.attributeValue(), ...ngDevMode ? [{ debugName: "resolvedMode" }] : /* istanbul ignore next */ []);
|
|
487
|
+
isDark = computed(() => this.resolvedMode() === "dark", ...ngDevMode ? [{ debugName: "isDark" }] : /* istanbul ignore next */ []);
|
|
488
|
+
setMode(mode) {
|
|
489
|
+
this.axis.set(mode);
|
|
490
|
+
}
|
|
491
|
+
toggle() {
|
|
492
|
+
this.setMode(this.isDark() ? "light" : "dark");
|
|
493
|
+
}
|
|
494
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
495
|
+
minVersion: "12.0.0",
|
|
496
|
+
version: "22.2.4",
|
|
497
|
+
ngImport: i0,
|
|
498
|
+
type: ThemeModeService,
|
|
499
|
+
deps: [],
|
|
500
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
501
|
+
});
|
|
502
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
503
|
+
minVersion: "22.0.0",
|
|
504
|
+
version: "22.2.4",
|
|
505
|
+
ngImport: i0,
|
|
506
|
+
type: ThemeModeService
|
|
507
|
+
});
|
|
508
|
+
};
|
|
509
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
510
|
+
minVersion: "12.0.0",
|
|
511
|
+
version: "22.2.4",
|
|
512
|
+
ngImport: i0,
|
|
513
|
+
type: ThemeModeService,
|
|
514
|
+
decorators: [{ type: Service }]
|
|
515
|
+
});
|
|
516
|
+
const RADIUS_PX = {
|
|
517
|
+
none: 0,
|
|
518
|
+
xs: 2,
|
|
519
|
+
sm: 4,
|
|
520
|
+
md: 6,
|
|
521
|
+
xl: 12,
|
|
522
|
+
full: 9999
|
|
523
|
+
};
|
|
524
|
+
var ThemeRadiusService = class ThemeRadiusService {
|
|
525
|
+
options = inject(THEME_OPTIONS, { optional: true });
|
|
526
|
+
axis = persistedHtmlAttributeSignal({
|
|
527
|
+
key: THEME_RADIUS_STORAGE_KEY,
|
|
528
|
+
attribute: "theme-radius",
|
|
529
|
+
normalize: normalizeThemeRadius,
|
|
530
|
+
initial: this.options?.radius
|
|
531
|
+
});
|
|
532
|
+
radius = this.axis.value;
|
|
533
|
+
radiusPx = computed(() => RADIUS_PX[this.radius()] ?? RADIUS_PX.md, ...ngDevMode ? [{ debugName: "radiusPx" }] : /* istanbul ignore next */ []);
|
|
534
|
+
setRadius(radius) {
|
|
535
|
+
this.axis.set(radius);
|
|
536
|
+
}
|
|
537
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
538
|
+
minVersion: "12.0.0",
|
|
539
|
+
version: "22.2.4",
|
|
540
|
+
ngImport: i0,
|
|
541
|
+
type: ThemeRadiusService,
|
|
542
|
+
deps: [],
|
|
543
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
544
|
+
});
|
|
545
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
546
|
+
minVersion: "22.0.0",
|
|
547
|
+
version: "22.2.4",
|
|
548
|
+
ngImport: i0,
|
|
549
|
+
type: ThemeRadiusService
|
|
550
|
+
});
|
|
551
|
+
};
|
|
552
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
553
|
+
minVersion: "12.0.0",
|
|
554
|
+
version: "22.2.4",
|
|
555
|
+
ngImport: i0,
|
|
556
|
+
type: ThemeRadiusService,
|
|
557
|
+
decorators: [{ type: Service }]
|
|
558
|
+
});
|
|
559
|
+
var ThemeSpaceService = class ThemeSpaceService {
|
|
560
|
+
options = inject(THEME_OPTIONS, { optional: true });
|
|
561
|
+
axis = persistedHtmlAttributeSignal({
|
|
562
|
+
key: THEME_SPACE_STORAGE_KEY,
|
|
563
|
+
attribute: "theme-space",
|
|
564
|
+
normalize: normalizeThemeSpace,
|
|
565
|
+
initial: this.options?.space
|
|
566
|
+
});
|
|
567
|
+
space = this.axis.value;
|
|
568
|
+
setSpace(space) {
|
|
569
|
+
this.axis.set(space);
|
|
570
|
+
}
|
|
571
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
572
|
+
minVersion: "12.0.0",
|
|
573
|
+
version: "22.2.4",
|
|
574
|
+
ngImport: i0,
|
|
575
|
+
type: ThemeSpaceService,
|
|
576
|
+
deps: [],
|
|
577
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
578
|
+
});
|
|
579
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
580
|
+
minVersion: "22.0.0",
|
|
581
|
+
version: "22.2.4",
|
|
582
|
+
ngImport: i0,
|
|
583
|
+
type: ThemeSpaceService
|
|
584
|
+
});
|
|
585
|
+
};
|
|
586
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
587
|
+
minVersion: "12.0.0",
|
|
588
|
+
version: "22.2.4",
|
|
589
|
+
ngImport: i0,
|
|
590
|
+
type: ThemeSpaceService,
|
|
591
|
+
decorators: [{ type: Service }]
|
|
592
|
+
});
|
|
593
|
+
function provideUiTheme(options = {}) {
|
|
594
|
+
return makeEnvironmentProviders([{
|
|
595
|
+
provide: THEME_OPTIONS,
|
|
596
|
+
useValue: options
|
|
597
|
+
}, provideEnvironmentInitializer(() => {
|
|
598
|
+
inject(ThemeModeService);
|
|
599
|
+
inject(ThemeColorService);
|
|
600
|
+
inject(ThemeBrandService);
|
|
601
|
+
inject(ThemeRadiusService);
|
|
602
|
+
inject(ThemeSpaceService);
|
|
603
|
+
})]);
|
|
604
|
+
}
|
|
605
|
+
export { DEFAULT_THEME_COLOR, DEFAULT_THEME_MODE, DEFAULT_THEME_NEUTRAL, DEFAULT_THEME_RADIUS, DEFAULT_THEME_SPACE, ON_FILL_INK, RESOLVED_THEME_MODES, THEME_BRAND_STORAGE_KEY, THEME_COLORS, THEME_COLOR_STORAGE_KEY, THEME_MODES, THEME_MODE_STORAGE_KEY, THEME_NEUTRALS, THEME_NEUTRAL_STORAGE_KEY, THEME_OPTIONS, THEME_RADII, THEME_RADIUS_STORAGE_KEY, THEME_SPACES, THEME_SPACE_STORAGE_KEY, ThemeBrandService, ThemeColorService, ThemeModeService, ThemeRadiusService, ThemeSpaceService, foregroundFor, htmlAttributeEffect, htmlStylePropertyEffect, isResolvedThemeMode, isThemeColor, isThemeMode, isThemeNeutral, isThemeRadius, isThemeSpace, normalizeThemeColor, normalizeThemeMode, normalizeThemeNeutral, normalizeThemeRadius, normalizeThemeSpace, persistedHtmlAttributeSignal, persistedSignal, prefersDarkSignal, provideUiTheme };
|
|
File without changes
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
8
|
-
//# sourceMappingURL=edsis-angular.mjs.map
|
|
1
|
+
export * from "@edsis/angular/chart";
|
|
2
|
+
export * from "@edsis/angular/component";
|
|
3
|
+
export * from "@edsis/angular/navigation";
|
|
4
|
+
export * from "@edsis/angular/sdk";
|
|
5
|
+
export * from "@edsis/angular/theme";
|