@mezzanine-ui/core 1.0.2 → 1.0.3-rc.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.
@@ -8,9 +8,9 @@ export type AlertBannerSeverity = 'info' | 'warning' | 'error';
8
8
  export declare const alertBannerPrefix = "mzn-alert-banner";
9
9
  export declare const alertBannerGroupPrefix = "mzn-alert-banner-group";
10
10
  export declare const alertBannerIcons: {
11
- readonly info: import("@mezzanine-ui/icons").IconDefinition;
12
- readonly warning: import("@mezzanine-ui/icons").IconDefinition;
13
- readonly error: import("@mezzanine-ui/icons").IconDefinition;
11
+ readonly info: any;
12
+ readonly warning: any;
13
+ readonly error: any;
14
14
  };
15
15
  export declare const alertBannerClasses: {
16
16
  readonly host: "mzn-alert-banner";
@@ -30,9 +30,11 @@
30
30
  pointer-events: none;
31
31
  }
32
32
 
33
- // Inside trigger uses a plain Input instead of SelectTrigger in some cases.
34
- // Hide it consistently so the host collapses when dropdown is closed.
35
- .#{input.$prefix} {
33
+ // Inside trigger uses a plain Input (React) or an [mznTextField] div
34
+ // (Angular) instead of SelectTrigger in some cases. Hide both so the
35
+ // host collapses when the dropdown is closed, regardless of platform.
36
+ .#{input.$prefix},
37
+ .#{text-field.$prefix} {
36
38
  opacity: 0;
37
39
  pointer-events: none;
38
40
  }
@@ -347,6 +347,18 @@ const CalendarMethodsDayjs = {
347
347
  const halfYear = Math.ceil(quarter / 2);
348
348
  return result.format(format.replace('n', halfYear.toString()));
349
349
  }
350
+ // Handle week-year formats (moment-compatible tokens not native to dayjs)
351
+ // gggg = locale week year, ww = locale week number
352
+ // GGGG = ISO week year, WW = ISO week number
353
+ if (format.includes('gggg') || format.includes('GGGG')) {
354
+ const isMon = isMondayFirst(locale);
355
+ const weekYear = isMon ? result.isoWeekYear() : result.year();
356
+ const weekNum = isMon ? result.isoWeek() : result.week();
357
+ return format
358
+ .replace(/gggg|GGGG/, String(weekYear))
359
+ .replace(/\[([^\]]*)\]/g, '$1')
360
+ .replace(/ww|WW/, String(weekNum).padStart(2, '0'));
361
+ }
350
362
  return result.format(format);
351
363
  },
352
364
  formatToISOString: (date) => dayjs(date).toISOString(),
@@ -1,8 +1,8 @@
1
1
  export declare const inlineMessagePrefix = "mzn-inline-message";
2
2
  export declare const inlineMessageIcons: {
3
- readonly info: import("@mezzanine-ui/icons").IconDefinition;
4
- readonly warning: import("@mezzanine-ui/icons").IconDefinition;
5
- readonly error: import("@mezzanine-ui/icons").IconDefinition;
3
+ readonly info: any;
4
+ readonly warning: any;
5
+ readonly error: any;
6
6
  };
7
7
  export type InlineMessageSeverity = keyof typeof inlineMessageIcons;
