@besaitech/ng-design-system 0.0.77 → 0.0.78

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/index.d.ts CHANGED
@@ -1532,6 +1532,58 @@ declare class SdsStatusTile {
1532
1532
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsStatusTile, "sds-status-tile", never, { "title": { "alias": "title"; "required": true; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; "image": { "alias": "image"; "required": false; "isSignal": true; }; "imageAlt": { "alias": "imageAlt"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "note": { "alias": "note"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "busy": { "alias": "busy"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "availableLabel": { "alias": "availableLabel"; "required": false; "isSignal": true; }; "soldOutLabel": { "alias": "soldOutLabel"; "required": false; "isSignal": true; }; "hiddenLabel": { "alias": "hiddenLabel"; "required": false; "isSignal": true; }; }, { "activate": "activate"; "imageError": "imageError"; }, never, never, true, never>;
1533
1533
  }
1534
1534
 
1535
+ /**
1536
+ * Clinical severity, lowest to highest. `unknown` is not a low severity — it means nobody has
1537
+ * assessed it, which is a different statement and deliberately sits outside the ramp.
1538
+ */
1539
+ type SdsSeverityLevel = 'unknown' | 'mild' | 'moderate' | 'severe' | 'critical';
1540
+ type SdsSeverityVariant = 'badge' | 'meter';
1541
+ type SdsSeveritySize = 'sm' | 'md';
1542
+ /**
1543
+ * How bad the thing itself is — an allergy's criticality, a reaction, an observation's abnormal
1544
+ * flag, a triage level.
1545
+ *
1546
+ * <b>This is not `sds-badge` with a status colour.</b> Status says what the UI did (saved, failed);
1547
+ * severity says what the record says. A red meaning "save failed" in one place and "anaphylaxis" in
1548
+ * another is a safety problem, so severity has its own measured ramp (see base.css) and its own
1549
+ * shape: five ordered steps that can render as a filled meter, where status is three categorical
1550
+ * states that render as a badge.
1551
+ *
1552
+ * <b>[label] is required and is never defaulted.</b> The component will not invent the word
1553
+ * "Severe" for you: colour alone must not carry meaning (greyscale, colour-blind readers, screen
1554
+ * readers), and a hardcoded English default is the exact bug that ships a trilingual app with one
1555
+ * untranslatable word in it. Pass your own translated text.
1556
+ *
1557
+ * `critical` is filled rather than tinted — the top of a scale should be louder than one more step
1558
+ * of the same treatment.
1559
+ *
1560
+ * @example
1561
+ * <sds-severity level="severe" [label]="'allergy.severe' | translate" />
1562
+ * <sds-severity level="moderate" variant="meter" [label]="'reaction.moderate' | translate" />
1563
+ */
1564
+ declare class SdsSeverity {
1565
+ readonly level: _angular_core.InputSignal<SdsSeverityLevel>;
1566
+ /** The visible wording, in the reader's language. Required on purpose — see the class docs. */
1567
+ readonly label: _angular_core.InputSignal<string>;
1568
+ readonly variant: _angular_core.InputSignal<SdsSeverityVariant>;
1569
+ readonly size: _angular_core.InputSignal<SdsSeveritySize>;
1570
+ /**
1571
+ * Accessible name for the meter, when the visible label alone would not say what the number
1572
+ * means ("Élevée" out of context). Defaults to the label.
1573
+ */
1574
+ readonly ariaLabel: _angular_core.InputSignal<string>;
1575
+ protected readonly ramp: readonly SdsSeverityLevel[];
1576
+ protected readonly small: _angular_core.Signal<boolean>;
1577
+ protected readonly tintClass: _angular_core.Signal<string>;
1578
+ protected readonly dotClass: _angular_core.Signal<string>;
1579
+ protected readonly fillClass: _angular_core.Signal<string>;
1580
+ protected readonly accessibleName: _angular_core.Signal<string>;
1581
+ /** How many of the four steps are lit. `unknown` lights none: it is not a low score. */
1582
+ protected readonly reached: _angular_core.Signal<number>;
1583
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdsSeverity, never>;
1584
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsSeverity, "sds-severity", never, { "level": { "alias": "level"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1585
+ }
1586
+
1535
1587
  /** An actionable row. */
1536
1588
  interface SdsMenuAction {
1537
1589
  /** Optional stable id, handy in the `(select)` handler. */
@@ -2499,7 +2551,7 @@ declare class SdsRangeCalendar {
2499
2551
  /** BCP 47 locale for month and weekday names. Defaults to `en-GB`; pass the app's locale. */
2500
2552
  readonly locale: _angular_core.InputSignal<string>;
2501
2553
  /** Months shown side by side (from the `sm` breakpoint; always one below it). */
2502
- readonly months: _angular_core.InputSignal<2 | 1>;
2554
+ readonly months: _angular_core.InputSignal<1 | 2>;
2503
2555
  /** Accessible name of the calendar group. English default — translate it in the app. */
2504
2556
  readonly calendarLabel: _angular_core.InputSignal<string>;
2505
2557
  /** Accessible name of the icon-only "previous month" button (its ONLY name — translate it). */
@@ -2518,7 +2570,7 @@ declare class SdsRangeCalendar {
2518
2570
  protected readonly hovered: _angular_core.WritableSignal<Date | null>;
2519
2571
  private readonly wide;
2520
2572
  /** Months actually rendered: {@link months}, but one on narrow viewports. */
2521
- protected readonly monthsShown: _angular_core.Signal<2 | 1>;
2573
+ protected readonly monthsShown: _angular_core.Signal<1 | 2>;
2522
2574
  constructor();
2523
2575
  private watchViewport;
2524
2576
  protected readonly navBtn = "inline-flex h-8 w-8 items-center justify-center rounded-control text-ink-soft hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 disabled:cursor-not-allowed disabled:opacity-40";
@@ -2597,7 +2649,7 @@ declare class SdsDateRangePicker implements OnDestroy {
2597
2649
  readonly size: _angular_core.InputSignal<SdsDateRangePickerSize>;
2598
2650
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
2599
2651
  /** Months side by side in the panel (from the `sm` breakpoint; always one below it). */
2600
- readonly months: _angular_core.InputSignal<2 | 1>;
2652
+ readonly months: _angular_core.InputSignal<1 | 2>;
2601
2653
  /**
2602
2654
  * Display formatter for the field. Default: `Intl.DateTimeFormat#formatRange` with day, short
2603
2655
  * month and year in {@link locale} (e.g. `1–7 Oct 2026`) — see `formatDateRange`.
@@ -5582,5 +5634,5 @@ declare const SDS_CHART_CONFIG: InjectionToken<SdsChartConfig>;
5582
5634
  */
5583
5635
  declare function provideSdsCharts(config: SdsChartConfig): Provider;
5584
5636
 
5585
- export { SDS_ALLERGENS, SDS_ALLERGEN_ICONS, SDS_ALLERGEN_LABELS_EN, SDS_CHART_CONFIG, SDS_CHART_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, SdsDateRangePicker, SdsEnvBanner, SdsFileDrop, SdsFormActions, SdsIcon, SdsImageCropper, SdsInput, SdsInputNumber, SdsLanguageSwitcher, SdsLocalizedInput, SdsMenu, SdsMenuItem, SdsMenuTrigger, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsRadio, SdsRangeCalendar, 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, diffInDays, formatDateRange, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isSameRange, isSdsThemeMode, isoDay, pad2, provideSdsCharts, readUiPrefs, sdsFileMatchesAccept, sdsFormatBytes, sdsFormatNational, sdsLastDays, sdsLastMonths, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth, stripUiPrefs };
5586
- export type { SdsAccordionActive, SdsAccordionValue, SdsAddressAutocompleteAppearance, SdsAddressAutocompleteShape, SdsAddressAutocompleteSize, SdsAddressExtraContext, SdsAddressExtraPosition, SdsAddressLocateFn, SdsAddressSearchFn, SdsAddressSuggestion, SdsAllergen, SdsAvatarShape, SdsAvatarStatus, SdsBadgeSize, SdsBadgeVariant, SdsBulkBarPosition, SdsButtonShape, SdsButtonSize, SdsButtonVariant, SdsCardVariant, SdsChartConfig, SdsChartLabels, SdsCheckboxSize, SdsChecklistStatus, SdsChipOption, SdsChipSize, SdsCropRect, SdsDatePickerSize, SdsDateRange, SdsDateRangePickerSize, SdsDateRangePreset, SdsEnvBannerEnv, SdsFileDropAppearance, SdsFileRejection, SdsFileRejectionReason, SdsFormActionsPosition, SdsIconName, SdsIconSize, SdsImageCropperBlobOptions, SdsImageCropperShape, SdsInputAppearance, SdsInputNumberAppearance, SdsInputNumberButtonLayout, SdsInputNumberCurrencyDisplay, SdsInputNumberMode, SdsInputNumberSize, SdsInputShape, SdsInputSize, SdsInputType, SdsKpiChangeText, SdsLanguageOption, SdsLanguageSwitcherAlign, SdsLanguageSwitcherAppearance, SdsLanguageSwitcherDirection, SdsLocalizedInputSize, SdsLocalizedValue, SdsMenuAction, SdsMenuAlign, SdsMenuEntry, SdsMenuItemTone, SdsMenuSeparator, SdsMultiSelectDisplay, SdsMultiSelectSize, SdsNavItemBadgeTone, SdsOtpInputSize, SdsPaginatorSize, SdsPaginatorState, SdsPhoneCountry, SdsPhoneInputSize, SdsPhoneValue, SdsRadioSize, SdsScoreSize, SdsScoreTier, SdsScoreVariant, SdsSearchAppearance, SdsSearchItem, SdsSegmentedOption, SdsSegmentedSize, SdsSelectAppearance, SdsSelectEmptyContext, SdsSelectFooterContext, SdsSelectOptionContext, SdsSelectSize, SdsShellBackground, SdsSidebarAppearance, SdsSortOrder, SdsSortableAppearance, SdsSortableItemContext, SdsSortableReorderEvent, SdsSparklineSummaryText, SdsStatusTileState, SdsTabValue, SdsTableCellCommitEvent, SdsTableCellContext, SdsTableCellErrors, SdsTableColumn, SdsTableEditTrigger, SdsTableEditor, SdsTableEmptyContext, SdsTableHeaderContext, SdsTableLazyEvent, SdsTableRowExpansionContext, SdsTableSelectOption, SdsTableSize, SdsTableSortEvent, SdsTabsVariant, SdsTextareaAppearance, SdsTextareaResize, SdsTextareaSize, SdsTheme, SdsThemeMode, SdsThemeToggleAppearance, SdsTimeInputAppearance, SdsTimeInputSize, SdsToast, SdsToastKind, SdsToggleSwitchSize, SdsTopbarAppearance, SdsTrendDirection, SdsTriState, SdsTriStateChipSize, SdsUiPrefs, SdsUserMenuAlign, SdsUserMenuAppearance };
5637
+ export { SDS_ALLERGENS, SDS_ALLERGEN_ICONS, SDS_ALLERGEN_LABELS_EN, SDS_CHART_CONFIG, SDS_CHART_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, SdsDateRangePicker, SdsEnvBanner, SdsFileDrop, SdsFormActions, SdsIcon, SdsImageCropper, SdsInput, SdsInputNumber, SdsLanguageSwitcher, SdsLocalizedInput, SdsMenu, SdsMenuItem, SdsMenuTrigger, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsRadio, SdsRangeCalendar, SdsScore, SdsSearchCommand, SdsSegmented, SdsSelect, SdsSelectEmpty, SdsSelectFooter, SdsSelectOption, SdsSeverity, 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, diffInDays, formatDateRange, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isSameRange, isSdsThemeMode, isoDay, pad2, provideSdsCharts, readUiPrefs, sdsFileMatchesAccept, sdsFormatBytes, sdsFormatNational, sdsLastDays, sdsLastMonths, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth, stripUiPrefs };
5638
+ export type { SdsAccordionActive, SdsAccordionValue, SdsAddressAutocompleteAppearance, SdsAddressAutocompleteShape, SdsAddressAutocompleteSize, SdsAddressExtraContext, SdsAddressExtraPosition, SdsAddressLocateFn, SdsAddressSearchFn, SdsAddressSuggestion, SdsAllergen, SdsAvatarShape, SdsAvatarStatus, SdsBadgeSize, SdsBadgeVariant, SdsBulkBarPosition, SdsButtonShape, SdsButtonSize, SdsButtonVariant, SdsCardVariant, SdsChartConfig, SdsChartLabels, SdsCheckboxSize, SdsChecklistStatus, SdsChipOption, SdsChipSize, SdsCropRect, SdsDatePickerSize, SdsDateRange, SdsDateRangePickerSize, SdsDateRangePreset, SdsEnvBannerEnv, SdsFileDropAppearance, SdsFileRejection, SdsFileRejectionReason, SdsFormActionsPosition, SdsIconName, SdsIconSize, SdsImageCropperBlobOptions, SdsImageCropperShape, SdsInputAppearance, SdsInputNumberAppearance, SdsInputNumberButtonLayout, SdsInputNumberCurrencyDisplay, SdsInputNumberMode, SdsInputNumberSize, SdsInputShape, SdsInputSize, SdsInputType, SdsKpiChangeText, SdsLanguageOption, SdsLanguageSwitcherAlign, SdsLanguageSwitcherAppearance, SdsLanguageSwitcherDirection, SdsLocalizedInputSize, SdsLocalizedValue, SdsMenuAction, SdsMenuAlign, SdsMenuEntry, SdsMenuItemTone, SdsMenuSeparator, SdsMultiSelectDisplay, SdsMultiSelectSize, SdsNavItemBadgeTone, SdsOtpInputSize, SdsPaginatorSize, SdsPaginatorState, SdsPhoneCountry, SdsPhoneInputSize, SdsPhoneValue, SdsRadioSize, SdsScoreSize, SdsScoreTier, SdsScoreVariant, SdsSearchAppearance, SdsSearchItem, SdsSegmentedOption, SdsSegmentedSize, SdsSelectAppearance, SdsSelectEmptyContext, SdsSelectFooterContext, SdsSelectOptionContext, SdsSelectSize, SdsSeverityLevel, SdsSeveritySize, SdsSeverityVariant, SdsShellBackground, SdsSidebarAppearance, SdsSortOrder, SdsSortableAppearance, SdsSortableItemContext, SdsSortableReorderEvent, SdsSparklineSummaryText, SdsStatusTileState, SdsTabValue, SdsTableCellCommitEvent, SdsTableCellContext, SdsTableCellErrors, SdsTableColumn, SdsTableEditTrigger, SdsTableEditor, SdsTableEmptyContext, SdsTableHeaderContext, SdsTableLazyEvent, SdsTableRowExpansionContext, SdsTableSelectOption, SdsTableSize, SdsTableSortEvent, SdsTabsVariant, SdsTextareaAppearance, SdsTextareaResize, SdsTextareaSize, SdsTheme, SdsThemeMode, SdsThemeToggleAppearance, SdsTimeInputAppearance, SdsTimeInputSize, SdsToast, SdsToastKind, SdsToggleSwitchSize, SdsTopbarAppearance, SdsTrendDirection, SdsTriState, SdsTriStateChipSize, SdsUiPrefs, SdsUserMenuAlign, SdsUserMenuAppearance };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besaitech/ng-design-system",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -37,6 +37,10 @@
37
37
  "types": "./index.d.ts",
38
38
  "default": "./fesm2022/besaitech-ng-design-system.mjs"
39
39
  },
40
+ "./calendar": {
41
+ "types": "./calendar/index.d.ts",
42
+ "default": "./fesm2022/besaitech-ng-design-system-calendar.mjs"
43
+ },
40
44
  "./charts": {
41
45
  "types": "./charts/index.d.ts",
42
46
  "default": "./fesm2022/besaitech-ng-design-system-charts.mjs"
package/themes/base.css CHANGED
@@ -47,12 +47,50 @@
47
47
  --color-warning: #f3b73c;
48
48
  --color-danger: #df4f6b;
49
49
 
50
+ /*
51
+ * Clinical severity — an ORDINAL scale, and deliberately not the status trio.
52
+ *
53
+ * Status says what the UI did: saved, needs attention, failed. Severity says how bad the thing
54
+ * itself is. A red that sometimes means "save failed" and sometimes means "anaphylaxis" is a
55
+ * safety problem, so these are a separate ramp and must never be substituted for each other.
56
+ *
57
+ * Two mechanisms keep them apart. The COLOURS are perceptually distant: every level below is at
58
+ * least dE76 30 from the nearest of success/warning/danger in CIELAB, and adjacent levels are at
59
+ * least 27 from each other, so the ramp is readable as a ramp. The FORM differs too — status is
60
+ * three categorical states and renders as a solid badge, severity is five ordered steps and can
61
+ * render as a filled meter (sds-severity). Shape is the channel that survives greyscale.
62
+ *
63
+ * `unknown` sits OUTSIDE the ramp on purpose: "not assessed" is not a low severity, and colouring
64
+ * it like one tells a clinician something nobody established.
65
+ *
66
+ * Every fg clears 4.5:1 on surface, canvas, muted AND on its own -soft in both modes. If you
67
+ * restep one, re-measure it — nothing in the build will catch a contrast regression.
68
+ */
69
+ --color-severity-unknown: #55606f;
70
+ --color-severity-unknown-soft: #eef1f5;
71
+ --color-severity-mild: #0f766e;
72
+ --color-severity-mild-soft: #e2f3f0;
73
+ --color-severity-moderate: #9a4708;
74
+ --color-severity-moderate-soft: #fbeedd;
75
+ --color-severity-severe: #b91c1c;
76
+ --color-severity-severe-soft: #fde6e6;
77
+ --color-severity-critical: #7f1d1d;
78
+ --color-severity-critical-soft: #f7cccc;
79
+ /*
80
+ * The top step is FILLED rather than tinted, so it is louder than a colour change alone — and the
81
+ * fill needs its own pair. `-critical` is a foreground (dark red on a pale surface, light pink on
82
+ * a dark one), so reusing it as a background would, in dark mode, put pale text on pale pink.
83
+ * `-fill` is the background and `-on` the text that sits on it; both measured, both modes.
84
+ */
85
+ --color-severity-critical-fill: #7f1d1d;
86
+ --color-severity-critical-on: #ffffff;
87
+
50
88
  /* Radius */
51
89
  --radius-control: 0.5rem;
52
90
  --radius-card: 0.75rem;
53
91
 
54
92
  /* Typography — override in your app's own @theme if your brand uses a different face. */
55
- --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
93
+ --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
56
94
 
57
95
  /*
58
96
  * Ambient decoration — the slow, breathing drift of the brand-tinted blobs behind the glass top bar,
@@ -123,6 +161,20 @@ html.dark {
123
161
  --color-success: #34d67e;
124
162
  --color-warning: #f6c453;
125
163
  --color-danger: #f2748c;
164
+
165
+ /* Clinical severity — re-stepped for the dark surface, same measured rules as light. */
166
+ --color-severity-unknown: #a9b0bb;
167
+ --color-severity-unknown-soft: #27272b;
168
+ --color-severity-mild: #2dd4bf;
169
+ --color-severity-mild-soft: #0f2e2b;
170
+ --color-severity-moderate: #e8903a;
171
+ --color-severity-moderate-soft: #33240f;
172
+ --color-severity-severe: #f87171;
173
+ --color-severity-severe-soft: #361616;
174
+ --color-severity-critical: #fca5a5;
175
+ --color-severity-critical-soft: #3f1111;
176
+ --color-severity-critical-fill: #991b1b;
177
+ --color-severity-critical-on: #fee2e2;
126
178
  }
127
179
 
128
180
  /*