@varlet/ui 3.16.0-alpha.1778310023051 → 3.16.0-alpha.1778498431663

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,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "3.16.0-alpha.1778310023051",
4
+ "version": "3.16.0-alpha.1778498431663",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -1586,6 +1586,24 @@
1586
1586
  "type": "number",
1587
1587
  "kind": "expression"
1588
1588
  }
1589
+ },
1590
+ {
1591
+ "name": "hoverable",
1592
+ "description": "Whether to show a hover highlight overlay on desktop",
1593
+ "default": "false",
1594
+ "value": {
1595
+ "type": "boolean",
1596
+ "kind": "expression"
1597
+ }
1598
+ },
1599
+ {
1600
+ "name": "surface",
1601
+ "description": "Background preset, optional value is `low`, invalid when `variant` is `filled`. It currently only takes effect in the MD3 dark theme",
1602
+ "default": "-",
1603
+ "value": {
1604
+ "type": "string",
1605
+ "kind": "expression"
1606
+ }
1589
1607
  }
1590
1608
  ],
1591
1609
  "events": [
@@ -5954,6 +5972,24 @@
5954
5972
  "type": "boolean",
5955
5973
  "kind": "expression"
5956
5974
  }
5975
+ },
5976
+ {
5977
+ "name": "surface",
5978
+ "description": "Background preset, optional value is `low`. It currently only takes effect in the MD3 dark theme",
5979
+ "default": "-",
5980
+ "value": {
5981
+ "type": "string",
5982
+ "kind": "expression"
5983
+ }
5984
+ },
5985
+ {
5986
+ "name": "hoverable",
5987
+ "description": "Whether to show a hover highlight overlay on desktop",
5988
+ "default": "false",
5989
+ "value": {
5990
+ "type": "boolean",
5991
+ "kind": "expression"
5992
+ }
5957
5993
  }
5958
5994
  ],
5959
5995
  "events": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "3.16.0-alpha.1778310023051",
4
+ "version": "3.16.0-alpha.1778498431663",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -1637,6 +1637,24 @@
1637
1637
  "type": "number",
1638
1638
  "kind": "expression"
1639
1639
  }
1640
+ },
1641
+ {
1642
+ "name": "hoverable",
1643
+ "description": "是否在桌面端悬停时显示一层高亮遮罩",
1644
+ "default": "false",
1645
+ "value": {
1646
+ "type": "boolean",
1647
+ "kind": "expression"
1648
+ }
1649
+ },
1650
+ {
1651
+ "name": "surface",
1652
+ "description": "背景色预设,可选值 `low`,在 `variant` 为 `filled` 时无效,目前只作用在 MD3 暗色主题",
1653
+ "default": "-",
1654
+ "value": {
1655
+ "type": "string",
1656
+ "kind": "expression"
1657
+ }
1640
1658
  }
1641
1659
  ],
1642
1660
  "events": [
@@ -5996,6 +6014,24 @@
5996
6014
  "type": "boolean",
5997
6015
  "kind": "expression"
5998
6016
  }
6017
+ },
6018
+ {
6019
+ "name": "surface",
6020
+ "description": "背景色预设,可选值 `low`,目前只作用在 MD3 暗色主题",
6021
+ "default": "-",
6022
+ "value": {
6023
+ "type": "string",
6024
+ "kind": "expression"
6025
+ }
6026
+ },
6027
+ {
6028
+ "name": "hoverable",
6029
+ "description": "是否在桌面端悬停时显示一层高亮遮罩",
6030
+ "default": "false",
6031
+ "value": {
6032
+ "type": "boolean",
6033
+ "kind": "expression"
6034
+ }
5999
6035
  }
6000
6036
  ],
