@multiplatform.one/components 6.4.0 → 6.4.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.
@@ -19,4 +19,5 @@ var icons_exports = {};
19
19
  module.exports = __toCommonJS(icons_exports);
20
20
  __reExport(icons_exports, require("./CheckRegular.cjs"), module.exports);
21
21
  __reExport(icons_exports, require("./MinusRegular.cjs"), module.exports);
22
- __reExport(icons_exports, require("./lucide.cjs"), module.exports);
22
+ __reExport(icons_exports, require("./lucide.cjs"), module.exports);
23
+ __reExport(icons_exports, require("./themed.cjs"), module.exports);
@@ -22,4 +22,5 @@ module.exports = __toCommonJS(icons_exports);
22
22
  __reExport(icons_exports, require("./CheckRegular.native.js"), module.exports);
23
23
  __reExport(icons_exports, require("./MinusRegular.native.js"), module.exports);
24
24
  __reExport(icons_exports, require("./lucide.native.js"), module.exports);
25
+ __reExport(icons_exports, require("./themed.native.js"), module.exports);
25
26
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","icons_exports","module","exports","__reExport","require"],"sources":["../../../src/icons/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,8BADdH,MAAA,CAAAC,OAAA;AAEAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,2BAFd,GAAAH,MAAA,CAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","icons_exports","module","exports","__reExport","require"],"sources":["../../../src/icons/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,8BADdH,MAAA,CAAAC,OAAA;AAEAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,2BAFd,GAAAH,MAAA,CAAAC,OAAA;AAMAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,wBANdH,MAAA,CAAAC,OAAA","ignoreList":[]}
@@ -1,4 +1,5 @@
1
1
  export * from "./CheckRegular.mjs";
2
2
  export * from "./MinusRegular.mjs";
3
3
  export * from "./lucide.mjs";
4
+ export * from "./themed.mjs";
4
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/icons/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../src/icons/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc","ignoreList":[]}
@@ -1,4 +1,5 @@
1
1
  export * from "./CheckRegular.native.js";
2
2
  export * from "./MinusRegular.native.js";
3
3
  export * from "./lucide.native.js";
4
+ export * from "./themed.native.js";
4
5
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/icons/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../src/icons/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc","ignoreList":[]}
@@ -1,4 +1,5 @@
1
1
  export * from "./CheckRegular.mjs";
2
2
  export * from "./MinusRegular.mjs";
3
3
  export * from "./lucide.mjs";
4
+ export * from "./themed.mjs";
4
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/icons/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../src/icons/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc","ignoreList":[]}
@@ -22,4 +22,5 @@ module.exports = __toCommonJS(icons_exports);
22
22
  __reExport(icons_exports, require("./CheckRegular.native.js"), module.exports);
23
23
  __reExport(icons_exports, require("./MinusRegular.native.js"), module.exports);
24
24
  __reExport(icons_exports, require("./lucide.native.js"), module.exports);
25
+ __reExport(icons_exports, require("./themed.native.js"), module.exports);
25
26
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor"],"sources":["../../../src/icons/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;AACA,IAAAA,SAAA,GAAcC,MAAA,CAAAC,cAAA;AACd,IAAAC,gBAAc,GAAAF,MAAA,CAAAG,wBAAA","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames"],"sources":["../../../src/icons/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;AACA,IAAAA,SAAA,GAAcC,MAAA,CAAAC,cAAA;AACd,IAAAC,gBAAc,GAAAF,MAAA,CAAAG,wBAAA;AAId,IAAAC,iBAAc,GAAAJ,MAAA,CAAAK,mBAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/components",
3
- "version": "6.4.0",
3
+ "version": "6.4.1",
4
4
  "description": "multiplatform.one ui components",
5
5
  "keywords": [
6
6
  "components",
@@ -74,11 +74,11 @@
74
74
  "link": "^2.1.2",
75
75
  "shiki": "^4.0.2",
76
76
  "tamagui": "2.0.0-rc.41",
77
- "@multiplatform.one/forms": "6.4.0",
78
- "@multiplatform.one/i18n": "6.4.0",
79
- "@multiplatform.one/router": "6.4.0",
80
- "@multiplatform.one/theme": "6.4.0",
81
- "@multiplatform.one/platform": "6.4.0"
77
+ "@multiplatform.one/forms": "6.4.1",
78
+ "@multiplatform.one/i18n": "6.4.1",
79
+ "@multiplatform.one/platform": "6.4.1",
80
+ "@multiplatform.one/router": "6.4.1",
81
+ "@multiplatform.one/theme": "6.4.1"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@tamagui/build": "2.0.0-rc.41",
@@ -96,9 +96,9 @@
96
96
  "react-native-svg": "15.15.4",
97
97
  "react-native-web": "^0.21.2",
98
98
  "vitest": "^4.1.5",
99
- "@multiplatform.one/storybook": "6.4.0",
100
- "@multiplatform.one/config": "6.4.0",
101
- "@multiplatform.one/test-utils": "6.4.0"
99
+ "@multiplatform.one/config": "6.4.1",
100
+ "@multiplatform.one/storybook": "6.4.1",
101
+ "@multiplatform.one/test-utils": "6.4.1"
102
102
  },
