@africanies/angular-web-sdk 0.1.11 → 0.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/.nx/cache/{13466509747676776487 → 13293303228070520113}/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +66 -1
- package/.nx/cache/13293303228070520113/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -0
- package/.nx/cache/{13466509747676776487 → 13293303228070520113}/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +6 -1
- package/.nx/cache/{6673686859704879504 → 13387631073062967069}/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +31 -13
- package/.nx/cache/13387631073062967069/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
- package/.nx/cache/{6673686859704879504 → 13387631073062967069}/dist/libs/africanies-theme/tailwind-preset.cjs +85 -17
- package/.nx/cache/{6673686859704879504 → 13387631073062967069}/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +7 -3
- package/.nx/cache/16704640000606796352/dist/libs/africanies-storage/README.md +31 -0
- package/.nx/cache/16704640000606796352/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs +249 -0
- package/.nx/cache/16704640000606796352/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs.map +1 -0
- package/.nx/cache/16704640000606796352/dist/libs/africanies-storage/package.json +26 -0
- package/.nx/cache/16704640000606796352/dist/libs/africanies-storage/types/africanies-africanies-storage.d.ts +210 -0
- package/.nx/cache/{14876618240301288353 → 2427575433215940812}/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +2998 -1122
- package/.nx/cache/2427575433215940812/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
- package/.nx/cache/{14995846848874973576 → 2427575433215940812}/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +450 -140
- package/.nx/cache/{6664915487114632770 → 7730350229628359718}/dist/libs/africanies-icons/assets/icons.sprite.svg +7 -0
- package/.nx/cache/{6664915487114632770 → 7730350229628359718}/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs +7 -0
- package/.nx/cache/7730350229628359718/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs.map +1 -0
- package/.nx/cache/{6664915487114632770 → 7730350229628359718}/dist/libs/africanies-icons/types/africanies-africanies-icons.d.ts +2 -2
- package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +2572 -962
- package/.nx/cache/7821397806208783174/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
- package/.nx/cache/{14876618240301288353 → 7821397806208783174}/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +460 -147
- package/.nx/cache/run.json +35 -35
- package/.nx/cache/terminalOutputs/10603154579345867998 +397 -0
- package/.nx/cache/terminalOutputs/12354163057083828162 +80 -0
- package/.nx/cache/terminalOutputs/{9040451482998546630 → 13293303228070520113} +1 -1
- package/.nx/cache/terminalOutputs/{6673686859704879504 → 13387631073062967069} +1 -1
- package/.nx/cache/terminalOutputs/{14061940909886036014 → 14876351543379349919} +46 -43
- package/.nx/cache/terminalOutputs/15336883221450327589 +21 -0
- package/.nx/cache/terminalOutputs/16208231681037145050 +87 -0
- package/.nx/cache/terminalOutputs/{13466509747676776487 → 16704640000606796352} +6 -6
- package/.nx/cache/terminalOutputs/1811006905937373707 +74 -0
- package/.nx/cache/terminalOutputs/2005781115771702035 +8 -0
- package/.nx/cache/terminalOutputs/2360743690449633551 +21 -0
- package/.nx/cache/terminalOutputs/{14876618240301288353 → 2427575433215940812} +2 -2
- package/.nx/cache/terminalOutputs/2981230413857865352 +8 -0
- package/.nx/cache/terminalOutputs/3243550283886864639 +8 -0
- package/.nx/cache/terminalOutputs/3380188914363501109 +231 -0
- package/.nx/cache/terminalOutputs/3699068646900552690 +8 -0
- package/.nx/cache/terminalOutputs/5175669339257931410 +8 -0
- package/.nx/cache/terminalOutputs/6040230831125637867 +8 -0
- package/.nx/cache/terminalOutputs/7730350229628359718 +21 -0
- package/.nx/cache/terminalOutputs/{14995846848874973576 → 7821397806208783174} +2 -2
- package/.nx/cache/terminalOutputs/8098730470212963224 +87 -0
- package/.nx/cache/terminalOutputs/8928690901537686687 +21 -0
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
- package/.nx/workspace-data/d/daemon.log +4176 -0
- package/.nx/workspace-data/d/server-process.json +2 -2
- package/.nx/workspace-data/file-map.json +2995 -2989
- package/.nx/workspace-data/nx_files.nxt +0 -0
- package/.nx/workspace-data/project-graph.json +2 -2
- package/apps/playground/src/app/pages/forms-page.ts +70 -14
- package/apps/playground/src/app/snippets/forms.snippets.ts +41 -6
- package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +60 -0
- package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -1
- package/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs +6 -0
- package/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs.map +1 -1
- package/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs +6 -0
- package/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs.map +1 -1
- package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +6 -0
- package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -1
- package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +1323 -85
- package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
- package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +201 -15
- package/libs/africanies-core/src/lib/auth/auth-token.service.ts +3 -0
- package/libs/africanies-core/src/lib/auth/auth.service.ts +3 -0
- package/libs/africanies-core/src/lib/country/country.service.ts +3 -0
- package/libs/africanies-core/src/lib/currency/currency.service.ts +3 -0
- package/libs/africanies-core/src/lib/document/document.service.ts +3 -0
- package/libs/africanies-core/src/lib/file/file.service.ts +3 -0
- package/libs/africanies-core/src/lib/filters/filter-options.resolver.ts +3 -0
- package/libs/africanies-core/src/lib/http/api-client.ts +3 -0
- package/libs/africanies-core/src/lib/mode/mode-config.service.ts +3 -0
- package/libs/africanies-core/src/lib/notification/notification.service.ts +3 -0
- package/libs/africanies-core/src/lib/overlay/route-overlay.service.ts +3 -0
- package/libs/africanies-core/src/lib/payment-method/payment-method.service.ts +3 -0
- package/libs/africanies-core/src/lib/plan/plan.service.ts +3 -0
- package/libs/africanies-core/src/lib/product/product.service.ts +3 -0
- package/libs/africanies-core/src/lib/service/service.service.ts +3 -0
- package/libs/africanies-core/src/lib/shipment-method/shipment-method.service.ts +3 -0
- package/libs/africanies-core/src/lib/shipping/shipping-mode.service.ts +3 -0
- package/libs/africanies-core/src/lib/user/user.service.ts +3 -0
- package/libs/africanies-core/src/lib/warehouse/warehouse.service.ts +3 -0
- package/libs/africanies-core/src/lib/zone/zone.service.ts +3 -0
- package/libs/africanies-icons/src/lib/africanies-icon.component.ts +3 -0
- package/libs/africanies-icons/src/lib/icon-registry.service.ts +3 -0
- package/libs/africanies-storage/src/lib/local-storage.service.ts +3 -0
- package/libs/africanies-storage/src/lib/session-storage.service.ts +3 -0
- package/libs/africanies-theme/src/lib/mode-color.service.ts +3 -0
- package/libs/africanies-theme/src/lib/theme.service.ts +3 -0
- package/libs/africanies-ui/src/index.ts +18 -0
- package/libs/africanies-ui/src/lib/accordion/accordion.component.ts +3 -0
- package/libs/africanies-ui/src/lib/action-menu/action-menu-trigger.directive.ts +3 -0
- package/libs/africanies-ui/src/lib/action-menu/action-menu.component.ts +3 -0
- package/libs/africanies-ui/src/lib/alert/alert.component.ts +3 -0
- package/libs/africanies-ui/src/lib/avatar/avatar-menu.component.ts +3 -0
- package/libs/africanies-ui/src/lib/avatar/avatar.component.ts +3 -0
- package/libs/africanies-ui/src/lib/brand/brand-logo.component.ts +3 -0
- package/libs/africanies-ui/src/lib/button/button.component.ts +3 -0
- package/libs/africanies-ui/src/lib/carrier/carrier-logo.component.ts +3 -0
- package/libs/africanies-ui/src/lib/chip/chip.component.ts +3 -0
- package/libs/africanies-ui/src/lib/content-stack/content-stack.component.ts +3 -0
- package/libs/africanies-ui/src/lib/copy-button/copy-button.component.ts +3 -0
- package/libs/africanies-ui/src/lib/feedback/async-state.component.ts +3 -0
- package/libs/africanies-ui/src/lib/feedback/empty-state.component.ts +3 -0
- package/libs/africanies-ui/src/lib/feedback/error-indicator.component.ts +3 -0
- package/libs/africanies-ui/src/lib/feedback/error-state.component.ts +3 -0
- package/libs/africanies-ui/src/lib/feedback/loading-state.component.ts +3 -0
- package/libs/africanies-ui/src/lib/filters/filter-drawer.panel.ts +3 -0
- package/libs/africanies-ui/src/lib/filters/filter-drawer.service.ts +3 -0
- package/libs/africanies-ui/src/lib/filters/filter-query.service.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/address-input/address-input.component.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/address-input/google-places.service.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/checkbox/checkbox.component.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/date-picker/date-picker.component.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/file-upload/camera-capture.dialog.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/file-upload/file-preview.dialog.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/file-upload/file-upload.component.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/index.ts +20 -0
- package/libs/africanies-ui/src/lib/forms/number-input/number-input.component.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/otp-input/otp-input.component.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/phone-input/index.ts +21 -0
- package/libs/africanies-ui/src/lib/forms/phone-input/phone-codes.ts +264 -0
- package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.component.ts +480 -0
- package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.types.ts +35 -0
- package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.utils.spec.ts +81 -0
- package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.utils.ts +275 -0
- package/libs/africanies-ui/src/lib/forms/radio/radio.component.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/search-combobox/search-combobox.component.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/select/select.component.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/text-input/text-input.component.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/textarea/textarea.component.ts +3 -0
- package/libs/africanies-ui/src/lib/forms/toggle/toggle.component.ts +3 -0
- package/libs/africanies-ui/src/lib/image/image.component.ts +3 -0
- package/libs/africanies-ui/src/lib/info-popover/info-popover-content.directive.ts +3 -0
- package/libs/africanies-ui/src/lib/info-popover/info-popover-trigger.directive.ts +3 -0
- package/libs/africanies-ui/src/lib/info-popover/info-popover.component.ts +3 -0
- package/libs/africanies-ui/src/lib/layout/app-shell-content-header.component.ts +3 -0
- package/libs/africanies-ui/src/lib/layout/app-shell-header-slot.directive.ts +3 -0
- package/libs/africanies-ui/src/lib/layout/app-shell-header.component.ts +9 -0
- package/libs/africanies-ui/src/lib/layout/app-shell.component.ts +3 -0
- package/libs/africanies-ui/src/lib/layout/header-weather.spec.ts +62 -94
- package/libs/africanies-ui/src/lib/layout/header-weather.ts +54 -61
- package/libs/africanies-ui/src/lib/layout/page-header.component.ts +3 -0
- package/libs/africanies-ui/src/lib/modules/africanies-actions.module.ts +3 -0
- package/libs/africanies-ui/src/lib/modules/africanies-feedback.module.ts +3 -0
- package/libs/africanies-ui/src/lib/modules/africanies-forms.module.ts +5 -0
- package/libs/africanies-ui/src/lib/modules/africanies-info-popover.module.ts +3 -0
- package/libs/africanies-ui/src/lib/modules/africanies-navigation.module.ts +3 -0
- package/libs/africanies-ui/src/lib/modules/africanies-stepper.module.ts +3 -0
- package/libs/africanies-ui/src/lib/modules/africanies-table.module.ts +3 -0
- package/libs/africanies-ui/src/lib/modules/africanies-tooltip.module.ts +3 -0
- package/libs/africanies-ui/src/lib/navigation/breadcrumb/breadcrumb.component.ts +3 -0
- package/libs/africanies-ui/src/lib/navigation/segment/segment.component.ts +5 -1
- package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts +3 -0
- package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.ts +3 -0
- package/libs/africanies-ui/src/lib/navigation/tabs/tab-def.directive.ts +3 -0
- package/libs/africanies-ui/src/lib/navigation/tabs/tabs.component.ts +3 -0
- package/libs/africanies-ui/src/lib/notifications/notification-drawer.panel.ts +3 -0
- package/libs/africanies-ui/src/lib/notifications/notification-drawer.service.ts +3 -0
- package/libs/africanies-ui/src/lib/overlay/confirm-dialog.component.ts +3 -0
- package/libs/africanies-ui/src/lib/overlay/confirm.service.ts +3 -0
- package/libs/africanies-ui/src/lib/overlay/drawer.service.ts +3 -0
- package/libs/africanies-ui/src/lib/overlay/modal.service.ts +3 -0
- package/libs/africanies-ui/src/lib/overlay/overlay-frame.component.ts +9 -0
- package/libs/africanies-ui/src/lib/pagination/pagination.component.ts +3 -0
- package/libs/africanies-ui/src/lib/stepper/step-def.directive.ts +3 -0
- package/libs/africanies-ui/src/lib/stepper/stepper.component.ts +3 -0
- package/libs/africanies-ui/src/lib/table/cell-def.directive.ts +3 -0
- package/libs/africanies-ui/src/lib/table/header-cell-def.directive.ts +3 -0
- package/libs/africanies-ui/src/lib/table/row-detail-def.directive.ts +3 -0
- package/libs/africanies-ui/src/lib/table/table.component.ts +3 -0
- package/libs/africanies-ui/src/lib/toast/toast-host.component.ts +4 -1
- package/libs/africanies-ui/src/lib/toast/toast-item.component.ts +3 -0
- package/libs/africanies-ui/src/lib/toast/toast.service.ts +3 -0
- package/libs/africanies-ui/src/lib/tooltip/tooltip-trigger.directive.ts +3 -0
- package/libs/africanies-ui/src/lib/tooltip/tooltip.component.ts +3 -0
- package/package.json +1 -1
- package/.nx/cache/13466509747676776487/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +0 -1
- package/.nx/cache/14416694322692463866/dist/libs/africanies-models/README.md +0 -60
- package/.nx/cache/14416694322692463866/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs +0 -599
- package/.nx/cache/14416694322692463866/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs.map +0 -1
- package/.nx/cache/14416694322692463866/dist/libs/africanies-models/package.json +0 -23
- package/.nx/cache/14416694322692463866/dist/libs/africanies-models/types/africanies-africanies-models.d.ts +0 -1452
- package/.nx/cache/14876618240301288353/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
- package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
- package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +0 -221
- package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
- package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/tailwind-preset.cjs +0 -253
- package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +0 -166
- package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs.map +0 -1
- package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/README.md +0 -46
- package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
- package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/package.json +0 -35
- package/.nx/cache/9040451482998546630/dist/libs/africanies-core/README.md +0 -85
- package/.nx/cache/9040451482998546630/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +0 -4511
- package/.nx/cache/9040451482998546630/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +0 -1
- package/.nx/cache/9040451482998546630/dist/libs/africanies-core/package.json +0 -31
- package/.nx/cache/9040451482998546630/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +0 -2741
- package/.nx/cache/terminalOutputs/13555699813138069787 +0 -6
- package/.nx/cache/terminalOutputs/14416694322692463866 +0 -108
- package/.nx/cache/terminalOutputs/1446890025183346611 +0 -32
- package/.nx/cache/terminalOutputs/17394769338046050914 +0 -8
- package/.nx/cache/terminalOutputs/17626862048742598274 +0 -21
- package/.nx/cache/terminalOutputs/6337357866566791975 +0 -6
- package/.nx/cache/terminalOutputs/6664915487114632770 +0 -44
- package/.nx/cache/terminalOutputs/783228502946611950 +0 -19
- package/.nx/cache/terminalOutputs/7978448102466861029 +0 -32
- /package/.nx/cache/{13466509747676776487 → 13293303228070520113}/dist/libs/africanies-core/README.md +0 -0
- /package/.nx/cache/{13466509747676776487 → 13293303228070520113}/dist/libs/africanies-core/package.json +0 -0
- /package/.nx/cache/{17626862048742598274 → 13387631073062967069}/dist/libs/africanies-theme/README.md +0 -0
- /package/.nx/cache/{17626862048742598274 → 13387631073062967069}/dist/libs/africanies-theme/package.json +0 -0
- /package/.nx/cache/{14876618240301288353 → 2427575433215940812}/dist/libs/africanies-ui/README.md +0 -0
- /package/.nx/cache/{14876618240301288353 → 2427575433215940812}/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
- /package/.nx/cache/{14876618240301288353 → 2427575433215940812}/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
- /package/.nx/cache/{14876618240301288353 → 2427575433215940812}/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -0
- /package/.nx/cache/{14876618240301288353 → 2427575433215940812}/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -0
- /package/.nx/cache/{14876618240301288353 → 2427575433215940812}/dist/libs/africanies-ui/package.json +0 -0
- /package/.nx/cache/{6664915487114632770 → 7730350229628359718}/dist/libs/africanies-icons/README.md +0 -0
- /package/.nx/cache/{6664915487114632770 → 7730350229628359718}/dist/libs/africanies-icons/package.json +0 -0
- /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/README.md +0 -0
- /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
- /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
- /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -0
- /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -0
- /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/package.json +0 -0
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, computed, Injectable, signal } from '@angular/core';
|
|
3
|
-
import { ShippingModeService } from '@africanies/africanies-core';
|
|
4
|
-
import { DOCUMENT } from '@angular/common';
|
|
5
|
-
import { STORAGE_TOKEN, AFRICANIES_THEME_KEY } from '@africanies/africanies-storage';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Tailwind safelist side-effect for shipping-mode color utilities.
|
|
9
|
-
*
|
|
10
|
-
* WHY this file exists: JIT/content scanning only keeps class names that appear
|
|
11
|
-
* as *literal strings* in scanned sources. {@link ModeColorService} already
|
|
12
|
-
* returns these literals, but keeping a dedicated comment list makes the
|
|
13
|
-
* contract obvious for consumers who configure `safelist` or purge plugins.
|
|
14
|
-
*
|
|
15
|
-
* Do not rename these strings without updating ModeColorService and THEME.md.
|
|
16
|
-
*
|
|
17
|
-
* SFN (export / green):
|
|
18
|
-
* text-export bg-export bg-export-subtle bg-export-light border-export
|
|
19
|
-
* hover:bg-export-light hover:bg-export-subtle dark:bg-export/15 dark:hover:bg-export/15
|
|
20
|
-
* dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]
|
|
21
|
-
*
|
|
22
|
-
* STN (import / orange):
|
|
23
|
-
* text-import bg-import bg-import-subtle bg-import-light border-import
|
|
24
|
-
* hover:bg-import-light hover:bg-import-subtle dark:bg-import/15 dark:hover:bg-import/15
|
|
25
|
-
* dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]
|
|
26
|
-
*/
|
|
27
|
-
const MODE_COLOR_SAFELIST = [
|
|
28
|
-
'text-export',
|
|
29
|
-
'bg-export',
|
|
30
|
-
'bg-export-subtle',
|
|
31
|
-
'bg-export-light',
|
|
32
|
-
'border-export',
|
|
33
|
-
'hover:bg-export-light',
|
|
34
|
-
'hover:bg-export-subtle',
|
|
35
|
-
'dark:bg-export/15',
|
|
36
|
-
'dark:hover:bg-export/15',
|
|
37
|
-
'dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]',
|
|
38
|
-
'text-import',
|
|
39
|
-
'bg-import',
|
|
40
|
-
'bg-import-subtle',
|
|
41
|
-
'bg-import-light',
|
|
42
|
-
'border-import',
|
|
43
|
-
'hover:bg-import-light',
|
|
44
|
-
'hover:bg-import-subtle',
|
|
45
|
-
'dark:bg-import/15',
|
|
46
|
-
'dark:hover:bg-import/15',
|
|
47
|
-
'dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]',
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Maps {@link ShippingModeService} to mode-accent Tailwind classes.
|
|
52
|
-
*
|
|
53
|
-
* - **SFN** → export green is primary
|
|
54
|
-
* - **STN** → import orange is primary
|
|
55
|
-
*
|
|
56
|
-
* WHY literal class strings: Tailwind's scanner cannot see dynamically built
|
|
57
|
-
* names like `` `text-${token}` ``. Returning full literals (`text-export`, …)
|
|
58
|
-
* keeps utilities in the compiled CSS. See {@link MODE_COLOR_SAFELIST}.
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```html
|
|
62
|
-
* @let colors = modeColor.classes();
|
|
63
|
-
* <button type="button" [class]="colors.primary">Save</button>
|
|
64
|
-
* <span [class]="colors.text">Mode accent</span>
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
class ModeColorService {
|
|
68
|
-
shippingMode = inject(ShippingModeService);
|
|
69
|
-
/**
|
|
70
|
-
* Mode-dependent utility classes. Recomputes when shipping mode changes.
|
|
71
|
-
*/
|
|
72
|
-
classes = computed(() => {
|
|
73
|
-
// Literal strings required for Tailwind content detection — do not interpolate.
|
|
74
|
-
if (this.shippingMode.mode() === 'sfn') {
|
|
75
|
-
return {
|
|
76
|
-
text: 'text-export',
|
|
77
|
-
bg: 'bg-export',
|
|
78
|
-
bgSubtle: 'bg-export-subtle',
|
|
79
|
-
border: 'border-export',
|
|
80
|
-
primary: 'bg-export text-white border-transparent hover:bg-export-light',
|
|
81
|
-
ghostPrimary: 'bg-transparent text-export border-transparent hover:bg-export-subtle dark:hover:bg-export/15',
|
|
82
|
-
soft: 'bg-export-subtle dark:bg-export/15',
|
|
83
|
-
softSolid: 'bg-export-subtle dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]',
|
|
84
|
-
softHover: 'hover:bg-export-subtle dark:hover:bg-export/15',
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
text: 'text-import',
|
|
89
|
-
bg: 'bg-import',
|
|
90
|
-
bgSubtle: 'bg-import-subtle',
|
|
91
|
-
border: 'border-import',
|
|
92
|
-
primary: 'bg-import text-white border-transparent hover:bg-import-light',
|
|
93
|
-
ghostPrimary: 'bg-transparent text-import border-transparent hover:bg-import-subtle dark:hover:bg-import/15',
|
|
94
|
-
soft: 'bg-import-subtle dark:bg-import/15',
|
|
95
|
-
softSolid: 'bg-import-subtle dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]',
|
|
96
|
-
softHover: 'hover:bg-import-subtle dark:hover:bg-import/15',
|
|
97
|
-
};
|
|
98
|
-
}, /* @ts-ignore */
|
|
99
|
-
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
100
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ModeColorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
101
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ModeColorService, providedIn: 'root' });
|
|
102
|
-
}
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ModeColorService, decorators: [{
|
|
104
|
-
type: Injectable,
|
|
105
|
-
args: [{ providedIn: 'root' }]
|
|
106
|
-
}] });
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Application light/dark theme preference.
|
|
110
|
-
*
|
|
111
|
-
* WHY signals (not BehaviorSubject): theme is synchronous UI state read from
|
|
112
|
-
* templates and other services; a signal avoids RxJS subscription boilerplate
|
|
113
|
-
* and matches Angular 22 change detection. Persistence goes through
|
|
114
|
-
* {@link STORAGE_TOKEN} so tests can swap storage without touching `localStorage`.
|
|
115
|
-
*
|
|
116
|
-
* Applies the Tailwind `darkMode: 'class'` contract by toggling `dark` on
|
|
117
|
-
* `document.documentElement`, and sets `color-scheme` so native UI (date
|
|
118
|
-
* pickers, scrollbars, form controls) matches the app theme — class-based
|
|
119
|
-
* dark mode alone does not restyle browser chrome.
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* ```ts
|
|
123
|
-
* // app.config.ts
|
|
124
|
-
* import { inject, provideAppInitializer } from '@angular/core';
|
|
125
|
-
* import { ThemeService } from '@africanies/africanies-theme';
|
|
126
|
-
*
|
|
127
|
-
* export const appConfig = {
|
|
128
|
-
* providers: [
|
|
129
|
-
* provideAppInitializer(() => {
|
|
130
|
-
* inject(ThemeService); // applies stored / system theme once
|
|
131
|
-
* }),
|
|
132
|
-
* ],
|
|
133
|
-
* };
|
|
134
|
-
*
|
|
135
|
-
* // In a component
|
|
136
|
-
* const theme = inject(ThemeService);
|
|
137
|
-
* theme.toggle();
|
|
138
|
-
* theme.setTheme('dark');
|
|
139
|
-
* const current = theme.theme(); // 'light' | 'dark'
|
|
140
|
-
* ```
|
|
141
|
-
*/
|
|
142
|
-
class ThemeService {
|
|
143
|
-
storage = inject(STORAGE_TOKEN);
|
|
144
|
-
document = inject(DOCUMENT);
|
|
145
|
-
/**
|
|
146
|
-
* Current theme. Prefer reading via `theme()` in templates / computed values
|
|
147
|
-
* rather than caching the string, so dark-class consumers stay in sync.
|
|
148
|
-
*/
|
|
149
|
-
theme = signal(this.resolveInitialTheme(), /* @ts-ignore */
|
|
150
|
-
...(ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []));
|
|
151
|
-
constructor() {
|
|
152
|
-
this.applyToDocument(this.theme());
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Sets and persists the theme, updating the `dark` class and `color-scheme`
|
|
156
|
-
* on `<html>`.
|
|
157
|
-
*
|
|
158
|
-
* @param theme - Absolute preference to store.
|
|
159
|
-
*/
|
|
160
|
-
setTheme(theme) {
|
|
161
|
-
this.theme.set(theme);
|
|
162
|
-
this.applyToDocument(theme);
|
|
163
|
-
try {
|
|
164
|
-
this.storage.set(AFRICANIES_THEME_KEY, theme);
|
|
165
|
-
}
|
|
166
|
-
catch {
|
|
167
|
-
// Persistence failure must not block the in-session visual toggle —
|
|
168
|
-
// private browsing / quota issues are transient for theme preference.
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Flips between light and dark.
|
|
173
|
-
*
|
|
174
|
-
* @returns The theme after the toggle.
|
|
175
|
-
*/
|
|
176
|
-
toggle() {
|
|
177
|
-
const next = this.theme() === 'light' ? 'dark' : 'light';
|
|
178
|
-
this.setTheme(next);
|
|
179
|
-
return next;
|
|
180
|
-
}
|
|
181
|
-
resolveInitialTheme() {
|
|
182
|
-
try {
|
|
183
|
-
const stored = this.storage.get(AFRICANIES_THEME_KEY);
|
|
184
|
-
if (stored === 'light' || stored === 'dark') {
|
|
185
|
-
return stored;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
catch {
|
|
189
|
-
// Fall through to system preference when storage is unavailable.
|
|
190
|
-
}
|
|
191
|
-
return this.prefersDark() ? 'dark' : 'light';
|
|
192
|
-
}
|
|
193
|
-
prefersDark() {
|
|
194
|
-
const win = this.document.defaultView;
|
|
195
|
-
return !!win?.matchMedia?.('(prefers-color-scheme: dark)').matches;
|
|
196
|
-
}
|
|
197
|
-
applyToDocument(theme) {
|
|
198
|
-
const root = this.document.documentElement;
|
|
199
|
-
if (theme === 'dark') {
|
|
200
|
-
root.classList.add('dark');
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
root.classList.remove('dark');
|
|
204
|
-
}
|
|
205
|
-
// Native date/time pickers follow `color-scheme`, not Tailwind's `dark` class.
|
|
206
|
-
root.style.colorScheme = theme;
|
|
207
|
-
}
|
|
208
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
209
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ThemeService, providedIn: 'root' });
|
|
210
|
-
}
|
|
211
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ThemeService, decorators: [{
|
|
212
|
-
type: Injectable,
|
|
213
|
-
args: [{ providedIn: 'root' }]
|
|
214
|
-
}], ctorParameters: () => [] });
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Generated bundle index. Do not edit.
|
|
218
|
-
*/
|
|
219
|
-
|
|
220
|
-
export { MODE_COLOR_SAFELIST, ModeColorService, ThemeService };
|
|
221
|
-
//# sourceMappingURL=africanies-africanies-theme.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"africanies-africanies-theme.mjs","sources":["../../../../libs/africanies-theme/src/lib/mode-color.safelist.ts","../../../../libs/africanies-theme/src/lib/mode-color.service.ts","../../../../libs/africanies-theme/src/lib/theme.service.ts","../../../../libs/africanies-theme/src/africanies-africanies-theme.ts"],"sourcesContent":["/**\n * Tailwind safelist side-effect for shipping-mode color utilities.\n *\n * WHY this file exists: JIT/content scanning only keeps class names that appear\n * as *literal strings* in scanned sources. {@link ModeColorService} already\n * returns these literals, but keeping a dedicated comment list makes the\n * contract obvious for consumers who configure `safelist` or purge plugins.\n *\n * Do not rename these strings without updating ModeColorService and THEME.md.\n *\n * SFN (export / green):\n * text-export bg-export bg-export-subtle bg-export-light border-export\n * hover:bg-export-light hover:bg-export-subtle dark:bg-export/15 dark:hover:bg-export/15\n * dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]\n *\n * STN (import / orange):\n * text-import bg-import bg-import-subtle bg-import-light border-import\n * hover:bg-import-light hover:bg-import-subtle dark:bg-import/15 dark:hover:bg-import/15\n * dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]\n */\nexport const MODE_COLOR_SAFELIST = [\n 'text-export',\n 'bg-export',\n 'bg-export-subtle',\n 'bg-export-light',\n 'border-export',\n 'hover:bg-export-light',\n 'hover:bg-export-subtle',\n 'dark:bg-export/15',\n 'dark:hover:bg-export/15',\n 'dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]',\n 'text-import',\n 'bg-import',\n 'bg-import-subtle',\n 'bg-import-light',\n 'border-import',\n 'hover:bg-import-light',\n 'hover:bg-import-subtle',\n 'dark:bg-import/15',\n 'dark:hover:bg-import/15',\n 'dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]',\n] as const;\n","import { computed, inject, Injectable } from '@angular/core';\n\nimport { ShippingModeService } from '@africanies/africanies-core';\n\n/**\n * Tailwind class bundle for the active shipping mode (SFN export / STN import).\n *\n * Use these for **primary** product chrome: CTAs, selected controls, progress,\n * and accent text. Semantic colors (danger / warning) stay mode-independent.\n */\nexport interface ModeColorClasses {\n /** Text color utility, e.g. `text-export`. */\n text: string;\n /** Solid background utility, e.g. `bg-export`. */\n bg: string;\n /** Soft background utility, e.g. `bg-export-subtle`. */\n bgSubtle: string;\n /** Border matching the mode accent, e.g. `border-export`. */\n border: string;\n /**\n * Filled primary CTA — `variant=\"primary\"` on buttons.\n * Includes hover utility as a literal so Tailwind keeps it.\n */\n primary: string;\n /**\n * Transparent / text-only CTA — `variant=\"ghost-primary\"` on buttons.\n * Mode accent text + soft hover fill.\n */\n ghostPrimary: string;\n /**\n * Soft highlight for selected / active rows (works in dark mode).\n * Dark uses a translucent tint — fine over solid surfaces, not for\n * sticky overlays (see {@link softSolid}).\n */\n soft: string;\n /**\n * Opaque soft fill — same tint as {@link soft}, but dark mode mixes into\n * ink so scrolled content cannot show through (sticky table headers/cells).\n */\n softSolid: string;\n /**\n * Soft hover highlight for menus and lists.\n */\n softHover: string;\n}\n\n/**\n * Maps {@link ShippingModeService} to mode-accent Tailwind classes.\n *\n * - **SFN** → export green is primary\n * - **STN** → import orange is primary\n *\n * WHY literal class strings: Tailwind's scanner cannot see dynamically built\n * names like `` `text-${token}` ``. Returning full literals (`text-export`, …)\n * keeps utilities in the compiled CSS. See {@link MODE_COLOR_SAFELIST}.\n *\n * @example\n * ```html\n * @let colors = modeColor.classes();\n * <button type=\"button\" [class]=\"colors.primary\">Save</button>\n * <span [class]=\"colors.text\">Mode accent</span>\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class ModeColorService {\n private readonly shippingMode = inject(ShippingModeService);\n\n /**\n * Mode-dependent utility classes. Recomputes when shipping mode changes.\n */\n readonly classes = computed<ModeColorClasses>(() => {\n // Literal strings required for Tailwind content detection — do not interpolate.\n if (this.shippingMode.mode() === 'sfn') {\n return {\n text: 'text-export',\n bg: 'bg-export',\n bgSubtle: 'bg-export-subtle',\n border: 'border-export',\n primary:\n 'bg-export text-white border-transparent hover:bg-export-light',\n ghostPrimary:\n 'bg-transparent text-export border-transparent hover:bg-export-subtle dark:hover:bg-export/15',\n soft: 'bg-export-subtle dark:bg-export/15',\n softSolid:\n 'bg-export-subtle dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]',\n softHover: 'hover:bg-export-subtle dark:hover:bg-export/15',\n };\n }\n return {\n text: 'text-import',\n bg: 'bg-import',\n bgSubtle: 'bg-import-subtle',\n border: 'border-import',\n primary:\n 'bg-import text-white border-transparent hover:bg-import-light',\n ghostPrimary:\n 'bg-transparent text-import border-transparent hover:bg-import-subtle dark:hover:bg-import/15',\n soft: 'bg-import-subtle dark:bg-import/15',\n softSolid:\n 'bg-import-subtle dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]',\n softHover: 'hover:bg-import-subtle dark:hover:bg-import/15',\n };\n });\n}\n","import { DOCUMENT } from '@angular/common';\nimport { inject, Injectable, signal } from '@angular/core';\n\nimport { AFRICANIES_THEME_KEY, STORAGE_TOKEN } from '@africanies/africanies-storage';\n\nimport type { Theme } from './theme.types';\n\n/**\n * Application light/dark theme preference.\n *\n * WHY signals (not BehaviorSubject): theme is synchronous UI state read from\n * templates and other services; a signal avoids RxJS subscription boilerplate\n * and matches Angular 22 change detection. Persistence goes through\n * {@link STORAGE_TOKEN} so tests can swap storage without touching `localStorage`.\n *\n * Applies the Tailwind `darkMode: 'class'` contract by toggling `dark` on\n * `document.documentElement`, and sets `color-scheme` so native UI (date\n * pickers, scrollbars, form controls) matches the app theme — class-based\n * dark mode alone does not restyle browser chrome.\n *\n * @example\n * ```ts\n * // app.config.ts\n * import { inject, provideAppInitializer } from '@angular/core';\n * import { ThemeService } from '@africanies/africanies-theme';\n *\n * export const appConfig = {\n * providers: [\n * provideAppInitializer(() => {\n * inject(ThemeService); // applies stored / system theme once\n * }),\n * ],\n * };\n *\n * // In a component\n * const theme = inject(ThemeService);\n * theme.toggle();\n * theme.setTheme('dark');\n * const current = theme.theme(); // 'light' | 'dark'\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class ThemeService {\n private readonly storage = inject(STORAGE_TOKEN);\n private readonly document = inject(DOCUMENT);\n\n /**\n * Current theme. Prefer reading via `theme()` in templates / computed values\n * rather than caching the string, so dark-class consumers stay in sync.\n */\n readonly theme = signal<Theme>(this.resolveInitialTheme());\n\n constructor() {\n this.applyToDocument(this.theme());\n }\n\n /**\n * Sets and persists the theme, updating the `dark` class and `color-scheme`\n * on `<html>`.\n *\n * @param theme - Absolute preference to store.\n */\n setTheme(theme: Theme): void {\n this.theme.set(theme);\n this.applyToDocument(theme);\n try {\n this.storage.set(AFRICANIES_THEME_KEY, theme);\n } catch {\n // Persistence failure must not block the in-session visual toggle —\n // private browsing / quota issues are transient for theme preference.\n }\n }\n\n /**\n * Flips between light and dark.\n *\n * @returns The theme after the toggle.\n */\n toggle(): Theme {\n const next: Theme = this.theme() === 'light' ? 'dark' : 'light';\n this.setTheme(next);\n return next;\n }\n\n private resolveInitialTheme(): Theme {\n try {\n const stored = this.storage.get<Theme>(AFRICANIES_THEME_KEY);\n if (stored === 'light' || stored === 'dark') {\n return stored;\n }\n } catch {\n // Fall through to system preference when storage is unavailable.\n }\n return this.prefersDark() ? 'dark' : 'light';\n }\n\n private prefersDark(): boolean {\n const win = this.document.defaultView;\n return !!win?.matchMedia?.('(prefers-color-scheme: dark)').matches;\n }\n\n private applyToDocument(theme: Theme): void {\n const root = this.document.documentElement;\n if (theme === 'dark') {\n root.classList.add('dark');\n } else {\n root.classList.remove('dark');\n }\n // Native date/time pickers follow `color-scheme`, not Tailwind's `dark` class.\n root.style.colorScheme = theme;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Tailwind preset for AFRICANIES product UIs.
|
|
3
|
-
*
|
|
4
|
-
* WHY a preset (not only CSS variables): consuming apps and `@africanies/africanies-ui`
|
|
5
|
-
* already use Tailwind utility classes. Shipping the palette as a preset keeps
|
|
6
|
-
* class names (`text-export`, `bg-import-subtle`, …) consistent and scannable
|
|
7
|
-
* by Tailwind's content detection across packages.
|
|
8
|
-
*
|
|
9
|
-
* Shipped as `.cjs` because ng-packagr publishes this package with
|
|
10
|
-
* `"type": "module"` — a `.js` CommonJS file would break
|
|
11
|
-
* `require('@africanies/africanies-theme/tailwind-preset')`.
|
|
12
|
-
*
|
|
13
|
-
* Consumer setup (see THEME.md):
|
|
14
|
-
* presets: [require('@africanies/africanies-theme/tailwind-preset')]
|
|
15
|
-
* content: app sources + ./node_modules/@africanies/africanies-ui (js/mjs)
|
|
16
|
-
*
|
|
17
|
-
* Also injects base autofill overrides so Chrome/Safari do not paint a
|
|
18
|
-
* yellow/blue fill over AFRICANIES form shells (`bg-white` / `dark:bg-ink-950`),
|
|
19
|
-
* and a pointer cursor on interactive controls.
|
|
20
|
-
*
|
|
21
|
-
* @type {import('tailwindcss').Config}
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Pointer cursor on clickable controls.
|
|
26
|
-
*
|
|
27
|
-
* WHY base CSS (not only `cursor-pointer` utilities): browsers use
|
|
28
|
-
* `cursor: default` on `button`, and Tailwind v4 content detection often
|
|
29
|
-
* skips pnpm-linked `@africanies/africanies-ui` bundles so the utility is never emitted.
|
|
30
|
-
*
|
|
31
|
-
* @param {import('tailwindcss/types/config').PluginAPI} api
|
|
32
|
-
*/
|
|
33
|
-
function africaniesInteractiveCursorPlugin({ addBase }) {
|
|
34
|
-
addBase({
|
|
35
|
-
[[
|
|
36
|
-
'a[href]',
|
|
37
|
-
'button:not(:disabled):not([aria-disabled="true"])',
|
|
38
|
-
'summary',
|
|
39
|
-
'label[for]',
|
|
40
|
-
'select:not(:disabled)',
|
|
41
|
-
'input[type="button"]:not(:disabled)',
|
|
42
|
-
'input[type="submit"]:not(:disabled)',
|
|
43
|
-
'input[type="reset"]:not(:disabled)',
|
|
44
|
-
'input[type="checkbox"]:not(:disabled)',
|
|
45
|
-
'input[type="radio"]:not(:disabled)',
|
|
46
|
-
'input[type="file"]:not(:disabled)',
|
|
47
|
-
'[role="button"]:not([aria-disabled="true"])',
|
|
48
|
-
'[role="link"]:not([aria-disabled="true"])',
|
|
49
|
-
'[role="menuitem"]:not([aria-disabled="true"])',
|
|
50
|
-
'[role="option"]:not([aria-disabled="true"])',
|
|
51
|
-
'[role="tab"]:not([aria-disabled="true"])',
|
|
52
|
-
'[role="checkbox"]:not([aria-disabled="true"])',
|
|
53
|
-
'[role="radio"]:not([aria-disabled="true"])',
|
|
54
|
-
'[role="switch"]:not([aria-disabled="true"])',
|
|
55
|
-
].join(', ')]: {
|
|
56
|
-
cursor: 'pointer',
|
|
57
|
-
},
|
|
58
|
-
':disabled, [aria-disabled="true"]': {
|
|
59
|
-
cursor: 'not-allowed',
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Neutralize browser autofill chrome so fields keep AFRICANIES tokens.
|
|
66
|
-
*
|
|
67
|
-
* WHY inset box-shadow (not `background-color`): WebKit ignores background
|
|
68
|
-
* on `:-webkit-autofill`. A large inset shadow matches the field shell
|
|
69
|
-
* (`white` / `ink-950`) and `-webkit-text-fill-color` keeps body text on
|
|
70
|
-
* `ink` / white. `.dark` matches `ThemeService` (`class` on `<html>`).
|
|
71
|
-
*
|
|
72
|
-
* WHY one selector per `addBase` key: joining autofill selectors with commas
|
|
73
|
-
* under a single `.dark ${list}` key only scopes the first selector — the rest
|
|
74
|
-
* leak into light mode. WHY no `color` in the long transition: delaying color
|
|
75
|
-
* freezes text when the user toggles light/dark.
|
|
76
|
-
*
|
|
77
|
-
* @param {import('tailwindcss/types/config').PluginAPI} api
|
|
78
|
-
*/
|
|
79
|
-
function africaniesAutofillPlugin({ addBase }) {
|
|
80
|
-
const autofillSelectors = [
|
|
81
|
-
'input:-webkit-autofill',
|
|
82
|
-
'input:-webkit-autofill:hover',
|
|
83
|
-
'input:-webkit-autofill:focus',
|
|
84
|
-
'input:-webkit-autofill:active',
|
|
85
|
-
'textarea:-webkit-autofill',
|
|
86
|
-
'textarea:-webkit-autofill:hover',
|
|
87
|
-
'textarea:-webkit-autofill:focus',
|
|
88
|
-
'textarea:-webkit-autofill:active',
|
|
89
|
-
];
|
|
90
|
-
|
|
91
|
-
/** @type {Record<string, Record<string, string>>} */
|
|
92
|
-
const rules = {};
|
|
93
|
-
for (const selector of autofillSelectors) {
|
|
94
|
-
rules[selector] = {
|
|
95
|
-
WebkitTextFillColor: '#212529',
|
|
96
|
-
caretColor: '#212529',
|
|
97
|
-
boxShadow: '0 0 0 1000px #ffffff inset',
|
|
98
|
-
transition: 'background-color 99999s ease-in-out 0s',
|
|
99
|
-
};
|
|
100
|
-
rules[`.dark ${selector}`] = {
|
|
101
|
-
WebkitTextFillColor: '#ffffff',
|
|
102
|
-
caretColor: '#ffffff',
|
|
103
|
-
boxShadow: '0 0 0 1000px #272729 inset',
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
addBase(rules);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Always emit spinner motion.
|
|
111
|
-
*
|
|
112
|
-
* WHY: Tailwind v4 content detection often skips pnpm-linked `@africanies/africanies-ui`
|
|
113
|
-
* bundles, so `animate-spin` on button loading never lands in consumer CSS.
|
|
114
|
-
*
|
|
115
|
-
* @param {import('tailwindcss/types/config').PluginAPI} api
|
|
116
|
-
*/
|
|
117
|
-
function africaniesSpinPlugin({ addBase }) {
|
|
118
|
-
addBase({
|
|
119
|
-
'@keyframes africanies-spin': {
|
|
120
|
-
to: { transform: 'rotate(360deg)' },
|
|
121
|
-
},
|
|
122
|
-
'.animate-spin': {
|
|
123
|
-
animation: 'africanies-spin 1s linear infinite',
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Keep toasts above dialogs, drawers, and other CDK overlays.
|
|
130
|
-
*
|
|
131
|
-
* WHY: CDK sets `z-index: 1000` on overlay wrappers, panes, and backdrops.
|
|
132
|
-
* This covers overlays outside the popover top layer; inside it, ToastService
|
|
133
|
-
* re-shows the toast popover to stay in front.
|
|
134
|
-
*
|
|
135
|
-
* @param {import('tailwindcss/types/config').PluginAPI} api
|
|
136
|
-
*/
|
|
137
|
-
function africaniesOverlayStackPlugin({ addBase }) {
|
|
138
|
-
addBase({
|
|
139
|
-
'.cdk-global-overlay-wrapper.africanies-toast-overlay, .cdk-overlay-pane.africanies-toast-panel':
|
|
140
|
-
{
|
|
141
|
-
zIndex: '1100',
|
|
142
|
-
},
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Keep overlay scrollbars off close buttons and other end-aligned chrome.
|
|
148
|
-
*
|
|
149
|
-
* WHY: modal/drawer panes used to scroll themselves. Overlay (and some
|
|
150
|
-
* classic) scrollbars paint in the padding box and cover a top-right close
|
|
151
|
-
* control. The pane stays `overflow: hidden`; the hosted component scrolls
|
|
152
|
-
* with `scrollbar-gutter: stable` so the track is reserved even before
|
|
153
|
-
* content overflows. Dialogs that split header/body can set `overflow-hidden`
|
|
154
|
-
* on the host (a utility, so it wins this base rule) and put
|
|
155
|
-
* `.africanies-overlay-scroll` on the body.
|
|
156
|
-
*
|
|
157
|
-
* @param {import('tailwindcss/types/config').PluginAPI} api
|
|
158
|
-
*/
|
|
159
|
-
function africaniesOverlayScrollPlugin({ addBase }) {
|
|
160
|
-
addBase({
|
|
161
|
-
'.africanies-modal-panel, .africanies-drawer-panel': {
|
|
162
|
-
overflow: 'hidden',
|
|
163
|
-
overscrollBehavior: 'contain',
|
|
164
|
-
},
|
|
165
|
-
'.africanies-modal-panel > *, .africanies-drawer-panel > *': {
|
|
166
|
-
minHeight: 0,
|
|
167
|
-
overflowX: 'hidden',
|
|
168
|
-
overflowY: 'auto',
|
|
169
|
-
overscrollBehavior: 'contain',
|
|
170
|
-
scrollbarGutter: 'stable',
|
|
171
|
-
},
|
|
172
|
-
'.africanies-drawer-panel > *': {
|
|
173
|
-
height: '100%',
|
|
174
|
-
},
|
|
175
|
-
'.africanies-overlay-scroll': {
|
|
176
|
-
overscrollBehavior: 'contain',
|
|
177
|
-
scrollbarGutter: 'stable',
|
|
178
|
-
},
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
module.exports = {
|
|
183
|
-
darkMode: 'class',
|
|
184
|
-
plugins: [
|
|
185
|
-
africaniesInteractiveCursorPlugin,
|
|
186
|
-
africaniesSpinPlugin,
|
|
187
|
-
africaniesOverlayStackPlugin,
|
|
188
|
-
africaniesOverlayScrollPlugin,
|
|
189
|
-
africaniesAutofillPlugin,
|
|
190
|
-
],
|
|
191
|
-
theme: {
|
|
192
|
-
extend: {
|
|
193
|
-
colors: {
|
|
194
|
-
black: '#000000',
|
|
195
|
-
white: '#ffffff',
|
|
196
|
-
ink: {
|
|
197
|
-
DEFAULT: '#212529',
|
|
198
|
-
blue: '#192a3e',
|
|
199
|
-
brand: '#1c2b3f',
|
|
200
|
-
950: '#272729',
|
|
201
|
-
},
|
|
202
|
-
neutral: {
|
|
203
|
-
300: '#c9d5e1',
|
|
204
|
-
400: '#a9b5cb',
|
|
205
|
-
600: '#667185',
|
|
206
|
-
},
|
|
207
|
-
border: {
|
|
208
|
-
// Light chrome on white — match form field borders (`neutral-300`).
|
|
209
|
-
// Previous `#f0f2f5` was too close to white and washed out.
|
|
210
|
-
DEFAULT: '#c9d5e1',
|
|
211
|
-
},
|
|
212
|
-
background: {
|
|
213
|
-
welcome: '#f9fafb',
|
|
214
|
-
},
|
|
215
|
-
export: {
|
|
216
|
-
DEFAULT: '#1cbd5d',
|
|
217
|
-
light: '#24dc6d',
|
|
218
|
-
subtle: '#e4fff3',
|
|
219
|
-
tint: '#f2fff8',
|
|
220
|
-
},
|
|
221
|
-
import: {
|
|
222
|
-
DEFAULT: '#f08829',
|
|
223
|
-
light: '#ffa95b',
|
|
224
|
-
subtle: '#fffcef',
|
|
225
|
-
},
|
|
226
|
-
danger: {
|
|
227
|
-
DEFAULT: '#ff001c',
|
|
228
|
-
dark: '#b41433',
|
|
229
|
-
strong: '#C00B19',
|
|
230
|
-
subtle: '#FFF2F2',
|
|
231
|
-
},
|
|
232
|
-
warning: {
|
|
233
|
-
DEFAULT: '#DBB316',
|
|
234
|
-
dark: '#EF8833',
|
|
235
|
-
subtle: '#FFF6E6',
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
fontFamily: {
|
|
239
|
-
sans: ['Arial', 'sans-serif'],
|
|
240
|
-
},
|
|
241
|
-
fontSize: {
|
|
242
|
-
// PROVISIONAL — see THEME.md; sizes may tighten after design QA.
|
|
243
|
-
'heading-1': ['2.5rem', { lineHeight: 1.2, fontWeight: 700 }],
|
|
244
|
-
'heading-2': ['2rem', { lineHeight: 1.25, fontWeight: 700 }],
|
|
245
|
-
'heading-3': ['1.5rem', { lineHeight: 1.3, fontWeight: 600 }],
|
|
246
|
-
'body-lg': ['1.125rem', { lineHeight: 1.5, fontWeight: 400 }],
|
|
247
|
-
body: ['1rem', { lineHeight: 1.5, fontWeight: 400 }],
|
|
248
|
-
'body-sm': ['0.875rem', { lineHeight: 1.4, fontWeight: 400 }],
|
|
249
|
-
caption: ['0.75rem', { lineHeight: 1.3, fontWeight: 400 }],
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
};
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Tailwind safelist side-effect for shipping-mode color utilities.
|
|
5
|
-
*
|
|
6
|
-
* WHY this file exists: JIT/content scanning only keeps class names that appear
|
|
7
|
-
* as *literal strings* in scanned sources. {@link ModeColorService} already
|
|
8
|
-
* returns these literals, but keeping a dedicated comment list makes the
|
|
9
|
-
* contract obvious for consumers who configure `safelist` or purge plugins.
|
|
10
|
-
*
|
|
11
|
-
* Do not rename these strings without updating ModeColorService and THEME.md.
|
|
12
|
-
*
|
|
13
|
-
* SFN (export / green):
|
|
14
|
-
* text-export bg-export bg-export-subtle bg-export-light border-export
|
|
15
|
-
* hover:bg-export-light hover:bg-export-subtle dark:bg-export/15 dark:hover:bg-export/15
|
|
16
|
-
* dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]
|
|
17
|
-
*
|
|
18
|
-
* STN (import / orange):
|
|
19
|
-
* text-import bg-import bg-import-subtle bg-import-light border-import
|
|
20
|
-
* hover:bg-import-light hover:bg-import-subtle dark:bg-import/15 dark:hover:bg-import/15
|
|
21
|
-
* dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]
|
|
22
|
-
*/
|
|
23
|
-
declare const MODE_COLOR_SAFELIST: readonly ["text-export", "bg-export", "bg-export-subtle", "bg-export-light", "border-export", "hover:bg-export-light", "hover:bg-export-subtle", "dark:bg-export/15", "dark:hover:bg-export/15", "dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]", "text-import", "bg-import", "bg-import-subtle", "bg-import-light", "border-import", "hover:bg-import-light", "hover:bg-import-subtle", "dark:bg-import/15", "dark:hover:bg-import/15", "dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]"];
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Tailwind class bundle for the active shipping mode (SFN export / STN import).
|
|
27
|
-
*
|
|
28
|
-
* Use these for **primary** product chrome: CTAs, selected controls, progress,
|
|
29
|
-
* and accent text. Semantic colors (danger / warning) stay mode-independent.
|
|
30
|
-
*/
|
|
31
|
-
interface ModeColorClasses {
|
|
32
|
-
/** Text color utility, e.g. `text-export`. */
|
|
33
|
-
text: string;
|
|
34
|
-
/** Solid background utility, e.g. `bg-export`. */
|
|
35
|
-
bg: string;
|
|
36
|
-
/** Soft background utility, e.g. `bg-export-subtle`. */
|
|
37
|
-
bgSubtle: string;
|
|
38
|
-
/** Border matching the mode accent, e.g. `border-export`. */
|
|
39
|
-
border: string;
|
|
40
|
-
/**
|
|
41
|
-
* Filled primary CTA — `variant="primary"` on buttons.
|
|
42
|
-
* Includes hover utility as a literal so Tailwind keeps it.
|
|
43
|
-
*/
|
|
44
|
-
primary: string;
|
|
45
|
-
/**
|
|
46
|
-
* Transparent / text-only CTA — `variant="ghost-primary"` on buttons.
|
|
47
|
-
* Mode accent text + soft hover fill.
|
|
48
|
-
*/
|
|
49
|
-
ghostPrimary: string;
|
|
50
|
-
/**
|
|
51
|
-
* Soft highlight for selected / active rows (works in dark mode).
|
|
52
|
-
* Dark uses a translucent tint — fine over solid surfaces, not for
|
|
53
|
-
* sticky overlays (see {@link softSolid}).
|
|
54
|
-
*/
|
|
55
|
-
soft: string;
|
|
56
|
-
/**
|
|
57
|
-
* Opaque soft fill — same tint as {@link soft}, but dark mode mixes into
|
|
58
|
-
* ink so scrolled content cannot show through (sticky table headers/cells).
|
|
59
|
-
*/
|
|
60
|
-
softSolid: string;
|
|
61
|
-
/**
|
|
62
|
-
* Soft hover highlight for menus and lists.
|
|
63
|
-
*/
|
|
64
|
-
softHover: string;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Maps {@link ShippingModeService} to mode-accent Tailwind classes.
|
|
68
|
-
*
|
|
69
|
-
* - **SFN** → export green is primary
|
|
70
|
-
* - **STN** → import orange is primary
|
|
71
|
-
*
|
|
72
|
-
* WHY literal class strings: Tailwind's scanner cannot see dynamically built
|
|
73
|
-
* names like `` `text-${token}` ``. Returning full literals (`text-export`, …)
|
|
74
|
-
* keeps utilities in the compiled CSS. See {@link MODE_COLOR_SAFELIST}.
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```html
|
|
78
|
-
* @let colors = modeColor.classes();
|
|
79
|
-
* <button type="button" [class]="colors.primary">Save</button>
|
|
80
|
-
* <span [class]="colors.text">Mode accent</span>
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
declare class ModeColorService {
|
|
84
|
-
private readonly shippingMode;
|
|
85
|
-
/**
|
|
86
|
-
* Mode-dependent utility classes. Recomputes when shipping mode changes.
|
|
87
|
-
*/
|
|
88
|
-
readonly classes: i0.Signal<ModeColorClasses>;
|
|
89
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ModeColorService, never>;
|
|
90
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ModeColorService>;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Supported UI color schemes for {@link ThemeService}.
|
|
95
|
-
*
|
|
96
|
-
* Kept as a closed string union so storage values and DOM class toggles stay
|
|
97
|
-
* aligned — unknown persisted strings are ignored and fall back to system
|
|
98
|
-
* preference / light.
|
|
99
|
-
*/
|
|
100
|
-
type Theme = 'light' | 'dark';
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Application light/dark theme preference.
|
|
104
|
-
*
|
|
105
|
-
* WHY signals (not BehaviorSubject): theme is synchronous UI state read from
|
|
106
|
-
* templates and other services; a signal avoids RxJS subscription boilerplate
|
|
107
|
-
* and matches Angular 22 change detection. Persistence goes through
|
|
108
|
-
* {@link STORAGE_TOKEN} so tests can swap storage without touching `localStorage`.
|
|
109
|
-
*
|
|
110
|
-
* Applies the Tailwind `darkMode: 'class'` contract by toggling `dark` on
|
|
111
|
-
* `document.documentElement`, and sets `color-scheme` so native UI (date
|
|
112
|
-
* pickers, scrollbars, form controls) matches the app theme — class-based
|
|
113
|
-
* dark mode alone does not restyle browser chrome.
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* ```ts
|
|
117
|
-
* // app.config.ts
|
|
118
|
-
* import { inject, provideAppInitializer } from '@angular/core';
|
|
119
|
-
* import { ThemeService } from '@africanies/africanies-theme';
|
|
120
|
-
*
|
|
121
|
-
* export const appConfig = {
|
|
122
|
-
* providers: [
|
|
123
|
-
* provideAppInitializer(() => {
|
|
124
|
-
* inject(ThemeService); // applies stored / system theme once
|
|
125
|
-
* }),
|
|
126
|
-
* ],
|
|
127
|
-
* };
|
|
128
|
-
*
|
|
129
|
-
* // In a component
|
|
130
|
-
* const theme = inject(ThemeService);
|
|
131
|
-
* theme.toggle();
|
|
132
|
-
* theme.setTheme('dark');
|
|
133
|
-
* const current = theme.theme(); // 'light' | 'dark'
|
|
134
|
-
* ```
|
|
135
|
-
*/
|
|
136
|
-
declare class ThemeService {
|
|
137
|
-
private readonly storage;
|
|
138
|
-
private readonly document;
|
|
139
|
-
/**
|
|
140
|
-
* Current theme. Prefer reading via `theme()` in templates / computed values
|
|
141
|
-
* rather than caching the string, so dark-class consumers stay in sync.
|
|
142
|
-
*/
|
|
143
|
-
readonly theme: i0.WritableSignal<Theme>;
|
|
144
|
-
constructor();
|
|
145
|
-
/**
|
|
146
|
-
* Sets and persists the theme, updating the `dark` class and `color-scheme`
|
|
147
|
-
* on `<html>`.
|
|
148
|
-
*
|
|
149
|
-
* @param theme - Absolute preference to store.
|
|
150
|
-
*/
|
|
151
|
-
setTheme(theme: Theme): void;
|
|
152
|
-
/**
|
|
153
|
-
* Flips between light and dark.
|
|
154
|
-
*
|
|
155
|
-
* @returns The theme after the toggle.
|
|
156
|
-
*/
|
|
157
|
-
toggle(): Theme;
|
|
158
|
-
private resolveInitialTheme;
|
|
159
|
-
private prefersDark;
|
|
160
|
-
private applyToDocument;
|
|
161
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
|
|
162
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export { MODE_COLOR_SAFELIST, ModeColorService, ThemeService };
|
|
166
|
-
export type { ModeColorClasses, Theme };
|