6001
6037
  "events": [
package/lib/varlet.cjs.js CHANGED
@@ -9378,6 +9378,8 @@ var props$13 = {
9378
9378
  type: String,
9379
9379
  default: "column"
9380
9380
  },
9381
+ surface: String,
9382
+ hoverable: Boolean,
9381
9383
  floating: Boolean,
9382
9384
  floatingDuration: {
9383
9385
  type: Number,
@@ -9426,12 +9428,14 @@ var { name: name$63, n: n$71, classes: classes$55 } = createNamespace("card");
9426
9428
  var RIPPLE_DELAY = 500;
9427
9429
  var _hoisted_1$29 = ["src", "alt"];
9428
9430
  function __render__$69(_ctx, _cache) {
9431
+ const _component_var_hover_overlay = (0, vue.resolveComponent)("var-hover-overlay");
9429
9432
  const _component_var_icon = (0, vue.resolveComponent)("var-icon");
9430
9433
  const _component_var_button = (0, vue.resolveComponent)("var-button");
9431
9434
  const _directive_ripple = (0, vue.resolveDirective)("ripple");
9435
+ const _directive_hover = (0, vue.resolveDirective)("hover");
9432
9436
  return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
9433
9437
  ref: "card",
9434
- class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n("--layout-row")], [_ctx.variant === "outlined" || _ctx.outline, _ctx.n("--outline")], [_ctx.variant === "filled", _ctx.n("--filled")], [_ctx.variant === "standard" || _ctx.outline, _ctx.formatElevation(_ctx.elevation, 1)])),
9438
+ class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n("--layout-row")], [_ctx.variant === "outlined" || _ctx.outline, _ctx.n("--outline")], [_ctx.variant === "filled", _ctx.n("--filled")], [_ctx.surfaceLow, _ctx.n("--surface-low")], [_ctx.hoverable, _ctx.n("--cursor")], [_ctx.variant === "standard" || _ctx.outline, _ctx.formatElevation(_ctx.elevation, 1)])),
9435
9439
  style: (0, vue.normalizeStyle)({ zIndex: _ctx.floated ? _ctx.zIndex : void 0 }),
9436
9440
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
9437
9441
  }, [(0, vue.createElementVNode)("div", {
@@ -9491,6 +9495,7 @@ function __render__$69(_ctx, _cache) {
9491
9495
  })
9492
9496
  }, [(0, vue.renderSlot)(_ctx.$slots, "floating-content")], 6)) : (0, vue.createCommentVNode)("v-if", true)
9493
9497
  ], 2),
9498
+ (0, vue.createVNode)(_component_var_hover_overlay, { hovering: _ctx.hoverable && !_ctx.floated ? _ctx.hovering : false }, null, 8, ["hovering"]),
9494
9499
  _ctx.showFloatingButtons ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
9495
9500
  key: 0,
9496
9501
  class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n("floating-buttons"), _ctx.n("$--box"))),
@@ -9517,14 +9522,22 @@ function __render__$69(_ctx, _cache) {
9517
9522
  width: _ctx.holderWidth,
9518
9523
  height: _ctx.holderHeight
9519
9524
  })
9520
- }, null, 6)], 6)), [[_directive_ripple, { disabled: !_ctx.ripple || _ctx.floater }]]);
9525
+ }, null, 6)], 6)), [[_directive_ripple, { disabled: !_ctx.ripple || _ctx.floater }], [
9526
+ _directive_hover,
9527
+ _ctx.handleHovering,
9528
+ "desktop"
9529
+ ]]);
9521
9530
  }
