@besaitech/ng-design-system 0.0.60 → 0.0.61
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.
|
@@ -18408,6 +18408,89 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
18408
18408
|
`, styles: [".animate-sds-menu{animation:sds-menu-in .14s ease-out}@keyframes sds-menu-in{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.animate-sds-menu{animation:none}}\n"] }]
|
|
18409
18409
|
}], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], languages: [{ type: i0.Input, args: [{ isSignal: true, alias: "languages", required: false }] }], current: [{ type: i0.Input, args: [{ isSignal: true, alias: "current", required: false }] }, { type: i0.Output, args: ["currentChange"] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], menuLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuLabel", required: false }] }], heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }], openChange: [{ type: i0.Output, args: ["openChange"] }] } });
|
|
18410
18410
|
|
|
18411
|
+
/**
|
|
18412
|
+
* Fixed, theme- AND brand-independent hues on purpose: a non-production marker must look identical in every
|
|
18413
|
+
* app, brand and colour-scheme, so it uses literal sky / amber rather than themeable design-system tokens
|
|
18414
|
+
* (which a brand preset could redefine). Sky for DEV, amber for TEST.
|
|
18415
|
+
*/
|
|
18416
|
+
const MARKERS = {
|
|
18417
|
+
dev: { label: 'DEV', bar: 'bg-[#38bdf8]', tab: 'bg-[#38bdf8] text-[#0c1a24]', variant: 'dev' },
|
|
18418
|
+
test: { label: 'TEST', bar: 'bg-[#f59e0b]', tab: 'bg-[#f59e0b] text-[#1c1916]', variant: 'test' },
|
|
18419
|
+
};
|
|
18420
|
+
/**
|
|
18421
|
+
* Non-production environment marker: a 3px rule pinned across the very top of the viewport with a small tab
|
|
18422
|
+
* hanging from its centre — sky **DEV** or amber **TEST**, nothing in production. Fixed and click-through,
|
|
18423
|
+
* above all app chrome, so a dev or test environment is never mistaken for the live one.
|
|
18424
|
+
*
|
|
18425
|
+
* Presentation only, no i18n or environment dependency: the host app supplies the resolved `[env]` (from its
|
|
18426
|
+
* `environment.env`, or — for an SSR app — from the request host) and, optionally, the translated
|
|
18427
|
+
* screen-reader sentences. Render it once from the app's root component.
|
|
18428
|
+
*/
|
|
18429
|
+
class SdsEnvBanner {
|
|
18430
|
+
/** The resolved build environment. Only `dev` and `test` show a marker; `prod`/anything else shows nothing. */
|
|
18431
|
+
env = input(...(ngDevMode ? [undefined, { debugName: "env" }] : []));
|
|
18432
|
+
/** Screen-reader sentence for the DEV marker (pass a translated string; English default). */
|
|
18433
|
+
devSrLabel = input('Development environment — not production', ...(ngDevMode ? [{ debugName: "devSrLabel" }] : []));
|
|
18434
|
+
/** Screen-reader sentence for the TEST marker (pass a translated string; English default). */
|
|
18435
|
+
testSrLabel = input('Test environment — not production', ...(ngDevMode ? [{ debugName: "testSrLabel" }] : []));
|
|
18436
|
+
marker = computed(() => {
|
|
18437
|
+
const env = this.env();
|
|
18438
|
+
return env === 'dev' ? MARKERS.dev : env === 'test' ? MARKERS.test : null;
|
|
18439
|
+
}, ...(ngDevMode ? [{ debugName: "marker" }] : []));
|
|
18440
|
+
srLabel = computed(() => {
|
|
18441
|
+
const m = this.marker();
|
|
18442
|
+
return m ? (m.variant === 'dev' ? this.devSrLabel() : this.testSrLabel()) : '';
|
|
18443
|
+
}, ...(ngDevMode ? [{ debugName: "srLabel" }] : []));
|
|
18444
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsEnvBanner, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18445
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsEnvBanner, isStandalone: true, selector: "sds-env-banner", inputs: { env: { classPropertyName: "env", publicName: "env", isSignal: true, isRequired: false, transformFunction: null }, devSrLabel: { classPropertyName: "devSrLabel", publicName: "devSrLabel", isSignal: true, isRequired: false, transformFunction: null }, testSrLabel: { classPropertyName: "testSrLabel", publicName: "testSrLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
18446
|
+
@if (marker(); as m) {
|
|
18447
|
+
<div
|
|
18448
|
+
class="pointer-events-none fixed inset-x-0 top-0 z-[2147483000] h-[3px]"
|
|
18449
|
+
[class]="m.bar"
|
|
18450
|
+
role="note"
|
|
18451
|
+
data-testid="env-banner"
|
|
18452
|
+
>
|
|
18453
|
+
<span
|
|
18454
|
+
class="absolute left-1/2 top-0 -translate-x-1/2 rounded-b-lg px-3 pb-[3px] pt-px font-sans text-[11px] font-extrabold leading-4 tracking-[0.12em] shadow-[0_2px_6px_rgb(0_0_0/0.18)]"
|
|
18455
|
+
[class]="m.tab"
|
|
18456
|
+
aria-hidden="true"
|
|
18457
|
+
>{{ m.label }}</span
|
|
18458
|
+
>
|
|
18459
|
+
@if (srLabel(); as sr) {
|
|
18460
|
+
<span class="sr-only">{{ sr }}</span>
|
|
18461
|
+
}
|
|
18462
|
+
</div>
|
|
18463
|
+
}
|
|
18464
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
18465
|
+
}
|
|
18466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsEnvBanner, decorators: [{
|
|
18467
|
+
type: Component,
|
|
18468
|
+
args: [{
|
|
18469
|
+
selector: 'sds-env-banner',
|
|
18470
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18471
|
+
template: `
|
|
18472
|
+
@if (marker(); as m) {
|
|
18473
|
+
<div
|
|
18474
|
+
class="pointer-events-none fixed inset-x-0 top-0 z-[2147483000] h-[3px]"
|
|
18475
|
+
[class]="m.bar"
|
|
18476
|
+
role="note"
|
|
18477
|
+
data-testid="env-banner"
|
|
18478
|
+
>
|
|
18479
|
+
<span
|
|
18480
|
+
class="absolute left-1/2 top-0 -translate-x-1/2 rounded-b-lg px-3 pb-[3px] pt-px font-sans text-[11px] font-extrabold leading-4 tracking-[0.12em] shadow-[0_2px_6px_rgb(0_0_0/0.18)]"
|
|
18481
|
+
[class]="m.tab"
|
|
18482
|
+
aria-hidden="true"
|
|
18483
|
+
>{{ m.label }}</span
|
|
18484
|
+
>
|
|
18485
|
+
@if (srLabel(); as sr) {
|
|
18486
|
+
<span class="sr-only">{{ sr }}</span>
|
|
18487
|
+
}
|
|
18488
|
+
</div>
|
|
18489
|
+
}
|
|
18490
|
+
`,
|
|
18491
|
+
}]
|
|
18492
|
+
}], propDecorators: { env: [{ type: i0.Input, args: [{ isSignal: true, alias: "env", required: false }] }], devSrLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "devSrLabel", required: false }] }], testSrLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "testSrLabel", required: false }] }] } });
|
|
18493
|
+
|
|
18411
18494
|
/*
|
|
18412
18495
|
* Public API Surface of saitech-design-system — the Saitech / App design system.
|
|
18413
18496
|
*/
|
|
@@ -18417,5 +18500,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
18417
18500
|
* Generated bundle index. Do not edit.
|
|
18418
18501
|
*/
|
|
18419
18502
|
|
|
18420
|
-
export { SDS_ALLERGENS, SDS_ALLERGEN_ICONS, SDS_ALLERGEN_LABELS_EN, SDS_ICONS, SDS_PHONE_COUNTRIES, SDS_THEME_STORAGE_KEY, SDS_UI_PREF_LANG_PARAM, SDS_UI_PREF_THEME_PARAM, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAddressAutocomplete, SdsAddressExtra, SdsAllergenIcon, SdsAvatar, SdsBadge, SdsBulkBar, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsChecklistRow, SdsChip, SdsChipGroup, SdsDatePicker, SdsFileDrop, SdsIcon, SdsImageCropper, SdsInput, SdsInputNumber, SdsLanguageSwitcher, SdsLocalizedInput, SdsMenu, SdsMenuItem, SdsMenuTrigger, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsRadio, SdsScore, SdsSearchCommand, SdsSegmented, SdsSelect, SdsSelectEmpty, SdsSelectFooter, SdsSelectOption, SdsShell, SdsSidebar, SdsSortableHandle, SdsSortableItem, SdsSortableList, SdsStatusTile, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableEmpty, SdsTableHeader, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsThemeService, SdsThemeToggle, SdsTimeInput, SdsToastHost, SdsToastService, SdsToggleSwitch, SdsTopbar, SdsTriStateChip, SdsUserMenu, SidebarStore, addDays, addMonths, addMonthsKeepDay, appendUiPrefs, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isSdsThemeMode, isoDay, pad2, readUiPrefs, sdsFileMatchesAccept, sdsFormatBytes, sdsFormatNational, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth, stripUiPrefs };
|
|
18503
|
+
export { SDS_ALLERGENS, SDS_ALLERGEN_ICONS, SDS_ALLERGEN_LABELS_EN, SDS_ICONS, SDS_PHONE_COUNTRIES, SDS_THEME_STORAGE_KEY, SDS_UI_PREF_LANG_PARAM, SDS_UI_PREF_THEME_PARAM, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAddressAutocomplete, SdsAddressExtra, SdsAllergenIcon, SdsAvatar, SdsBadge, SdsBulkBar, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsChecklistRow, SdsChip, SdsChipGroup, SdsDatePicker, SdsEnvBanner, SdsFileDrop, SdsIcon, SdsImageCropper, SdsInput, SdsInputNumber, SdsLanguageSwitcher, SdsLocalizedInput, SdsMenu, SdsMenuItem, SdsMenuTrigger, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsRadio, SdsScore, SdsSearchCommand, SdsSegmented, SdsSelect, SdsSelectEmpty, SdsSelectFooter, SdsSelectOption, SdsShell, SdsSidebar, SdsSortableHandle, SdsSortableItem, SdsSortableList, SdsStatusTile, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableEmpty, SdsTableHeader, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsThemeService, SdsThemeToggle, SdsTimeInput, SdsToastHost, SdsToastService, SdsToggleSwitch, SdsTopbar, SdsTriStateChip, SdsUserMenu, SidebarStore, addDays, addMonths, addMonthsKeepDay, appendUiPrefs, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isSdsThemeMode, isoDay, pad2, readUiPrefs, sdsFileMatchesAccept, sdsFormatBytes, sdsFormatNational, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth, stripUiPrefs };
|
|
18421
18504
|
//# sourceMappingURL=besaitech-ng-design-system.mjs.map
|