8
8
  export declare const inlineMessageClasses: {
@@ -2,10 +2,10 @@ import { SeverityWithInfo } from '@mezzanine-ui/system/severity';
2
2
  export type MessageSeverity = SeverityWithInfo | 'loading';
3
3
  export declare const messagePrefix = "mzn-message";
4
4
  export declare const messageIcons: {
5
- readonly success: import("@mezzanine-ui/icons").IconDefinition;
6
- readonly warning: import("@mezzanine-ui/icons").IconDefinition;
7
- readonly error: import("@mezzanine-ui/icons").IconDefinition;
8
- readonly info: import("@mezzanine-ui/icons").IconDefinition;
5
+ readonly success: any;
6
+ readonly warning: any;
7
+ readonly error: any;
8
+ readonly info: any;
9
9
  };
10
10
  export declare const messageClasses: {
11
11
  readonly host: "mzn-message";
package/modal/modal.d.ts CHANGED
@@ -28,11 +28,11 @@ export type ModalSize = 'tight' | 'narrow' | 'regular' | 'wide';
28
28
  export type ModalType = 'extended' | 'extendedSplit' | 'standard' | 'mediaPreview' | 'verification';
29
29
  export declare const modalPrefix = "mzn-modal";
30
30
  export declare const modalStatusTypeIcons: {
31
- readonly success: import("@mezzanine-ui/icons").IconDefinition;
32
- readonly warning: import("@mezzanine-ui/icons").IconDefinition;
33
- readonly error: import("@mezzanine-ui/icons").IconDefinition;
34
- readonly info: import("@mezzanine-ui/icons").IconDefinition;
35
- readonly email: import("@mezzanine-ui/icons").IconDefinition;
31
+ readonly success: any;
32
+ readonly warning: any;
33
+ readonly error: any;
34
+ readonly info: any;
35
+ readonly email: any;
36
36
  readonly delete: import("@mezzanine-ui/icons").IconDefinition;
37
37
  };
38
38
  export declare const modalClasses: {
@@ -243,6 +243,11 @@ $drawer-container-config: (
243
243
 
244
244
  &__dot-icon-button {
245
245
  padding: spacing.semantic-variable(padding, vertical, tight);
246
+ // 讓 dot 按鈕對齊區塊右上(而非預設 align-items: stretch 造成的垂直置中)。
247
+ // React 該按鈕外層還包一層 `<div class="mzn-dropdown">`,wrapper 是 flex item
248
+ // 而 button 不是;Angular 的 `<button>` 直接當 flex item 會被拉成全高並把 icon
249
+ // 置中,因此以 align-self: flex-start 補齊 — React 側 button 非 flex item,no-op。
250
+ align-self: flex-start;
246
251
  }
247
252
 
248
253
  &__body-content {
@@ -9,10 +9,10 @@ export type NotificationType = 'notification' | 'drawer';
9
9
  export declare const notificationPrefix = "mzn-notification-center";
10
10
  export declare const notificationRootPrefix = "mzn-notification-center-root";
11
11
  export declare const notificationIcons: {
12
- success: import("@mezzanine-ui/icons").IconDefinition;
13
- warning: import("@mezzanine-ui/icons").IconDefinition;
14
- error: import("@mezzanine-ui/icons").IconDefinition;
15
- info: import("@mezzanine-ui/icons").IconDefinition;
12
+ success: any;
13
+ warning: any;
14
+ error: any;
15
+ info: any;
16
16
  };
17
17
  export declare const notificationClasses: {
18
18
  readonly notificationsContainer: "mzn-notification-center__notifications-container";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mezzanine-ui/core",
3
- "version": "1.0.2",
3
+ "version": "1.0.3-rc.0",
4
4
  "description": "Core for mezzanine-ui",
5
5
  "author": "Mezzanine",
6
6
  "repository": {
@@ -128,6 +128,8 @@
128
128
  &:focus-within:not(.#{text-field.$prefix}--disabled):not(.#{text-field.$prefix}--readonly) {
129
129
  .#{text-field.$prefix}__clear-icon {
130
130
  display: inline-flex;
131
+ opacity: 1;
132
+ pointer-events: auto;
131
133
  }
132
134
 
133
135
  .#{text-field.$prefix}__suffix {
@@ -28,6 +28,8 @@ export declare const selectClasses: {
28
28
  readonly triggerReadOnly: "mzn-select-trigger--readonly";
29
29
  readonly triggerDisabled: "mzn-select-trigger--disabled";
30
30
  readonly triggerInput: "mzn-select-trigger__input";
31
+ readonly triggerPrefix: "mzn-select-trigger__prefix";
32
+ readonly triggerClearIcon: "mzn-select-trigger__clear-icon";
31
33
  readonly triggerTagsInputWrapper: "mzn-select-trigger__tags-input-wrapper";
32
34
  readonly triggerTagsInputWrapperEllipsis: "mzn-select-trigger__tags-input-wrapper--ellipsis";
33
35
  readonly triggerTagsInputWrapperWrap: "mzn-select-trigger__tags-input-wrapper--wrap";
package/select/select.js CHANGED
@@ -14,6 +14,8 @@ const selectClasses = {
14
14
  triggerReadOnly: `${selectTriggerPrefix}--readonly`,
15
15
  triggerDisabled: `${selectTriggerPrefix}--disabled`,
16
16
  triggerInput: `${selectTriggerPrefix}__input`,
17
+ triggerPrefix: `${selectTriggerPrefix}__prefix`,
18
+ triggerClearIcon: `${selectTriggerPrefix}__clear-icon`,
17
19
  triggerTagsInputWrapper: `${selectTriggerPrefix}__tags-input-wrapper`,
18
20
  triggerTagsInputWrapperEllipsis: `${selectTriggerPrefix}__tags-input-wrapper--ellipsis`,
19
21
  triggerTagsInputWrapperWrap: `${selectTriggerPrefix}__tags-input-wrapper--wrap`,
@@ -673,3 +673,35 @@ $z-index-config: (
673
673
  background-color: palette.semantic-variable(separator, neutral);
674
674
  }
675
675
  }
676
+
677
+ /* ------------------------------------------------------------------ *
678
+ * Angular CDK drag-drop integration *
679
+ * *
680
+ * Angular `MznTable` wires CDK's `cdkDropList` + `cdkDrag` on *
681
+ * `<tbody>`/`<tr>`. CDK ships no CSS — it only applies marker *
682
+ * classes (`.cdk-drag-placeholder`, `.cdk-drag-animating`, *
683
+ * `.cdk-drop-list-dragging`) and expects consumers to style them to *
684
+ * match `@hello-pangea/dnd`'s behaviour on the React side: the *
685
+ * source row becomes an invisible space-reserving placeholder while *
686
+ * sibling rows slide to reveal the drop target. *
687
+ * *
688
+ * Rules are scoped inside `.#{$prefix}` so they only affect *
689
+ * Mezzanine tables. React never emits these classes, so the block *
690
+ * is a no-op there. *
691
+ * ------------------------------------------------------------------ */
692
+ .#{$prefix} {
693
+ /* Source row while dragging — hide so only the preview is visible. */
694
+ .cdk-drag-placeholder {
695
+ opacity: 0;
696
+ }
697
+
698
+ /* Sibling rows transition smoothly as the preview passes by. */
699
+ &__body.cdk-drop-list-dragging .cdk-drag:not(.cdk-drag-placeholder) {
700
+ transition: transition.standard(transform, moderate);
701
+ }
702
+
703
+ /* Ease the drop-settle animation when the user releases. */
704
+ .cdk-drag-animating {
705
+ transition: transition.standard(transform, moderate);
706
+ }
707
+ }
@@ -19,11 +19,11 @@ export interface TypographyCssVars {
19
19
  }
20
20
  export declare const typographyClasses: {
21
21
  readonly type: (type: TypographySemanticType) => string;
22
- readonly align: "mzn-typography--align";
23
- readonly color: "mzn-typography--color";
24
- readonly display: "mzn-typography--display";
25
- readonly ellipsis: "mzn-typography--ellipsis";
26
- readonly noWrap: "mzn-typography--nowrap";
22
+ readonly align: `${any}--align`;
23
+ readonly color: `${any}--color`;
24
+ readonly display: `${any}--display`;
25
+ readonly ellipsis: `${any}--ellipsis`;
26
+ readonly noWrap: `${any}--nowrap`;
27
27
  };
28
28
  export declare function toTypographyCssVars(variables: TypographyCssVars): CssVarInterpolations;
29
29
  export {};