9522
9531
  var __sfc__$69 = (0, vue.defineComponent)({
9523
9532
  name: name$63,
9524
- directives: { Ripple: stdin_default$70 },
9533
+ directives: {
9534
+ Ripple: stdin_default$70,
9535
+ Hover: stdin_default$39
9536
+ },
9525
9537
  components: {
9526
9538
  VarIcon: stdin_default$41,
9527
- VarButton: stdin_default$12
9539
+ VarButton: stdin_default$12,
9540
+ VarHoverOverlay: stdin_default$40
9528
9541
  },
9529
9542
  props: props$13,
9530
9543
  setup(props2) {
@@ -9541,6 +9554,8 @@ var __sfc__$69 = (0, vue.defineComponent)({
9541
9554
  const contentHeight = (0, vue.ref)("0px");
9542
9555
  const opacity = (0, vue.ref)("0");
9543
9556
  const isRow = (0, vue.computed)(() => props2.layout === "row");
9557
+ const surfaceLow = (0, vue.computed)(() => props2.surface === "low" && props2.variant !== "filled");
9558
+ const { hovering, handleHovering } = useHoverOverlay();
9544
9559
  const showFloatingButtons = (0, vue.ref)(false);
9545
9560
  const floated = (0, vue.ref)(false);
9546
9561
  const { zIndex } = useZIndex(() => props2.floating, 1);
@@ -9548,11 +9563,15 @@ var __sfc__$69 = (0, vue.defineComponent)({
9548
9563
  let dropdownFloaterLeft = "auto";
9549
9564
  let dropper = null;
9550
9565
  const floater = (0, vue.ref)(null);
9566
+ let hasEnteredFloating = false;
9551
9567
  useLock(() => props2.floating, () => !isRow.value);
9552
9568
  (0, vue.watch)(() => props2.floating, (value) => {
9553
9569
  if (isRow.value) return;
9554
9570
  (0, vue.nextTick)(() => {
9555
- value ? floating() : dropdown();
9571
+ if (value) {
9572
+ hasEnteredFloating = true;
9573
+ floating();
9574
+ } else if (hasEnteredFloating) dropdown();
9556
9575
  });
9557
9576
  }, { immediate: true });
9558
9577
  function floating() {
@@ -9629,6 +9648,9 @@ var __sfc__$69 = (0, vue.defineComponent)({
9629
9648
  opacity,
9630
9649
  zIndex,
9631
9650
  isRow,
9651
+ surfaceLow,
9652
+ hovering,
9653
+ handleHovering,
9632
9654
  showFloatingButtons,
9633
9655
  floated,
9634
9656
  n: n$71,
@@ -19153,28 +19175,42 @@ var props$53 = {
19153
19175
  height: [Number, String],
19154
19176
  round: Boolean,
19155
19177
  inline: Boolean,
19178
+ surface: String,
19179
+ hoverable: Boolean,
19156
19180
  onClick: defineListenerProp()
19157
19181
  };
19158
19182
  //#endregion
19159
19183
  //#region es/paper/Paper.mjs
19160
19184
  var { name: name$26, n: n$30, classes: classes$24 } = createNamespace("paper");
19161
19185
  function __render__$33(_ctx, _cache) {
19186
+ const _component_var_hover_overlay = (0, vue.resolveComponent)("var-hover-overlay");
19162
19187
  const _directive_ripple = (0, vue.resolveDirective)("ripple");
19188
+ const _directive_hover = (0, vue.resolveDirective)("hover");
19163
19189
  return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
19164
- class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n("$--box"), _ctx.formatElevation(_ctx.elevation, 2), [_ctx.onClick, _ctx.n("--cursor")], [_ctx.round, _ctx.n("--round")], [_ctx.inline, _ctx.n("$--inline-flex")])),
19190
+ class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n("$--box"), _ctx.formatElevation(_ctx.elevation, 2), [_ctx.onClick || _ctx.hoverable, _ctx.n("--cursor")], [_ctx.round, _ctx.n("--round")], [_ctx.surfaceLow, _ctx.n("--surface-low")], [_ctx.inline, _ctx.n("$--inline-flex")])),
19165
19191
  style: (0, vue.normalizeStyle)({
19166
19192
  width: _ctx.toSizeUnit(_ctx.width),
19167
19193
  height: _ctx.toSizeUnit(_ctx.height),
19168
19194
  "border-radius": _ctx.toSizeUnit(_ctx.radius)
19169
19195
  }),
19170
19196
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
19171
- }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 6)), [[_directive_ripple, { disabled: !_ctx.ripple }]]);
19197
+ }, [(0, vue.renderSlot)(_ctx.$slots, "default"), (0, vue.createVNode)(_component_var_hover_overlay, { hovering: _ctx.hoverable ? _ctx.hovering : false }, null, 8, ["hovering"])], 6)), [[_directive_ripple, { disabled: !_ctx.ripple }], [
19198
+ _directive_hover,
19199
+ _ctx.handleHovering,
19200
+ "desktop"
19201
+ ]]);
19172
19202
  }
