@besaitech/ng-design-system 0.0.39 → 0.0.41
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
|
@@ -227,6 +227,65 @@ declare class SdsInput implements ControlValueAccessor {
|
|
|
227
227
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsInput, "sds-input", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "clearLabel": { "alias": "clearLabel"; "required": false; "isSignal": true; }; "leadingIcon": { "alias": "leadingIcon"; "required": false; "isSignal": true; }; "trailingIcon": { "alias": "trailingIcon"; "required": false; "isSignal": true; }; "trailingAction": { "alias": "trailingAction"; "required": false; "isSignal": true; }; "trailingActionLabel": { "alias": "trailingActionLabel"; "required": false; "isSignal": true; }; "trailingActionPressed": { "alias": "trailingActionPressed"; "required": false; "isSignal": true; }; }, { "trailingActionClick": "trailingActionClick"; }, never, never, true, never>;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
+
/** A translatable string held per language code — e.g. `{ fr: 'Titre', nl: 'Titel' }`. */
|
|
231
|
+
type SdsLocalizedValue = Record<string, string>;
|
|
232
|
+
type SdsLocalizedInputSize = 'sm' | 'md' | 'lg';
|
|
233
|
+
/**
|
|
234
|
+
* One language-aware text field for editing a translated value (a {@link SdsLocalizedValue} — a title,
|
|
235
|
+
* label or description in several languages). Only one language is edited at a time; a compact switcher
|
|
236
|
+
* sitting **inside the field** flips which translation you are editing, and a dot marks the languages that
|
|
237
|
+
* already have content, so a partially-translated value is obvious at a glance.
|
|
238
|
+
*
|
|
239
|
+
* The active language defaults to {@link currentLanguage} when it is one of {@link languages}, otherwise the
|
|
240
|
+
* first accepted language — so the field "opens on the language you are working in". Empty translations are
|
|
241
|
+
* pruned from the emitted value, keeping the stored map clean.
|
|
242
|
+
*
|
|
243
|
+
* Implements ControlValueAccessor over the map — use with reactive forms or `[(ngModel)]`:
|
|
244
|
+
* `<sds-localized-input [languages]="['fr','nl','en']" [(ngModel)]="title" />`.
|
|
245
|
+
*/
|
|
246
|
+
declare class SdsLocalizedInput implements ControlValueAccessor {
|
|
247
|
+
readonly inputId: string;
|
|
248
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
249
|
+
readonly hint: _angular_core.InputSignal<string>;
|
|
250
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
251
|
+
/** The accepted language codes, in display order (e.g. `['fr','nl','en']`). */
|
|
252
|
+
readonly languages: _angular_core.InputSignal<string[]>;
|
|
253
|
+
/** Language to pre-select; used when it is one of {@link languages}, else the first accepted language. */
|
|
254
|
+
readonly currentLanguage: _angular_core.InputSignal<string | null>;
|
|
255
|
+
readonly multiline: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
256
|
+
readonly rows: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
257
|
+
readonly size: _angular_core.InputSignal<SdsLocalizedInputSize>;
|
|
258
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
259
|
+
/**
|
|
260
|
+
* Accessible name for the in-field language switcher, and the "no translation yet" title suffix on each
|
|
261
|
+
* language button. French defaults so existing consumers are unchanged; translate them in a multi-language
|
|
262
|
+
* app (the buttons are letter-only, so the title carries their meaning).
|
|
263
|
+
*/
|
|
264
|
+
readonly languageSwitcherLabel: _angular_core.InputSignal<string>;
|
|
265
|
+
readonly untranslatedLabel: _angular_core.InputSignal<string>;
|
|
266
|
+
private readonly valueMap;
|
|
267
|
+
/** Language chosen via the switcher; null means "follow currentLanguage / the first language". */
|
|
268
|
+
private readonly manual;
|
|
269
|
+
private readonly cvaDisabled;
|
|
270
|
+
protected readonly isDisabled: _angular_core.Signal<boolean>;
|
|
271
|
+
protected readonly wrapperClasses: _angular_core.Signal<string>;
|
|
272
|
+
/** The language currently being edited. */
|
|
273
|
+
protected readonly activeLang: _angular_core.Signal<string>;
|
|
274
|
+
protected readonly current: _angular_core.Signal<string>;
|
|
275
|
+
protected filled(lang: string): boolean;
|
|
276
|
+
protected fieldPlaceholder(): string;
|
|
277
|
+
protected select(lang: string): void;
|
|
278
|
+
protected write(event: Event): void;
|
|
279
|
+
private onChange;
|
|
280
|
+
protected onTouched: () => void;
|
|
281
|
+
writeValue(value: SdsLocalizedValue | null): void;
|
|
282
|
+
registerOnChange(fn: (value: SdsLocalizedValue) => void): void;
|
|
283
|
+
registerOnTouched(fn: () => void): void;
|
|
284
|
+
setDisabledState(isDisabled: boolean): void;
|
|
285
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdsLocalizedInput, never>;
|
|
286
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsLocalizedInput, "sds-localized-input", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "languages": { "alias": "languages"; "required": false; "isSignal": true; }; "currentLanguage": { "alias": "currentLanguage"; "required": false; "isSignal": true; }; "multiline": { "alias": "multiline"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "languageSwitcherLabel": { "alias": "languageSwitcherLabel"; "required": false; "isSignal": true; }; "untranslatedLabel": { "alias": "untranslatedLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
287
|
+
}
|
|
288
|
+
|
|
230
289
|
type SdsOtpInputSize = 'md' | 'lg';
|
|
231
290
|
/**
|
|
232
291
|
* A segmented one-time-code field: one box per character, for the short numeric codes emailed or
|
|
@@ -1736,6 +1795,65 @@ declare class SdsTableRowExpansion {
|
|
|
1736
1795
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SdsTableRowExpansion, "ng-template[sdsRowExpansion]", never, {}, {}, never, never, true, never>;
|
|
1737
1796
|
}
|
|
1738
1797
|
|
|
1798
|
+
type SdsToastKind = 'success' | 'error' | 'info';
|
|
1799
|
+
interface SdsToast {
|
|
1800
|
+
id: number;
|
|
1801
|
+
kind: SdsToastKind;
|
|
1802
|
+
text: string;
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* A tiny transient-notification bus. Application code calls {@link success} / {@link error} / {@link info}
|
|
1806
|
+
* after an action; a single {@link SdsToastHost} mounted in the app shell renders the queue and each toast
|
|
1807
|
+
* auto-dismisses. Deliberately minimal — no positions, no actions-in-toast — because it exists to confirm
|
|
1808
|
+
* an action, not to be a notification centre.
|
|
1809
|
+
*
|
|
1810
|
+
* `providedIn: 'root'`, so injecting it anywhere shares one queue:
|
|
1811
|
+
*
|
|
1812
|
+
* ```ts
|
|
1813
|
+
* private readonly toasts = inject(SdsToastService);
|
|
1814
|
+
* this.toasts.success('Enregistré.');
|
|
1815
|
+
* ```
|
|
1816
|
+
*
|
|
1817
|
+
* Mount the host once (e.g. in the shell): `<sds-toast-host />`.
|
|
1818
|
+
*/
|
|
1819
|
+
declare class SdsToastService {
|
|
1820
|
+
private seq;
|
|
1821
|
+
readonly toasts: _angular_core.WritableSignal<SdsToast[]>;
|
|
1822
|
+
/** How long a toast stays, in ms, by kind. Errors linger; success/info are brief. */
|
|
1823
|
+
private static readonly TTL;
|
|
1824
|
+
success(text: string): void;
|
|
1825
|
+
error(text: string): void;
|
|
1826
|
+
info(text: string): void;
|
|
1827
|
+
dismiss(id: number): void;
|
|
1828
|
+
private push;
|
|
1829
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdsToastService, never>;
|
|
1830
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdsToastService>;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
/**
|
|
1834
|
+
* Renders the {@link SdsToastService} queue, fixed bottom-centre. Mount it once, in the app shell:
|
|
1835
|
+
* `<sds-toast-host />`. Application code pushes toasts through the injected service.
|
|
1836
|
+
*
|
|
1837
|
+
* Accessibility: the two live regions are ALWAYS in the DOM (even when empty), because a live region must
|
|
1838
|
+
* pre-exist for its later content changes to be announced. Errors go to an assertive `role="alert"` region
|
|
1839
|
+
* so a failure interrupts; success/info go to a polite region so they queue.
|
|
1840
|
+
*/
|
|
1841
|
+
declare class SdsToastHost {
|
|
1842
|
+
readonly toasts: SdsToastService;
|
|
1843
|
+
/**
|
|
1844
|
+
* Accessible name for each toast's close button. French default so existing consumers are unchanged; the
|
|
1845
|
+
* button is icon-only, so an app serving more than one language MUST translate it.
|
|
1846
|
+
*/
|
|
1847
|
+
readonly closeLabel: _angular_core.InputSignal<string>;
|
|
1848
|
+
protected readonly errors: _angular_core.Signal<SdsToast[]>;
|
|
1849
|
+
protected readonly notices: _angular_core.Signal<SdsToast[]>;
|
|
1850
|
+
protected icon(kind: SdsToastKind): SdsIconName;
|
|
1851
|
+
protected tone(kind: SdsToastKind): string;
|
|
1852
|
+
protected border(kind: SdsToast['kind']): string;
|
|
1853
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdsToastHost, never>;
|
|
1854
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsToastHost, "sds-toast-host", never, { "closeLabel": { "alias": "closeLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1739
1857
|
/**
|
|
1740
1858
|
* Shared collapse state for the sidebar and its nav items.
|
|
1741
1859
|
*
|
|
@@ -1957,5 +2075,5 @@ declare class SdsNavItem {
|
|
|
1957
2075
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsNavItem, "sds-nav-item", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "link": { "alias": "link"; "required": false; "isSignal": true; }; "exact": { "alias": "exact"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; }, { "select": "select"; }, never, never, true, never>;
|
|
1958
2076
|
}
|
|
1959
2077
|
|
|
1960
|
-
export { SDS_ICONS, SDS_PHONE_COUNTRIES, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAvatar, SdsBadge, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsDatePicker, SdsIcon, SdsInput, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsSelect, SdsShell, SdsSidebar, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsToggleSwitch, SdsTopbar, SidebarStore, addDays, addMonths, addMonthsKeepDay, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isoDay, pad2, sdsFormatNational, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth };
|
|
1961
|
-
export type { SdsAccordionActive, SdsAccordionValue, SdsAvatarStatus, SdsBadgeSize, SdsBadgeVariant, SdsButtonShape, SdsButtonSize, SdsButtonVariant, SdsCardVariant, SdsCheckboxSize, SdsDatePickerSize, SdsIconName, SdsIconSize, SdsInputAppearance, SdsInputShape, SdsInputSize, SdsInputType, SdsMultiSelectDisplay, SdsMultiSelectSize, SdsOtpInputSize, SdsPaginatorSize, SdsPaginatorState, SdsPhoneCountry, SdsPhoneInputSize, SdsPhoneValue, SdsSelectAppearance, SdsSelectSize, SdsSortOrder, SdsTabValue, SdsTableCellContext, SdsTableColumn, SdsTableLazyEvent, SdsTableRowExpansionContext, SdsTableSize, SdsTableSortEvent, SdsTextareaResize, SdsTextareaSize, SdsToggleSwitchSize, SdsTopbarAppearance };
|
|
2078
|
+
export { SDS_ICONS, SDS_PHONE_COUNTRIES, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAvatar, SdsBadge, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsDatePicker, SdsIcon, SdsInput, SdsLocalizedInput, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsSelect, SdsShell, SdsSidebar, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsToastHost, SdsToastService, SdsToggleSwitch, SdsTopbar, SidebarStore, addDays, addMonths, addMonthsKeepDay, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isoDay, pad2, sdsFormatNational, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth };
|
|
2079
|
+
export type { SdsAccordionActive, SdsAccordionValue, SdsAvatarStatus, SdsBadgeSize, SdsBadgeVariant, SdsButtonShape, SdsButtonSize, SdsButtonVariant, SdsCardVariant, SdsCheckboxSize, SdsDatePickerSize, SdsIconName, SdsIconSize, SdsInputAppearance, SdsInputShape, SdsInputSize, SdsInputType, SdsLocalizedInputSize, SdsLocalizedValue, SdsMultiSelectDisplay, SdsMultiSelectSize, SdsOtpInputSize, SdsPaginatorSize, SdsPaginatorState, SdsPhoneCountry, SdsPhoneInputSize, SdsPhoneValue, SdsSelectAppearance, SdsSelectSize, SdsSortOrder, SdsTabValue, SdsTableCellContext, SdsTableColumn, SdsTableLazyEvent, SdsTableRowExpansionContext, SdsTableSize, SdsTableSortEvent, SdsTextareaResize, SdsTextareaSize, SdsToast, SdsToastKind, SdsToggleSwitchSize, SdsTopbarAppearance };
|
package/package.json
CHANGED
package/themes/saitech.css
CHANGED
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
*/
|
|
15
15
|
@theme {
|
|
16
16
|
/* Brand blues */
|
|
17
|
-
--color-brand-50: #
|
|
18
|
-
--color-brand-100: #
|
|
19
|
-
--color-brand-200: #
|
|
20
|
-
--color-brand-300: #
|
|
21
|
-
--color-brand-400: #
|
|
22
|
-
--color-brand-500: #
|
|
23
|
-
--color-brand-600: #
|
|
24
|
-
--color-brand-700: #
|
|
25
|
-
--color-brand-800: #
|
|
26
|
-
--color-brand-900: #
|
|
27
|
-
--color-brand-950: #
|
|
17
|
+
--color-brand-50: #fafafa;
|
|
18
|
+
--color-brand-100: #f4f4f5;
|
|
19
|
+
--color-brand-200: #e4e4e7;
|
|
20
|
+
--color-brand-300: #d4d4d8;
|
|
21
|
+
--color-brand-400: #a1a1aa;
|
|
22
|
+
--color-brand-500: #52525b; /* active nav highlight */
|
|
23
|
+
--color-brand-600: #27272a; /* primary button */
|
|
24
|
+
--color-brand-700: #18181b; /* top bar base */
|
|
25
|
+
--color-brand-800: #131316;
|
|
26
|
+
--color-brand-900: #0a0a0b; /* sidebar background */
|
|
27
|
+
--color-brand-950: #000000;
|
|
28
28
|
}
|