@moubing/bing-ui 0.11.1 → 0.12.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.
Files changed (210) hide show
  1. package/README.md +300 -171
  2. package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
  3. package/dist/bing-ui.css +1 -1
  4. package/dist/components/BingAnimatedText/BingAnimatedText.js +7 -0
  5. package/dist/components/BingAnimatedText/BingAnimatedText.vue_vue_type_script_setup_true_lang.js +194 -0
  6. package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.js +7 -0
  7. package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.vue_vue_type_script_setup_true_lang.js +244 -0
  8. package/dist/components/BingAutocomplete/BingAutocomplete.js +7 -0
  9. package/dist/components/BingAutocomplete/BingAutocomplete.vue.d.ts +4 -4
  10. package/dist/components/BingAutocomplete/BingAutocomplete.vue_vue_type_script_setup_true_lang.js +560 -0
  11. package/dist/components/BingButton/BingButton.js +7 -0
  12. package/dist/components/BingButton/BingButton.vue.d.ts +2 -2
  13. package/dist/components/BingButton/BingButton.vue_vue_type_script_setup_true_lang.js +200 -0
  14. package/dist/components/BingCard/BingCard.js +7 -0
  15. package/dist/components/BingCard/BingCard.vue_vue_type_script_setup_true_lang.js +481 -0
  16. package/dist/components/BingCarouselTransition/BingCarouselTransition.js +7 -0
  17. package/dist/components/BingCarouselTransition/BingCarouselTransition.vue_vue_type_script_setup_true_lang.js +174 -0
  18. package/dist/components/BingCheckbox/BingCheckbox.js +7 -0
  19. package/dist/components/BingCheckbox/BingCheckbox.vue.d.ts +4 -4
  20. package/dist/components/BingCheckbox/BingCheckbox.vue_vue_type_script_setup_true_lang.js +233 -0
  21. package/dist/components/BingCheckboxGroup/BingCheckboxGroup.context.js +4 -0
  22. package/dist/components/BingCheckboxGroup/BingCheckboxGroup.js +7 -0
  23. package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue.d.ts +4 -4
  24. package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue_vue_type_script_setup_true_lang.js +105 -0
  25. package/dist/components/BingCodeBlock/BingCodeBlock.highlight.js +78 -0
  26. package/dist/components/BingCodeBlock/BingCodeBlock.js +7 -0
  27. package/dist/components/BingCodeBlock/BingCodeBlock.vue_vue_type_script_setup_true_lang.js +347 -0
  28. package/dist/components/BingColorPicker/BingColorPicker.js +7 -0
  29. package/dist/components/BingColorPicker/BingColorPicker.utils.d.ts +70 -0
  30. package/dist/components/BingColorPicker/BingColorPicker.utils.js +265 -0
  31. package/dist/components/BingColorPicker/BingColorPicker.vue.d.ts +7 -7
  32. package/dist/components/BingColorPicker/BingColorPicker.vue_vue_type_script_setup_true_lang.js +540 -0
  33. package/dist/components/BingColorPicker/BingColorPickerFormatEditor.js +7 -0
  34. package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue.d.ts +27 -0
  35. package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue_vue_type_script_setup_true_lang.js +142 -0
  36. package/dist/components/BingColorPicker/BingColorPickerSpectrum.js +7 -0
  37. package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue.d.ts +26 -0
  38. package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue_vue_type_script_setup_true_lang.js +168 -0
  39. package/dist/components/BingConfigProvider/BingConfigProvider.js +5 -0
  40. package/dist/components/BingConfigProvider/BingConfigProvider.types.d.ts +5 -0
  41. package/dist/components/BingConfigProvider/BingConfigProvider.vue.d.ts +18 -0
  42. package/dist/components/BingConfigProvider/BingConfigProvider.vue_vue_type_script_setup_true_lang.js +18 -0
  43. package/dist/components/BingConfigProvider/index.d.ts +3 -0
  44. package/dist/components/BingCursor/BingCursor.controller.js +240 -0
  45. package/dist/components/BingCursor/BingCursor.js +7 -0
  46. package/dist/components/BingCursor/BingCursor.native.js +20 -0
  47. package/dist/components/BingCursor/BingCursor.presets.js +60 -0
  48. package/dist/components/BingCursor/BingCursor.shapes.js +83 -0
  49. package/dist/components/BingCursor/BingCursor.styleSource.js +83 -0
  50. package/dist/components/BingCursor/BingCursor.vue_vue_type_script_setup_true_lang.js +73 -0
  51. package/dist/components/BingDatePicker/BingDatePicker.js +7 -0
  52. package/dist/components/BingDatePicker/BingDatePicker.utils.d.ts +26 -0
  53. package/dist/components/BingDatePicker/BingDatePicker.utils.js +137 -0
  54. package/dist/components/BingDatePicker/BingDatePicker.vue.d.ts +14 -14
  55. package/dist/components/BingDatePicker/BingDatePicker.vue_vue_type_script_setup_true_lang.js +804 -0
  56. package/dist/components/BingDatePicker/BingDatePickerCalendar.js +7 -0
  57. package/dist/components/BingDatePicker/BingDatePickerCalendar.vue.d.ts +37 -0
  58. package/dist/components/BingDatePicker/BingDatePickerCalendar.vue_vue_type_script_setup_true_lang.js +248 -0
  59. package/dist/components/BingDatePicker/BingDatePickerTimePanel.js +7 -0
  60. package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue.d.ts +26 -0
  61. package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue_vue_type_script_setup_true_lang.js +97 -0
  62. package/dist/components/BingDeckTransition/BingDeckTransition.js +7 -0
  63. package/dist/components/BingDeckTransition/BingDeckTransition.vue_vue_type_script_setup_true_lang.js +187 -0
  64. package/dist/components/BingDialog/BingDialog.js +7 -0
  65. package/dist/components/BingDialog/BingDialog.vue.d.ts +4 -5
  66. package/dist/components/BingDialog/BingDialog.vue_vue_type_script_setup_true_lang.js +558 -0
  67. package/dist/components/BingDropDown/BingDropDown.context.js +4 -0
  68. package/dist/components/BingDropDown/BingDropDown.js +7 -0
  69. package/dist/components/BingDropDown/BingDropDown.vue.d.ts +1 -2
  70. package/dist/components/BingDropDown/BingDropDown.vue_vue_type_script_setup_true_lang.js +649 -0
  71. package/dist/components/BingDropDown/BingDropDownItem.js +7 -0
  72. package/dist/components/BingDropDown/BingDropDownItem.vue.d.ts +1 -1
  73. package/dist/components/BingDropDown/BingDropDownItem.vue_vue_type_script_setup_true_lang.js +308 -0
  74. package/dist/components/BingFilePreview/BingFilePreview.js +7 -0
  75. package/dist/components/BingFilePreview/BingFilePreview.vue.d.ts +4 -5
  76. package/dist/components/BingFilePreview/BingFilePreview.vue_vue_type_script_setup_true_lang.js +589 -0
  77. package/dist/components/BingForm/BingForm.context.js +7 -0
  78. package/dist/components/BingForm/BingForm.js +7 -0
  79. package/dist/components/BingForm/BingForm.vue.d.ts +0 -1
  80. package/dist/components/BingForm/BingForm.vue_vue_type_script_setup_true_lang.js +300 -0
  81. package/dist/components/BingForm/formFocus.js +13 -0
  82. package/dist/components/BingForm/formTabOrder.js +27 -0
  83. package/dist/components/BingForm/useFormControl.d.ts +1 -1
  84. package/dist/components/BingForm/useFormControl.js +24 -0
  85. package/dist/components/BingForm/useFormNextHint.js +135 -0
  86. package/dist/components/BingFormItem/BingFormItem.js +7 -0
  87. package/dist/components/BingFormItem/BingFormItem.vue.d.ts +1 -1
  88. package/dist/components/BingFormItem/BingFormItem.vue_vue_type_script_setup_true_lang.js +252 -0
  89. package/dist/components/BingIcon/BingIcon.js +7 -0
  90. package/dist/components/BingIcon/BingIcon.vue_vue_type_script_setup_true_lang.js +48 -0
  91. package/dist/components/BingImage/BingImage.js +7 -0
  92. package/dist/components/BingImage/BingImage.vue_vue_type_script_setup_true_lang.js +244 -0
  93. package/dist/components/BingImagePreview/BingImagePreview.js +7 -0
  94. package/dist/components/BingImagePreview/BingImagePreview.vue.d.ts +4 -5
  95. package/dist/components/BingImagePreview/BingImagePreview.vue_vue_type_script_setup_true_lang.js +699 -0
  96. package/dist/components/BingInput/BingInput.js +7 -0
  97. package/dist/components/BingInput/BingInput.vue.d.ts +6 -6
  98. package/dist/components/BingInput/BingInput.vue_vue_type_script_setup_true_lang.js +311 -0
  99. package/dist/components/BingRadio/BingRadio.js +7 -0
  100. package/dist/components/BingRadio/BingRadio.vue.d.ts +4 -4
  101. package/dist/components/BingRadio/BingRadio.vue_vue_type_script_setup_true_lang.js +170 -0
  102. package/dist/components/BingRadioGroup/BingRadioGroup.context.js +4 -0
  103. package/dist/components/BingRadioGroup/BingRadioGroup.js +7 -0
  104. package/dist/components/BingRadioGroup/BingRadioGroup.vue.d.ts +4 -4
  105. package/dist/components/BingRadioGroup/BingRadioGroup.vue_vue_type_script_setup_true_lang.js +125 -0
  106. package/dist/components/BingResizable/BingResizable.js +7 -0
  107. package/dist/components/BingResizable/BingResizable.vue.d.ts +1 -1
  108. package/dist/components/BingResizable/BingResizable.vue_vue_type_script_setup_true_lang.js +555 -0
  109. package/dist/components/BingScrollbar/BingScrollbar.js +7 -0
  110. package/dist/components/BingScrollbar/BingScrollbar.vue.d.ts +2 -2
  111. package/dist/components/BingScrollbar/BingScrollbar.vue_vue_type_script_setup_true_lang.js +398 -0
  112. package/dist/components/BingSelect/BingSelect.js +7 -0
  113. package/dist/components/BingSelect/BingSelect.vue.d.ts +7 -7
  114. package/dist/components/BingSelect/BingSelect.vue_vue_type_script_setup_true_lang.js +1066 -0
  115. package/dist/components/BingSlider/BingSlider.js +7 -0
  116. package/dist/components/BingSlider/BingSlider.vue.d.ts +6 -6
  117. package/dist/components/BingSlider/BingSlider.vue_vue_type_script_setup_true_lang.js +130 -0
  118. package/dist/components/BingSortableList/BingSortableList.js +7 -0
  119. package/dist/components/BingSortableList/BingSortableList.vue_vue_type_script_setup_true_lang.js +334 -0
  120. package/dist/components/BingSortableList/BingSortableListItem.js +7 -0
  121. package/dist/components/BingSortableList/BingSortableListItem.vue_vue_type_script_setup_true_lang.js +76 -0
  122. package/dist/components/BingSplitPane/BingSplitPane.js +7 -0
  123. package/dist/components/BingSplitPane/BingSplitPane.vue_vue_type_script_setup_true_lang.js +167 -0
  124. package/dist/components/BingTable/BingTable.js +7 -0
  125. package/dist/components/BingTable/BingTable.measurements.js +72 -0
  126. package/dist/components/BingTable/BingTable.vue.d.ts +1 -2
  127. package/dist/components/BingTable/BingTable.vue_vue_type_script_setup_true_lang.js +1416 -0
  128. package/dist/components/BingTable/BingTableCellValue.js +7 -0
  129. package/dist/components/BingTable/BingTableCellValue.vue_vue_type_script_setup_true_lang.js +68 -0
  130. package/dist/components/BingTable/BingTableHeaderCell.js +5 -0
  131. package/dist/components/BingTable/BingTableHeaderCell.vue_vue_type_script_setup_true_lang.js +45 -0
  132. package/dist/components/BingTable/BingTableHeaderContent.js +7 -0
  133. package/dist/components/BingTable/BingTableHeaderContent.vue_vue_type_script_setup_true_lang.js +110 -0
  134. package/dist/components/BingTable/useTableColumns.js +126 -0
  135. package/dist/components/BingTableColumnControls/BingTableColumnControls.js +7 -0
  136. package/dist/components/BingTableColumnControls/BingTableColumnControls.vue.d.ts +1 -1
  137. package/dist/components/BingTableColumnControls/BingTableColumnControls.vue_vue_type_script_setup_true_lang.js +251 -0
  138. package/dist/components/BingTabs/BingTabs.js +7 -0
  139. package/dist/components/BingTabs/BingTabs.vue.d.ts +2 -3
  140. package/dist/components/BingTabs/BingTabs.vue_vue_type_script_setup_true_lang.js +320 -0
  141. package/dist/components/BingTag/BingTag.js +7 -0
  142. package/dist/components/BingTag/BingTag.vue.d.ts +0 -1
  143. package/dist/components/BingTag/BingTag.vue_vue_type_script_setup_true_lang.js +65 -0
  144. package/dist/components/BingTextarea/BingTextarea.js +7 -0
  145. package/dist/components/BingTextarea/BingTextarea.vue.d.ts +6 -6
  146. package/dist/components/BingTextarea/BingTextarea.vue_vue_type_script_setup_true_lang.js +243 -0
  147. package/dist/components/BingToast/BingToast.js +7 -0
  148. package/dist/components/BingToast/BingToast.service.js +132 -0
  149. package/dist/components/BingToast/BingToast.types.d.ts +1 -1
  150. package/dist/components/BingToast/BingToast.types.js +19 -0
  151. package/dist/components/BingToast/BingToast.vue.d.ts +0 -1
  152. package/dist/components/BingToast/BingToast.vue_vue_type_script_setup_true_lang.js +307 -0
  153. package/dist/components/BingTooltip/BingTooltip.js +7 -0
  154. package/dist/components/BingTooltip/BingTooltip.shared.js +14 -0
  155. package/dist/components/BingTooltip/BingTooltip.vue.d.ts +4 -5
  156. package/dist/components/BingTooltip/BingTooltip.vue_vue_type_script_setup_true_lang.js +572 -0
  157. package/dist/components/BingTreeSelect/BingTreeSelect.js +7 -0
  158. package/dist/components/BingTreeSelect/BingTreeSelect.vue.d.ts +7 -7
  159. package/dist/components/BingTreeSelect/BingTreeSelect.vue_vue_type_script_setup_true_lang.js +1274 -0
  160. package/dist/components/index.d.ts +1 -0
  161. package/dist/icons/LICENSE-lucide.txt +39 -0
  162. package/dist/icons/createIcon.d.ts +8 -0
  163. package/dist/icons/createIcon.js +36 -0
  164. package/dist/icons/icons.d.ts +51 -0
  165. package/dist/icons/icons.js +252 -0
  166. package/dist/icons/index.d.ts +3 -0
  167. package/dist/index.js +48 -0
  168. package/dist/motion/clickParticles.d.ts +1 -1
  169. package/dist/motion/clickParticles2.js +66 -0
  170. package/dist/motion/index.d.ts +1 -1
  171. package/dist/motion/index.js +17 -0
  172. package/dist/motion/liquidHover.js +36 -0
  173. package/dist/motion/optionDetailMotion.d.ts +7 -1
  174. package/dist/motion/optionDetailMotion.js +74 -0
  175. package/dist/motion/panelMotion.js +19 -0
  176. package/dist/motion/reducedMotion.d.ts +16 -0
  177. package/dist/motion/reducedMotion.js +28 -0
  178. package/dist/motion/selectPanelMotion.js +115 -0
  179. package/dist/motion/smoothScroll.d.ts +2 -0
  180. package/dist/motion/smoothScroll.js +276 -0
  181. package/dist/motion/useClickFeedback.js +47 -0
  182. package/dist/motion/useTextControlCaret.js +136 -0
  183. package/dist/utils/clipboard.d.ts +9 -0
  184. package/dist/utils/clipboard.js +16 -0
  185. package/dist/utils/config.d.ts +42 -0
  186. package/dist/utils/config.js +37 -0
  187. package/dist/utils/controlAttrs.js +37 -0
  188. package/dist/utils/floating.d.ts +86 -0
  189. package/dist/utils/floating.js +99 -0
  190. package/dist/utils/glass.js +25 -0
  191. package/dist/utils/overlay.js +94 -0
  192. package/dist/utils/scrollLock.js +44 -0
  193. package/dist/utils/search.d.ts +16 -0
  194. package/dist/utils/search.js +23 -0
  195. package/dist/utils/useClientReady.js +10 -0
  196. package/dist/utils/useDeferredBlurValidation.d.ts +18 -0
  197. package/dist/utils/useDeferredBlurValidation.js +34 -0
  198. package/dist/utils/useKeyboardScrollSync.d.ts +11 -0
  199. package/dist/utils/useKeyboardScrollSync.js +28 -0
  200. package/dist/utils/useOptionDetailPanel.d.ts +50 -0
  201. package/dist/utils/useOptionDetailPanel.js +180 -0
  202. package/dist/utils/useOutsidePointerDown.d.ts +8 -0
  203. package/dist/utils/useOutsidePointerDown.js +17 -0
  204. package/dist/utils/useSearchShortcutFocus.d.ts +18 -0
  205. package/dist/utils/useSearchShortcutFocus.js +47 -0
  206. package/dist/utils/useVirtualList.d.ts +42 -0
  207. package/dist/utils/useVirtualList.js +74 -0
  208. package/package.json +15 -9
  209. package/dist/bing-ui.es.js +0 -31276
  210. package/dist/bing-ui.umd.js +0 -229
