@marwes-ui/core 1.0.5 → 1.2.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.
- package/README.md +4 -2
- package/dist/index.d.ts +253 -4
- package/dist/index.js +477 -57
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -316,8 +316,8 @@ function resolveColorRole(base, overrides) {
|
|
|
316
316
|
};
|
|
317
317
|
return overrides ? { ...derived, ...overrides } : derived;
|
|
318
318
|
}
|
|
319
|
-
function resolveSecondaryRole(primary) {
|
|
320
|
-
|
|
319
|
+
function resolveSecondaryRole(primary, overrides) {
|
|
320
|
+
const derived = {
|
|
321
321
|
base: "transparent",
|
|
322
322
|
hover: setAlpha(primary.base, 0.08),
|
|
323
323
|
pressed: setAlpha(primary.base, 0.15),
|
|
@@ -327,6 +327,7 @@ function resolveSecondaryRole(primary) {
|
|
|
327
327
|
border: primary.base,
|
|
328
328
|
borderDisabled: primary.disabled
|
|
329
329
|
};
|
|
330
|
+
return overrides ? { ...derived, ...overrides } : derived;
|
|
330
331
|
}
|
|
331
332
|
function resolveInfoRole(primary) {
|
|
332
333
|
return { ...primary };
|
|
@@ -345,30 +346,30 @@ var lightThemeDefaults = {
|
|
|
345
346
|
color: {
|
|
346
347
|
// Primary (firstEdition brand blue)
|
|
347
348
|
primary: "#2F31FC",
|
|
348
|
-
// Background & Surface
|
|
349
|
+
// Background & Surface
|
|
349
350
|
background: "#FFFFFF",
|
|
350
|
-
surface: "#
|
|
351
|
-
surfaceSubtle: "#
|
|
351
|
+
surface: "#F8F8F8",
|
|
352
|
+
surfaceSubtle: "#F5F5F5",
|
|
352
353
|
surfaceElevated: "#FFFFFF",
|
|
353
|
-
surfaceDisabled: "#
|
|
354
|
+
surfaceDisabled: "#F5F5F5",
|
|
354
355
|
surfaceInverted: "#141414",
|
|
355
|
-
// Text
|
|
356
|
+
// Text
|
|
356
357
|
text: "#141414",
|
|
357
|
-
textMuted: "#
|
|
358
|
-
textSubtle: "#
|
|
359
|
-
textDisabled: "
|
|
360
|
-
textInverted: "#
|
|
361
|
-
// Borders
|
|
362
|
-
border: "
|
|
363
|
-
borderSubtle: "#
|
|
364
|
-
borderStrong: "#
|
|
365
|
-
borderDisabled: "
|
|
366
|
-
// Focus
|
|
367
|
-
focus: "#
|
|
358
|
+
textMuted: "#595959",
|
|
359
|
+
textSubtle: "#737373",
|
|
360
|
+
textDisabled: "#737373",
|
|
361
|
+
textInverted: "#FFFFFF",
|
|
362
|
+
// Borders
|
|
363
|
+
border: "#D8D8D8",
|
|
364
|
+
borderSubtle: "#D8D8D8",
|
|
365
|
+
borderStrong: "#A3A3A3",
|
|
366
|
+
borderDisabled: "#D8D8D8",
|
|
367
|
+
// Focus
|
|
368
|
+
focus: "#2F31FC",
|
|
368
369
|
// Semantic colors
|
|
369
370
|
danger: "#D90429",
|
|
370
|
-
success: "#
|
|
371
|
-
warning: "#
|
|
371
|
+
success: "#006633",
|
|
372
|
+
warning: "#B45309"
|
|
372
373
|
},
|
|
373
374
|
font: {
|
|
374
375
|
primary: "'Instrument Sans', Inter, system-ui, sans-serif",
|
|
@@ -417,32 +418,32 @@ var lightThemeDefaults = {
|
|
|
417
418
|
var darkThemeDefaults = {
|
|
418
419
|
mode: ThemeMode.dark,
|
|
419
420
|
color: {
|
|
420
|
-
// Primary
|
|
421
|
-
primary: "#
|
|
422
|
-
// Background & Surface
|
|
423
|
-
background: "#
|
|
424
|
-
surface: "#
|
|
425
|
-
surfaceSubtle: "#
|
|
426
|
-
surfaceElevated: "#
|
|
427
|
-
surfaceDisabled: "#
|
|
428
|
-
surfaceInverted: "#
|
|
429
|
-
// Text
|
|
421
|
+
// Primary
|
|
422
|
+
primary: "#5859FC",
|
|
423
|
+
// Background & Surface
|
|
424
|
+
background: "#0F0F0F",
|
|
425
|
+
surface: "#1A1A1A",
|
|
426
|
+
surfaceSubtle: "#050505",
|
|
427
|
+
surfaceElevated: "#2B2B2B",
|
|
428
|
+
surfaceDisabled: "#1A1A1A",
|
|
429
|
+
surfaceInverted: "#FFFFFF",
|
|
430
|
+
// Text
|
|
430
431
|
text: "#F9FAFB",
|
|
431
|
-
textMuted: "#
|
|
432
|
-
textSubtle: "#
|
|
433
|
-
textDisabled: "
|
|
432
|
+
textMuted: "#A3A3A3",
|
|
433
|
+
textSubtle: "#595959",
|
|
434
|
+
textDisabled: "#595959",
|
|
434
435
|
textInverted: "#141414",
|
|
435
|
-
// Borders
|
|
436
|
-
border: "#
|
|
437
|
-
borderSubtle: "#
|
|
438
|
-
borderStrong: "#
|
|
439
|
-
borderDisabled: "
|
|
440
|
-
// Focus
|
|
441
|
-
focus: "#
|
|
436
|
+
// Borders
|
|
437
|
+
border: "#474747",
|
|
438
|
+
borderSubtle: "#474747",
|
|
439
|
+
borderStrong: "#A3A3A3",
|
|
440
|
+
borderDisabled: "#474747",
|
|
441
|
+
// Focus
|
|
442
|
+
focus: "#8182FC",
|
|
442
443
|
// Semantic colors
|
|
443
|
-
danger: "#
|
|
444
|
-
success: "#
|
|
445
|
-
warning: "#
|
|
444
|
+
danger: "#FF002C",
|
|
445
|
+
success: "#90CAAD",
|
|
446
|
+
warning: "#FCC94A"
|
|
446
447
|
},
|
|
447
448
|
font: {
|
|
448
449
|
primary: "'Instrument Sans', Inter, system-ui, sans-serif",
|
|
@@ -552,24 +553,97 @@ function resolveTone(tone) {
|
|
|
552
553
|
}
|
|
553
554
|
|
|
554
555
|
// src/theme/theme-normalize.ts
|
|
556
|
+
var lightDefaultColorRoles = {
|
|
557
|
+
primary: {
|
|
558
|
+
base: "#2F31FC",
|
|
559
|
+
hover: "#2527CA",
|
|
560
|
+
pressed: "#1B1D97",
|
|
561
|
+
disabled: "#8182FC",
|
|
562
|
+
label: "#FFFFFF",
|
|
563
|
+
labelDisabled: "rgba(255,255,255,0.5)"
|
|
564
|
+
},
|
|
565
|
+
secondary: {
|
|
566
|
+
hover: "#EEEEFF",
|
|
567
|
+
pressed: "#D4D5FE",
|
|
568
|
+
label: "#2F31FC",
|
|
569
|
+
labelDisabled: "rgba(47,49,252,0.5)",
|
|
570
|
+
border: "#2F31FC",
|
|
571
|
+
borderDisabled: "#8182FC"
|
|
572
|
+
},
|
|
573
|
+
danger: {
|
|
574
|
+
base: "#D90429",
|
|
575
|
+
hover: "#A8031F",
|
|
576
|
+
pressed: "#780215",
|
|
577
|
+
disabled: "#FF8A95",
|
|
578
|
+
label: "#FFFFFF",
|
|
579
|
+
labelDisabled: "rgba(255,255,255,0.5)"
|
|
580
|
+
},
|
|
581
|
+
success: {
|
|
582
|
+
base: "#006633"
|
|
583
|
+
},
|
|
584
|
+
warning: {
|
|
585
|
+
base: "#B45309"
|
|
586
|
+
},
|
|
587
|
+
info: {
|
|
588
|
+
base: "#2F31FC"
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
var darkDefaultColorRoles = {
|
|
592
|
+
primary: {
|
|
593
|
+
base: "#2F31FC",
|
|
594
|
+
hover: "#5859FC",
|
|
595
|
+
pressed: "#8182FC",
|
|
596
|
+
disabled: "#121365",
|
|
597
|
+
label: "#FFFFFF",
|
|
598
|
+
labelDisabled: "rgba(255,255,255,0.5)"
|
|
599
|
+
},
|
|
600
|
+
secondary: {
|
|
601
|
+
hover: "#090A32",
|
|
602
|
+
pressed: "#121365",
|
|
603
|
+
label: "#8182FC",
|
|
604
|
+
labelDisabled: "rgba(129,130,252,0.5)",
|
|
605
|
+
border: "#8182FC",
|
|
606
|
+
borderDisabled: "#121365"
|
|
607
|
+
},
|
|
608
|
+
danger: {
|
|
609
|
+
base: "#FF002C",
|
|
610
|
+
hover: "#FF2847",
|
|
611
|
+
pressed: "#FF5566",
|
|
612
|
+
disabled: "#48010D",
|
|
613
|
+
label: "#FFFFFF",
|
|
614
|
+
labelDisabled: "rgba(255,255,255,0.5)"
|
|
615
|
+
},
|
|
616
|
+
success: {
|
|
617
|
+
base: "#90CAAD"
|
|
618
|
+
},
|
|
619
|
+
warning: {
|
|
620
|
+
base: "#FCC94A"
|
|
621
|
+
},
|
|
622
|
+
info: {
|
|
623
|
+
base: "#8182FC"
|
|
624
|
+
}
|
|
625
|
+
};
|
|
555
626
|
function resolveThemeInput(input) {
|
|
556
627
|
const mode = input.mode ?? ThemeMode.light;
|
|
557
628
|
const colorBase = mode === ThemeMode.dark ? darkThemeDefaults.color : lightThemeDefaults.color;
|
|
629
|
+
const defaultColorRoles = mode === ThemeMode.dark ? darkDefaultColorRoles : lightDefaultColorRoles;
|
|
558
630
|
const base = lightThemeDefaults;
|
|
559
631
|
const tone = resolveTone(input.tone ?? "default");
|
|
560
|
-
const primary = normalizeColorInput(input.color?.primary ??
|
|
561
|
-
const
|
|
562
|
-
const
|
|
563
|
-
const
|
|
632
|
+
const primary = normalizeColorInput(input.color?.primary ?? defaultColorRoles.primary);
|
|
633
|
+
const secondary = input.color?.primary === void 0 ? resolveSecondaryRole(primary, defaultColorRoles.secondary) : resolveSecondaryRole(primary);
|
|
634
|
+
const danger = normalizeColorInput(input.color?.danger ?? defaultColorRoles.danger);
|
|
635
|
+
const success = normalizeColorInput(input.color?.success ?? defaultColorRoles.success);
|
|
636
|
+
const warning = normalizeColorInput(input.color?.warning ?? defaultColorRoles.warning);
|
|
637
|
+
const info = input.color?.primary === void 0 ? normalizeColorInput(defaultColorRoles.info) : resolveInfoRole(primary);
|
|
564
638
|
return {
|
|
565
639
|
mode,
|
|
566
640
|
color: {
|
|
567
641
|
primary,
|
|
568
|
-
secondary
|
|
642
|
+
secondary,
|
|
569
643
|
danger,
|
|
570
644
|
success,
|
|
571
645
|
warning,
|
|
572
|
-
info
|
|
646
|
+
info,
|
|
573
647
|
background: input.color?.background ?? colorBase.background,
|
|
574
648
|
surface: input.color?.surface ?? colorBase.surface,
|
|
575
649
|
surfaceSubtle: input.color?.surfaceSubtle ?? colorBase.surfaceSubtle,
|
|
@@ -5133,6 +5207,286 @@ function createSpinnerRecipe(options = {}) {
|
|
|
5133
5207
|
};
|
|
5134
5208
|
}
|
|
5135
5209
|
|
|
5210
|
+
// src/components/atoms/skeleton/skeleton-a11y.ts
|
|
5211
|
+
function isDev4() {
|
|
5212
|
+
const p = globalThis.process;
|
|
5213
|
+
const nodeEnv = p?.env?.NODE_ENV;
|
|
5214
|
+
if (nodeEnv) return nodeEnv !== "production";
|
|
5215
|
+
const meta = import.meta;
|
|
5216
|
+
if (typeof meta.env?.PROD === "boolean") return !meta.env.PROD;
|
|
5217
|
+
if (meta.env?.MODE) return meta.env.MODE !== "production";
|
|
5218
|
+
return true;
|
|
5219
|
+
}
|
|
5220
|
+
var __DEV__4 = isDev4();
|
|
5221
|
+
function resolveSkeletonA11y(options = {}) {
|
|
5222
|
+
if (options.decorative === true) {
|
|
5223
|
+
return {
|
|
5224
|
+
...options.id ? { id: options.id } : {},
|
|
5225
|
+
ariaHidden: true
|
|
5226
|
+
};
|
|
5227
|
+
}
|
|
5228
|
+
if (options.ariaLabel) {
|
|
5229
|
+
return {
|
|
5230
|
+
...options.id ? { id: options.id } : {},
|
|
5231
|
+
role: "status",
|
|
5232
|
+
ariaLabel: options.ariaLabel,
|
|
5233
|
+
ariaLive: "polite"
|
|
5234
|
+
};
|
|
5235
|
+
}
|
|
5236
|
+
if (__DEV__4 && options.decorative === false) {
|
|
5237
|
+
console.warn(
|
|
5238
|
+
"[marwes] Skeleton: decorative={false} was passed without ariaLabel. The skeleton stays hidden from assistive technology unless ariaLabel is also provided."
|
|
5239
|
+
);
|
|
5240
|
+
}
|
|
5241
|
+
return {
|
|
5242
|
+
...options.id ? { id: options.id } : {},
|
|
5243
|
+
ariaHidden: true
|
|
5244
|
+
};
|
|
5245
|
+
}
|
|
5246
|
+
|
|
5247
|
+
// src/components/atoms/skeleton/skeleton-types.ts
|
|
5248
|
+
var SkeletonVariant = {
|
|
5249
|
+
text: "text",
|
|
5250
|
+
circular: "circular",
|
|
5251
|
+
rectangular: "rectangular"
|
|
5252
|
+
};
|
|
5253
|
+
var skeletonVariants = Object.values(SkeletonVariant);
|
|
5254
|
+
var SkeletonAnimation = {
|
|
5255
|
+
pulse: "pulse",
|
|
5256
|
+
wave: "wave",
|
|
5257
|
+
none: "none"
|
|
5258
|
+
};
|
|
5259
|
+
var skeletonAnimations = Object.values(SkeletonAnimation);
|
|
5260
|
+
|
|
5261
|
+
// src/components/atoms/skeleton/skeleton-recipe.ts
|
|
5262
|
+
var FIGMA_TEXT_WIDTH = 120;
|
|
5263
|
+
var FIGMA_TEXT_HEIGHT = 12;
|
|
5264
|
+
var FIGMA_CIRCULAR_SIZE = 40;
|
|
5265
|
+
var FIGMA_RECTANGULAR_SIZE = 120;
|
|
5266
|
+
var FIGMA_RADIUS = 4;
|
|
5267
|
+
function cx11(...parts) {
|
|
5268
|
+
return parts.filter(Boolean).join(" ");
|
|
5269
|
+
}
|
|
5270
|
+
function toCssDimension(value) {
|
|
5271
|
+
if (value === void 0) return void 0;
|
|
5272
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
5273
|
+
}
|
|
5274
|
+
function resolveDefaultWidth(variant) {
|
|
5275
|
+
if (variant === SkeletonVariant.circular) return `${FIGMA_CIRCULAR_SIZE}px`;
|
|
5276
|
+
return `${variant === SkeletonVariant.text ? FIGMA_TEXT_WIDTH : FIGMA_RECTANGULAR_SIZE}px`;
|
|
5277
|
+
}
|
|
5278
|
+
function resolveDefaultHeight(variant) {
|
|
5279
|
+
if (variant === SkeletonVariant.text) return `${FIGMA_TEXT_HEIGHT}px`;
|
|
5280
|
+
if (variant === SkeletonVariant.circular) return `${FIGMA_CIRCULAR_SIZE}px`;
|
|
5281
|
+
return `${FIGMA_RECTANGULAR_SIZE}px`;
|
|
5282
|
+
}
|
|
5283
|
+
function resolveRadius(variant, radius) {
|
|
5284
|
+
if (variant === SkeletonVariant.circular) return "9999px";
|
|
5285
|
+
return toCssDimension(radius) ?? `${FIGMA_RADIUS}px`;
|
|
5286
|
+
}
|
|
5287
|
+
function createSkeletonRecipe(options = {}) {
|
|
5288
|
+
const variant = options.variant ?? SkeletonVariant.text;
|
|
5289
|
+
const animation = options.animation ?? SkeletonAnimation.pulse;
|
|
5290
|
+
return {
|
|
5291
|
+
tag: "span",
|
|
5292
|
+
className: cx11(
|
|
5293
|
+
"mw-skeleton",
|
|
5294
|
+
`mw-skeleton--${variant}`,
|
|
5295
|
+
animation !== SkeletonAnimation.none && `mw-skeleton--${animation}`
|
|
5296
|
+
),
|
|
5297
|
+
vars: {
|
|
5298
|
+
"--mw-skeleton-width": toCssDimension(options.width) ?? resolveDefaultWidth(variant),
|
|
5299
|
+
"--mw-skeleton-height": toCssDimension(options.height) ?? resolveDefaultHeight(variant),
|
|
5300
|
+
"--mw-skeleton-radius": resolveRadius(variant, options.radius)
|
|
5301
|
+
},
|
|
5302
|
+
a11y: resolveSkeletonA11y(options),
|
|
5303
|
+
dataAttributes: {
|
|
5304
|
+
"data-component": "skeleton",
|
|
5305
|
+
"data-variant": variant,
|
|
5306
|
+
"data-animation": animation
|
|
5307
|
+
}
|
|
5308
|
+
};
|
|
5309
|
+
}
|
|
5310
|
+
|
|
5311
|
+
// src/components/atoms/stat-tile/stat-tile-a11y.ts
|
|
5312
|
+
function resolveStatTileTrendLabel(direction, trendValue) {
|
|
5313
|
+
if (!direction || !trendValue) return void 0;
|
|
5314
|
+
return direction === "positive" ? `Increased by ${trendValue}` : `Decreased by ${trendValue}`;
|
|
5315
|
+
}
|
|
5316
|
+
|
|
5317
|
+
// src/components/atoms/stat-tile/stat-tile-recipe.ts
|
|
5318
|
+
var statTileTones = ["neutral", "brand", "success", "warning", "danger"];
|
|
5319
|
+
function resolveTone2(tone) {
|
|
5320
|
+
return tone && statTileTones.includes(tone) ? tone : "neutral";
|
|
5321
|
+
}
|
|
5322
|
+
function createStatTileRecipe(opts = {}) {
|
|
5323
|
+
const tone = resolveTone2(opts.tone);
|
|
5324
|
+
const trendDirection = opts.trendDirection;
|
|
5325
|
+
const trendClassName = [
|
|
5326
|
+
"mw-stat-tile__trend",
|
|
5327
|
+
trendDirection ? `mw-stat-tile__trend--${trendDirection}` : null
|
|
5328
|
+
].filter(Boolean).join(" ");
|
|
5329
|
+
const trendAriaLabel = resolveStatTileTrendLabel(trendDirection, opts.trendValue);
|
|
5330
|
+
return {
|
|
5331
|
+
tag: "article",
|
|
5332
|
+
className: ["mw-stat-tile", `mw-stat-tile--${tone}`].join(" "),
|
|
5333
|
+
slots: {
|
|
5334
|
+
headerClassName: "mw-stat-tile__header",
|
|
5335
|
+
labelClassName: "mw-stat-tile__label",
|
|
5336
|
+
trendClassName,
|
|
5337
|
+
trendIconClassName: "mw-stat-tile__trend-icon",
|
|
5338
|
+
trendValueClassName: "mw-stat-tile__trend-value",
|
|
5339
|
+
valueClassName: "mw-stat-tile__value",
|
|
5340
|
+
subtitleClassName: "mw-stat-tile__subtitle"
|
|
5341
|
+
},
|
|
5342
|
+
dataAttributes: {
|
|
5343
|
+
...opts.dataAttributes,
|
|
5344
|
+
"data-component": "stat-tile",
|
|
5345
|
+
"data-tone": tone,
|
|
5346
|
+
...trendDirection ? { "data-trend": trendDirection } : {}
|
|
5347
|
+
},
|
|
5348
|
+
trendDataAttributes: {
|
|
5349
|
+
"data-component": "stat-tile-trend",
|
|
5350
|
+
...trendDirection ? { "data-trend": trendDirection } : {}
|
|
5351
|
+
},
|
|
5352
|
+
trendIcon: trendDirection === "positive" ? "\u2191" : trendDirection === "negative" ? "\u2193" : null,
|
|
5353
|
+
a11y: {
|
|
5354
|
+
...trendAriaLabel ? { trendAriaLabel } : {}
|
|
5355
|
+
}
|
|
5356
|
+
};
|
|
5357
|
+
}
|
|
5358
|
+
|
|
5359
|
+
// src/components/atoms/date-picker/date-picker-a11y.ts
|
|
5360
|
+
function resolveDatePickerDayLabel(day) {
|
|
5361
|
+
if (day.ariaLabel) return day.ariaLabel;
|
|
5362
|
+
if (day.date) return day.date;
|
|
5363
|
+
return day.label;
|
|
5364
|
+
}
|
|
5365
|
+
|
|
5366
|
+
// src/components/atoms/date-picker/date-picker-recipe.ts
|
|
5367
|
+
var datePickerDevices = ["desktop", "mobile"];
|
|
5368
|
+
var defaultWeekdayLabels = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"];
|
|
5369
|
+
var defaultWeeks = [
|
|
5370
|
+
[
|
|
5371
|
+
{ label: "", state: "null" },
|
|
5372
|
+
{ label: "", state: "null" },
|
|
5373
|
+
{ label: "", state: "null" },
|
|
5374
|
+
{ label: "", state: "null" },
|
|
5375
|
+
{ label: "", state: "null" },
|
|
5376
|
+
{ label: "", state: "null" },
|
|
5377
|
+
{ label: "01", date: "2026-03-01" }
|
|
5378
|
+
],
|
|
5379
|
+
[
|
|
5380
|
+
{ label: "02", date: "2026-03-02" },
|
|
5381
|
+
{ label: "03", date: "2026-03-03" },
|
|
5382
|
+
{ label: "04", date: "2026-03-04", state: "selected" },
|
|
5383
|
+
{ label: "05", date: "2026-03-05", state: "range" },
|
|
5384
|
+
{ label: "06", date: "2026-03-06", state: "range" },
|
|
5385
|
+
{ label: "07", date: "2026-03-07", state: "range" },
|
|
5386
|
+
{ label: "08", date: "2026-03-08", state: "selected" }
|
|
5387
|
+
],
|
|
5388
|
+
[
|
|
5389
|
+
{ label: "09", date: "2026-03-09" },
|
|
5390
|
+
{ label: "10", date: "2026-03-10" },
|
|
5391
|
+
{ label: "11", date: "2026-03-11" },
|
|
5392
|
+
{ label: "12", date: "2026-03-12" },
|
|
5393
|
+
{ label: "13", date: "2026-03-13" },
|
|
5394
|
+
{ label: "14", date: "2026-03-14" },
|
|
5395
|
+
{ label: "15", date: "2026-03-15" }
|
|
5396
|
+
],
|
|
5397
|
+
[
|
|
5398
|
+
{ label: "16", date: "2026-03-16" },
|
|
5399
|
+
{ label: "17", date: "2026-03-17" },
|
|
5400
|
+
{ label: "18", date: "2026-03-18" },
|
|
5401
|
+
{ label: "19", date: "2026-03-19" },
|
|
5402
|
+
{ label: "20", date: "2026-03-20" },
|
|
5403
|
+
{ label: "21", date: "2026-03-21" },
|
|
5404
|
+
{ label: "22", date: "2026-03-22" }
|
|
5405
|
+
],
|
|
5406
|
+
[
|
|
5407
|
+
{ label: "23", date: "2026-03-23" },
|
|
5408
|
+
{ label: "24", date: "2026-03-24" },
|
|
5409
|
+
{ label: "25", date: "2026-03-25" },
|
|
5410
|
+
{ label: "26", date: "2026-03-26" },
|
|
5411
|
+
{ label: "27", date: "2026-03-27" },
|
|
5412
|
+
{ label: "28", date: "2026-03-28" },
|
|
5413
|
+
{ label: "29", date: "2026-03-29" }
|
|
5414
|
+
],
|
|
5415
|
+
[
|
|
5416
|
+
{ label: "30", date: "2026-03-30" },
|
|
5417
|
+
{ label: "31", date: "2026-03-31" },
|
|
5418
|
+
{ label: "", state: "null" },
|
|
5419
|
+
{ label: "", state: "null" },
|
|
5420
|
+
{ label: "", state: "null" },
|
|
5421
|
+
{ label: "", state: "null" },
|
|
5422
|
+
{ label: "", state: "null" }
|
|
5423
|
+
]
|
|
5424
|
+
];
|
|
5425
|
+
function resolveDevice(device) {
|
|
5426
|
+
return device && datePickerDevices.includes(device) ? device : "desktop";
|
|
5427
|
+
}
|
|
5428
|
+
function createDayKit(day) {
|
|
5429
|
+
const state = day.state ?? "default";
|
|
5430
|
+
const isEmpty = state === "null" || day.label === "";
|
|
5431
|
+
const disabled = state === "disabled" || isEmpty;
|
|
5432
|
+
const selected = state === "selected";
|
|
5433
|
+
return {
|
|
5434
|
+
className: [
|
|
5435
|
+
"mw-date-picker__day",
|
|
5436
|
+
`mw-date-picker__day--${state}`,
|
|
5437
|
+
day.isToday ? "mw-date-picker__day--today" : null
|
|
5438
|
+
].filter(Boolean).join(" "),
|
|
5439
|
+
dataAttributes: {
|
|
5440
|
+
"data-component": "date-picker-day",
|
|
5441
|
+
"data-state": state,
|
|
5442
|
+
...day.date ? { "data-date": day.date } : {},
|
|
5443
|
+
...day.isToday ? { "data-today": "true" } : {}
|
|
5444
|
+
},
|
|
5445
|
+
ariaLabel: resolveDatePickerDayLabel(day),
|
|
5446
|
+
disabled,
|
|
5447
|
+
selected,
|
|
5448
|
+
isEmpty
|
|
5449
|
+
};
|
|
5450
|
+
}
|
|
5451
|
+
function createDatePickerRecipe(opts = {}) {
|
|
5452
|
+
const device = resolveDevice(opts.device);
|
|
5453
|
+
const weeks = opts.weeks ?? defaultWeeks;
|
|
5454
|
+
return {
|
|
5455
|
+
className: ["mw-date-picker", `mw-date-picker--${device}`].join(" "),
|
|
5456
|
+
dataAttributes: {
|
|
5457
|
+
...opts.dataAttributes,
|
|
5458
|
+
"data-component": "date-picker",
|
|
5459
|
+
"data-device": device
|
|
5460
|
+
},
|
|
5461
|
+
monthLabel: opts.monthLabel ?? "March 2026",
|
|
5462
|
+
weekdayLabels: opts.weekdayLabels ?? defaultWeekdayLabels,
|
|
5463
|
+
weeks,
|
|
5464
|
+
dayKits: weeks.map((week) => week.map(createDayKit)),
|
|
5465
|
+
slots: {
|
|
5466
|
+
headerClassName: "mw-date-picker__header",
|
|
5467
|
+
navGroupClassName: "mw-date-picker__nav-group",
|
|
5468
|
+
navButtonClassName: "mw-date-picker__nav-button",
|
|
5469
|
+
monthLabelClassName: "mw-date-picker__month-label",
|
|
5470
|
+
gridClassName: "mw-date-picker__grid",
|
|
5471
|
+
weekdayClassName: "mw-date-picker__weekday",
|
|
5472
|
+
weekClassName: "mw-date-picker__week",
|
|
5473
|
+
cellClassName: "mw-date-picker__cell",
|
|
5474
|
+
dayClassName: "mw-date-picker__day",
|
|
5475
|
+
footerClassName: "mw-date-picker__footer",
|
|
5476
|
+
footerButtonClassName: "mw-date-picker__footer-button"
|
|
5477
|
+
},
|
|
5478
|
+
labels: {
|
|
5479
|
+
calendar: opts.calendarLabel ?? "Choose date",
|
|
5480
|
+
previousYear: opts.previousYearLabel ?? "Previous year",
|
|
5481
|
+
previousMonth: opts.previousMonthLabel ?? "Previous month",
|
|
5482
|
+
nextMonth: opts.nextMonthLabel ?? "Next month",
|
|
5483
|
+
nextYear: opts.nextYearLabel ?? "Next year",
|
|
5484
|
+
cancel: opts.cancelLabel ?? "Today",
|
|
5485
|
+
apply: opts.applyLabel ?? ""
|
|
5486
|
+
}
|
|
5487
|
+
};
|
|
5488
|
+
}
|
|
5489
|
+
|
|
5136
5490
|
// src/components/atoms/icon/icon-registry.ts
|
|
5137
5491
|
var iconRegistry = {
|
|
5138
5492
|
airplay: {
|
|
@@ -9942,7 +10296,7 @@ function resolveIconStrokeWidth(input) {
|
|
|
9942
10296
|
var iconNames = iconNamesList;
|
|
9943
10297
|
|
|
9944
10298
|
// src/components/atoms/icon/icon-a11y.ts
|
|
9945
|
-
function
|
|
10299
|
+
function isDev5() {
|
|
9946
10300
|
const p = globalThis.process;
|
|
9947
10301
|
const nodeEnv = p?.env?.NODE_ENV;
|
|
9948
10302
|
if (nodeEnv) return nodeEnv !== "production";
|
|
@@ -9951,7 +10305,7 @@ function isDev4() {
|
|
|
9951
10305
|
if (meta.env?.MODE) return meta.env.MODE !== "production";
|
|
9952
10306
|
return true;
|
|
9953
10307
|
}
|
|
9954
|
-
var
|
|
10308
|
+
var __DEV__5 = isDev5();
|
|
9955
10309
|
function resolveIconA11y(options) {
|
|
9956
10310
|
if (options.ariaLabel) {
|
|
9957
10311
|
return {
|
|
@@ -9959,7 +10313,7 @@ function resolveIconA11y(options) {
|
|
|
9959
10313
|
ariaLabel: options.ariaLabel
|
|
9960
10314
|
};
|
|
9961
10315
|
}
|
|
9962
|
-
if (
|
|
10316
|
+
if (__DEV__5 && options.decorative === false) {
|
|
9963
10317
|
console.warn(
|
|
9964
10318
|
"[marwes] Icon: decorative={false} was passed without ariaLabel. The icon stays hidden from assistive technology unless ariaLabel is also provided."
|
|
9965
10319
|
);
|
|
@@ -10061,7 +10415,7 @@ function resolveInputOtpA11y(options) {
|
|
|
10061
10415
|
}
|
|
10062
10416
|
|
|
10063
10417
|
// src/components/atoms/input/input-otp-recipe.ts
|
|
10064
|
-
function
|
|
10418
|
+
function cx12(...parts) {
|
|
10065
10419
|
return parts.filter(Boolean).join(" ");
|
|
10066
10420
|
}
|
|
10067
10421
|
function sanitizeInputOtpValue(rawValue, length) {
|
|
@@ -10097,7 +10451,7 @@ function createInputOtpRecipe(options) {
|
|
|
10097
10451
|
};
|
|
10098
10452
|
return {
|
|
10099
10453
|
tag: "div",
|
|
10100
|
-
className:
|
|
10454
|
+
className: cx12(
|
|
10101
10455
|
"mw-input-otp",
|
|
10102
10456
|
options.invalid && "mw-input-otp--invalid",
|
|
10103
10457
|
options.disabled && "mw-input-otp--disabled",
|
|
@@ -10345,13 +10699,13 @@ function resolveTabA11y(opts) {
|
|
|
10345
10699
|
}
|
|
10346
10700
|
|
|
10347
10701
|
// src/components/atoms/tab/tab-recipe.ts
|
|
10348
|
-
function
|
|
10702
|
+
function cx13(...parts) {
|
|
10349
10703
|
return parts.filter(Boolean).join(" ");
|
|
10350
10704
|
}
|
|
10351
10705
|
function createTabRecipe(opts) {
|
|
10352
10706
|
return {
|
|
10353
10707
|
tag: "button",
|
|
10354
|
-
className:
|
|
10708
|
+
className: cx13(
|
|
10355
10709
|
"mw-tab",
|
|
10356
10710
|
opts.selected && "mw-tab--selected",
|
|
10357
10711
|
opts.disabled && "mw-tab--disabled"
|
|
@@ -10553,6 +10907,72 @@ var storybookSpinnerArgTypes = {
|
|
|
10553
10907
|
description: "Accessible label for standalone loading indicators"
|
|
10554
10908
|
}
|
|
10555
10909
|
};
|
|
10910
|
+
var storybookSkeletonArgTypes = {
|
|
10911
|
+
variant: {
|
|
10912
|
+
control: "select",
|
|
10913
|
+
options: ["text", "circular", "rectangular"],
|
|
10914
|
+
description: "Skeleton shape from the synced Skeleton page"
|
|
10915
|
+
},
|
|
10916
|
+
animation: {
|
|
10917
|
+
control: "select",
|
|
10918
|
+
options: ["pulse", "wave", "none"],
|
|
10919
|
+
description: "Visual loading animation"
|
|
10920
|
+
},
|
|
10921
|
+
width: {
|
|
10922
|
+
control: "text",
|
|
10923
|
+
description: "Width override; numbers in code are treated as pixels"
|
|
10924
|
+
},
|
|
10925
|
+
height: {
|
|
10926
|
+
control: "text",
|
|
10927
|
+
description: "Height override; numbers in code are treated as pixels"
|
|
10928
|
+
},
|
|
10929
|
+
radius: {
|
|
10930
|
+
control: "text",
|
|
10931
|
+
description: "Corner radius override; circular skeletons force a full radius"
|
|
10932
|
+
},
|
|
10933
|
+
decorative: {
|
|
10934
|
+
control: "boolean",
|
|
10935
|
+
description: "Hide the skeleton from assistive technology when surrounding UI already communicates loading"
|
|
10936
|
+
},
|
|
10937
|
+
ariaLabel: {
|
|
10938
|
+
control: "text",
|
|
10939
|
+
description: "Accessible label for standalone loading placeholder groups"
|
|
10940
|
+
}
|
|
10941
|
+
};
|
|
10942
|
+
var storybookStatTileArgTypes = {
|
|
10943
|
+
tone: {
|
|
10944
|
+
control: "select",
|
|
10945
|
+
options: ["neutral", "brand", "success", "warning", "danger"],
|
|
10946
|
+
description: "Color treatment from the synced Stat Tile Figma instances"
|
|
10947
|
+
},
|
|
10948
|
+
trendDirection: {
|
|
10949
|
+
control: "select",
|
|
10950
|
+
options: [void 0, "positive", "negative"],
|
|
10951
|
+
description: "Trend direction for the compact trend pill"
|
|
10952
|
+
},
|
|
10953
|
+
trendValue: {
|
|
10954
|
+
control: "text",
|
|
10955
|
+
description: "Compact trend value, for example 12%"
|
|
10956
|
+
},
|
|
10957
|
+
label: { control: "text" },
|
|
10958
|
+
value: { control: "text" },
|
|
10959
|
+
subtitle: { control: "text" }
|
|
10960
|
+
};
|
|
10961
|
+
var storybookDatePickerArgTypes = {
|
|
10962
|
+
device: {
|
|
10963
|
+
control: "select",
|
|
10964
|
+
options: ["desktop", "mobile"],
|
|
10965
|
+
description: "Device variant from the synced Date Picker Figma component set"
|
|
10966
|
+
},
|
|
10967
|
+
monthLabel: { control: "text" },
|
|
10968
|
+
calendarLabel: { control: "text" },
|
|
10969
|
+
previousYearLabel: { control: "text" },
|
|
10970
|
+
previousMonthLabel: { control: "text" },
|
|
10971
|
+
nextMonthLabel: { control: "text" },
|
|
10972
|
+
nextYearLabel: { control: "text" },
|
|
10973
|
+
cancelLabel: { control: "text" },
|
|
10974
|
+
applyLabel: { control: "text" }
|
|
10975
|
+
};
|
|
10556
10976
|
var storybookSpacingArgTypes = {
|
|
10557
10977
|
size: {
|
|
10558
10978
|
control: "select",
|
|
@@ -10646,6 +11066,6 @@ var storybookDocsDescription = {
|
|
|
10646
11066
|
colors: "Complete color palette from the design system. Semantic roles map to CSS variables, with label colors auto-derived by default and overrideable for brand-specific fills."
|
|
10647
11067
|
};
|
|
10648
11068
|
|
|
10649
|
-
export { AvatarSize, AvatarType, BadgeVariant, ButtonAction, ButtonSize, ButtonVariant, DENSITY_SCALES, IconName, Spacings, SpinnerVariant, SpinnerVariants, SwitchSize, ThemeMode, accordionPurposeComponentReference, accordionWhyPurposeComponents, avatarPurposeSemantics, avatarPurposes, badgePurposeComponentReference, badgePurposeSemantics, badgePurposes, badgeWhyPurposeComponents, buildAccordionFieldA11yIds, buildCheckboxA11y, buildCheckboxFieldA11yIds, buildCheckboxGroupFieldA11yIds, buildCurrencyHelperText, buildGoogleFontsUrl, buildHeadingA11y, buildInputFieldA11yIds, buildRadioA11y, buildRadioGroupFieldA11yIds, buildRichTextFieldA11yIds, buildSliderFieldA11yIds, buildSwitchFieldA11yIds, buildTabGroupA11yIds, buttonActionSemanticPurposes, buttonPurposeSemantics, buttonPurposes, buttonVariantVisualStyles, buttonWhySemanticComponents, canonicalSemanticAttributeNames, canonicalSemanticAttributeRegistry, canonicalSemanticAttributes, cardPurposeComponentReference, cardWhyPurposeComponents, checkboxRecipe, createAccordionRecipe, createAvatarRecipe, createBadgeRecipe, createButtonRecipe, createCardRecipe, createDialogRecipe, createDividerRecipe, createFamilySemanticAttributes, createFontStack, createIconRecipe, createInputOtpRecipe, createInputRecipe, createMarwesThemeScript, createMarwesThemeStyle, createPurposeSemanticAttributes, createRichTextRecipe, createSelectRecipe, createSliderRecipe, createSpacingRecipe, createSpinnerRecipe, createSwitchRecipe, createTabRecipe, createTextareaRecipe, createToastRecipe, createTooltipRecipe, currencyCodes, darkThemeDefaults, densityToCSSVars, dialogPurposeComponentReference, dialogPurposeSemantics, dialogPurposes, dialogWhyPurposeComponents, emptySemanticAttributes, escapeRichTextHtml, extractFontFamilyName, extractUsedWeights, familySemanticsRegistry, fieldComparisonRows, fieldWhyPurposeComponents, filterUndefinedSemanticAttributes, getCurrencySymbol, headingRecipe, iconNames, iconNamesList, iconRegistry, iconSizeScale, iconStrokeWidthScale, isRichTextHtmlEmpty, isSystemFont, isThemeMode, isThemePreference, lightThemeDefaults, mergeIdRefs, mergeSemanticAttributes, moveTabSelection, mwAvailableFonts, mwFontFallbacks, mwGoogleFontFamilies, mwStyledTheme, mwThemeVarNames, mwThemeVars, mwVar, nextThemeMode, normalizeRichTextHtml, paragraphRecipe, purposeSemanticsRegistry, radioPurposeComponentReference, radioRecipe, radioWhyPurposeComponents, resolveAccordionA11y, resolveAvatarA11y, resolveBadgeA11y, resolveButtonLoading, resolveDialogA11y, resolveIconA11y, resolveIconSize, resolveIconStrokeWidth, resolveRichTextAllowedFormats, resolveSelectMode, resolveServerThemeMode, resolveSliderA11y, resolveSpinnerA11y, resolveSpinnerSize, resolveSwitchA11y, resolveTabA11y, resolveTabValue, resolveThemeInput, resolveThemePreference, resolveToastA11y, resolveTone, resolveTooltipA11y, richTextCommandByFormat, richTextFormattingReference, richTextWhyUseIt, sanitizeCurrencyValue, sanitizeInputOtpValue, semanticFamilies, semanticFrameworkSupport, semanticIntents, semanticLayers, semanticOrientations, semanticOutcomes, semanticPurposes, shouldLoadGoogleFont, sliderPurposeComponentReference, sliderWhyPurposeComponents, spinnerSizeScale, spinnerSizes, spinnerVariants, storybookA11yPolicy, storybookButtonGeneralArgTypes, storybookButtonIconArgTypes, storybookButtonPurposeArgTypes, storybookCheckboxArgTypes, storybookDividerArgTypes, storybookDocsDescription, storybookIconGalleryArgTypes, storybookIconGalleryDefaults, storybookIconNames, storybookLayout, storybookOptionalIconNames, storybookRadioArgTypes, storybookSliderArgTypes, storybookSpacingArgTypes, storybookSpinnerArgTypes, switchPurposeComponentReference, switchWhyPurposeComponents, tabPurposeComponentReference, tabWhyPurposeComponents, themeModesToCSSRules, themeToCSSRule, themeToCSSVars, toastPurposeComponentReference, toastPurposeSemantics, toastPurposes, toastWhyPurposeComponents, validateSemanticRegistry };
|
|
11069
|
+
export { AvatarSize, AvatarType, BadgeVariant, ButtonAction, ButtonSize, ButtonVariant, DENSITY_SCALES, IconName, SkeletonAnimation, SkeletonVariant, Spacings, SpinnerVariant, SpinnerVariants, SwitchSize, ThemeMode, accordionPurposeComponentReference, accordionWhyPurposeComponents, avatarPurposeSemantics, avatarPurposes, badgePurposeComponentReference, badgePurposeSemantics, badgePurposes, badgeWhyPurposeComponents, buildAccordionFieldA11yIds, buildCheckboxA11y, buildCheckboxFieldA11yIds, buildCheckboxGroupFieldA11yIds, buildCurrencyHelperText, buildGoogleFontsUrl, buildHeadingA11y, buildInputFieldA11yIds, buildRadioA11y, buildRadioGroupFieldA11yIds, buildRichTextFieldA11yIds, buildSliderFieldA11yIds, buildSwitchFieldA11yIds, buildTabGroupA11yIds, buttonActionSemanticPurposes, buttonPurposeSemantics, buttonPurposes, buttonVariantVisualStyles, buttonWhySemanticComponents, canonicalSemanticAttributeNames, canonicalSemanticAttributeRegistry, canonicalSemanticAttributes, cardPurposeComponentReference, cardWhyPurposeComponents, checkboxRecipe, createAccordionRecipe, createAvatarRecipe, createBadgeRecipe, createButtonRecipe, createCardRecipe, createDatePickerRecipe, createDialogRecipe, createDividerRecipe, createFamilySemanticAttributes, createFontStack, createIconRecipe, createInputOtpRecipe, createInputRecipe, createMarwesThemeScript, createMarwesThemeStyle, createPurposeSemanticAttributes, createRichTextRecipe, createSelectRecipe, createSkeletonRecipe, createSliderRecipe, createSpacingRecipe, createSpinnerRecipe, createStatTileRecipe, createSwitchRecipe, createTabRecipe, createTextareaRecipe, createToastRecipe, createTooltipRecipe, currencyCodes, darkThemeDefaults, densityToCSSVars, dialogPurposeComponentReference, dialogPurposeSemantics, dialogPurposes, dialogWhyPurposeComponents, emptySemanticAttributes, escapeRichTextHtml, extractFontFamilyName, extractUsedWeights, familySemanticsRegistry, fieldComparisonRows, fieldWhyPurposeComponents, filterUndefinedSemanticAttributes, getCurrencySymbol, headingRecipe, iconNames, iconNamesList, iconRegistry, iconSizeScale, iconStrokeWidthScale, isRichTextHtmlEmpty, isSystemFont, isThemeMode, isThemePreference, lightThemeDefaults, mergeIdRefs, mergeSemanticAttributes, moveTabSelection, mwAvailableFonts, mwFontFallbacks, mwGoogleFontFamilies, mwStyledTheme, mwThemeVarNames, mwThemeVars, mwVar, nextThemeMode, normalizeRichTextHtml, paragraphRecipe, purposeSemanticsRegistry, radioPurposeComponentReference, radioRecipe, radioWhyPurposeComponents, resolveAccordionA11y, resolveAvatarA11y, resolveBadgeA11y, resolveButtonLoading, resolveDatePickerDayLabel, resolveDialogA11y, resolveIconA11y, resolveIconSize, resolveIconStrokeWidth, resolveRichTextAllowedFormats, resolveSelectMode, resolveServerThemeMode, resolveSkeletonA11y, resolveSliderA11y, resolveSpinnerA11y, resolveSpinnerSize, resolveStatTileTrendLabel, resolveSwitchA11y, resolveTabA11y, resolveTabValue, resolveThemeInput, resolveThemePreference, resolveToastA11y, resolveTone, resolveTooltipA11y, richTextCommandByFormat, richTextFormattingReference, richTextWhyUseIt, sanitizeCurrencyValue, sanitizeInputOtpValue, semanticFamilies, semanticFrameworkSupport, semanticIntents, semanticLayers, semanticOrientations, semanticOutcomes, semanticPurposes, shouldLoadGoogleFont, skeletonAnimations, skeletonVariants, sliderPurposeComponentReference, sliderWhyPurposeComponents, spinnerSizeScale, spinnerSizes, spinnerVariants, storybookA11yPolicy, storybookButtonGeneralArgTypes, storybookButtonIconArgTypes, storybookButtonPurposeArgTypes, storybookCheckboxArgTypes, storybookDatePickerArgTypes, storybookDividerArgTypes, storybookDocsDescription, storybookIconGalleryArgTypes, storybookIconGalleryDefaults, storybookIconNames, storybookLayout, storybookOptionalIconNames, storybookRadioArgTypes, storybookSkeletonArgTypes, storybookSliderArgTypes, storybookSpacingArgTypes, storybookSpinnerArgTypes, storybookStatTileArgTypes, switchPurposeComponentReference, switchWhyPurposeComponents, tabPurposeComponentReference, tabWhyPurposeComponents, themeModesToCSSRules, themeToCSSRule, themeToCSSVars, toastPurposeComponentReference, toastPurposeSemantics, toastPurposes, toastWhyPurposeComponents, validateSemanticRegistry };
|
|
10650
11070
|
//# sourceMappingURL=index.js.map
|
|
10651
11071
|
//# sourceMappingURL=index.js.map
|