vunor 0.2.1 → 0.3.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.
@@ -1,4 +1,4 @@
1
- import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
1
+ import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
2
2
  import { Primitive } from "reka-ui";
3
3
  import VuIcon from "vunor/Icon";
4
4
  import VuLoadingIndicator from "vunor/LoadingIndicator";
@@ -46,7 +46,7 @@ var ButtonBase_default = /* @__PURE__ */ defineComponent({
46
46
  },
47
47
  setup(__props) {
48
48
  return (_ctx, _cache) => {
49
- return openBlock(), createBlock(unref(Primitive), {
49
+ return openBlock(), createElementBlock(Fragment, null, [createCommentVNode("\n `group/btn` is no longer read by any vunor rule: since 0.3.0 the label and\n icon take their cue from inherited custom properties instead of\n `group-[.btn-square]/btn:` descendant rules. It stays because it is public\n surface that consumer-authored `group-*/btn:` rules may still key on.\n "), createVNode(unref(Primitive), {
50
50
  class: "btn group/btn",
51
51
  as: __props.as,
52
52
  href: __props.href,
@@ -77,7 +77,7 @@ var ButtonBase_default = /* @__PURE__ */ defineComponent({
77
77
  "data-has-icon",
78
78
  "data-loading",
79
79
  "disabled"
80
- ]);
80
+ ])], 2112);
81
81
  };
82
82
  }
83
83
  });
package/dist/theme.d.mts CHANGED
@@ -16,7 +16,7 @@ interface TVunorUnoPresetOpts {
16
16
  regular: number;
17
17
  dense: number;
18
18
  };
19
- typography?: Record<TTypographyNames, TTypography | undefined>;
19
+ typography?: Partial<Record<TTypographyNames, TTypography>>;
20
20
  layers?: {
21
21
  reverseDark?: boolean;
22
22
  reverseLight?: boolean;
package/dist/theme.mjs CHANGED
@@ -161,11 +161,8 @@ const shortcuts = [
161
161
  defineShortcuts({
162
162
  "rb-container": { "": "flex flex-col gap-$s text-body" },
163
163
  "rb-label": { "": "text-label text-grey-400" },
164
- "rb-root": {
165
- "": "flex gap-x-$l gap-y-$m",
166
- "[&.rb-row]:": "flex-wrap",
167
- "not-[.rb-row]:": "flex-col"
168
- },
164
+ "rb-root": { "": "flex [flex-direction:var(--rb-dir,column)] gap-x-$l gap-y-$m" },
165
+ "rb-row": { "": "[--rb-dir:row] flex-wrap" },
169
166
  "rb-item-wrapper": { "": "flex" },
170
167
  "rb-item": {
171
168
  "": "disabled-soft select-none shrink-0 current-bg-scope-color-500 bg-current/0 size-1.25em rounded-full cursor-default current-border-grey-500 border-current/40 border-[0.16em] transition-none",
@@ -232,29 +229,25 @@ const shortcuts = [
232
229
  ];
233
230
  //#endregion
234
231
  //#region src/theme/shortcuts/btn.ts
232
+ const btnRound = "px-fingertip-half rounded-fingertip-half [--btn-icon-pull:-0.5em]";
233
+ const btnSquare = "size-fingertip px-0 [--btn-label-display:none] [--btn-icon-fs:1.5em] [--btn-icon-pull:0]";
235
234
  const btn = defineShortcuts({
236
235
  "btn": {
237
236
  "": "h-fingertip flex items-center justify-center px-$m gap-$xs select-none fw-bold tracking-wide relative",
238
- "[&.btn-round]:": "px-fingertip-half rounded-fingertip-half",
239
- "[&.btn-square]:": "size-fingertip px-0",
240
- "[&.btn-round.btn-square]:": "px-0",
237
+ "[&.btn-round]:": btnRound,
238
+ "[&.btn-square]:": btnSquare,
239
+ "[&.btn-round.btn-square]:": "px-0 [--btn-icon-pull:0]",
241
240
  "disabled:": "opacity-80 cursor-not-allowed",
242
241
  "[&>span]:data-[loading]:": "opacity-0 pointer-events-none",
243
242
  "[&>div:not(.loading-indicator-wrapper)]:data-[loading]:": "opacity-0 pointer-events-none",
244
243
  "[&>.loading-indicator-wrapper]:": "absolute left-0 top-0 right-0 bottom-0 flex items-center justify-center cursor-wait"
245
244
  },
246
- "btn-square": { "": "" },
247
- "btn-label": {
248
- "": "lh-1em ellipsis whitespace-nowrap overflow-x-clip overflow-y-visible",
249
- "group-[.btn-square]/btn:": "hidden"
250
- },
251
- "btn-icon": {
252
- "": "size-1em font-size-1.25em",
253
- "group-[.btn-round]/btn:[&.btn-icon-left]:": "ml-[-0.5em]",
254
- "group-[.btn-round]/btn:[&.btn-icon-right]:": "mr-[-0.5em]",
255
- "group-[.btn-square]/btn:": "font-size-1.5em m-0!",
256
- "group-[.btn-round.btn-square]/btn:": "m-0!"
257
- }
245
+ "btn-round": { "": btnRound },
246
+ "btn-square": { "": btnSquare },
247
+ "btn-label": { "": "lh-1em ellipsis whitespace-nowrap overflow-x-clip overflow-y-visible display-[var(--btn-label-display,revert)]" },
248
+ "btn-icon": { "": "size-1em font-size-[var(--btn-icon-fs,1.25em)]" },
249
+ "btn-icon-left": { "": "ml-[var(--btn-icon-pull,0)]" },
250
+ "btn-icon-right": { "": "mr-[var(--btn-icon-pull,0)]" }
258
251
  });
259
252
  //#endregion
260
253
  //#region src/theme/shortcuts/c8.ts
@@ -358,6 +351,13 @@ const disabledSoft = defineShortcuts({ "disabled-soft": {
358
351
  "data-[disabled]:": disabledPaint
359
352
  } });
360
353
  //#endregion
354
+ //#region src/theme/shortcuts/i8.ts
355
+ const M = "1em";
356
+ const FINGERTIP_HALF = "var(--v-fingertip-half)";
357
+ const pad = (v) => `[--i8-pl:${v}] [--i8-pr:${v}] [--i8-hint-px:${v}]`;
358
+ const filledSignal = `${pad(M)} [--i8-underline-display:none]`;
359
+ const roundSignal = pad(FINGERTIP_HALF);
360
+ //#endregion
361
361
  //#region src/theme/shortcuts/raw.ts
362
362
  const rawVunorShortcuts = [
363
363
  defineShortcuts({
@@ -368,18 +368,22 @@ const rawVunorShortcuts = [
368
368
  "focus-within:": "icon-current-hl",
369
369
  "[&.i8-flat]:": { "": "border-b-width-[var(--i8-border-width,1px)]" },
370
370
  "[&.i8-filled]:": {
371
- "": "i8-apply-bg current-outline-hl i8-apply-border rounded-r1 i8-apply-border",
371
+ "": "i8-apply-bg current-outline-hl i8-apply-border rounded-r1",
372
372
  "data-[active=true]:": "current-border-hl outline i8-apply-outline",
373
373
  "focus-within:": "current-border-hl outline i8-apply-outline"
374
374
  },
375
- "[&.i8-transparent]:": "bg-transparent!",
376
375
  "[&.i8-round]:": {
377
376
  "": "i8-apply-bg current-outline-hl rounded-fingertip-half i8-apply-border",
378
377
  "data-[active=true]:": "current-border-hl outline i8-apply-outline",
379
378
  "focus-within:": "current-border-hl outline i8-apply-outline"
380
379
  },
380
+ "[&.segmented.i8-round:not(:first-child)]:": `[--i8-pl:${M}]`,
381
+ "[&.segmented.i8-round:not(:last-child)]:": `[--i8-pr:${M}]`,
381
382
  "group-[[data-error=true]]/i8:": { "": "current-border-error-500 current-outline-error-500 border-opacity-100 border-current" }
382
383
  },
384
+ "i8-filled": filledSignal,
385
+ "i8-round": roundSignal,
386
+ "i8-transparent": "bg-transparent!",
383
387
  "i8-bare": {
384
388
  "": "i8-apply-bg i8-apply-border current-outline-hl rounded-r1 outline-none text-current placeholder:text-current/50 disabled-soft",
385
389
  "hover:": "border-current-hover",
@@ -392,8 +396,7 @@ const rawVunorShortcuts = [
392
396
  },
393
397
  "i8-icon-wrap": "size-fingertip flex items-center justify-center",
394
398
  "i8-underline": {
395
- "group-[.i8-filled]/i8:": "hidden",
396
- "": "absolute left-50% h-2px right-50% bottom-[-1px] pointer-events-none transition-all transition-duration-300 will-change-left will-change-right bg-current-hl",
399
+ "": "absolute left-50% h-2px right-50% bottom-[-1px] pointer-events-none transition-all transition-duration-300 will-change-left will-change-right bg-current-hl display-[var(--i8-underline-display,revert)]",
397
400
  "group-[[data-active=true]]/i8:": "left-0 right-0"
398
401
  },
399
402
  "segmented": {
@@ -409,24 +412,16 @@ const rawVunorShortcuts = [
409
412
  "i8-input-wrapper": { "": "relative w-full h-full" },
410
413
  "i8-input": {
411
414
  "": "w-full outline-none h-full bg-transparent",
412
- "group-[.i8-filled]/i8:[&:not([data-has-prepend=true])]:": "pl-$m",
413
- "group-[.i8-filled]/i8:[&:not([data-has-append=true])]:": "pr-$m",
415
+ "[&:not([data-has-prepend=true])]:": "pl-[var(--i8-pl,0)]",
416
+ "[&:not([data-has-append=true])]:": "pr-[var(--i8-pr,0)]",
414
417
  "selection:": "bg-scope-color-500 text-white",
415
- "group-[.i8-round]/i8:[&:not([data-has-prepend=true])]:": "pl-fingertip-half",
416
- "group-[.i8-round]/i8:[&:not([data-has-append=true])]:": "pr-fingertip-half",
417
- "group-[[data-has-label]]/i8:": "pt-$m",
418
- "group-[.segmented.i8-round:not(:first-child)]/i8:[&:not([data-has-prepend=true])]:": "pl-$m",
419
- "group-[.segmented.i8-round:not(:last-child)]/i8:[&:not([data-has-append=true])]:": "pr-$m"
418
+ "group-[[data-has-label]]/i8:": "pt-$m"
420
419
  },
421
420
  "i8-textarea": {
422
421
  "": "w-full outline-none h-full bg-transparent text-body",
423
- "group-[.i8-filled]/i8:[&:not([data-has-prepend=true])]:": "pl-$m",
424
- "group-[.i8-filled]/i8:[&:not([data-has-append=true])]:": "pr-$m",
425
- "selection:": "bg-scope-color-500 text-white",
426
- "group-[.i8-round]/i8:[&:not([data-has-prepend=true])]:": "pl-fingertip-half",
427
- "group-[.i8-round]/i8:[&:not([data-has-append=true])]:": "pr-fingertip-half",
428
- "group-[.segmented.i8-round:not(:first-child)]/i8:[&:not([data-has-prepend=true])]:": "pl-$m",
429
- "group-[.segmented.i8-round:not(:last-child)]/i8:[&:not([data-has-append=true])]:": "pr-$m"
422
+ "[&:not([data-has-prepend=true])]:": "pl-[var(--i8-pl,0)]",
423
+ "[&:not([data-has-append=true])]:": "pr-[var(--i8-pr,0)]",
424
+ "selection:": "bg-scope-color-500 text-white"
430
425
  },
431
426
  "i8-ta-wrapper": {
432
427
  "": "w-full pt-0.75em",
@@ -441,21 +436,12 @@ const rawVunorShortcuts = [
441
436
  },
442
437
  "i8-label-wrapper": {
443
438
  "": "pointer-events-none absolute left-0 right-0 bottom-0 top-0",
444
- "group-[.i8-filled]/i8:data-[has-prepend=true]": "pl-0",
445
- "group-[.i8-filled]/i8:data-[has-append=true]": "pr-0",
446
- "group-[.i8-filled]/i8:": "px-$m",
447
- "group-[.i8-round]/i8:[&:not([data-has-prepend=true])]:": "pl-fingertip-half",
448
- "group-[.i8-round]/i8:[&:not([data-has-append=true])]:": "pr-fingertip-half",
449
- "group-[.segmented.i8-round:not(:first-child)]/i8:[&:not([data-has-prepend=true])]:": "pl-$m",
450
- "group-[.segmented.i8-round:not(:last-child)]/i8:[&:not([data-has-append=true])]:": "pr-$m"
439
+ "[&:not([data-has-prepend=true])]:": "pl-[var(--i8-pl,0)]",
440
+ "[&:not([data-has-append=true])]:": "pr-[var(--i8-pr,0)]"
451
441
  },
452
442
  "i8-hint": { "": "text-caption pt-$xs text-grey-400 flex-1" },
453
443
  "i8-counter": { "": "text-caption pt-$xs text-grey-400" },
454
- "i8-hint-wrapper": {
455
- "": "relative flex justify-between",
456
- "group-[.i8-round]/i8:": "px-fingertip-half",
457
- "group-[.i8-filled]/i8:": "px-$m"
458
- },
444
+ "i8-hint-wrapper": { "": "relative flex justify-between px-[var(--i8-hint-px,0)]" },
459
445
  "i8-hint-wrapper-stack": { "": "relative flex justify-between" },
460
446
  "i8-stack-label": { "": "relative pb-$xxs" },
461
447
  "i8-prepend": {
@@ -587,6 +573,8 @@ const componentClasses = {
587
573
  "[grid-area:_title]",
588
574
  "btn",
589
575
  "btn-icon",
576
+ "btn-icon-left",
577
+ "btn-icon-right",
590
578
  "btn-label",
591
579
  "c8-flat",
592
580
  "fw-$bold",
@@ -595,6 +583,7 @@ const componentClasses = {
595
583
  "loading-indicator",
596
584
  "loading-indicator-ring",
597
585
  "mb-$s",
586
+ "surface",
598
587
  "text-body-s",
599
588
  "toast-root",
600
589
  "toasts-viewport"
@@ -602,25 +591,34 @@ const componentClasses = {
602
591
  Button: [
603
592
  "btn",
604
593
  "btn-icon",
594
+ "btn-icon-left",
595
+ "btn-icon-right",
605
596
  "btn-label",
606
597
  "icon-color",
607
598
  "icon-size",
608
599
  "loading-indicator",
609
- "loading-indicator-ring"
600
+ "loading-indicator-ring",
601
+ "surface"
610
602
  ],
611
603
  ButtonBase: [
612
604
  "btn",
613
605
  "btn-icon",
606
+ "btn-icon-left",
607
+ "btn-icon-right",
614
608
  "btn-label",
615
609
  "icon-color",
616
610
  "icon-size",
617
611
  "loading-indicator",
618
- "loading-indicator-ring"
612
+ "loading-indicator-ring",
613
+ "surface"
619
614
  ],
620
615
  Calendar: [
621
616
  "btn",
622
617
  "btn-icon",
618
+ "btn-icon-left",
619
+ "btn-icon-right",
623
620
  "btn-label",
621
+ "btn-square",
624
622
  "c8-flat",
625
623
  "calendar-cell",
626
624
  "calendar-grid-row",
@@ -644,6 +642,7 @@ const componentClasses = {
644
642
  "relative",
645
643
  "rounded",
646
644
  "select-none",
645
+ "surface",
647
646
  "text-center"
648
647
  ],
649
648
  Card: [
@@ -713,6 +712,7 @@ const componentClasses = {
713
712
  "i8-before",
714
713
  "i8-border-none",
715
714
  "i8-counter",
715
+ "i8-filled",
716
716
  "i8-hint",
717
717
  "i8-hint-wrapper",
718
718
  "i8-hint-wrapper-stack",
@@ -725,6 +725,7 @@ const componentClasses = {
725
725
  "i8-loading",
726
726
  "i8-outline-none",
727
727
  "i8-prepend",
728
+ "i8-round",
728
729
  "i8-stack-label",
729
730
  "i8-ta-wrapper",
730
731
  "i8-textarea",
@@ -769,7 +770,10 @@ const componentClasses = {
769
770
  "bottom-0",
770
771
  "btn",
771
772
  "btn-icon",
773
+ "btn-icon-left",
774
+ "btn-icon-right",
772
775
  "btn-label",
776
+ "btn-square",
773
777
  "c8-flat",
774
778
  "calendar-cell",
775
779
  "calendar-grid-row",
@@ -796,6 +800,7 @@ const componentClasses = {
796
800
  "i8-append",
797
801
  "i8-before",
798
802
  "i8-counter",
803
+ "i8-filled",
799
804
  "i8-hint",
800
805
  "i8-hint-wrapper",
801
806
  "i8-hint-wrapper-stack",
@@ -807,6 +812,7 @@ const componentClasses = {
807
812
  "i8-label-wrapper",
808
813
  "i8-loading",
809
814
  "i8-prepend",
815
+ "i8-round",
810
816
  "i8-stack-label",
811
817
  "i8-ta-wrapper",
812
818
  "i8-textarea",
@@ -828,6 +834,7 @@ const componentClasses = {
828
834
  "scope-error",
829
835
  "segmented",
830
836
  "select-none",
837
+ "surface",
831
838
  "text-body",
832
839
  "text-center",
833
840
  "text-ellipsis",
@@ -842,7 +849,10 @@ const componentClasses = {
842
849
  "bottom-0",
843
850
  "btn",
844
851
  "btn-icon",
852
+ "btn-icon-left",
853
+ "btn-icon-right",
845
854
  "btn-label",
855
+ "btn-square",
846
856
  "c8-flat",
847
857
  "calendar-cell",
848
858
  "calendar-grid-row",
@@ -889,6 +899,7 @@ const componentClasses = {
889
899
  "rounded",
890
900
  "segmented",
891
901
  "select-none",
902
+ "surface",
892
903
  "text-center",
893
904
  "top-0"
894
905
  ],
@@ -902,7 +913,10 @@ const componentClasses = {
902
913
  DatePickerPopup: [
903
914
  "btn",
904
915
  "btn-icon",
916
+ "btn-icon-left",
917
+ "btn-icon-right",
905
918
  "btn-label",
919
+ "btn-square",
906
920
  "c8-flat",
907
921
  "calendar-cell",
908
922
  "calendar-grid-row",
@@ -925,6 +939,7 @@ const componentClasses = {
925
939
  "relative",
926
940
  "rounded",
927
941
  "select-none",
942
+ "surface",
928
943
  "text-center"
929
944
  ],
930
945
  DelayedSwitch: ["visible"],
@@ -939,7 +954,10 @@ const componentClasses = {
939
954
  "border-grey-500/50",
940
955
  "btn",
941
956
  "btn-icon",
957
+ "btn-icon-left",
958
+ "btn-icon-right",
942
959
  "btn-label",
960
+ "btn-square",
943
961
  "c8-flat",
944
962
  "card",
945
963
  "checkbox",
@@ -1018,6 +1036,7 @@ const componentClasses = {
1018
1036
  "slider-range",
1019
1037
  "slider-thumb",
1020
1038
  "slider-track",
1039
+ "surface",
1021
1040
  "surface-500",
1022
1041
  "tab",
1023
1042
  "tabs-indicator",
@@ -1049,6 +1068,8 @@ const componentClasses = {
1049
1068
  "b",
1050
1069
  "btn",
1051
1070
  "btn-icon",
1071
+ "btn-icon-left",
1072
+ "btn-icon-right",
1052
1073
  "btn-label",
1053
1074
  "c8-filled",
1054
1075
  "c8-flat",
@@ -1074,6 +1095,7 @@ const componentClasses = {
1074
1095
  "px-$card-spacing",
1075
1096
  "py-$m",
1076
1097
  "rounded",
1098
+ "surface",
1077
1099
  "text-card-header",
1078
1100
  "text-mt-0"
1079
1101
  ],
@@ -1097,6 +1119,7 @@ const componentClasses = {
1097
1119
  "i8-append",
1098
1120
  "i8-before",
1099
1121
  "i8-counter",
1122
+ "i8-filled",
1100
1123
  "i8-hint",
1101
1124
  "i8-hint-wrapper",
1102
1125
  "i8-hint-wrapper-stack",
@@ -1108,6 +1131,7 @@ const componentClasses = {
1108
1131
  "i8-label-wrapper",
1109
1132
  "i8-loading",
1110
1133
  "i8-prepend",
1134
+ "i8-round",
1111
1135
  "i8-stack-label",
1112
1136
  "i8-ta-wrapper",
1113
1137
  "i8-textarea",
@@ -1139,6 +1163,7 @@ const componentClasses = {
1139
1163
  "flex-grow",
1140
1164
  "i8",
1141
1165
  "i8-append",
1166
+ "i8-filled",
1142
1167
  "i8-icon-clickable",
1143
1168
  "i8-icon-wrap",
1144
1169
  "i8-input",
@@ -1147,6 +1172,7 @@ const componentClasses = {
1147
1172
  "i8-label-wrapper",
1148
1173
  "i8-loading",
1149
1174
  "i8-prepend",
1175
+ "i8-round",
1150
1176
  "i8-ta-wrapper",
1151
1177
  "i8-textarea",
1152
1178
  "i8-underline",
@@ -1177,6 +1203,8 @@ const componentClasses = {
1177
1203
  "bottom-0",
1178
1204
  "btn",
1179
1205
  "btn-icon",
1206
+ "btn-icon-left",
1207
+ "btn-icon-right",
1180
1208
  "btn-label",
1181
1209
  "cursor-pointer",
1182
1210
  "flex",
@@ -1189,6 +1217,7 @@ const componentClasses = {
1189
1217
  "i8-append",
1190
1218
  "i8-before",
1191
1219
  "i8-counter",
1220
+ "i8-filled",
1192
1221
  "i8-hint",
1193
1222
  "i8-hint-wrapper",
1194
1223
  "i8-hint-wrapper-stack",
@@ -1200,6 +1229,7 @@ const componentClasses = {
1200
1229
  "i8-label-wrapper",
1201
1230
  "i8-loading",
1202
1231
  "i8-prepend",
1232
+ "i8-round",
1203
1233
  "i8-stack-label",
1204
1234
  "i8-ta-wrapper",
1205
1235
  "i8-textarea",
@@ -1225,6 +1255,7 @@ const componentClasses = {
1225
1255
  "scope-error",
1226
1256
  "scope-grey",
1227
1257
  "segmented",
1258
+ "surface",
1228
1259
  "text-body",
1229
1260
  "text-caption",
1230
1261
  "text-center",
@@ -1239,18 +1270,23 @@ const componentClasses = {
1239
1270
  MenuItem: [
1240
1271
  "btn",
1241
1272
  "btn-icon",
1273
+ "btn-icon-left",
1274
+ "btn-icon-right",
1242
1275
  "btn-label",
1243
1276
  "icon-color",
1244
1277
  "icon-size",
1245
1278
  "loading-indicator",
1246
1279
  "loading-indicator-ring",
1247
1280
  "menu-item",
1248
- "scope-grey"
1281
+ "scope-grey",
1282
+ "surface"
1249
1283
  ],
1250
1284
  OverflowContainer: ["flex", "whitespace-nowrap"],
1251
1285
  Pagination: [
1252
1286
  "btn",
1253
1287
  "btn-icon",
1288
+ "btn-icon-left",
1289
+ "btn-square",
1254
1290
  "c8-flat",
1255
1291
  "flex",
1256
1292
  "gap-1",
@@ -1265,11 +1301,14 @@ const componentClasses = {
1265
1301
  Popover: [
1266
1302
  "btn",
1267
1303
  "btn-icon",
1304
+ "btn-icon-left",
1305
+ "btn-icon-right",
1268
1306
  "btn-label",
1269
1307
  "icon-color",
1270
1308
  "icon-size",
1271
1309
  "loading-indicator",
1272
- "loading-indicator-ring"
1310
+ "loading-indicator-ring",
1311
+ "surface"
1273
1312
  ],
1274
1313
  ProgressBar: [
1275
1314
  "progress-bar",
@@ -1287,6 +1326,7 @@ const componentClasses = {
1287
1326
  "rb-item-wrapper",
1288
1327
  "rb-label",
1289
1328
  "rb-root",
1329
+ "rb-row",
1290
1330
  "text-caption",
1291
1331
  "text-error-500",
1292
1332
  "text-mt-0",
@@ -1308,6 +1348,7 @@ const componentClasses = {
1308
1348
  "i8-append",
1309
1349
  "i8-before",
1310
1350
  "i8-counter",
1351
+ "i8-filled",
1311
1352
  "i8-hint",
1312
1353
  "i8-hint-wrapper",
1313
1354
  "i8-hint-wrapper-stack",
@@ -1319,6 +1360,7 @@ const componentClasses = {
1319
1360
  "i8-label-wrapper",
1320
1361
  "i8-loading",
1321
1362
  "i8-prepend",
1363
+ "i8-round",
1322
1364
  "i8-stack-label",
1323
1365
  "i8-ta-wrapper",
1324
1366
  "i8-textarea",
@@ -2060,6 +2102,7 @@ const rules = [
2060
2102
  "--card-heading-ls": props["letter-spacing"],
2061
2103
  "--card-heading-bc": props["--font-bc"],
2062
2104
  "--card-heading-tc": props["--font-tc"],
2105
+ "--card-heading-font": props["font-family"] || "inherit",
2063
2106
  "padding": "var(--card-spacing)"
2064
2107
  };
2065
2108
  }
@@ -2121,7 +2164,22 @@ const defaultTypography = {
2121
2164
  "caption": font(400, 600, k$1(-.5), k$1(.5), -.007),
2122
2165
  "overline": font(400, 600, k$1(-.5), k$1(.5), .0618)
2123
2166
  };
2124
- function buildFontTheme(size, w, wBold, lh, ls, actualFontHeightFactor = 1, actualFontHeightTopBottomRatio = .5) {
2167
+ /**
2168
+ * Builds the UnoCSS `fontSize` theme entry for one typography level.
2169
+ *
2170
+ * Takes the whole {@link TTypography} rather than its numeric fields: this
2171
+ * function owns the shape of the emitted tuple, so fields that carry no
2172
+ * geometry (`font`, `css`) reach the output instead of being dropped at a call
2173
+ * site that can only forward numbers.
2174
+ */
2175
+ function buildFontTheme(t, defaults) {
2176
+ const size = t.size || 1;
2177
+ const w = t.weight || 400;
2178
+ const wBold = t.boldWeight || 700;
2179
+ const lh = t.height || 1;
2180
+ const ls = t.spacing || 0;
2181
+ const actualFontHeightFactor = t.actualHeightFactor || defaults.actualHeightFactor;
2182
+ const actualFontHeightTopBottomRatio = t.actualHeightTopBottomRatio || defaults.actualHeightTopBottomRatio;
2125
2183
  const correctedSize = size * actualFontHeightFactor;
2126
2184
  const m = (lh * size - correctedSize) / size;
2127
2185
  const half = correctedSize / 2;
@@ -2142,7 +2200,9 @@ function buildFontTheme(size, w, wBold, lh, ls, actualFontHeightFactor = 1, actu
2142
2200
  "--font-tc": `${-mt}em`,
2143
2201
  "font-weight": w,
2144
2202
  "line-height": `${lh}em`,
2145
- "letter-spacing": `${ls}em`
2203
+ "letter-spacing": `${ls}em`,
2204
+ ...t.font && { "font-family": t.font },
2205
+ ...t.css
2146
2206
  }]
2147
2207
  };
2148
2208
  }
@@ -2244,10 +2304,15 @@ const themeFactory = (opts) => {
2244
2304
  "--font-tc": "var(--card-heading-tc)",
2245
2305
  "font-weight": "var(--card-heading-weight)",
2246
2306
  "line-height": "var(--card-heading-lh)",
2247
- "letter-spacing": "var(--card-heading-ls)"
2307
+ "letter-spacing": "var(--card-heading-ls)",
2308
+ "font-family": "var(--card-heading-font, inherit)"
2248
2309
  }] };
2249
- for (const [name, val] of Object.entries(opts.typography)) if (val?.size) {
2250
- const ft = buildFontTheme(val.size || 1, val.weight || 400, val.boldWeight || 700, val.height || 1, val.spacing || 0, val.actualHeightFactor || opts.actualFontHeightFactor, val.actualHeightTopBottomRatio || opts.actualFontHeightTopBottomRatio);
2310
+ for (const [name, val] of Object.entries(opts.typography)) {
2311
+ if (!val) continue;
2312
+ const ft = buildFontTheme(val, {
2313
+ actualHeightFactor: opts.actualFontHeightFactor,
2314
+ actualHeightTopBottomRatio: opts.actualFontHeightTopBottomRatio
2315
+ });
2251
2316
  fontSize[name] = ft.theme;
2252
2317
  spacing[name] = `${ft.size}em`;
2253
2318
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vunor",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],