@@ -0,0 +1,200 @@
1
+ import { useReducedMotion as e } from "../../motion/reducedMotion.js";
2
+ import t from "../BingAnimatedText/BingAnimatedText.js";
3
+ import { enterLiquidHover as n, leaveLiquidHover as r, resetLiquidHover as i } from "../../motion/liquidHover.js";
4
+ import { useClickFeedback as a } from "../../motion/useClickFeedback.js";
5
+ import { useFormControl as o } from "../BingForm/useFormControl.js";
6
+ import { computed as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, normalizeStyle as m, onBeforeUnmount as h, openBlock as g, ref as _, renderSlot as v, unref as y, useSlots as b, watch as x, withCtx as S } from "vue";
7
+ //#region src/components/BingButton/BingButton.vue?vue&type=script&setup=true&lang.ts
8
+ var C = [
9
+ "type",
10
+ "disabled",
11
+ "aria-busy",
12
+ "aria-label"
13
+ ], ee = { class: "bing-button__content" }, te = {
14
+ key: 0,
15
+ class: "bing-button__loading-indicator",
16
+ "aria-hidden": "true"
17
+ }, w = { class: "bing-button__resting-content" }, T = {
18
+ key: 0,
19
+ class: "bing-button__icon bing-button__icon--prefix"
20
+ }, E = {
21
+ key: 1,
22
+ class: "bing-button__label"
23
+ }, D = {
24
+ key: 2,
25
+ class: "bing-button__icon bing-button__icon--suffix"
26
+ }, O = /* @__PURE__ */ f({
27
+ __name: "BingButton",
28
+ props: {
29
+ variant: { default: "primary" },
30
+ size: { default: void 0 },
31
+ rounded: { default: "md" },
32
+ htmlType: { default: "button" },
33
+ disabled: {
34
+ type: Boolean,
35
+ default: void 0
36
+ },
37
+ loading: {
38
+ type: Boolean,
39
+ default: !1
40
+ },
41
+ block: {
42
+ type: Boolean,
43
+ default: !1
44
+ },
45
+ throttle: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ throttleDelay: { default: 600 },
50
+ textEffect: {},
51
+ textEffectTrigger: {},
52
+ textShine: {},
53
+ shineColor: { default: void 0 },
54
+ shineBaseColor: { default: void 0 },
55
+ shineSpeed: { default: 3 },
56
+ shineDelay: { default: 0 },
57
+ shineInterval: { default: 1.6 },
58
+ shineDirection: { default: "left" },
59
+ shineAngle: { default: 120 },
60
+ textJumpY: { default: -6 },
61
+ textJumpStagger: { default: .035 },
62
+ textJumpDuration: { default: .34 },
63
+ textJumpEase: { default: "power2.out" },
64
+ textJumpReturnEase: { default: "back.out(2.4)" },
65
+ textJumpRepeatDelay: { default: 1.2 },
66
+ ariaLabel: { default: void 0 }
67
+ },
68
+ emits: [
69
+ "click",
70
+ "throttled",
71
+ "focus",
72
+ "blur"
73
+ ],
74
+ setup(f, { emit: O }) {
75
+ let k = e(), A = f, j = O, { resolvedSize: M, resolvedDisabled: N } = o(A, { register: !1 }), P = b(), F = _(0), I = _(null), L = !1, { playClickFeedback: R } = a(), z = s(() => N.value || A.loading), B = s(() => Math.max(0, A.throttleDelay)), V = s(() => !!P.default), H = s(() => !!P.prefix), U = s(() => !!P.suffix), W = s(() => A.textShine ?? (A.variant === "primary" ? "always" : "none")), G = s(() => A.loading && V.value ? "jump" : A.textEffect ? A.textEffect : W.value === "none" ? "none" : "shine"), K = s(() => A.loading && V.value ? "always" : A.textEffectTrigger ? A.textEffectTrigger : G.value === "jump" || W.value === "hover" ? "hover" : "always"), q = s(() => G.value === "shine"), J = s(() => G.value !== "none"), Y = s(() => [
76
+ "bing-button",
77
+ `bing-button--${A.variant}`,
78
+ `bing-button--${M.value}`,
79
+ `bing-button--rounded-${A.rounded}`,
80
+ {
81
+ "is-block": A.block,
82
+ "is-disabled": N.value,
83
+ "is-loading": A.loading,
84
+ "is-icon-only": !V.value && (H.value || U.value),
85
+ [`bing-button--text-${G.value}`]: J.value,
86
+ [`bing-button--text-trigger-${K.value}`]: J.value,
87
+ [`bing-button--shine-${K.value}`]: q.value,
88
+ [`bing-button--shine-direction-${A.shineDirection}`]: q.value
89
+ }
90
+ ]), X = s(() => {
91
+ let e = {};
92
+ return q.value ? (e["--animated-text-shine-angle"] = `${A.shineAngle}deg`, A.shineColor && (e["--animated-text-shine-color"] = A.shineColor), A.shineBaseColor && (e["--animated-text-shine-base-color"] = A.shineBaseColor), e) : e;
93
+ });
94
+ function Z(e) {
95
+ if (e.defaultPrevented) return;
96
+ if (z.value) {
97
+ e.preventDefault();
98
+ return;
99
+ }
100
+ let t = Date.now(), n = B.value, r = t - F.value;
101
+ if (A.throttle && n > 0 && F.value > 0 && r < n) {
102
+ e.preventDefault(), j("throttled", {
103
+ event: e,
104
+ remaining: n - r
105
+ });
106
+ return;
107
+ }
108
+ F.value = t, R(e), j("click", e);
109
+ }
110
+ function ne(e) {
111
+ j("focus", e);
112
+ }
113
+ function re(e) {
114
+ j("blur", e);
115
+ }
116
+ function Q() {
117
+ L = !1, I.value && i(I.value);
118
+ }
119
+ function $(e) {
120
+ let t = I.value;
121
+ if (!t || z.value || e.pointerType === "touch") return;
122
+ if (k()) {
123
+ Q();
124
+ return;
125
+ }
126
+ let r = e.currentTarget, i = r.getBoundingClientRect();
127
+ if (!i.width || !i.height) return;
128
+ let a = (e.clientX - i.left) * (r.offsetWidth / i.width) - r.clientLeft, o = (e.clientY - i.top) * (r.offsetHeight / i.height) - r.clientTop, s = Math.max(0, Math.min(r.clientWidth, a)), c = Math.max(0, Math.min(r.clientHeight, o));
129
+ t.style.setProperty("--button-liquid-x", `${s}px`), t.style.setProperty("--button-liquid-y", `${c}px`), t.style.transformOrigin = `${s}px ${c}px`, L || (L = !0, n(t));
130
+ }
131
+ function ie() {
132
+ !L || !I.value || (L = !1, k() ? Q() : r(I.value));
133
+ }
134
+ return x([z, () => A.variant], ([e, t]) => {
135
+ (e || t === "primary") && Q();
136
+ }), h(() => {
137
+ Q();
138
+ }), (e, n) => (g(), l("button", {
139
+ type: f.htmlType,
140
+ class: p(Y.value),
141
+ style: m(X.value),
142
+ disabled: z.value,
143
+ "aria-busy": f.loading || void 0,
144
+ "aria-label": f.ariaLabel,
145
+ onClick: Z,
146
+ onFocus: ne,
147
+ onBlur: re,
148
+ onPointerenter: $,
149
+ onPointermove: $,
150
+ onPointerleave: ie,
151
+ onPointercancel: Q
152
+ }, [f.variant === "primary" ? c("", !0) : (g(), l("span", {
153
+ key: 0,
154
+ ref_key: "liquidRef",
155
+ ref: I,
156
+ class: "bing-button__liquid",
157
+ "aria-hidden": "true"
158
+ }, null, 512)), u("span", ee, [V.value ? c("", !0) : (g(), l("span", te, [...n[0] ||= [u("span", { class: "bing-button__spinner" }, null, -1)]])), u("span", w, [
159
+ H.value ? (g(), l("span", T, [v(e.$slots, "prefix", {}, void 0, !0)])) : c("", !0),
160
+ V.value ? (g(), l("span", E, [d(t, {
161
+ class: "bing-button__animated-text",
162
+ effect: G.value,
163
+ trigger: K.value,
164
+ disabled: y(N),
165
+ "shine-speed": f.shineSpeed,
166
+ "shine-delay": f.shineDelay,
167
+ "shine-interval": f.shineInterval,
168
+ "shine-direction": f.shineDirection,
169
+ "shine-angle": f.shineAngle,
170
+ "jump-y": f.textJumpY,
171
+ "jump-stagger": f.textJumpStagger,
172
+ "jump-duration": f.textJumpDuration,
173
+ "jump-ease": f.textJumpEase,
174
+ "jump-return-ease": f.textJumpReturnEase,
175
+ "jump-repeat-delay": f.textJumpRepeatDelay
176
+ }, {
177
+ default: S(() => [v(e.$slots, "default", {}, void 0, !0)]),
178
+ _: 3
179
+ }, 8, [
180
+ "effect",
181
+ "trigger",
182
+ "disabled",
183
+ "shine-speed",
184
+ "shine-delay",
185
+ "shine-interval",
186
+ "shine-direction",
187
+ "shine-angle",
188
+ "jump-y",
189
+ "jump-stagger",
190
+ "jump-duration",
191
+ "jump-ease",
192
+ "jump-return-ease",
193
+ "jump-repeat-delay"
194
+ ])])) : c("", !0),
195
+ U.value ? (g(), l("span", D, [v(e.$slots, "suffix", {}, void 0, !0)])) : c("", !0)
196
+ ])])], 46, C));
197
+ }
198
+ });
199
+ //#endregion
200
+ export { O as default };
@@ -0,0 +1,7 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./BingCard.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/BingCard/BingCard.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-1cbe589f"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,481 @@
1
+ import { useReducedMotion as e } from "../../motion/reducedMotion.js";
2
+ import { useClickFeedback as t } from "../../motion/useClickFeedback.js";
3
+ import { createGlassCssVariables as n } from "../../utils/glass.js";
4
+ import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, nextTick as c, normalizeClass as l, normalizeStyle as ee, onBeforeUnmount as te, onMounted as ne, openBlock as u, ref as d, renderSlot as f, toDisplayString as p, watch as re } from "vue";
5
+ import { gsap as m } from "gsap";
6
+ //#region src/components/BingCard/BingCard.vue?vue&type=script&setup=true&lang.ts
7
+ var ie = { class: "bing-card__face bing-card__front" }, h = {
8
+ key: 1,
9
+ class: "bing-card__media"
10
+ }, g = { class: "bing-card__content" }, ae = {
11
+ key: 0,
12
+ class: "bing-card__header"
13
+ }, oe = { class: "bing-card__heading" }, se = {
14
+ key: 0,
15
+ class: "bing-card__title"
16
+ }, _ = {
17
+ key: 1,
18
+ class: "bing-card__description"
19
+ }, v = {
20
+ key: 1,
21
+ class: "bing-card__body"
22
+ }, y = {
23
+ key: 2,
24
+ class: "bing-card__footer"
25
+ }, ce = {
26
+ class: "bing-card__face bing-card__back",
27
+ "aria-hidden": "true"
28
+ }, le = 10, b = /* @__PURE__ */ s({
29
+ __name: "BingCard",
30
+ props: {
31
+ title: { default: void 0 },
32
+ description: { default: void 0 },
33
+ variant: { default: "soft" },
34
+ padding: { default: "md" },
35
+ rounded: { default: "md" },
36
+ glass: {
37
+ type: Boolean,
38
+ default: !0
39
+ },
40
+ interactive: {
41
+ type: Boolean,
42
+ default: !0
43
+ },
44
+ tilt: {
45
+ type: Boolean,
46
+ default: !0
47
+ },
48
+ tiltMax: { default: 8 },
49
+ tiltScale: { default: 1.015 },
50
+ glare: {
51
+ type: Boolean,
52
+ default: !0
53
+ },
54
+ entrance: { default: "fade-up" },
55
+ entranceOnce: {
56
+ type: Boolean,
57
+ default: !0
58
+ },
59
+ entranceDelay: { default: 0 },
60
+ entranceDuration: { default: .72 },
61
+ flipAxis: { default: "x" },
62
+ flipTurns: { default: 2.5 },
63
+ flipEase: { default: "power4.out" },
64
+ flipTrigger: { default: "press" },
65
+ longPressDelay: { default: 560 },
66
+ longPressRelease: { default: "restore" },
67
+ disabled: {
68
+ type: Boolean,
69
+ default: !1
70
+ },
71
+ glassBlur: { default: void 0 },
72
+ glassOpacity: { default: void 0 },
73
+ glassSaturation: { default: void 0 }
74
+ },
75
+ emits: [
76
+ "enter",
77
+ "long-press",
78
+ "flip"
79
+ ],
80
+ setup(s, { emit: b }) {
81
+ let x = e(), { playClickFeedback: S } = t(), C = s, w = b, T = d(null), E = d(null), D = d(null), O = d(null), k = d(null), A = d(!1), j = d(!1), M = d(!1), N, P, F, I, L, R = !1, z = !1, B = 0, V = 0, H = !1, U = r(() => C.flipAxis === "z" ? "y" : C.flipAxis), W = r(() => C.disabled ? "none" : C.flipTrigger), ue = r(() => [
82
+ "bing-card",
83
+ `bing-card--${C.variant}`,
84
+ `bing-card--padding-${C.padding}`,
85
+ `bing-card--rounded-${C.rounded}`,
86
+ `bing-card--back-axis-${U.value}`,
87
+ {
88
+ "is-glass": C.glass,
89
+ "is-interactive": C.interactive,
90
+ "is-tilt": C.tilt,
91
+ "is-glare": C.glare,
92
+ "is-flipped": j.value,
93
+ "is-pressing": M.value,
94
+ "is-long-press-enabled": W.value === "press",
95
+ "is-click-flip-enabled": W.value === "click",
96
+ "is-disabled": C.disabled,
97
+ "has-entered": A.value
98
+ }
99
+ ]), de = r(() => ({
100
+ ...n("bing-card", {
101
+ glass: C.glass,
102
+ glassBlur: C.glassBlur,
103
+ glassOpacity: C.glassOpacity,
104
+ glassSaturation: C.glassSaturation
105
+ }),
106
+ "--bing-card-tilt-max": `${C.tiltMax}deg`
107
+ })), fe = r(() => !!(C.title || C.description));
108
+ function G() {
109
+ return typeof window < "u" && typeof document < "u";
110
+ }
111
+ function K(e, t, n) {
112
+ return Math.min(n, Math.max(t, e));
113
+ }
114
+ function q(e) {
115
+ return e === "x" ? "rotationX" : e === "y" ? "rotationY" : "rotation";
116
+ }
117
+ function J() {
118
+ return {
119
+ rotationX: 0,
120
+ rotationY: 0,
121
+ rotation: 0,
122
+ [q(U.value)]: j.value ? 180 : 0
123
+ };
124
+ }
125
+ function pe(e, t) {
126
+ return j.value ? U.value === "x" ? {
127
+ rotationX: 180 + e,
128
+ rotationY: t,
129
+ rotation: 0
130
+ } : {
131
+ rotationX: e,
132
+ rotationY: 180 + t,
133
+ rotation: 0
134
+ } : {
135
+ rotationX: e,
136
+ rotationY: t,
137
+ rotation: 0
138
+ };
139
+ }
140
+ function me() {
141
+ return C.interactive && C.tilt && !C.disabled && !x() && !z && !R && E.value;
142
+ }
143
+ function he(e) {
144
+ if (Se(e), !me()) return;
145
+ let t = T.value, n = E.value;
146
+ if (!t || !n) return;
147
+ let r = t.getBoundingClientRect();
148
+ if (r.width === 0 || r.height === 0) return;
149
+ let i = K((e.clientX - r.left) / r.width, 0, 1), a = K((e.clientY - r.top) / r.height, 0, 1), o = Math.max(0, C.tiltMax), s = (i - .5) * o * 2, c = (.5 - a) * o * 2;
150
+ m.to(n, {
151
+ ...pe(c, s),
152
+ scale: Math.max(1, C.tiltScale),
153
+ transformPerspective: 900,
154
+ transformOrigin: "50% 50%",
155
+ duration: .34,
156
+ ease: "power3.out",
157
+ overwrite: !0,
158
+ force3D: !0
159
+ }), C.glare && D.value && m.to(D.value, {
160
+ "--bing-card-glare-x": `${i * 100}%`,
161
+ "--bing-card-glare-y": `${a * 100}%`,
162
+ opacity: 1,
163
+ duration: .24,
164
+ ease: "power2.out",
165
+ overwrite: !0
166
+ });
167
+ }
168
+ function ge() {
169
+ if (z) return;
170
+ let e = E.value;
171
+ e && m.to(e, {
172
+ ...J(),
173
+ scale: 1,
174
+ duration: .48,
175
+ ease: "elastic.out(1, 0.72)",
176
+ overwrite: !0,
177
+ force3D: !0
178
+ }), D.value && m.to(D.value, {
179
+ opacity: 0,
180
+ duration: .26,
181
+ ease: "power2.out",
182
+ overwrite: !0
183
+ });
184
+ }
185
+ function _e() {
186
+ let e = q(C.flipAxis), t = -360 * Math.max(1, C.flipTurns);
187
+ return {
188
+ from: {
189
+ autoAlpha: 0,
190
+ y: 34,
191
+ z: C.flipAxis === "z" ? 0 : -120,
192
+ [e]: t,
193
+ scale: .96,
194
+ transformPerspective: 900,
195
+ transformOrigin: "50% 50%"
196
+ },
197
+ to: {
198
+ autoAlpha: 1,
199
+ y: 0,
200
+ z: 0,
201
+ rotationX: 0,
202
+ rotationY: 0,
203
+ rotation: 0,
204
+ scale: 1,
205
+ ease: C.flipEase
206
+ }
207
+ };
208
+ }
209
+ function ve() {
210
+ switch (C.entrance) {
211
+ case "bubble": return {
212
+ from: {
213
+ autoAlpha: 0,
214
+ y: 18,
215
+ scale: .78
216
+ },
217
+ to: {
218
+ autoAlpha: 1,
219
+ y: 0,
220
+ scale: 1,
221
+ ease: "elastic.out(1, 0.64)"
222
+ }
223
+ };
224
+ case "rotate-up": return _e();
225
+ case "soft-pop": return {
226
+ from: {
227
+ autoAlpha: 0,
228
+ y: 10,
229
+ scale: .92,
230
+ filter: "blur(10px)"
231
+ },
232
+ to: {
233
+ autoAlpha: 1,
234
+ y: 0,
235
+ scale: 1,
236
+ filter: "blur(0px)",
237
+ ease: "power3.out"
238
+ }
239
+ };
240
+ default: return {
241
+ from: {
242
+ autoAlpha: 0,
243
+ y: 26,
244
+ scale: .98
245
+ },
246
+ to: {
247
+ autoAlpha: 1,
248
+ y: 0,
249
+ scale: 1,
250
+ ease: "power3.out"
251
+ }
252
+ };
253
+ }
254
+ }
255
+ function Y() {
256
+ F?.kill(), F = void 0, M.value = !1, O.value && (m.killTweensOf(O.value), m.set(O.value, {
257
+ "--bing-card-press-progress": 0,
258
+ "--bing-card-press-ring-scale": .78,
259
+ autoAlpha: 0
260
+ })), k.value && (m.killTweensOf(k.value), m.set(k.value, {
261
+ autoAlpha: 0,
262
+ scale: .98
263
+ }));
264
+ }
265
+ function ye() {
266
+ M.value = !1, O.value && (m.killTweensOf(O.value), m.timeline().to(O.value, {
267
+ "--bing-card-press-ring-scale": .96,
268
+ autoAlpha: .82,
269
+ duration: .1,
270
+ ease: "power2.out"
271
+ }).to(O.value, {
272
+ "--bing-card-press-ring-scale": 1.08,
273
+ autoAlpha: 0,
274
+ duration: .38,
275
+ ease: "power3.out"
276
+ }, .06)), k.value && (m.killTweensOf(k.value), m.timeline().to(k.value, {
277
+ autoAlpha: .18,
278
+ scale: 1,
279
+ duration: .1,
280
+ ease: "power2.out"
281
+ }).to(k.value, {
282
+ autoAlpha: 0,
283
+ scale: 1.015,
284
+ duration: .38,
285
+ ease: "power3.out"
286
+ }, .06));
287
+ }
288
+ function X(e = !j.value) {
289
+ let t = E.value;
290
+ if (!t || C.disabled || z || j.value === e) return;
291
+ j.value = e;
292
+ let n = m.to(t, {
293
+ ...J(),
294
+ scale: 1,
295
+ transformPerspective: 900,
296
+ transformOrigin: "50% 50%",
297
+ duration: .68,
298
+ ease: "power3.inOut",
299
+ overwrite: !0,
300
+ force3D: !0,
301
+ onComplete: () => {
302
+ I === n && (R = !1);
303
+ },
304
+ onInterrupt: () => {
305
+ I === n && (R = !1);
306
+ }
307
+ });
308
+ I = n, R = !0, w("flip", e ? "back" : "front");
309
+ }
310
+ function be(e) {
311
+ if (!G() || W.value !== "press" || z || e.button !== 0) return;
312
+ Y(), H = !1, B = e.clientX, V = e.clientY, M.value = !0;
313
+ let t = T.value?.getBoundingClientRect(), n = t && t.width > 0 ? `${K((e.clientX - t.left) / t.width * 100, 0, 100)}%` : "50%", r = t && t.height > 0 ? `${K((e.clientY - t.top) / t.height * 100, 0, 100)}%` : "50%";
314
+ try {
315
+ e.currentTarget?.setPointerCapture?.(e.pointerId);
316
+ } catch {}
317
+ O.value && (m.set(O.value, {
318
+ "--bing-card-press-progress": 0,
319
+ "--bing-card-press-x": n,
320
+ "--bing-card-press-y": r,
321
+ "--bing-card-press-ring-scale": .78,
322
+ autoAlpha: 1
323
+ }), F = m.to(O.value, {
324
+ "--bing-card-press-progress": 1,
325
+ "--bing-card-press-ring-scale": .98,
326
+ duration: Math.max(120, C.longPressDelay) / 1e3,
327
+ ease: "none",
328
+ overwrite: !0,
329
+ onComplete: () => {
330
+ if (F = void 0, H = !0, w("long-press"), ye(), C.longPressRelease === "restore") {
331
+ X(!0);
332
+ return;
333
+ }
334
+ X();
335
+ }
336
+ })), k.value && m.fromTo(k.value, {
337
+ autoAlpha: 0,
338
+ scale: .98
339
+ }, {
340
+ autoAlpha: 1,
341
+ scale: 1,
342
+ duration: Math.min(.24, Math.max(120, C.longPressDelay) / 2e3),
343
+ ease: "power2.out",
344
+ overwrite: !0
345
+ });
346
+ }
347
+ function xe(e) {
348
+ e.defaultPrevented || C.disabled || W.value !== "click" || z || e.target instanceof Element && e.target.closest("button,a[href],input,label,select,textarea,[role=\"button\"],[role=\"tab\"],[contenteditable]:not([contenteditable=\"false\"])") || (S(e), X());
349
+ }
350
+ function Se(e) {
351
+ if (!F) return;
352
+ let t = e.clientX - B, n = e.clientY - V;
353
+ Math.hypot(t, n) > le && Y();
354
+ }
355
+ function Z() {
356
+ Y(), H && C.longPressRelease === "restore" && X(!1), H = !1;
357
+ }
358
+ function Ce() {
359
+ H || Y(), !R && ge();
360
+ }
361
+ function Q() {
362
+ let e = T.value, t = E.value;
363
+ if (!e || !t || C.disabled || A.value && C.entranceOnce) return;
364
+ if (A.value = !0, e.classList.add("has-entered"), w("enter"), L?.kill(), L = void 0, z = !1, N?.revert(), N = void 0, C.entrance === "none" || x()) {
365
+ m.set(t, {
366
+ autoAlpha: 1,
367
+ clearProps: "transform,filter"
368
+ });
369
+ return;
370
+ }
371
+ let n = ve();
372
+ N = m.context(() => {
373
+ let e = m.fromTo(t, n.from, {
374
+ ...n.to,
375
+ duration: Math.max(.1, C.entranceDuration),
376
+ delay: Math.max(0, C.entranceDelay),
377
+ clearProps: "filter",
378
+ onComplete: () => {
379
+ L === e && (L = void 0, z = !1);
380
+ },
381
+ onInterrupt: () => {
382
+ L === e && (L = void 0, z = !1);
383
+ }
384
+ });
385
+ L = e, z = !0;
386
+ }, e);
387
+ }
388
+ function $() {
389
+ if (P?.disconnect(), P = void 0, !G()) {
390
+ Q();
391
+ return;
392
+ }
393
+ if (C.entrance === "none" || x()) {
394
+ Q();
395
+ return;
396
+ }
397
+ if (!("IntersectionObserver" in window)) {
398
+ Q();
399
+ return;
400
+ }
401
+ let e = T.value;
402
+ e && (P = new IntersectionObserver((e) => {
403
+ e.some((e) => e.isIntersecting) && (Q(), C.entranceOnce && (P?.disconnect(), P = void 0));
404
+ }, {
405
+ threshold: .18,
406
+ rootMargin: "0px 0px -8% 0px"
407
+ }), P.observe(e));
408
+ }
409
+ return re(() => [
410
+ C.entrance,
411
+ C.entranceOnce,
412
+ C.entranceDelay,
413
+ C.entranceDuration,
414
+ C.flipAxis,
415
+ C.flipTurns,
416
+ C.flipEase,
417
+ C.flipTrigger,
418
+ C.disabled
419
+ ], () => {
420
+ Y(), A.value = !1, c($);
421
+ }, { flush: "post" }), ne(() => {
422
+ c($);
423
+ }), te(() => {
424
+ Y(), L?.kill(), L = void 0, z = !1, I?.kill(), I = void 0, R = !1, P?.disconnect(), P = void 0, N?.revert(), N = void 0, m.killTweensOf([
425
+ E.value,
426
+ D.value,
427
+ O.value,
428
+ k.value
429
+ ].filter(Boolean));
430
+ }), (e, t) => (u(), a("article", {
431
+ ref_key: "rootRef",
432
+ ref: T,
433
+ class: l(ue.value),
434
+ style: ee(de.value),
435
+ onPointerdown: be,
436
+ onPointermove: he,
437
+ onPointerup: Z,
438
+ onPointerleave: Ce,
439
+ onPointercancel: Z,
440
+ onLostpointercapture: Z,
441
+ onClick: xe
442
+ }, [o("div", {
443
+ ref_key: "surfaceRef",
444
+ ref: E,
445
+ class: "bing-card__surface"
446
+ }, [
447
+ o("div", ie, [
448
+ s.glare ? (u(), a("span", {
449
+ key: 0,
450
+ ref_key: "glareRef",
451
+ ref: D,
452
+ class: "bing-card__glare",
453
+ "aria-hidden": "true"
454
+ }, null, 512)) : i("", !0),
455
+ e.$slots.media ? (u(), a("div", h, [f(e.$slots, "media", {}, void 0, !0)])) : i("", !0),
456
+ o("div", g, [
457
+ e.$slots.header || fe.value ? (u(), a("header", ae, [f(e.$slots, "header", {}, () => [o("div", oe, [s.title ? (u(), a("h3", se, p(s.title), 1)) : i("", !0), s.description ? (u(), a("p", _, p(s.description), 1)) : i("", !0)])], !0)])) : i("", !0),
458
+ e.$slots.default ? (u(), a("div", v, [f(e.$slots, "default", {}, void 0, !0)])) : i("", !0),
459
+ e.$slots.footer ? (u(), a("footer", y, [f(e.$slots, "footer", {}, void 0, !0)])) : i("", !0)
460
+ ])
461
+ ]),
462
+ o("div", ce, [f(e.$slots, "back", {}, () => [t[0] ||= o("div", { class: "bing-card__back-mark" }, "Bing UI", -1), t[1] ||= o("div", { class: "bing-card__back-text" }, "交互卡片", -1)], !0)]),
463
+ W.value === "press" ? (u(), a("span", {
464
+ key: 0,
465
+ ref_key: "pressAmbienceRef",
466
+ ref: k,
467
+ class: "bing-card__press-ambience",
468
+ "aria-hidden": "true"
469
+ }, null, 512)) : i("", !0),
470
+ W.value === "press" ? (u(), a("span", {
471
+ key: 1,
472
+ ref_key: "pressFeedbackRef",
473
+ ref: O,
474
+ class: "bing-card__press-feedback",
475
+ "aria-hidden": "true"
476
+ }, null, 512)) : i("", !0)
477
+ ], 512)], 38));
478
+ }
479
+ });
480
+ //#endregion
481
+ export { b as default };
@@ -0,0 +1,7 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./BingCarouselTransition.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/BingCarouselTransition/BingCarouselTransition.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-a8a3a5af"]]);
6
+ //#endregion
7
+ export { n as default };