@mezzanine-ui/core 1.0.3-rc.0 → 1.0.3

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: any;
12
- readonly warning: any;
13
- readonly error: any;
11
+ readonly info: import("@mezzanine-ui/icons").IconDefinition;
12
+ readonly warning: import("@mezzanine-ui/icons").IconDefinition;
13
+ readonly error: import("@mezzanine-ui/icons").IconDefinition;
14
14
  };
15
15
  export declare const alertBannerClasses: {
16
16
  readonly host: "mzn-alert-banner";
@@ -57,7 +57,7 @@
57
57
 
58
58
  .#{$week-prefix} {
59
59
  height: 100%;
60
- padding-top: 40px;
60
+ padding-top: spacing.semantic-variable(size, element, extra-wide);
61
61
  display: flex;
62
62
  flex-flow: column;
63
63
 
@@ -158,13 +158,13 @@
158
158
  .#{$prefix}--quarter & {
159
159
  padding: spacing.semantic-variable(padding, vertical, tiny) 0;
160
160
  grid-template-columns: repeat(5, minmax(0, 1fr));
161
- grid-auto-rows: 32px;
161
+ grid-auto-rows: spacing.semantic-variable(size, element, roomy);
162
162
  }
163
163
 
164
164
  .#{$prefix}--half-year & {
165
165
  padding: spacing.semantic-variable(padding, vertical, tiny) 0;
166
166
  grid-template-columns: repeat(3, minmax(0, 1fr));
167
- grid-auto-rows: 32px;
167
+ grid-auto-rows: spacing.semantic-variable(size, element, roomy);
168
168
  }
169
169
 
170
170
  &--with-border {
@@ -247,7 +247,7 @@
247
247
 
248
248
  .#{$prefix}--quarter &,
249
249
  .#{$prefix}--half-year & {
250
- padding-top: 32px;
250
+ padding-top: spacing.semantic-variable(size, element, roomy);
251
251
  }
252
252
 
253
253
  &--today {
@@ -365,6 +365,7 @@
365
365
  }
366
366
 
367
367
  .#{$quick-select-prefix} {
368
+ // allow-hardcoded: quick-select panel固定寬度 128px 不在 primitive scale
368
369
  width: 128px;
369
370
  border-radius: radius.variable(roomy);
370
371
  padding: spacing.semantic-variable(padding, vertical, comfort) spacing.semantic-variable(padding, horizontal, comfort);
@@ -347,17 +347,23 @@ 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
350
+ // Handle week-year formats (moment-compatible tokens not native to dayjs).
351
+ // - gggg / ww: locale-aware week year / number (Sunday-first locales use
352
+ // dayjs default `year()` + `week()`; Monday-first locales fall back to
353
+ // ISO values because dayjs does not expose a locale `weekYear()`).
354
+ // - GGGG / WW: ISO-8601 week year / number regardless of locale.
353
355
  if (format.includes('gggg') || format.includes('GGGG')) {
354
356
  const isMon = isMondayFirst(locale);
355
- const weekYear = isMon ? result.isoWeekYear() : result.year();
356
- const weekNum = isMon ? result.isoWeek() : result.week();
357
+ const localeYear = isMon ? result.isoWeekYear() : result.year();
358
+ const localeWeek = isMon ? result.isoWeek() : result.week();
359
+ const isoYear = result.isoWeekYear();
360
+ const isoWeek = result.isoWeek();
357
361
  return format
358
- .replace(/gggg|GGGG/, String(weekYear))
359
- .replace(/\[([^\]]*)\]/g, '$1')
360
- .replace(/ww|WW/, String(weekNum).padStart(2, '0'));
362
+ .replace(/GGGG/g, String(isoYear))
363
+ .replace(/WW/g, String(isoWeek).padStart(2, '0'))
364
+ .replace(/gggg/g, String(localeYear))
365
+ .replace(/ww/g, String(localeWeek).padStart(2, '0'))
366
+ .replace(/\[([^\]]*)\]/g, '$1');
361
367
  }
362
368
  return result.format(format);
363
369
  },
@@ -321,7 +321,7 @@ $file-icon-color: (
321
321
  flex-shrink: 0;
322
322
  width: spacing.semantic-variable(size, element, roomy);
323
323
  height: spacing.semantic-variable(size, element, roomy);
324
- margin: 2px;
324
+ margin: spacing.primitive-variable(2);
325
325
  border-radius: radius.variable(base);
326
326
  background-color: map.get($file-icon-color, default);
327
327
  display: flex;
@@ -614,7 +614,7 @@ $checked-disabled: (
614
614
  }
615
615
 
616
616
  &__editable-input-container {
617
- width: 120px;
617
+ width: spacing.primitive-variable(120);
618
618
  }
619
619
  }
620
620
 
@@ -1,8 +1,8 @@
1
1
  export declare const inlineMessagePrefix = "mzn-inline-message";
2
2
  export declare const inlineMessageIcons: {
3
- readonly info: any;
4
- readonly warning: any;
5
- readonly error: any;
3
+ readonly info: import("@mezzanine-ui/icons").IconDefinition;
4
+ readonly warning: import("@mezzanine-ui/icons").IconDefinition;
5
+ readonly error: import("@mezzanine-ui/icons").IconDefinition;
6
6
  };
7
7
  export type InlineMessageSeverity = keyof typeof inlineMessageIcons;