103
103
  "peerDependencies": {
104
104
  "@mdx-js/mdx": "^3.1.1",
@@ -1,3 +1,7 @@
1
1
  export * from "./CheckRegular";
2
2
  export * from "./MinusRegular";
3
3
  export * from "./lucide";
4
+ // Token-resolving icon wrapper (LC-53 GLYPH-SLOT): icon-only controls slot
5
+ // `themed(Icon)` elements and color them with bare theme keys ("red9"),
6
+ // instead of baseline-shifting Text wrappers around raw icons.
7
+ export * from "./themed";
@@ -18,6 +18,10 @@ import {
18
18
  type CalendarRange,
19
19
  } from "./calendarMath";
20
20
  import {
21
+ formatDayLong,
22
+ formatTimeOfDay,
23
+ getMonthNames,
24
+ getWeekdayNames,
21
25
  hairline,
22
26
  hairlineWidth,
23
27
  pressTargetHitSlop,
@@ -389,34 +393,13 @@ const DAY_DISC_PX = 22;
389
393
  /** Month-view chip visual floor (hit slop fills the 44px target, DG-LAY-04). */
390
394
  const MONTH_CHIP_MIN_PX = 24;
391
395
 
392
- function getWeekdayNames(): string[] {
393
- const formatter = new Intl.DateTimeFormat(undefined, { weekday: "short" });
394
- return Array.from({ length: 7 }, (_, i) => formatter.format(new Date(2004, 0, 4 + i)));
395
- }
396
-
397
- function getMonthNames(): string[] {
398
- const formatter = new Intl.DateTimeFormat(undefined, { month: "long" });
399
- return Array.from({ length: 12 }, (_, i) => formatter.format(new Date(2000, i, 1)));
400
- }
401
-
402
396
  function getHours(): number[] {
403
397
  return Array.from({ length: 24 }, (_, i) => i);
404
398
  }
405
399
 
400
+ /** Hour ticks speak the house time-of-day register without minutes ("2 PM"). */
406
401
  function formatHour(hour: number): string {
407
- const date = new Date(2000, 0, 1, hour, 0, 0);
408
- return new Intl.DateTimeFormat(undefined, {
409
- hour: "numeric",
410
- hour12: true,
411
- }).format(date);
412
- }
413
-
414
- function formatDayLong(date: Date): string {
415
- return new Intl.DateTimeFormat(undefined, {
416
- weekday: "long",
417
- month: "long",
418
- day: "numeric",
419
- }).format(date);
402
+ return formatTimeOfDay(new Date(2000, 0, 1, hour, 0, 0), { minutes: false });
420
403
  }
421
404
 
422
405
  const weekdayNames = getWeekdayNames();
@@ -10,8 +10,14 @@
10
10
  * values — the component layer tweens between them with `knobProps.transition`
11
11
  * (LC-25 CONTROL-SMOOTH-JUMP) while raw pointer tracking stays 1:1
12
12
  * (A-GESTURE).
13
+ *
14
+ * Every visible/spoken date string here routes through the canonical
15
+ * registers in `@multiplatform.one/theme` (LC-12 render channel) — the
16
+ * calendar speaks the same date voice as tables, feeds and pickers.
13
17
  */
14
18
 
19
+ import { formatDayLong, formatTimeOfDay } from "@multiplatform.one/theme";
20
+
15
21
  export const MINUTES_PER_DAY = 1440;
16
22
 
17
23
  /** Wall-clock minutes since midnight for a date. */
@@ -201,9 +207,9 @@ export function moveFocusSlot(
201
207
 
202
208
  // ── Formatting / accessible names ─────────────────────────────
203
209
 
204
- /** "2:00 PM" (locale-aware, minutes only when meaningful). */
210
+ /** "2:00 PM" the house time-of-day register. */
205
211
  export function formatTimeShort(date: Date): string {
206
- return new Intl.DateTimeFormat(undefined, { hour: "numeric", minute: "2-digit" }).format(date);
212
+ return formatTimeOfDay(date);
207
213
  }
208
214
 
209
215
  /** "2:00 PM – 3:30 PM" visible label used by resize / create sketches. */
@@ -217,11 +223,7 @@ export function formatTimeRangeLabel(start: Date, end: Date): string {
217
223
  * Untimed events fall back to the day name alone.
218
224
  */
219
225
  export function eventAccessibleLabel(event: { title: string; start: Date; end?: Date }): string {
220
- const dayLabel = new Intl.DateTimeFormat(undefined, {
221
- weekday: "long",
222
- month: "long",
223
- day: "numeric",
224
- }).format(event.start);
226
+ const dayLabel = formatDayLong(event.start);
225
227
  if (!event.end || event.end.getTime() === event.start.getTime()) {
226
228
  return `${event.title}, ${dayLabel}`;
227
229
  }
@@ -241,9 +241,12 @@ export interface GanttTick {
241
241
  label?: string;
242
242
  }
243
243
 
244
- const dayLabelFormatter = new Intl.DateTimeFormat(undefined, { day: "numeric" });
245
- const monthDayFormatter = new Intl.DateTimeFormat(undefined, { month: "short", day: "numeric" });
246
- const monthYearFormatter = new Intl.DateTimeFormat(undefined, { month: "short", year: "numeric" });
244
+ // Timeline labels ride the canonical date registers (LC-12 render channel).
245
+ // Ticks take `year: "never"` the header states the year, and a widened
246
+ // "Mar 10, 2025" tick would collide with its neighbour.
247
+ const dayLabel = (date: Date) => formatDayOfMonth(date);
248
+ const monthDayLabel = (date: Date) => formatAbsoluteDate(date, { year: "never" });
249
+ const monthYearLabel = (date: Date) => formatMonthYear(date);
247
250
 
248
251
  /**
249
252
  * Axis ticks for a range at a zoom level.
@@ -271,7 +274,7 @@ export function generateTicks(
271
274
  x,
272
275
  date,
273
276
  major: true,
274
- label: monthEdge ? monthDayFormatter.format(date) : dayLabelFormatter.format(date),
277
+ label: monthEdge ? monthDayLabel(date) : dayLabel(date),
275
278
  });
276
279
  continue;
277
280
  }
@@ -281,7 +284,7 @@ export function generateTicks(
281
284
  x,
282
285
  date,
283
286
  major: weekStart,
284
- label: weekStart ? monthDayFormatter.format(date) : undefined,
287
+ label: weekStart ? monthDayLabel(date) : undefined,
285
288
  });
286
289
  continue;
287
290
  }
@@ -292,7 +295,7 @@ export function generateTicks(
292
295
  x,
293
296
  date,
294
297
  major: monthStart,
295
- label: monthStart ? monthYearFormatter.format(date) : undefined,
298
+ label: monthStart ? monthYearLabel(date) : undefined,
296
299
  });
297
300
  }
298
301
  return ticks;
@@ -300,8 +303,8 @@ export function generateTicks(
300
303
 
301
304
  /** Visible header label for the chart range: "Mar 2026 – Jun 2026". */
302
305
  export function formatRangeLabel(range: GanttRange): string {
303
- const start = monthYearFormatter.format(range.start);
304
- const end = monthYearFormatter.format(addDays(range.end, -1));
306
+ const start = monthYearLabel(range.start);
307
+ const end = monthYearLabel(addDays(range.end, -1));
305
308
  return start === end ? start : `${start} – ${end}`;
306
309
  }
307
310
 
@@ -312,8 +315,8 @@ export function formatRangeLabel(range: GanttRange): string {
312
315
  export function ganttTaskAccessibleLabel(task: { title: string; start: Date; end: Date }): string {
313
316
  const { startEdge, endEdge } = normalizeSpanEdges(task);
314
317
  const lastDay = addDays(endEdge, -1);
315
- const startLabel = monthDayFormatter.format(startEdge);
316
- const endLabel = monthDayFormatter.format(
318
+ const startLabel = monthDayLabel(startEdge);
319
+ const endLabel = monthDayLabel(
317
320
  lastDay.getTime() >= startEdge.getTime() ? lastDay : startEdge,
318
321
  );
319
322
  return startLabel === endLabel
@@ -325,8 +328,8 @@ export function ganttTaskAccessibleLabel(task: { title: string; start: Date; end
325
328
  export function formatSpanLabel(span: GanttSpan): string {
326
329
  const { startEdge, endEdge } = normalizeSpanEdges(span);
327
330
  const lastDay = addDays(endEdge, -1);
328
- const startLabel = monthDayFormatter.format(startEdge);
329
- const endLabel = monthDayFormatter.format(
331
+ const startLabel = monthDayLabel(startEdge);
332
+ const endLabel = monthDayLabel(
330
333
  lastDay.getTime() >= startEdge.getTime() ? lastDay : startEdge,
331
334
  );
332
335
  return startLabel === endLabel ? startLabel : `${startLabel} – ${endLabel}`;
@@ -1,4 +1,5 @@
1
1
  export * from "./CheckRegular";
2
2
  export * from "./MinusRegular";
3
3
  export * from "./lucide";
4
+ export * from "./themed";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/icons/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/icons/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AAIzB,cAAc,UAAU,CAAC"}