@sixbell-telco/sdk 1.3.0 → 1.4.0

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +28 -1
  3. package/_index.css +109 -11
  4. package/assets/styles/toast.css +8 -0
  5. package/components/forms/date-picker/constants/date-picker.constants.d.ts +13 -0
  6. package/components/forms/date-picker/index.d.ts +5 -0
  7. package/components/forms/date-picker/public-api.d.ts +3 -0
  8. package/components/forms/date-picker/src/date-picker.component.d.ts +323 -0
  9. package/components/forms/date-picker/types/date-picker.types.d.ts +39 -0
  10. package/components/{forms/datepicker → sonner}/index.d.ts +1 -1
  11. package/components/sonner/public-api.d.ts +2 -0
  12. package/components/sonner/src/sonner.component.d.ts +39 -0
  13. package/components/sonner/toaster/index.d.ts +5 -0
  14. package/components/sonner/toaster/public-api.d.ts +1 -0
  15. package/components/sonner/toaster/src/toaster.component.d.ts +89 -0
  16. package/components/toast/public-api.d.ts +9 -0
  17. package/components/toast/services/toast.service.d.ts +3 -0
  18. package/components/toast/toast-message/toast-message.component.d.ts +3 -0
  19. package/components/toast/toasts-container/toasts-container.component.d.ts +3 -0
  20. package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +885 -0
  21. package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -0
  22. package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs +132 -0
  23. package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs.map +1 -0
  24. package/fesm2022/sixbell-telco-sdk-components-sonner.mjs +179 -0
  25. package/fesm2022/sixbell-telco-sdk-components-sonner.mjs.map +1 -0
  26. package/fesm2022/sixbell-telco-sdk-components-toast.mjs +14 -0
  27. package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +1 -1
  28. package/fesm2022/sixbell-telco-sdk-utils-date.mjs +90 -2
  29. package/fesm2022/sixbell-telco-sdk-utils-date.mjs.map +1 -1
  30. package/package.json +47 -38
  31. package/utils/date/src/date-utils.d.ts +44 -0
  32. package/components/forms/datepicker/constants/datepicker.constants.d.ts +0 -5
  33. package/components/forms/datepicker/public-api.d.ts +0 -3
  34. package/components/forms/datepicker/src/datepicker.component.d.ts +0 -165
  35. package/components/forms/datepicker/types/datepicker.types.d.ts +0 -7
  36. package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs +0 -487
  37. package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs.map +0 -1
@@ -0,0 +1,39 @@
1
+ import { DATE_STYLES, DATEPICKER_MODES, RANGE_CALENDARS, SUPPORTED_LOCALES, TIME_DISPLAY_FORMATS } from '../constants/date-picker.constants';
2
+ /** Union type of all supported locale strings for the datepicker. */
3
+ export type SupportedLocale = (typeof SUPPORTED_LOCALES)[number];
4
+ /**
5
+ * Union type for datepicker component values
6
+ */
7
+ export type DatePickerValue = string | import('@sixbell-telco/sdk/utils/date').DateRange | null;
8
+ /** Derived union types from constants for the public API */
9
+ /** One of 'single' or 'range' */
10
+ export type DatepickerMode = (typeof DATEPICKER_MODES)[number];
11
+ /** Time display format for trigger text: '24h' | '12h' */
12
+ export type TimeDisplayFormat = (typeof TIME_DISPLAY_FORMATS)[number];
13
+ /** Intl.DateTimeFormat dateStyle value used when useLocaleDisplay=true */
14
+ export type DateStyle = (typeof DATE_STYLES)[number];
15
+ /** Number of calendars to display in range mode: 1 | 2 */
16
+ export type RangeCalendars = (typeof RANGE_CALENDARS)[number];
17
+ /** Time string with minutes precision (e.g. 09:30) */
18
+ /** Time with minutes precision (e.g. "09:30"). Always 2-digit HH and mm. */
19
+ export type TimeMinutesString = `${number}${number}:${number}${number}`;
20
+ /** Time string with seconds precision (e.g. 09:30:15) */
21
+ /** Time with seconds precision (e.g. "09:30:15"). Always 2-digit HH, mm, ss. */
22
+ export type TimeSecondsString = `${number}${number}:${number}${number}:${number}${number}`;
23
+ /** Time string accepted by the datepicker time inputs/outputs */
24
+ /**
25
+ * Canonical time string shape accepted by the datepicker time inputs/outputs.
26
+ * Values are either HH:mm or HH:mm:ss with leading zeros.
27
+ */
28
+ export type TimeString = TimeMinutesString | TimeSecondsString;
29
+ /** Time string or empty string to represent an unset time */
30
+ /**
31
+ * Official "unset time" representation used by the datepicker API.
32
+ * - Use '' (empty string) to indicate no time has been selected/set yet.
33
+ * - Use TimeString when a time is explicitly selected.
34
+ *
35
+ * Notes for consumers:
36
+ * - Bind startTimeValue/endTimeValue with '' to clear/reset the time input.
37
+ * - Listen to (startTimeChanged)/(endTimeChanged) which emit OptionalTimeString and handle '' as "no time".
38
+ */
39
+ export type OptionalTimeString = TimeString | '';
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
- /// <amd-module name="@sixbell-telco/sdk/components/forms/datepicker" />
4
+ /// <amd-module name="@sixbell-telco/sdk/components/sonner" />
5
5
  export * from './public-api';