8
8
  export declare const inlineMessageClasses: {
@@ -61,7 +61,9 @@
61
61
  &::before {
62
62
  content: '';
63
63
  inset-block: 0;
64
+ // allow-hardcoded: column resize handle hit-area 向左偏 4px 讓觸擊範圍跨越 divider
64
65
  inset-inline-start: -4px;
66
+ // allow-hardcoded: 9px 觸擊寬度(divider 1px 左右各 4px 擴充),不在 primitive scale
65
67
  inline-size: 9px;
66
68
  position: absolute;
67
69
  }
@@ -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: any;
6
- readonly warning: any;
7
- readonly error: any;
8
- readonly info: any;
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;
9
9
  };
10
10
  export declare const messageClasses: {
11
11
  readonly host: "mzn-message";
@@ -143,8 +143,8 @@ $modalSizes: (
143
143
  }
144
144
 
145
145
  &__status-type-icon {
146
- width: 32px;
147
- height: 32px;
146
+ width: spacing.semantic-variable(size, element, roomy);
147
+ height: spacing.semantic-variable(size, element, roomy);
148
148
  display: flex;
149
149
  flex-shrink: 0;
150
150
  align-items: center;
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: any;
32
- readonly warning: any;
33
- readonly error: any;
34
- readonly info: any;
35
- readonly email: any;
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;
36
36
  readonly delete: import("@mezzanine-ui/icons").IconDefinition;
37
37
  };
38
38
  export declare const modalClasses: {
@@ -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: any;
13
- warning: any;
14
- error: any;
15
- info: any;
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;
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.3-rc.0",
3
+ "version": "1.0.3",
4
4
  "description": "Core for mezzanine-ui",
5
5
  "author": "Mezzanine",
6
6
  "repository": {
@@ -113,7 +113,7 @@
113
113
 
114
114
  &__separator {
115
115
  width: 1px;
116
- height: 16px;
116
+ height: spacing.semantic-variable(size, element, base);
117
117
  background-color: palette.semantic-variable(separator, neutral-light);
118
118
  flex-shrink: 0;
119
119
  }
@@ -234,7 +234,7 @@ $status-hierarchy: (
234
234
  top: 50%;
235
235
  transform: translate(-50%, -50%);
236
236
  width: 1px;
237
- height: 4px;
237
+ height: spacing.semantic-variable(size, element, tiny);
238
238
  margin-top: calc(-1 * (2px + #{spacing.semantic-variable(gap, slim)} / 2));
239
239
  pointer-events: none;
240
240
  background-color: palette.semantic-variable(border, neutral-strong);
@@ -103,7 +103,7 @@ $z-index-config: (
103
103
  &::after {
104
104
  position: absolute;
105
105
  inset-block: 0;
106
- width: 10px;
106
+ width: spacing.primitive-variable(10);
107
107
  content: '';
108
108
  pointer-events: none;
109
109
  transition: transition.standard(box-shadow);
@@ -335,6 +335,7 @@ $z-index-config: (
335
335
 
336
336
  &--separator {
337
337
  td {
338
+ // allow-hardcoded: separator row border 3px visual emphasis, thicker than the 1px cell borders; no token for border-width > 1px
338
339
  border-bottom: 3px solid palette.semantic-variable("background", neutral-subtle);
339
340
  }
340
341
  }
@@ -627,6 +628,7 @@ $z-index-config: (
627
628
  }
628
629
 
629
630
  .#{$prefix}__empty {
631
+ // allow-hardcoded: empty-state min-height 200px guarantees a consistent body height regardless of row count; not in primitive scale
630
632
  min-height: 200px;
631
633
  text-align: center;
632
634
  vertical-align: middle;
@@ -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: `${any}--align`;
23
- readonly color: `${any}--color`;
24
- readonly display: `${any}--display`;
25
- readonly ellipsis: `${any}--ellipsis`;
26
- readonly noWrap: `${any}--nowrap`;
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";
27
27
  };
28
28
  export declare function toTypographyCssVars(variables: TypographyCssVars): CssVarInterpolations;
29
29
  export {};
@@ -131,13 +131,13 @@ $thumbnail-image-size: spacing.primitive-variable(40);
131
131
  border-color: palette.semantic-variable(text, fixed-light);
132
132
  border-radius: 50%;
133
133
  content: '';
134
- height: 10px;
134
+ height: spacing.primitive-variable(10);
135
135
  left: 50%;
136
136
  pointer-events: none;
137
137
  position: absolute;
138
138
  top: 50%;
139
139
  transform: translate(-50%, -50%);
140
- width: 10px;
140
+ width: spacing.primitive-variable(10);
141
141
  }
142
142
  }
143
143
 
@@ -304,6 +304,7 @@ $image-size: spacing.primitive-variable(140);
304
304
  position: relative;
305
305
 
306
306
  &::before {
307
+ // allow-hardcoded: focus ring 2px border width for visual emphasis; no token for border-width > 1px
307
308
  border-width: 2px;
308
309
  border-style: solid;
309
310
  border-color: palette.semantic-variable(border, fixed-light);
@@ -43,6 +43,7 @@ $square-size: spacing.primitive-variable(140);
43
43
  }
44
44
 
45
45
  &:not(.#{$prefix}--button):active {
46
+ // allow-hardcoded: active-state 2px border width for visual emphasis; no token for border-width > 1px
46
47
  border-width: 2px;
47
48
  border-style: solid;
48
49
  border-color: palette.semantic-variable(border, brand);