@masterteam/components 0.0.243 → 0.0.244
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/assets/common.css +1 -1
- package/assets/ds-components/button.css +367 -0
- package/assets/ds-components/content-switcher.css +124 -0
- package/assets/ds-components/feedback.css +220 -0
- package/assets/ds-components/field.css +526 -0
- package/assets/ds-components/misc.css +252 -0
- package/assets/ds-components/overlay.css +268 -0
- package/assets/ds-components/pagination.css +140 -0
- package/assets/ds-components/selection-controls.css +245 -0
- package/assets/ds-components/surfaces.css +173 -0
- package/assets/ds-components/table.css +142 -0
- package/assets/ds-components/tabs.css +200 -0
- package/assets/ds-identity.css +275 -0
- package/assets/fonts/IBMPlexSansArabic-400-arabic.woff2 +0 -0
- package/assets/fonts/IBMPlexSansArabic-400-latin.woff2 +0 -0
- package/assets/fonts/IBMPlexSansArabic-500-arabic.woff2 +0 -0
- package/assets/fonts/IBMPlexSansArabic-500-latin.woff2 +0 -0
- package/assets/fonts/IBMPlexSansArabic-600-arabic.woff2 +0 -0
- package/assets/fonts/IBMPlexSansArabic-600-latin.woff2 +0 -0
- package/assets/fonts/IBMPlexSansArabic-700-arabic.woff2 +0 -0
- package/assets/fonts/IBMPlexSansArabic-700-latin.woff2 +0 -0
- package/assets/ibm-plex-sans-arabic.css +100 -0
- package/fesm2022/masterteam-components.mjs +662 -3
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components.d.ts +174 -2
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { EnvironmentProviders, InjectionToken, Signal, PipeTransform } from '@angular/core';
|
|
3
|
+
import { Preset } from '@primeuix/themes/types';
|
|
4
|
+
import { AuraBaseDesignTokens } from '@primeuix/themes/aura/base';
|
|
3
5
|
import { MessageService, ConfirmationService } from 'primeng/api';
|
|
4
6
|
import { HttpContext, HttpContextToken } from '@angular/common/http';
|
|
5
7
|
import { AbstractControl, ValidatorFn } from '@angular/forms';
|
|
@@ -7,16 +9,186 @@ import * as _masterteam_components from '@masterteam/components';
|
|
|
7
9
|
import { StateContext } from '@ngxs/store';
|
|
8
10
|
import { Observable } from 'rxjs';
|
|
9
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Masterteam Design System — experimental identity, expressed as a PrimeUIX
|
|
14
|
+
* preset.
|
|
15
|
+
*
|
|
16
|
+
* Every `mt-*` component is a thin wrapper over a PrimeNG component, so the
|
|
17
|
+
* identity is applied here rather than in 200 component stylesheets: retune the
|
|
18
|
+
* preset and buttons, fields, tables, overlays, tabs and toasts all move
|
|
19
|
+
* together. Only the handful of things a design token cannot express — the
|
|
20
|
+
* font, the double focus ring, the animated input underline — live in
|
|
21
|
+
* `assets/ds-identity.css`.
|
|
22
|
+
*
|
|
23
|
+
* This preset is *additive*: it is merged over the classic MT configuration, so
|
|
24
|
+
* anything it does not mention keeps its current behaviour.
|
|
25
|
+
*/
|
|
26
|
+
type MTDesignIdentity = 'classic' | 'experimental';
|
|
27
|
+
/** Root class that gates the CSS half of the identity. */
|
|
28
|
+
declare const MT_DESIGN_IDENTITY_CLASS = "mt-ds";
|
|
29
|
+
/** DS primary button background. Used when the host does not brand the app. */
|
|
30
|
+
declare const DS_DEFAULT_PRIMARY_COLOR: string;
|
|
31
|
+
/**
|
|
32
|
+
* The DS identity as a partial preset.
|
|
33
|
+
*
|
|
34
|
+
* @param primaryColor Optional brand override. Tenants that white-label the
|
|
35
|
+
* product still need their own colour; when omitted the DS blue is used.
|
|
36
|
+
* Note the DS itself treats the blue as fixed — an override is a deliberate
|
|
37
|
+
* deviation, not a supported DS variant.
|
|
38
|
+
*/
|
|
39
|
+
declare function dsIdentityConfigs(primaryColor?: string): Preset<AuraBaseDesignTokens>;
|
|
40
|
+
/** The DS chart ramp, for hosts that render charts outside PrimeNG. */
|
|
41
|
+
declare const dsChartSeries: readonly string[];
|
|
42
|
+
/**
|
|
43
|
+
* Adds or removes the root class that activates the CSS half of the identity.
|
|
44
|
+
* No-ops outside the browser so SSR builds stay safe.
|
|
45
|
+
*/
|
|
46
|
+
declare function applyDesignIdentityClass(identity: MTDesignIdentity): void;
|
|
47
|
+
|
|
10
48
|
interface MTThemeOptions {
|
|
11
49
|
primaryColor?: string;
|
|
12
50
|
textColor?: string;
|
|
13
51
|
backgroundColor?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Which visual identity to render.
|
|
54
|
+
*
|
|
55
|
+
* - `'classic'` (default) — the shipped MT look. Unchanged.
|
|
56
|
+
* - `'experimental'` — the Masterteam Design System identity (IBM Plex Sans
|
|
57
|
+
* Arabic, DS blue, 4px control radius, DS elevation and focus ring).
|
|
58
|
+
* Opt-in while the DS is being evaluated; see
|
|
59
|
+
* `.claude/skills/mt-design-identity/SKILL.md`.
|
|
60
|
+
*/
|
|
61
|
+
designIdentity?: MTDesignIdentity;
|
|
14
62
|
}
|
|
63
|
+
declare function getMTDesignIdentity(): MTDesignIdentity;
|
|
15
64
|
declare function changePrimaryColor(color: string): void;
|
|
16
65
|
declare function changeBackgroundColor(color?: string): void;
|
|
17
66
|
declare function changeTextColor(color: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Switches identity at runtime — for the showcase toggle and for side-by-side
|
|
69
|
+
* review. Replaces the active preset outright (rather than merging into it, as
|
|
70
|
+
* `updatePreset` would) so switching back to classic is lossless.
|
|
71
|
+
*/
|
|
72
|
+
declare function setMTDesignIdentity(identity: MTDesignIdentity, themeOptions?: Omit<MTThemeOptions, 'designIdentity'>): void;
|
|
18
73
|
declare function provideMTComponents(themeOptions?: MTThemeOptions): EnvironmentProviders;
|
|
19
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Masterteam Design System — raw palettes and scales.
|
|
77
|
+
*
|
|
78
|
+
* Transcribed from the DS Storybook foundations (Figma
|
|
79
|
+
* `WTmRAkJVvw0IvZMA7wBdTC`). These are primitives: they name colours, not
|
|
80
|
+
* roles. The mapping from primitive to role lives in `ds-identity.preset.ts`.
|
|
81
|
+
*
|
|
82
|
+
* Adding a value here without a corresponding Figma variable is how a design
|
|
83
|
+
* system drifts — extend the Figma file first, then mirror it.
|
|
84
|
+
*/
|
|
85
|
+
interface DSColorScale {
|
|
86
|
+
readonly 25: string;
|
|
87
|
+
readonly 50: string;
|
|
88
|
+
readonly 100: string;
|
|
89
|
+
readonly 200: string;
|
|
90
|
+
readonly 300: string;
|
|
91
|
+
readonly 400: string;
|
|
92
|
+
readonly 500: string;
|
|
93
|
+
readonly 600: string;
|
|
94
|
+
readonly 700: string;
|
|
95
|
+
readonly 800: string;
|
|
96
|
+
readonly 900: string;
|
|
97
|
+
readonly 950: string;
|
|
98
|
+
}
|
|
99
|
+
/** Primary blue. 800 is the primary button background. */
|
|
100
|
+
declare const DS_BLUE: DSColorScale;
|
|
101
|
+
/** Secondary indigo — accents, tags, selected states. */
|
|
102
|
+
declare const DS_INDIGO: DSColorScale;
|
|
103
|
+
declare const DS_SUCCESS: DSColorScale;
|
|
104
|
+
declare const DS_WARNING: DSColorScale;
|
|
105
|
+
declare const DS_ERROR: DSColorScale;
|
|
106
|
+
/** Neutral scale. Note it stops at 900 in Figma; 0/25/950 are extrapolated
|
|
107
|
+
* because PrimeUIX requires a full 0–950 surface ramp. */
|
|
108
|
+
declare const DS_GRAY: {
|
|
109
|
+
readonly 0: "#FFFFFF";
|
|
110
|
+
readonly 25: "#FCFCFD";
|
|
111
|
+
readonly 50: "#F9FAFB";
|
|
112
|
+
readonly 100: "#F3F4F6";
|
|
113
|
+
readonly 200: "#E5E7EB";
|
|
114
|
+
readonly 300: "#D1D5DB";
|
|
115
|
+
readonly 400: "#9CA3AF";
|
|
116
|
+
readonly 500: "#6B7280";
|
|
117
|
+
readonly 600: "#4B5563";
|
|
118
|
+
readonly 700: "#374151";
|
|
119
|
+
readonly 800: "#1F2937";
|
|
120
|
+
readonly 900: "#111827";
|
|
121
|
+
readonly 950: "#0A0F1C";
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Semantic values that are not part of a ramp. Each one is a named Figma
|
|
125
|
+
* variable in its own right.
|
|
126
|
+
*/
|
|
127
|
+
declare const DS_SEMANTIC: {
|
|
128
|
+
/** Default body / label text. Deliberately navy-black, not gray-900. */
|
|
129
|
+
readonly textStrong: "#000B36";
|
|
130
|
+
readonly textSecondary: "#3C5073";
|
|
131
|
+
readonly textPlaceholder: "#B6BDCA";
|
|
132
|
+
readonly textHelper: "#384250";
|
|
133
|
+
readonly surface: "#FFFFFF";
|
|
134
|
+
readonly border: "#E5E7EB";
|
|
135
|
+
/** Disabled is a colour swap, never an opacity fade. */
|
|
136
|
+
readonly disabledBg: "#D2D6DB";
|
|
137
|
+
readonly disabledText: "#6C7C96";
|
|
138
|
+
readonly inputBorder: "#D2D6DB";
|
|
139
|
+
readonly inputBorderHover: "#1F2A37";
|
|
140
|
+
readonly inputBorderReadonly: "#CED3DC";
|
|
141
|
+
readonly inputBgPressed: "#F3F4F6";
|
|
142
|
+
/** Destructive red. Distinct from the error ramp — this is the button colour. */
|
|
143
|
+
readonly danger: "#A30000";
|
|
144
|
+
readonly dangerSecondaryBg: "#FCDAD7";
|
|
145
|
+
readonly dangerSecondaryBgHover: "#F8BAB5";
|
|
146
|
+
readonly dangerSecondaryBgPressed: "#F3908A";
|
|
147
|
+
/** Tinted secondary button, expressed as primary-at-opacity. */
|
|
148
|
+
readonly secondaryBg: "rgba(24, 73, 169, 0.2)";
|
|
149
|
+
readonly secondaryBgHover: "rgba(24, 73, 169, 0.1)";
|
|
150
|
+
readonly focusRing: "#1849A9";
|
|
151
|
+
readonly focusOutline: "#FFFFFF";
|
|
152
|
+
readonly tooltipBg: "#1A2236";
|
|
153
|
+
};
|
|
154
|
+
/** Figma effect styles. Never invent a shadow outside this set. */
|
|
155
|
+
declare const DS_SHADOW: {
|
|
156
|
+
readonly xs: "0 1px 2px 0 rgba(16, 24, 40, 0.05)";
|
|
157
|
+
readonly sm: "0 1px 3px 0 rgba(16, 24, 40, 0.10), 0 1px 2px 0 rgba(16, 24, 40, 0.06)";
|
|
158
|
+
readonly md: "0 4px 8px -2px rgba(16, 24, 40, 0.10), 0 2px 4px -2px rgba(16, 24, 40, 0.06)";
|
|
159
|
+
readonly lg: "0 12px 16px -6px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03)";
|
|
160
|
+
readonly xl: "0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03)";
|
|
161
|
+
readonly '2xl': "0 24px 48px -12px rgba(16, 24, 40, 0.18)";
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Radius scale. The DS names differ from the PrimeUIX names by one step —
|
|
165
|
+
* DS `radius-sm` (4px, the default for buttons and inputs) lands on PrimeUIX
|
|
166
|
+
* `md`, because that is the key PrimeNG components reference. Mapping them
|
|
167
|
+
* here keeps the shift in one place instead of spreading it across overrides.
|
|
168
|
+
*/
|
|
169
|
+
declare const DS_RADIUS: {
|
|
170
|
+
readonly none: "0";
|
|
171
|
+
/** DS radius-xs — code badges, small tags */
|
|
172
|
+
readonly xs: "2px";
|
|
173
|
+
/** DS radius-xs..sm boundary */
|
|
174
|
+
readonly sm: "4px";
|
|
175
|
+
/** DS radius-sm — buttons, inputs, dropdowns (PrimeNG's default reference) */
|
|
176
|
+
readonly md: "4px";
|
|
177
|
+
/** DS radius-md — cards, tooltips, popovers */
|
|
178
|
+
readonly lg: "8px";
|
|
179
|
+
/** DS radius-lg — modals, drawers */
|
|
180
|
+
readonly xl: "16px";
|
|
181
|
+
};
|
|
182
|
+
/** Control heights, in px, from the Figma button spacing frame. */
|
|
183
|
+
declare const DS_CONTROL_HEIGHT: {
|
|
184
|
+
readonly sm: 24;
|
|
185
|
+
readonly md: 32;
|
|
186
|
+
readonly lg: 40;
|
|
187
|
+
};
|
|
188
|
+
declare const DS_FONT_FAMILY = "'IBM Plex Sans Arabic', system-ui, 'Segoe UI', sans-serif";
|
|
189
|
+
/** Ordered chart series. Six is the hard maximum. */
|
|
190
|
+
declare const DS_CHART_SERIES: readonly ["#1849A9", "#175CD3", "#2E90FA", "#53B1FD", "#B2DDFF", "#D1E9FF"];
|
|
191
|
+
|
|
20
192
|
declare function provideMTMessages(): typeof MessageService;
|
|
21
193
|
|
|
22
194
|
declare function provideMTConfirmation(): typeof ConfirmationService;
|
|
@@ -969,5 +1141,5 @@ declare class MTDateFormatPipe implements PipeTransform {
|
|
|
969
1141
|
static ɵpipe: i0.ɵɵPipeDeclaration<MTDateFormatPipe, "mtDateFormat", true>;
|
|
970
1142
|
}
|
|
971
1143
|
|
|
972
|
-
export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, LookupModuleCheckListFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, ScheduleItemSelectorFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, changeBackgroundColor, changePrimaryColor, changeTextColor, createCustomValidator, createEntityAdapter, endLoading, generateTailwindPalette, getContrastColor, getLightColor, handleApiRequest, isInvalid, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, setLoadingError, startLoading, toAngularDateFormat, wrapValidatorWithMessage };
|
|
973
|
-
export type { ApiRequestConfig, BaseFieldConstructorConfig, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, EntityListFieldRuntimeContext, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity, LayoutConfig, LoadingStateShape, LookupCheckListPropertyConfig, LookupMatrixCellConfig, LookupModuleCheckListFieldRuntimeContext, LookupOptionItemConfig, MTDateFormatType, MTDateFormats, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, ScheduleItemSelectorFieldRuntimeContext, SchedulePredecessorFieldRuntimeContext, SectionConfig, ValidatorType };
|
|
1144
|
+
export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DS_BLUE, DS_CHART_SERIES, DS_CONTROL_HEIGHT, DS_DEFAULT_PRIMARY_COLOR, DS_ERROR, DS_FONT_FAMILY, DS_GRAY, DS_INDIGO, DS_RADIUS, DS_SEMANTIC, DS_SHADOW, DS_SUCCESS, DS_WARNING, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, LookupModuleCheckListFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MT_DESIGN_IDENTITY_CLASS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, ScheduleItemSelectorFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, applyDesignIdentityClass, changeBackgroundColor, changePrimaryColor, changeTextColor, createCustomValidator, createEntityAdapter, dsChartSeries, dsIdentityConfigs, endLoading, generateTailwindPalette, getContrastColor, getLightColor, getMTDesignIdentity, handleApiRequest, isInvalid, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, setLoadingError, setMTDesignIdentity, startLoading, toAngularDateFormat, wrapValidatorWithMessage };
|
|
1145
|
+
export type { ApiRequestConfig, BaseFieldConstructorConfig, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DSColorScale, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, EntityListFieldRuntimeContext, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity, LayoutConfig, LoadingStateShape, LookupCheckListPropertyConfig, LookupMatrixCellConfig, LookupModuleCheckListFieldRuntimeContext, LookupOptionItemConfig, MTDateFormatType, MTDateFormats, MTDesignIdentity, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, ScheduleItemSelectorFieldRuntimeContext, SchedulePredecessorFieldRuntimeContext, SectionConfig, ValidatorType };
|