@beshkari/mb-ui 0.5.0-alpha.1
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/LICENSE +21 -0
- package/README.md +98 -0
- package/esm2022/beshkari-mb-ui.mjs +5 -0
- package/esm2022/lib/accordion/mb-accordion.component.mjs +37 -0
- package/esm2022/lib/alert/mb-alert.component.mjs +28 -0
- package/esm2022/lib/avatar/mb-avatar.component.mjs +32 -0
- package/esm2022/lib/badge/mb-badge.component.mjs +28 -0
- package/esm2022/lib/breadcrumb/mb-breadcrumb.component.mjs +23 -0
- package/esm2022/lib/button/mb-button.component.mjs +48 -0
- package/esm2022/lib/card/mb-card.component.mjs +28 -0
- package/esm2022/lib/checkbox/mb-checkbox.component.mjs +75 -0
- package/esm2022/lib/chip/mb-chip.component.mjs +33 -0
- package/esm2022/lib/combobox/mb-combobox.component.mjs +235 -0
- package/esm2022/lib/confirm/mb-confirm-dialog.component.mjs +44 -0
- package/esm2022/lib/confirm/mb-confirm.service.mjs +39 -0
- package/esm2022/lib/confirm/mb-confirm.types.mjs +2 -0
- package/esm2022/lib/datepicker/mb-datepicker.component.mjs +382 -0
- package/esm2022/lib/dialog/mb-dialog-container.component.mjs +37 -0
- package/esm2022/lib/dialog/mb-dialog-ref.mjs +17 -0
- package/esm2022/lib/dialog/mb-dialog.component.mjs +87 -0
- package/esm2022/lib/dialog/mb-dialog.service.mjs +61 -0
- package/esm2022/lib/dialog/mb-dialog.tokens.mjs +3 -0
- package/esm2022/lib/divider/mb-divider.component.mjs +18 -0
- package/esm2022/lib/drawer/mb-drawer.component.mjs +34 -0
- package/esm2022/lib/dropdown/mb-dropdown.component.mjs +24 -0
- package/esm2022/lib/empty/mb-empty.component.mjs +27 -0
- package/esm2022/lib/form-field/mb-form-field.component.mjs +24 -0
- package/esm2022/lib/grid/mb-grid-data.mjs +266 -0
- package/esm2022/lib/grid/mb-grid-export.mjs +36 -0
- package/esm2022/lib/grid/mb-grid-messages.mjs +10 -0
- package/esm2022/lib/grid/mb-grid-state-adapter.mjs +97 -0
- package/esm2022/lib/grid/mb-grid-state.service.mjs +47 -0
- package/esm2022/lib/grid/mb-grid-template.directive.mjs +109 -0
- package/esm2022/lib/grid/mb-grid.component.mjs +998 -0
- package/esm2022/lib/grid/mb-grid.types.mjs +2 -0
- package/esm2022/lib/i18n/mb-ui-locale.mjs +18 -0
- package/esm2022/lib/i18n/mb-ui-messages-en.mjs +103 -0
- package/esm2022/lib/i18n/mb-ui-messages-fa.mjs +103 -0
- package/esm2022/lib/i18n/mb-ui-messages.mjs +34 -0
- package/esm2022/lib/i18n/mb-ui-messages.types.mjs +2 -0
- package/esm2022/lib/i18n/provide-mb-ui.mjs +20 -0
- package/esm2022/lib/input/mb-input.component.mjs +86 -0
- package/esm2022/lib/pagination/mb-pagination.component.mjs +47 -0
- package/esm2022/lib/progress/mb-progress.component.mjs +29 -0
- package/esm2022/lib/radio/mb-radio-group.component.mjs +63 -0
- package/esm2022/lib/select/mb-select.component.mjs +73 -0
- package/esm2022/lib/skeleton/mb-skeleton.component.mjs +24 -0
- package/esm2022/lib/spinner/mb-spinner.component.mjs +21 -0
- package/esm2022/lib/switch/mb-switch.component.mjs +59 -0
- package/esm2022/lib/tabs/mb-tabs.component.mjs +31 -0
- package/esm2022/lib/textarea/mb-textarea.component.mjs +83 -0
- package/esm2022/lib/toast/mb-toast-container.component.mjs +21 -0
- package/esm2022/lib/toast/mb-toast.service.mjs +47 -0
- package/esm2022/lib/toast/mb-toast.types.mjs +2 -0
- package/esm2022/lib/tokens/mb-ui-config.token.mjs +11 -0
- package/esm2022/lib/tooltip/mb-tooltip.directive.mjs +48 -0
- package/esm2022/lib/utils/coerce.mjs +10 -0
- package/esm2022/lib/utils/mb-jalali-date.mjs +120 -0
- package/esm2022/public-api.mjs +56 -0
- package/fesm2022/beshkari-mb-ui.mjs +3828 -0
- package/fesm2022/beshkari-mb-ui.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/accordion/mb-accordion.component.d.ts +19 -0
- package/lib/alert/mb-alert.component.d.ts +12 -0
- package/lib/avatar/mb-avatar.component.d.ts +12 -0
- package/lib/badge/mb-badge.component.d.ts +12 -0
- package/lib/breadcrumb/mb-breadcrumb.component.d.ts +15 -0
- package/lib/button/mb-button.component.d.ts +19 -0
- package/lib/card/mb-card.component.d.ts +10 -0
- package/lib/checkbox/mb-checkbox.component.d.ts +25 -0
- package/lib/chip/mb-chip.component.d.ts +12 -0
- package/lib/combobox/mb-combobox.component.d.ts +65 -0
- package/lib/confirm/mb-confirm-dialog.component.d.ts +17 -0
- package/lib/confirm/mb-confirm.service.d.ts +12 -0
- package/lib/confirm/mb-confirm.types.d.ts +10 -0
- package/lib/datepicker/mb-datepicker.component.d.ts +87 -0
- package/lib/dialog/mb-dialog-container.component.d.ts +14 -0
- package/lib/dialog/mb-dialog-ref.d.ts +9 -0
- package/lib/dialog/mb-dialog.component.d.ts +27 -0
- package/lib/dialog/mb-dialog.service.d.ts +14 -0
- package/lib/dialog/mb-dialog.tokens.d.ts +13 -0
- package/lib/divider/mb-divider.component.d.ts +7 -0
- package/lib/drawer/mb-drawer.component.d.ts +14 -0
- package/lib/dropdown/mb-dropdown.component.d.ts +10 -0
- package/lib/empty/mb-empty.component.d.ts +10 -0
- package/lib/form-field/mb-form-field.component.d.ts +9 -0
- package/lib/grid/mb-grid-data.d.ts +20 -0
- package/lib/grid/mb-grid-export.d.ts +9 -0
- package/lib/grid/mb-grid-messages.d.ts +6 -0
- package/lib/grid/mb-grid-state-adapter.d.ts +24 -0
- package/lib/grid/mb-grid-state.service.d.ts +10 -0
- package/lib/grid/mb-grid-template.directive.d.ts +43 -0
- package/lib/grid/mb-grid.component.d.ts +233 -0
- package/lib/grid/mb-grid.types.d.ts +255 -0
- package/lib/i18n/mb-ui-locale.d.ts +2 -0
- package/lib/i18n/mb-ui-messages-en.d.ts +3 -0
- package/lib/i18n/mb-ui-messages-fa.d.ts +3 -0
- package/lib/i18n/mb-ui-messages.d.ts +5 -0
- package/lib/i18n/mb-ui-messages.types.d.ts +90 -0
- package/lib/i18n/provide-mb-ui.d.ts +7 -0
- package/lib/input/mb-input.component.d.ts +30 -0
- package/lib/pagination/mb-pagination.component.d.ts +16 -0
- package/lib/progress/mb-progress.component.d.ts +11 -0
- package/lib/radio/mb-radio-group.component.d.ts +30 -0
- package/lib/select/mb-select.component.d.ts +31 -0
- package/lib/skeleton/mb-skeleton.component.d.ts +9 -0
- package/lib/spinner/mb-spinner.component.d.ts +9 -0
- package/lib/switch/mb-switch.component.d.ts +22 -0
- package/lib/tabs/mb-tabs.component.d.ts +19 -0
- package/lib/textarea/mb-textarea.component.d.ts +29 -0
- package/lib/toast/mb-toast-container.component.d.ts +10 -0
- package/lib/toast/mb-toast.service.d.ts +15 -0
- package/lib/toast/mb-toast.types.d.ts +8 -0
- package/lib/tokens/mb-ui-config.token.d.ts +12 -0
- package/lib/tooltip/mb-tooltip.directive.d.ts +13 -0
- package/lib/utils/coerce.d.ts +3 -0
- package/lib/utils/mb-jalali-date.d.ts +18 -0
- package/package.json +50 -0
- package/public-api.d.ts +55 -0
- package/theme/_components.scss +19 -0
- package/theme/_dark.scss +1 -0
- package/theme/_density.scss +1 -0
- package/theme/_tokens.scss +57 -0
- package/theme/mb-ui.scss +28 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import { MbSize } from '../tokens/mb-ui-config.token';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface MbRadioOption<T = unknown> {
|
|
6
|
+
label: string;
|
|
7
|
+
value: T;
|
|
8
|
+
hint?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class MbRadioGroupComponent<T = unknown> implements ControlValueAccessor {
|
|
12
|
+
options: MbRadioOption<T>[];
|
|
13
|
+
name: string;
|
|
14
|
+
size: MbSize;
|
|
15
|
+
direction: 'horizontal' | 'vertical';
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
valueChange: EventEmitter<T>;
|
|
18
|
+
hostClass: string;
|
|
19
|
+
value: T | null;
|
|
20
|
+
private onChange;
|
|
21
|
+
private onTouched;
|
|
22
|
+
writeValue(value: T | null): void;
|
|
23
|
+
registerOnChange(fn: (value: T | null) => void): void;
|
|
24
|
+
registerOnTouched(fn: () => void): void;
|
|
25
|
+
setDisabledState(isDisabled: boolean): void;
|
|
26
|
+
choose(option: MbRadioOption<T>): void;
|
|
27
|
+
trackByValue(index: number): number;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MbRadioGroupComponent<any>, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MbRadioGroupComponent<any>, "mb-radio-group", never, { "options": { "alias": "options"; "required": false; }; "name": { "alias": "name"; "required": false; }; "size": { "alias": "size"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import { MbSize } from '../tokens/mb-ui-config.token';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface MbSelectOption<T = unknown> {
|
|
6
|
+
label: string;
|
|
7
|
+
value: T;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class MbSelectComponent<T = unknown> implements ControlValueAccessor {
|
|
11
|
+
private readonly messages;
|
|
12
|
+
options: MbSelectOption<T>[];
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
size: MbSize;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
invalid: boolean;
|
|
17
|
+
valueChange: EventEmitter<T>;
|
|
18
|
+
value: T | null;
|
|
19
|
+
get effectivePlaceholder(): string;
|
|
20
|
+
private onChange;
|
|
21
|
+
private onTouched;
|
|
22
|
+
writeValue(value: T | null): void;
|
|
23
|
+
registerOnChange(fn: (value: T | null) => void): void;
|
|
24
|
+
registerOnTouched(fn: () => void): void;
|
|
25
|
+
setDisabledState(isDisabled: boolean): void;
|
|
26
|
+
compareByValue: (a: T | null, b: T | null) => boolean;
|
|
27
|
+
handleChange(value: T | null): void;
|
|
28
|
+
blur(): void;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MbSelectComponent<any>, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MbSelectComponent<any>, "mb-select", never, { "options": { "alias": "options"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "size": { "alias": "size"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class MbSkeletonComponent {
|
|
3
|
+
width: string;
|
|
4
|
+
height: string;
|
|
5
|
+
radius: string;
|
|
6
|
+
hostClass: string;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MbSkeletonComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MbSkeletonComponent, "mb-skeleton", never, { "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "radius": { "alias": "radius"; "required": false; }; }, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MbSize } from '../tokens/mb-ui-config.token';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class MbSpinnerComponent {
|
|
4
|
+
size: MbSize;
|
|
5
|
+
label: string;
|
|
6
|
+
hostClass: string;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MbSpinnerComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MbSpinnerComponent, "mb-spinner", never, { "size": { "alias": "size"; "required": false; }; "label": { "alias": "label"; "required": false; }; }, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import { MbSize } from '../tokens/mb-ui-config.token';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class MbSwitchComponent implements ControlValueAccessor {
|
|
6
|
+
label: string;
|
|
7
|
+
hint: string;
|
|
8
|
+
size: MbSize;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
checkedChange: EventEmitter<boolean>;
|
|
11
|
+
hostClass: string;
|
|
12
|
+
checked: boolean;
|
|
13
|
+
private onChange;
|
|
14
|
+
private onTouched;
|
|
15
|
+
writeValue(value: boolean | null): void;
|
|
16
|
+
registerOnChange(fn: (value: boolean) => void): void;
|
|
17
|
+
registerOnTouched(fn: () => void): void;
|
|
18
|
+
setDisabledState(isDisabled: boolean): void;
|
|
19
|
+
toggle(): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MbSwitchComponent, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MbSwitchComponent, "mb-switch", never, { "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "size": { "alias": "size"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "checkedChange": "checkedChange"; }, never, never, true, never>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export interface MbTabItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
badge?: string | number;
|
|
8
|
+
}
|
|
9
|
+
export declare class MbTabsComponent {
|
|
10
|
+
tabs: MbTabItem[];
|
|
11
|
+
activeId: string;
|
|
12
|
+
variant: 'line' | 'pills';
|
|
13
|
+
activeIdChange: EventEmitter<string>;
|
|
14
|
+
hostClass: string;
|
|
15
|
+
select(tab: MbTabItem): void;
|
|
16
|
+
trackById(_: number, item: MbTabItem): string;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MbTabsComponent, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MbTabsComponent, "mb-tabs", never, { "tabs": { "alias": "tabs"; "required": false; }; "activeId": { "alias": "activeId"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; }, { "activeIdChange": "activeIdChange"; }, never, never, true, never>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ElementRef, EventEmitter } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import { MbSize } from '../tokens/mb-ui-config.token';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class MbTextareaComponent implements ControlValueAccessor {
|
|
6
|
+
placeholder: string;
|
|
7
|
+
rows: number;
|
|
8
|
+
size: MbSize;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
readonly: boolean;
|
|
11
|
+
invalid: boolean;
|
|
12
|
+
autoResize: boolean;
|
|
13
|
+
maxLength?: number;
|
|
14
|
+
valueChange: EventEmitter<string>;
|
|
15
|
+
textarea?: ElementRef<HTMLTextAreaElement>;
|
|
16
|
+
hostClass: string;
|
|
17
|
+
value: string;
|
|
18
|
+
private onChange;
|
|
19
|
+
private onTouched;
|
|
20
|
+
writeValue(value: string | null): void;
|
|
21
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
22
|
+
registerOnTouched(fn: () => void): void;
|
|
23
|
+
setDisabledState(isDisabled: boolean): void;
|
|
24
|
+
onInput(event: Event): void;
|
|
25
|
+
blur(): void;
|
|
26
|
+
private resize;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MbTextareaComponent, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MbTextareaComponent, "mb-textarea", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "size": { "alias": "size"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "autoResize": { "alias": "autoResize"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MbToastService } from './mb-toast.service';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class MbToastContainerComponent {
|
|
4
|
+
readonly toastService: MbToastService;
|
|
5
|
+
readonly messages: import("@beshkari/mb-ui").MbUiMessages;
|
|
6
|
+
readonly toasts$: any;
|
|
7
|
+
constructor(toastService: MbToastService);
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MbToastContainerComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MbToastContainerComponent, "mb-toast-container", never, {}, {}, never, never, true, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MbToast } from './mb-toast.types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class MbToastService {
|
|
4
|
+
private readonly toastsSubject;
|
|
5
|
+
readonly toasts$: import("rxjs").Observable<MbToast[]>;
|
|
6
|
+
show(message: string, options?: Partial<Omit<MbToast, 'id' | 'message'>>): string;
|
|
7
|
+
success(message: string, title?: string): string;
|
|
8
|
+
info(message: string, title?: string): string;
|
|
9
|
+
warning(message: string, title?: string): string;
|
|
10
|
+
danger(message: string, title?: string): string;
|
|
11
|
+
dismiss(id: string): void;
|
|
12
|
+
clear(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MbToastService, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MbToastService>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { MbUiLocale } from '../i18n/mb-ui-locale';
|
|
3
|
+
export type MbDirection = 'ltr' | 'rtl';
|
|
4
|
+
export type MbSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
export type MbDensity = 'compact' | 'comfortable' | 'spacious';
|
|
6
|
+
export interface MbUiConfig {
|
|
7
|
+
direction: MbDirection;
|
|
8
|
+
density: MbDensity;
|
|
9
|
+
locale: MbUiLocale;
|
|
10
|
+
}
|
|
11
|
+
export declare const MB_UI_DEFAULT_CONFIG: MbUiConfig;
|
|
12
|
+
export declare const MB_UI_CONFIG: InjectionToken<MbUiConfig>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class MbTooltipDirective {
|
|
4
|
+
private readonly elementRef;
|
|
5
|
+
private readonly renderer;
|
|
6
|
+
text: string;
|
|
7
|
+
private tooltip?;
|
|
8
|
+
constructor(elementRef: ElementRef<HTMLElement>, renderer: Renderer2);
|
|
9
|
+
show(): void;
|
|
10
|
+
hide(): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MbTooltipDirective, never>;
|
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MbTooltipDirective, "[mbTooltip]", never, { "text": { "alias": "mbTooltip"; "required": false; }; }, {}, never, never, true, never>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Lightweight Jalali (Persian) calendar conversion utilities. */
|
|
2
|
+
export interface MbJalaliDate {
|
|
3
|
+
year: number;
|
|
4
|
+
month: number;
|
|
5
|
+
day: number;
|
|
6
|
+
}
|
|
7
|
+
export interface MbGregorianDate {
|
|
8
|
+
year: number;
|
|
9
|
+
month: number;
|
|
10
|
+
day: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const MB_JALALI_MONTH_NAMES: string[];
|
|
13
|
+
export declare function mbGregorianToJalali(date: MbGregorianDate): MbJalaliDate;
|
|
14
|
+
export declare function mbJalaliToGregorian(date: MbJalaliDate): MbGregorianDate;
|
|
15
|
+
export declare function mbParseIsoDate(value: string): MbGregorianDate | null;
|
|
16
|
+
export declare function mbToIsoDate(date: MbGregorianDate): string;
|
|
17
|
+
export declare function mbJalaliMonthLength(year: number, month: number): number;
|
|
18
|
+
export declare function mbFormatJalali(date: MbJalaliDate, separator?: string): string;
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@beshkari/mb-ui",
|
|
3
|
+
"version": "0.5.0-alpha.1",
|
|
4
|
+
"description": "A modern Angular UI library for enterprise/admin projects with English and Persian (RTL) support.",
|
|
5
|
+
"author": "Mohammad Beshkari",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.scss"
|
|
10
|
+
],
|
|
11
|
+
"keywords": [
|
|
12
|
+
"angular",
|
|
13
|
+
"ui",
|
|
14
|
+
"component-library",
|
|
15
|
+
"rtl",
|
|
16
|
+
"design-system",
|
|
17
|
+
"grid",
|
|
18
|
+
"enterprise"
|
|
19
|
+
],
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@angular/animations": "^18.0.0",
|
|
22
|
+
"@angular/common": "^18.0.0",
|
|
23
|
+
"@angular/core": "^18.0.0",
|
|
24
|
+
"@angular/forms": "^18.0.0",
|
|
25
|
+
"@angular/cdk": "^18.0.0",
|
|
26
|
+
"rxjs": "^7.8.0"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"tslib": "^2.6.2"
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
"./theme": {
|
|
33
|
+
"sass": "./theme/mb-ui.scss"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": {
|
|
36
|
+
"default": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
".": {
|
|
39
|
+
"types": "./index.d.ts",
|
|
40
|
+
"esm2022": "./esm2022/beshkari-mb-ui.mjs",
|
|
41
|
+
"esm": "./esm2022/beshkari-mb-ui.mjs",
|
|
42
|
+
"default": "./fesm2022/beshkari-mb-ui.mjs"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"module": "fesm2022/beshkari-mb-ui.mjs",
|
|
49
|
+
"typings": "index.d.ts"
|
|
50
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export * from './lib/tokens/mb-ui-config.token';
|
|
2
|
+
export * from './lib/i18n/mb-ui-locale';
|
|
3
|
+
export * from './lib/i18n/mb-ui-messages.types';
|
|
4
|
+
export * from './lib/i18n/mb-ui-messages';
|
|
5
|
+
export * from './lib/i18n/mb-ui-messages-fa';
|
|
6
|
+
export * from './lib/i18n/mb-ui-messages-en';
|
|
7
|
+
export * from './lib/i18n/provide-mb-ui';
|
|
8
|
+
export * from './lib/utils/coerce';
|
|
9
|
+
export * from './lib/button/mb-button.component';
|
|
10
|
+
export * from './lib/input/mb-input.component';
|
|
11
|
+
export * from './lib/form-field/mb-form-field.component';
|
|
12
|
+
export * from './lib/select/mb-select.component';
|
|
13
|
+
export * from './lib/combobox/mb-combobox.component';
|
|
14
|
+
export * from './lib/grid/mb-grid.component';
|
|
15
|
+
export * from './lib/grid/mb-grid.types';
|
|
16
|
+
export * from './lib/grid/mb-grid-data';
|
|
17
|
+
export * from './lib/grid/mb-grid-export';
|
|
18
|
+
export * from './lib/grid/mb-grid-state.service';
|
|
19
|
+
export * from './lib/grid/mb-grid-template.directive';
|
|
20
|
+
export * from './lib/grid/mb-grid-messages';
|
|
21
|
+
export * from './lib/grid/mb-grid-state-adapter';
|
|
22
|
+
export * from './lib/dialog/mb-dialog.tokens';
|
|
23
|
+
export * from './lib/dialog/mb-dialog-ref';
|
|
24
|
+
export * from './lib/dialog/mb-dialog-container.component';
|
|
25
|
+
export * from './lib/dialog/mb-dialog.service';
|
|
26
|
+
export * from './lib/dialog/mb-dialog.component';
|
|
27
|
+
export * from './lib/utils/mb-jalali-date';
|
|
28
|
+
export * from './lib/toast/mb-toast.types';
|
|
29
|
+
export * from './lib/toast/mb-toast.service';
|
|
30
|
+
export * from './lib/toast/mb-toast-container.component';
|
|
31
|
+
export * from './lib/checkbox/mb-checkbox.component';
|
|
32
|
+
export * from './lib/switch/mb-switch.component';
|
|
33
|
+
export * from './lib/radio/mb-radio-group.component';
|
|
34
|
+
export * from './lib/textarea/mb-textarea.component';
|
|
35
|
+
export * from './lib/datepicker/mb-datepicker.component';
|
|
36
|
+
export * from './lib/badge/mb-badge.component';
|
|
37
|
+
export * from './lib/chip/mb-chip.component';
|
|
38
|
+
export * from './lib/avatar/mb-avatar.component';
|
|
39
|
+
export * from './lib/card/mb-card.component';
|
|
40
|
+
export * from './lib/alert/mb-alert.component';
|
|
41
|
+
export * from './lib/spinner/mb-spinner.component';
|
|
42
|
+
export * from './lib/skeleton/mb-skeleton.component';
|
|
43
|
+
export * from './lib/progress/mb-progress.component';
|
|
44
|
+
export * from './lib/empty/mb-empty.component';
|
|
45
|
+
export * from './lib/divider/mb-divider.component';
|
|
46
|
+
export * from './lib/breadcrumb/mb-breadcrumb.component';
|
|
47
|
+
export * from './lib/tabs/mb-tabs.component';
|
|
48
|
+
export * from './lib/accordion/mb-accordion.component';
|
|
49
|
+
export * from './lib/pagination/mb-pagination.component';
|
|
50
|
+
export * from './lib/drawer/mb-drawer.component';
|
|
51
|
+
export * from './lib/dropdown/mb-dropdown.component';
|
|
52
|
+
export * from './lib/tooltip/mb-tooltip.directive';
|
|
53
|
+
export * from './lib/confirm/mb-confirm.types';
|
|
54
|
+
export * from './lib/confirm/mb-confirm-dialog.component';
|
|
55
|
+
export * from './lib/confirm/mb-confirm.service';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.mb-tooltip-panel {
|
|
2
|
+
position: absolute;
|
|
3
|
+
z-index: 1200;
|
|
4
|
+
max-inline-size: 18rem;
|
|
5
|
+
padding: .42rem .6rem;
|
|
6
|
+
border-radius: var(--mb-radius-sm);
|
|
7
|
+
background: var(--mb-color-text);
|
|
8
|
+
color: var(--mb-color-bg);
|
|
9
|
+
font-size: .78rem;
|
|
10
|
+
box-shadow: var(--mb-shadow-md);
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.mb-stack { display: grid; gap: var(--mb-stack-gap, 1rem); }
|
|
15
|
+
.mb-inline { display: flex; gap: var(--mb-inline-gap, .75rem); align-items: center; flex-wrap: wrap; }
|
|
16
|
+
.mb-surface { background: var(--mb-color-surface); border: 1px solid var(--mb-color-border); border-radius: var(--mb-radius-lg); }
|
|
17
|
+
.mb-muted { color: var(--mb-color-muted); }
|
|
18
|
+
.mb-rtl { direction: rtl; }
|
|
19
|
+
.mb-ltr { direction: ltr; }
|
package/theme/_dark.scss
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.mb-theme-dark,[data-mb-theme='dark']{--mb-color-bg:#020617;--mb-color-surface:#0f172a;--mb-color-surface-muted:#111827;--mb-color-border:#334155;--mb-color-text:#e5e7eb;--mb-color-muted:#94a3b8;--mb-color-primary:#60a5fa;--mb-color-primary-contrast:#0f172a;--mb-color-danger:#f87171;--mb-color-success:#34d399;--mb-color-warning:#fbbf24;color-scheme:dark}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.mb-density-compact,[data-mb-density='compact']{--mb-control-height-sm:1.75rem;--mb-control-height-md:2rem;--mb-control-height-lg:2.4rem;--mb-grid-row-height:2.1rem}.mb-density-comfortable,[data-mb-density='comfortable']{--mb-control-height-sm:2rem;--mb-control-height-md:2.5rem;--mb-control-height-lg:3rem;--mb-grid-row-height:2.7rem}.mb-density-spacious,[data-mb-density='spacious']{--mb-control-height-sm:2.5rem;--mb-control-height-md:3rem;--mb-control-height-lg:3.5rem;--mb-grid-row-height:3.25rem}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
.mb-theme-light {
|
|
3
|
+
--mb-color-primary: #2563eb;
|
|
4
|
+
--mb-color-primary-hover: #1d4ed8;
|
|
5
|
+
--mb-color-primary-soft: #dbeafe;
|
|
6
|
+
--mb-color-danger: #dc2626;
|
|
7
|
+
--mb-color-danger-soft: #fee2e2;
|
|
8
|
+
--mb-color-success: #16a34a;
|
|
9
|
+
--mb-color-success-soft: #dcfce7;
|
|
10
|
+
--mb-color-warning: #d97706;
|
|
11
|
+
--mb-color-warning-soft: #fef3c7;
|
|
12
|
+
|
|
13
|
+
--mb-color-bg: #ffffff;
|
|
14
|
+
--mb-color-surface: #f8fafc;
|
|
15
|
+
--mb-color-surface-elevated: #ffffff;
|
|
16
|
+
--mb-color-border: #e2e8f0;
|
|
17
|
+
--mb-color-border-strong: #cbd5e1;
|
|
18
|
+
--mb-color-text: #0f172a;
|
|
19
|
+
--mb-color-muted: #64748b;
|
|
20
|
+
--mb-color-disabled: #94a3b8;
|
|
21
|
+
|
|
22
|
+
--mb-radius-xs: 4px;
|
|
23
|
+
--mb-radius-sm: 6px;
|
|
24
|
+
--mb-radius-md: 10px;
|
|
25
|
+
--mb-radius-lg: 14px;
|
|
26
|
+
--mb-radius-xl: 18px;
|
|
27
|
+
|
|
28
|
+
--mb-shadow-sm: 0 1px 2px rgb(15 23 42 / 8%);
|
|
29
|
+
--mb-shadow-md: 0 12px 28px rgb(15 23 42 / 12%);
|
|
30
|
+
--mb-shadow-lg: 0 22px 60px rgb(15 23 42 / 18%);
|
|
31
|
+
|
|
32
|
+
--mb-font-family: inherit;
|
|
33
|
+
--mb-transition-fast: 140ms ease;
|
|
34
|
+
--mb-transition-normal: 220ms ease;
|
|
35
|
+
--mb-focus-ring: 0 0 0 3px rgb(37 99 235 / 24%);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.mb-theme-dark {
|
|
39
|
+
--mb-color-primary: #60a5fa;
|
|
40
|
+
--mb-color-primary-hover: #93c5fd;
|
|
41
|
+
--mb-color-primary-soft: #172554;
|
|
42
|
+
--mb-color-danger: #f87171;
|
|
43
|
+
--mb-color-danger-soft: #450a0a;
|
|
44
|
+
--mb-color-success: #4ade80;
|
|
45
|
+
--mb-color-success-soft: #052e16;
|
|
46
|
+
--mb-color-warning: #fbbf24;
|
|
47
|
+
--mb-color-warning-soft: #451a03;
|
|
48
|
+
|
|
49
|
+
--mb-color-bg: #020617;
|
|
50
|
+
--mb-color-surface: #0f172a;
|
|
51
|
+
--mb-color-surface-elevated: #111827;
|
|
52
|
+
--mb-color-border: #334155;
|
|
53
|
+
--mb-color-border-strong: #475569;
|
|
54
|
+
--mb-color-text: #f8fafc;
|
|
55
|
+
--mb-color-muted: #cbd5e1;
|
|
56
|
+
--mb-color-disabled: #64748b;
|
|
57
|
+
}
|
package/theme/mb-ui.scss
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use './tokens';
|
|
2
|
+
@use './components';
|
|
3
|
+
|
|
4
|
+
* {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.mb-visually-hidden {
|
|
9
|
+
position: absolute !important;
|
|
10
|
+
width: 1px !important;
|
|
11
|
+
height: 1px !important;
|
|
12
|
+
padding: 0 !important;
|
|
13
|
+
margin: -1px !important;
|
|
14
|
+
overflow: hidden !important;
|
|
15
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
16
|
+
white-space: nowrap !important;
|
|
17
|
+
border: 0 !important;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.mb-overlay-backdrop {
|
|
21
|
+
position: fixed;
|
|
22
|
+
inset: 0;
|
|
23
|
+
background: rgb(15 23 42 / 48%);
|
|
24
|
+
backdrop-filter: blur(2px);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@use './dark';
|
|
28
|
+
@use './density';
|