@@ -0,0 +1,2 @@
1
+ export * from './src/sonner.component';
2
+ export * from './toaster/src/toaster.component';
@@ -0,0 +1,39 @@
1
+ import { Type } from '@angular/core';
2
+ import { toast as ngxToast } from 'ngx-sonner';
3
+ /**
4
+ * @internal
5
+ * Generates base toast classes with style variants for semantic colors
6
+ */
7
+ export declare const toastVariants: (props?: ({
8
+ variant?: "default" | "success" | "error" | "warning" | "info" | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
+ /** Possible toast style variants */
11
+ export type ToastVariantProps = 'default' | 'success' | 'error' | 'warning' | 'info' | null | undefined;
12
+ /**
13
+ * Toast function with semantic variants and Tailwind styling
14
+ * Proxies ngx-sonner toast functionality with SDK styling
15
+ */
16
+ declare function createToast(message: string, options?: Record<string, unknown>): string | number;
17
+ declare namespace createToast {
18
+ var success: (message: string, options?: Record<string, unknown>) => string | number;
19
+ var error: (message: string, options?: Record<string, unknown>) => string | number;
20
+ var warning: (message: string, options?: Record<string, unknown>) => string | number;
21
+ var info: (message: string, options?: Record<string, unknown>) => string | number;
22
+ var loading: (message: string, options?: Record<string, unknown>) => string | number;
23
+ var promise: (promise: Promise<unknown>, options: Record<string, unknown>) => string | number | undefined;
24
+ var custom: (component: Type<unknown>, options?: Record<string, unknown>) => string | number;
25
+ var dismiss: (id?: string | number) => string | number | undefined;
26
+ var dismissAll: () => string | number | undefined;
27
+ }
28
+ export declare const toast: typeof createToast & {
29
+ success: (message: string, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;
30
+ error: (message: string, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;
31
+ warning: (message: string, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;
32
+ info: (message: string, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;
33
+ loading: (message: string, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;
34
+ promise: (promise: Promise<unknown>, options: Record<string, unknown>) => ReturnType<typeof ngxToast>;
35
+ custom: (component: Type<unknown>, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;
36
+ dismiss: (id?: string | number) => ReturnType<typeof ngxToast>;
37
+ dismissAll: () => ReturnType<typeof ngxToast>;
38
+ };
39
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@sixbell-telco/sdk/components/sonner/toaster" />
5
+ export * from './public-api';
@@ -0,0 +1 @@
1
+ export * from './src/toaster.component';
@@ -0,0 +1,89 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Sixbell Telco Sonner Toaster Component
4
+ *
5
+ * A wrapper around ngx-sonner-toaster that provides Tailwind CSS styling and semantic color variants.
6
+ * This component proxies the ngx-sonner-toaster functionality while applying the SDK's design system.
7
+ *
8
+ * @example
9
+ * ```html
10
+ * <st-sonner-toaster
11
+ * [theme]="'light'"
12
+ * [position]="'bottom-right'"
13
+ * [richColors]="true"
14
+ * />
15
+ * ```
16
+ */
17
+ export declare class SonnerToasterComponent {
18
+ /**
19
+ * Direction for the toasts
20
+ * @defaultValue 'ltr'
21
+ */
22
+ dir: import("@angular/core").InputSignal<"ltr" | "rtl">;
23
+ /**
24
+ * Whether to use rich colors for semantic toasts
25
+ * @defaultValue true
26
+ */
27
+ richColors: import("@angular/core").InputSignal<boolean>;
28
+ /**
29
+ * Whether to expand the toast on hover
30
+ * @defaultValue false
31
+ */
32
+ expand: import("@angular/core").InputSignal<boolean>;
33
+ /**
34
+ * Maximum number of visible toasts
35
+ * @defaultValue 3
36
+ */
37
+ visibleToasts: import("@angular/core").InputSignal<number>;
38
+ /**
39
+ * Position of the toasts
40
+ * @defaultValue 'bottom-right'
41
+ */
42
+ position: import("@angular/core").InputSignal<"top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center">;
43
+ /**
44
+ * Offset from the edge of the screen
45
+ * @defaultValue '16px'
46
+ */
47
+ offset: import("@angular/core").InputSignal<string>;
48
+ /**
49
+ * Whether to show close button
50
+ * @defaultValue false
51
+ */
52
+ closeButton: import("@angular/core").InputSignal<boolean>;
53
+ /**
54
+ * Duration for the toast in milliseconds
55
+ * @defaultValue 4000
56
+ */
57
+ duration: import("@angular/core").InputSignal<number>;
58
+ /**
59
+ * Default toast options with semantic styling
60
+ */
61
+ toastOptions: import("@angular/core").Signal<{
62
+ unstyled: boolean;
63
+ classes: {
64
+ success: string;
65
+ error: string;
66
+ warning: string;
67
+ info: string;
68
+ toast: string;
69
+ title: string;
70
+ description: string;
71
+ actionButton: string;
72
+ cancelButton: string;
73
+ closeButton: string;
74
+ } | {
75
+ success?: undefined;
76
+ error?: undefined;
77
+ warning?: undefined;
78
+ info?: undefined;
79
+ toast: string;
80
+ title: string;
81
+ description: string;
82
+ actionButton: string;
83
+ cancelButton: string;
84
+ closeButton: string;
85
+ };
86
+ }>;
87
+ static ɵfac: i0.ɵɵFactoryDeclaration<SonnerToasterComponent, never>;
88
+ static ɵcmp: i0.ɵɵComponentDeclaration<SonnerToasterComponent, "st-sonner-toaster", never, { "dir": { "alias": "dir"; "required": false; "isSignal": true; }; "richColors": { "alias": "richColors"; "required": false; "isSignal": true; }; "expand": { "alias": "expand"; "required": false; "isSignal": true; }; "visibleToasts": { "alias": "visibleToasts"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "closeButton": { "alias": "closeButton"; "required": false; "isSignal": true; }; "duration": { "alias": "duration"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
89
+ }
@@ -1,3 +1,12 @@
1
+ /**
2
+ * @deprecated This toast system is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
3
+ */
1
4
  export * from './services/toast.service';
5
+ /**
6
+ * @deprecated This toast system is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
7
+ */
2
8
  export * from './toast-message/toast-message.component';
9
+ /**
10
+ * @deprecated This toast system is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
11
+ */
3
12
  export * from './toasts-container/toasts-container.component';
@@ -13,6 +13,9 @@ export type Toast = {
13
13
  duration: number;
14
14
  animate: 'enter' | 'leave';
15
15
  };
16
+ /**
17
+ * @deprecated This toast service is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
18
+ */
16
19
  export declare class ToastService {
17
20
  private toastsSignal;
18
21
  private expandedSignal;
@@ -7,6 +7,9 @@ export type ToastVariantProps = 'info' | 'success' | 'warning' | 'error' | null
7
7
  export type ToastProps = {
8
8
  variant?: ToastVariantProps;
9
9
  };
10
+ /**
11
+ * @deprecated This component is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
12
+ */
10
13
  export declare class ToastMessageComponent {
11
14
  variant: import("@angular/core").InputSignal<ToastVariantProps>;
12
15
  classes: import("@angular/core").InputSignal<string>;
@@ -1,5 +1,8 @@
1
1
  import { Toast, ToastService } from '../services/toast.service';
2
2
  import * as i0 from "@angular/core";
3
+ /**
4
+ * @deprecated This component is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
5
+ */
3
6
  export declare class ToastsContainerComponent {
4
7
  toastService: ToastService;
5
8
  protected containerClasses: import("@angular/core").Signal<{