19173
19203
  var __sfc__$33 = (0, vue.defineComponent)({
19174
19204
  name: name$26,
19175
- directives: { Ripple: stdin_default$70 },
19205
+ directives: {
19206
+ Ripple: stdin_default$70,
19207
+ Hover: stdin_default$39
19208
+ },
19209
+ components: { VarHoverOverlay: stdin_default$40 },
19176
19210
  props: props$53,
19177
19211
  setup(props2) {
19212
+ const surfaceLow = (0, vue.computed)(() => props2.surface === "low");
19213
+ const { hovering, handleHovering } = useHoverOverlay();
19178
19214
  function handleClick(e) {
19179
19215
  call(props2.onClick, e);
19180
19216
  }
@@ -19182,6 +19218,9 @@ var __sfc__$33 = (0, vue.defineComponent)({
19182
19218
  n: n$30,
19183
19219
  classes: classes$24,
19184
19220
  formatElevation,
19221
+ surfaceLow,
19222
+ hovering,
19223
+ handleHovering,
19185
19224
  toSizeUnit,
19186
19225
  handleClick
19187
19226
  };
@@ -25382,6 +25421,7 @@ var stdin_default$229 = {
25382
25421
  var stdin_default$228 = {
25383
25422
  "--card-border-radius": "12px",
25384
25423
  "--card-background": "var(--color-surface-container-highest)",
25424
+ "--card-surface-low-background": "#1c1b1d",
25385
25425
  "--card-filled-background": "var(--color-surface-container-highest)",
25386
25426
  "--card-image-height": "188px",
25387
25427
  "--card-title-color": "var(--color-inverse-surface)",
@@ -25870,6 +25910,7 @@ var stdin_default$198 = {
25870
25910
  //#region es/themes/md3-dark/paper.mjs
25871
25911
  var stdin_default$197 = {
25872
25912
  "--paper-background": "var(--color-surface-container-highest)",
25913
+ "--paper-surface-low-background": "#1c1b1d",
25873
25914
  "--paper-border-radius": "12px"
25874
25915
  };
25875
25916
  //#endregion
@@ -26576,6 +26617,7 @@ var stdin_default$161 = {
26576
26617
  var stdin_default$160 = {
26577
26618
  "--card-border-radius": "12px",
26578
26619
  "--card-background": "var(--color-surface-container-low)",
26620
+ "--card-surface-low-background": "var(--color-surface-container-low)",
26579
26621
  "--card-filled-background": "var(--color-surface-container-highest)",
26580
26622
  "--card-image-height": "188px",
26581
26623
  "--card-title-color": "#1D1B20",
@@ -27064,6 +27106,7 @@ var stdin_default$130 = {
27064
27106
  //#region es/themes/md3-light/paper.mjs
27065
27107
  var stdin_default$129 = {
27066
27108
  "--paper-background": "var(--color-surface-container-low)",
27109
+ "--paper-surface-low-background": "var(--color-surface-container-low)",
27067
27110
  "--paper-border-radius": "12px"
27068
27111
  };
27069
27112
  //#endregion
@@ -28997,7 +29040,7 @@ var _WatermarkComponent = stdin_default$100;
28997
29040
  var stdin_default$94 = stdin_default$100;
28998
29041
  //#endregion
28999
29042
  //#region es/index.bundle.mjs
29000
- var version = "3.16.0-alpha.1778310023051";
29043
+ var version = "3.16.0-alpha.1778498431663";
29001
29044
  function install(app) {
29002
29045
  stdin_default.install && app.use(stdin_default);
29003
29046
  stdin_default$1.install && app.use(stdin_default$1);