blessing-ui 0.1.0 → 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.
Files changed (200) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +139 -105
  3. package/dist/blessing-ui.css +97 -1
  4. package/dist/components/BlessAnnotator.css +1 -0
  5. package/dist/components/BlessAnnotator.js +6 -0
  6. package/dist/components/BlessAnnotator.vue.d.ts +71 -0
  7. package/dist/components/BlessAnnotator.vue_vue_type_script_setup_true_lang.js +264 -0
  8. package/dist/components/BlessAttachment.vue.d.ts +4 -1
  9. package/dist/components/BlessAttachment.vue_vue_type_script_setup_true_lang.js +3 -2
  10. package/dist/components/BlessCalendar.vue.d.ts +4 -0
  11. package/dist/components/BlessCalendar.vue_vue_type_script_setup_true_lang.js +65 -60
  12. package/dist/components/BlessCarousel.vue.d.ts +3 -0
  13. package/dist/components/BlessCarousel.vue_vue_type_script_setup_true_lang.js +10 -9
  14. package/dist/components/BlessCoachmark.css +1 -0
  15. package/dist/components/BlessCoachmark.js +6 -0
  16. package/dist/components/BlessCoachmark.vue.d.ts +40 -0
  17. package/dist/components/BlessCoachmark.vue_vue_type_script_setup_true_lang.js +74 -0
  18. package/dist/components/BlessCodeBlock.css +1 -0
  19. package/dist/components/BlessCodeBlock.js +6 -0
  20. package/dist/components/BlessCodeBlock.vue.d.ts +72 -0
  21. package/dist/components/BlessCodeBlock.vue_vue_type_script_setup_true_lang.js +140 -0
  22. package/dist/components/BlessCombobox.vue.d.ts +2 -0
  23. package/dist/components/BlessCombobox.vue_vue_type_script_setup_true_lang.js +3 -2
  24. package/dist/components/BlessCommand.css +1 -1
  25. package/dist/components/BlessCommand.vue.d.ts +26 -0
  26. package/dist/components/BlessCommand.vue_vue_type_script_setup_true_lang.js +137 -70
  27. package/dist/components/BlessConfetti.css +1 -0
  28. package/dist/components/BlessConfetti.js +6 -0
  29. package/dist/components/BlessConfetti.vue.d.ts +40 -0
  30. package/dist/components/BlessConfetti.vue_vue_type_script_setup_true_lang.js +77 -0
  31. package/dist/components/BlessCountUp.css +1 -0
  32. package/dist/components/BlessCountUp.js +6 -0
  33. package/dist/components/BlessCountUp.vue.d.ts +18 -0
  34. package/dist/components/BlessCountUp.vue_vue_type_script_setup_true_lang.js +49 -0
  35. package/dist/components/BlessCropper.css +1 -0
  36. package/dist/components/BlessCropper.js +6 -0
  37. package/dist/components/BlessCropper.vue.d.ts +70 -0
  38. package/dist/components/BlessCropper.vue_vue_type_script_setup_true_lang.js +220 -0
  39. package/dist/components/BlessDataTable.vue.d.ts +6 -0
  40. package/dist/components/BlessDataTable.vue_vue_type_script_setup_true_lang.js +56 -42
  41. package/dist/components/BlessDataView.vue.d.ts +7 -0
  42. package/dist/components/BlessDataView.vue_vue_type_script_setup_true_lang.js +38 -31
  43. package/dist/components/BlessDatePicker.vue.d.ts +3 -0
  44. package/dist/components/BlessDatePicker.vue_vue_type_script_setup_true_lang.js +46 -45
  45. package/dist/components/BlessDiff.css +1 -0
  46. package/dist/components/BlessDiff.js +6 -0
  47. package/dist/components/BlessDiff.vue.d.ts +22 -0
  48. package/dist/components/BlessDiff.vue_vue_type_script_setup_true_lang.js +148 -0
  49. package/dist/components/BlessDock.css +1 -0
  50. package/dist/components/BlessDock.js +6 -0
  51. package/dist/components/BlessDock.vue.d.ts +55 -0
  52. package/dist/components/BlessDock.vue_vue_type_script_setup_true_lang.js +100 -0
  53. package/dist/components/BlessEditor.vue.d.ts +2 -0
  54. package/dist/components/BlessEditor.vue_vue_type_script_setup_true_lang.js +23 -22
  55. package/dist/components/BlessFileInput.vue.d.ts +2 -0
  56. package/dist/components/BlessFileInput.vue_vue_type_script_setup_true_lang.js +3 -2
  57. package/dist/components/BlessFormula.css +1 -0
  58. package/dist/components/BlessFormula.js +6 -0
  59. package/dist/components/BlessFormula.vue.d.ts +53 -0
  60. package/dist/components/BlessFormula.vue_vue_type_script_setup_true_lang.js +111 -0
  61. package/dist/components/BlessGantt.css +1 -0
  62. package/dist/components/BlessGantt.js +6 -0
  63. package/dist/components/BlessGantt.vue.d.ts +81 -0
  64. package/dist/components/BlessGantt.vue_vue_type_script_setup_true_lang.js +276 -0
  65. package/dist/components/BlessGauge.css +1 -0
  66. package/dist/components/BlessGauge.js +6 -0
  67. package/dist/components/BlessGauge.vue.d.ts +36 -0
  68. package/dist/components/BlessGauge.vue_vue_type_script_setup_true_lang.js +100 -0
  69. package/dist/components/BlessHeatmapCalendar.css +1 -0
  70. package/dist/components/BlessHeatmapCalendar.js +6 -0
  71. package/dist/components/BlessHeatmapCalendar.vue.d.ts +38 -0
  72. package/dist/components/BlessHeatmapCalendar.vue_vue_type_script_setup_true_lang.js +146 -0
  73. package/dist/components/BlessHotspots.css +1 -0
  74. package/dist/components/BlessHotspots.js +6 -0
  75. package/dist/components/BlessHotspots.vue.d.ts +49 -0
  76. package/dist/components/BlessHotspots.vue_vue_type_script_setup_true_lang.js +127 -0
  77. package/dist/components/BlessInfiniteCanvas.css +1 -0
  78. package/dist/components/BlessInfiniteCanvas.js +6 -0
  79. package/dist/components/BlessInfiniteCanvas.vue.d.ts +91 -0
  80. package/dist/components/BlessInfiniteCanvas.vue_vue_type_script_setup_true_lang.js +232 -0
  81. package/dist/components/BlessInputNumber.vue.d.ts +5 -0
  82. package/dist/components/BlessInputNumber.vue_vue_type_script_setup_true_lang.js +39 -34
  83. package/dist/components/BlessKanban.css +1 -0
  84. package/dist/components/BlessKanban.js +6 -0
  85. package/dist/components/BlessKanban.vue.d.ts +67 -0
  86. package/dist/components/BlessKanban.vue_vue_type_script_setup_true_lang.js +195 -0
  87. package/dist/components/BlessLoadingBar.vue.d.ts +2 -0
  88. package/dist/components/BlessLoadingBar.vue_vue_type_script_setup_true_lang.js +8 -3
  89. package/dist/components/BlessLoupe.css +1 -0
  90. package/dist/components/BlessLoupe.js +6 -0
  91. package/dist/components/BlessLoupe.vue.d.ts +16 -0
  92. package/dist/components/BlessLoupe.vue_vue_type_script_setup_true_lang.js +93 -0
  93. package/dist/components/BlessMarquee.css +1 -0
  94. package/dist/components/BlessMarquee.js +6 -0
  95. package/dist/components/BlessMarquee.vue.d.ts +44 -0
  96. package/dist/components/BlessMarquee.vue_vue_type_script_setup_true_lang.js +69 -0
  97. package/dist/components/BlessMasonry.css +1 -0
  98. package/dist/components/BlessMasonry.js +6 -0
  99. package/dist/components/BlessMasonry.vue.d.ts +33 -0
  100. package/dist/components/BlessMasonry.vue_vue_type_script_setup_true_lang.js +79 -0
  101. package/dist/components/BlessMention.css +1 -0
  102. package/dist/components/BlessMention.js +6 -0
  103. package/dist/components/BlessMention.vue.d.ts +32 -0
  104. package/dist/components/BlessMention.vue_vue_type_script_setup_true_lang.js +116 -0
  105. package/dist/components/BlessNodeGraph.css +1 -0
  106. package/dist/components/BlessNodeGraph.js +6 -0
  107. package/dist/components/BlessNodeGraph.vue.d.ts +110 -0
  108. package/dist/components/BlessNodeGraph.vue_vue_type_script_setup_true_lang.js +321 -0
  109. package/dist/components/BlessOnboardingChecklist.css +1 -0
  110. package/dist/components/BlessOnboardingChecklist.js +6 -0
  111. package/dist/components/BlessOnboardingChecklist.vue.d.ts +72 -0
  112. package/dist/components/BlessOnboardingChecklist.vue_vue_type_script_setup_true_lang.js +157 -0
  113. package/dist/components/BlessOrderList.vue.d.ts +5 -0
  114. package/dist/components/BlessOrderList.vue_vue_type_script_setup_true_lang.js +62 -56
  115. package/dist/components/BlessPagination.vue.d.ts +2 -0
  116. package/dist/components/BlessPagination.vue_vue_type_script_setup_true_lang.js +2 -1
  117. package/dist/components/BlessPickList.vue.d.ts +5 -0
  118. package/dist/components/BlessPickList.vue_vue_type_script_setup_true_lang.js +55 -49
  119. package/dist/components/BlessRadialMenu.css +1 -0
  120. package/dist/components/BlessRadialMenu.js +6 -0
  121. package/dist/components/BlessRadialMenu.vue.d.ts +45 -0
  122. package/dist/components/BlessRadialMenu.vue_vue_type_script_setup_true_lang.js +146 -0
  123. package/dist/components/BlessRangeCalendar.css +1 -0
  124. package/dist/components/BlessRangeCalendar.js +6 -0
  125. package/dist/components/BlessRangeCalendar.vue.d.ts +51 -0
  126. package/dist/components/BlessRangeCalendar.vue_vue_type_script_setup_true_lang.js +217 -0
  127. package/dist/components/BlessScheduler.css +1 -0
  128. package/dist/components/BlessScheduler.js +6 -0
  129. package/dist/components/BlessScheduler.vue.d.ts +95 -0
  130. package/dist/components/BlessScheduler.vue_vue_type_script_setup_true_lang.js +347 -0
  131. package/dist/components/BlessShortcutRecorder.css +1 -0
  132. package/dist/components/BlessShortcutRecorder.js +6 -0
  133. package/dist/components/BlessShortcutRecorder.vue.d.ts +39 -0
  134. package/dist/components/BlessShortcutRecorder.vue_vue_type_script_setup_true_lang.js +126 -0
  135. package/dist/components/BlessSignaturePad.vue.d.ts +1 -1
  136. package/dist/components/BlessSliderCaptcha.css +1 -0
  137. package/dist/components/BlessSliderCaptcha.js +6 -0
  138. package/dist/components/BlessSliderCaptcha.vue.d.ts +38 -0
  139. package/dist/components/BlessSliderCaptcha.vue_vue_type_script_setup_true_lang.js +146 -0
  140. package/dist/components/BlessSortable.css +1 -0
  141. package/dist/components/BlessSortable.js +6 -0
  142. package/dist/components/BlessSortable.vue.d.ts +51 -0
  143. package/dist/components/BlessSortable.vue_vue_type_script_setup_true_lang.js +135 -0
  144. package/dist/components/BlessSparkline.css +1 -0
  145. package/dist/components/BlessSparkline.js +6 -0
  146. package/dist/components/BlessSparkline.vue.d.ts +28 -0
  147. package/dist/components/BlessSparkline.vue_vue_type_script_setup_true_lang.js +107 -0
  148. package/dist/components/BlessSplitView.css +1 -0
  149. package/dist/components/BlessSplitView.js +6 -0
  150. package/dist/components/BlessSplitView.vue.d.ts +61 -0
  151. package/dist/components/BlessSplitView.vue_vue_type_script_setup_true_lang.js +92 -0
  152. package/dist/components/BlessSteps.vue.d.ts +2 -0
  153. package/dist/components/BlessSteps.vue_vue_type_script_setup_true_lang.js +3 -2
  154. package/dist/components/BlessSwipeDeck.css +1 -0
  155. package/dist/components/BlessSwipeDeck.js +6 -0
  156. package/dist/components/BlessSwipeDeck.vue.d.ts +46 -0
  157. package/dist/components/BlessSwipeDeck.vue_vue_type_script_setup_true_lang.js +200 -0
  158. package/dist/components/BlessTimer.css +1 -0
  159. package/dist/components/BlessTimer.js +6 -0
  160. package/dist/components/BlessTimer.vue.d.ts +74 -0
  161. package/dist/components/BlessTimer.vue_vue_type_script_setup_true_lang.js +139 -0
  162. package/dist/components/BlessTour.vue.d.ts +1 -0
  163. package/dist/components/BlessTour.vue_vue_type_script_setup_true_lang.js +48 -42
  164. package/dist/components/BlessTreemap.css +1 -0
  165. package/dist/components/BlessTreemap.js +6 -0
  166. package/dist/components/BlessTreemap.vue.d.ts +46 -0
  167. package/dist/components/BlessTreemap.vue_vue_type_script_setup_true_lang.js +137 -0
  168. package/dist/components/BlessUploader.vue.d.ts +11 -0
  169. package/dist/components/BlessUploader.vue_vue_type_script_setup_true_lang.js +80 -69
  170. package/dist/composables/annotate.d.ts +35 -0
  171. package/dist/composables/annotate.js +33 -0
  172. package/dist/composables/canvasView.d.ts +21 -0
  173. package/dist/composables/canvasView.js +23 -0
  174. package/dist/composables/confetti.d.ts +32 -0
  175. package/dist/composables/confetti.js +23 -0
  176. package/dist/composables/cropBox.d.ts +22 -0
  177. package/dist/composables/cropBox.js +39 -0
  178. package/dist/composables/dayBlocks.d.ts +11 -0
  179. package/dist/composables/dayBlocks.js +26 -0
  180. package/dist/composables/diffLines.d.ts +10 -0
  181. package/dist/composables/diffLines.js +55 -0
  182. package/dist/composables/formula.d.ts +28 -0
  183. package/dist/composables/formula.js +161 -0
  184. package/dist/composables/graph.d.ts +19 -0
  185. package/dist/composables/graph.js +16 -0
  186. package/dist/composables/radial.d.ts +15 -0
  187. package/dist/composables/radial.js +22 -0
  188. package/dist/composables/schedule.d.ts +27 -0
  189. package/dist/composables/schedule.js +54 -0
  190. package/dist/composables/shortcut.d.ts +12 -0
  191. package/dist/composables/shortcut.js +35 -0
  192. package/dist/composables/treemap.d.ts +23 -0
  193. package/dist/composables/treemap.js +77 -0
  194. package/dist/composables/useAutoScroll.d.ts +15 -0
  195. package/dist/composables/useAutoScroll.js +32 -0
  196. package/dist/composables/useSortable.d.ts +58 -0
  197. package/dist/composables/useSortable.js +107 -0
  198. package/dist/index.d.ts +62 -1
  199. package/dist/index.js +93 -53
  200. package/package.json +22 -18
@@ -0,0 +1,100 @@
1
+ import { Fragment as e, computed as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, normalizeStyle as o, openBlock as s, renderList as c, toDisplayString as l } from "vue";
2
+ //#region src/components/BlessGauge.vue?vue&type=script&setup=true&lang.ts
3
+ var u = [
4
+ "aria-label",
5
+ "aria-valuemin",
6
+ "aria-valuemax",
7
+ "aria-valuenow",
8
+ "aria-valuetext"
9
+ ], d = {
10
+ key: 0,
11
+ class: "bless-gauge__svg",
12
+ viewBox: "0 0 200 118",
13
+ "aria-hidden": "true"
14
+ }, f = ["d"], p = ["d"], m = [
15
+ "x1",
16
+ "y1",
17
+ "x2",
18
+ "y2"
19
+ ], h = {
20
+ key: 1,
21
+ class: "bless-gauge__bar",
22
+ "aria-hidden": "true"
23
+ }, g = { class: "bless-gauge__read" }, _ = { class: "bless-gauge__value" }, v = { class: "bless-gauge__label" }, y = /*@__PURE__*/ i({
24
+ name: "BlessGauge",
25
+ __name: "BlessGauge",
26
+ props: {
27
+ value: {},
28
+ min: { default: 0 },
29
+ max: { default: 100 },
30
+ zones: {},
31
+ variant: { default: "arc" },
32
+ label: { default: "Gauge" },
33
+ format: {}
34
+ },
35
+ setup(i) {
36
+ let y = i, b = t(() => y.max - y.min || 1), x = (e) => Math.min(1, Math.max(0, (e - y.min) / b.value)), S = t(() => x(y.value)), C = t(() => (y.format ?? String)(y.value)), w = (e) => e ? /^[a-z0-9-]+$/i.test(e) ? `var(--bless-color-${e})` : e : "currentColor", T = t(() => {
37
+ let e = [...y.zones ?? []].sort((e, t) => e.to - t.to), t = 0;
38
+ return e.map((e) => {
39
+ let n = x(e.to), r = {
40
+ from: t,
41
+ to: n,
42
+ color: w(e.color)
43
+ };
44
+ return t = n, r;
45
+ });
46
+ }), E = t(() => {
47
+ let e = [...y.zones ?? []].sort((e, t) => e.to - t.to);
48
+ return e.find((e) => y.value <= e.to) ?? e.at(-1);
49
+ }), D = (e, t = 80) => ({
50
+ x: +(100 - t * Math.cos(e * Math.PI)).toFixed(2),
51
+ y: +(100 - t * Math.sin(e * Math.PI)).toFixed(2)
52
+ }), O = (e, t) => {
53
+ let n = D(e), r = D(t);
54
+ return `M${n.x} ${n.y}A80 80 0 0 1 ${r.x} ${r.y}`;
55
+ }, k = t(() => ({
56
+ a: D(S.value, 58),
57
+ b: D(S.value, 90)
58
+ }));
59
+ return (t, y) => (s(), n("div", {
60
+ class: a(["bless-gauge", `bless-gauge--${i.variant}`]),
61
+ role: "meter",
62
+ "aria-label": i.label,
63
+ "aria-valuemin": i.min,
64
+ "aria-valuemax": i.max,
65
+ "aria-valuenow": Math.min(i.max, Math.max(i.min, i.value)),
66
+ "aria-valuetext": E.value?.label ? `${C.value}, ${E.value.label}` : C.value
67
+ }, [i.variant === "arc" ? (s(), n("svg", d, [
68
+ r("path", {
69
+ class: "bless-gauge__track",
70
+ d: O(0, 1)
71
+ }, null, 8, f),
72
+ (s(!0), n(e, null, c(T.value, (e, t) => (s(), n("path", {
73
+ key: t,
74
+ class: "bless-gauge__band",
75
+ d: O(e.from, e.to),
76
+ style: o({ stroke: e.color })
77
+ }, null, 12, p))), 128)),
78
+ r("line", {
79
+ class: "bless-gauge__needle",
80
+ x1: k.value.a.x,
81
+ y1: k.value.a.y,
82
+ x2: k.value.b.x,
83
+ y2: k.value.b.y
84
+ }, null, 8, m)
85
+ ])) : (s(), n("div", h, [(s(!0), n(e, null, c(T.value, (e, t) => (s(), n("span", {
86
+ key: t,
87
+ class: "bless-gauge__seg",
88
+ style: o({
89
+ left: `${e.from * 100}%`,
90
+ width: `${(e.to - e.from) * 100}%`,
91
+ background: e.color
92
+ })
93
+ }, null, 4))), 128)), r("span", {
94
+ class: "bless-gauge__mark",
95
+ style: o({ left: `${S.value * 100}%` })
96
+ }, null, 4)])), r("div", g, [r("strong", _, l(C.value), 1), r("span", v, l(i.label), 1)])], 10, u));
97
+ }
98
+ });
99
+ //#endregion
100
+ export { y as default };
@@ -0,0 +1 @@
1
+ .bless-heat{font-family:var(--bless-font-sans);font-size:var(--bless-text-xs);color:var(--bless-color-text-muted)}.bless-heat__scroll{padding-bottom:var(--bless-space-1);overflow-x:auto}.bless-heat__grid{--bless-heat-size:12px;grid-template-columns:auto repeat(var(--bless-heat-weeks), var(--bless-heat-size));grid-template-rows:auto repeat(7, var(--bless-heat-size));align-items:center;gap:3px;width:max-content;display:grid}.bless-heat__month,.bless-heat__weekday{white-space:nowrap;line-height:1}.bless-heat__weekday{padding-inline-end:var(--bless-space-2)}.bless-heat__cell{width:var(--bless-heat-size,12px);height:var(--bless-heat-size,12px);border:var(--bless-border-width) solid var(--bless-color-border);background:color-mix(in srgb, var(--bless-color-text) calc(var(--bless-heat-l) * 85%), var(--bless-color-surface));cursor:pointer;padding:0;display:block}.bless-heat__cell:focus-visible,.bless-heat__cell--on{outline:2px solid var(--bless-color-accent);outline-offset:1px}.bless-heat__swatch{cursor:default;display:inline-block}.bless-heat__foot{justify-content:space-between;align-items:center;gap:var(--bless-space-2);margin-top:var(--bless-space-2);flex-wrap:wrap;display:flex}.bless-heat__legend{align-items:center;gap:3px;display:inline-flex}.bless-heat__legend .bless-heat__cell{--bless-heat-size:12px}
@@ -0,0 +1,6 @@
1
+ import "./BlessHeatmapCalendar.css";
2
+ import e from "./BlessHeatmapCalendar.vue_vue_type_script_setup_true_lang.js";
3
+ //#region src/components/BlessHeatmapCalendar.vue
4
+ var t = e;
5
+ //#endregion
6
+ export { t as default };
@@ -0,0 +1,38 @@
1
+ type __VLS_Props = {
2
+ /** counts by ISO date: `{ "2026-09-27": 4 }`; missing days are 0 */
3
+ data?: Record<string, number>;
4
+ /** last day shown, ISO; defaults to today */
5
+ end?: string;
6
+ weeks?: number;
7
+ /** first row of each column: 0 Sunday, 1 Monday */
8
+ weekStart?: 0 | 1;
9
+ /** intensity steps above zero */
10
+ levels?: number;
11
+ /** the count that fills the darkest step; defaults to the largest value in `data` */
12
+ max?: number;
13
+ locale?: string;
14
+ /** what is counted, singular: "contribution" */
15
+ unit?: string;
16
+ legend?: boolean;
17
+ label?: string;
18
+ };
19
+ type __VLS_ModelProps = {
20
+ /** the picked day */
21
+ modelValue?: string | null;
22
+ };
23
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
24
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
25
+ "update:modelValue": (value: string | null) => any;
26
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
27
+ "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
28
+ }>, {
29
+ label: string;
30
+ data: Record<string, number>;
31
+ legend: boolean;
32
+ weekStart: 0 | 1;
33
+ unit: string;
34
+ weeks: number;
35
+ levels: number;
36
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
37
+ declare const _default: typeof __VLS_export;
38
+ export default _default;
@@ -0,0 +1,146 @@
1
+ import { logicalKey as e } from "../composables/rtl.js";
2
+ import { addDays as t, fromISO as n, isoToday as r, toISO as i } from "../composables/date.js";
3
+ import { Fragment as a, computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, defineComponent as d, mergeModels as f, nextTick as p, normalizeClass as m, normalizeStyle as h, openBlock as g, ref as _, renderList as v, toDisplayString as y, useModel as b } from "vue";
4
+ //#region src/components/BlessHeatmapCalendar.vue?vue&type=script&setup=true&lang.ts
5
+ var x = ["aria-label"], S = { class: "bless-heat__scroll" }, C = [
6
+ "data-date",
7
+ "data-level",
8
+ "tabindex",
9
+ "aria-label",
10
+ "aria-pressed",
11
+ "onClick",
12
+ "onKeydown",
13
+ "onFocus",
14
+ "onMouseenter"
15
+ ], w = { class: "bless-heat__foot" }, T = {
16
+ class: "bless-heat__readout",
17
+ "aria-live": "polite"
18
+ }, E = {
19
+ key: 0,
20
+ class: "bless-heat__legend",
21
+ "aria-hidden": "true"
22
+ }, D = /*@__PURE__*/ d({
23
+ name: "BlessHeatmapCalendar",
24
+ __name: "BlessHeatmapCalendar",
25
+ props: /*@__PURE__*/ f({
26
+ data: { default: () => ({}) },
27
+ end: {},
28
+ weeks: { default: 53 },
29
+ weekStart: { default: 1 },
30
+ levels: { default: 4 },
31
+ max: {},
32
+ locale: {},
33
+ unit: { default: "contribution" },
34
+ legend: {
35
+ type: Boolean,
36
+ default: !0
37
+ },
38
+ label: { default: "Activity" }
39
+ }, {
40
+ modelValue: { default: null },
41
+ modelModifiers: {}
42
+ }),
43
+ emits: ["update:modelValue"],
44
+ setup(d) {
45
+ let f = d, D = b(d, "modelValue"), O = o(() => n(f.end ?? r())), k = o(() => {
46
+ let e = (O.value.getDay() - f.weekStart + 7) % 7;
47
+ return t(O.value, -e - (f.weeks - 1) * 7);
48
+ }), A = o(() => f.max ?? Math.max(1, ...Object.values(f.data))), j = o(() => new Intl.DateTimeFormat(f.locale, {
49
+ weekday: "short",
50
+ year: "numeric",
51
+ month: "short",
52
+ day: "numeric"
53
+ })), M = o(() => new Intl.DateTimeFormat(f.locale, { month: "short" })), N = (e) => `${e} ${f.unit}${e === 1 ? "" : "s"}`, P = o(() => {
54
+ let e = [];
55
+ for (let n = 0; n < f.weeks * 7; n++) {
56
+ let r = t(k.value, n), a = i(r), o = f.data[a] ?? 0;
57
+ e.push({
58
+ iso: a,
59
+ v: o,
60
+ level: o > 0 ? Math.min(f.levels, Math.max(1, Math.ceil(o / A.value * f.levels))) : 0,
61
+ text: `${N(o)} on ${j.value.format(r)}`,
62
+ shown: r <= O.value
63
+ });
64
+ }
65
+ return e;
66
+ }), F = o(() => P.value.reduce((e, t) => e + (t.shown ? t.v : 0), 0)), I = o(() => Array.from({ length: f.weeks }, (e, n) => {
67
+ let r = t(k.value, n * 7), i = t(r, -7);
68
+ return n === 0 || r.getMonth() !== i.getMonth() ? M.value.format(r) : "";
69
+ })), L = o(() => Array.from({ length: 7 }, (e, n) => n % 2 ? new Intl.DateTimeFormat(f.locale, { weekday: "short" }).format(t(k.value, n)) : "")), R = _(""), z = _(), B = o(() => i(O.value)), V = _(null), H = o(() => D.value ?? V.value ?? B.value), U = o(() => i(k.value));
70
+ function W(e) {
71
+ e < U.value || e > B.value || (V.value = e, p(() => z.value?.querySelector(`[data-date="${e}"]`)?.focus()));
72
+ }
73
+ function G(r, a) {
74
+ let o = e(a), s = n(r), c = {
75
+ ArrowUp: -1,
76
+ ArrowDown: 1,
77
+ ArrowLeft: -7,
78
+ ArrowRight: 7
79
+ };
80
+ o in c ? (a.preventDefault(), W(i(t(s, c[o])))) : o === "Home" ? (a.preventDefault(), W(U.value)) : o === "End" && (a.preventDefault(), W(B.value));
81
+ }
82
+ return (e, t) => (g(), c("div", {
83
+ ref_key: "root",
84
+ ref: z,
85
+ class: "bless-heat",
86
+ role: "group",
87
+ "aria-label": d.label
88
+ }, [l("div", S, [l("div", {
89
+ class: "bless-heat__grid",
90
+ style: h({
91
+ "--bless-heat-weeks": d.weeks,
92
+ "--bless-heat-levels": d.levels
93
+ })
94
+ }, [
95
+ (g(!0), c(a, null, v(I.value, (e, t) => (g(), c("span", {
96
+ key: `m${t}`,
97
+ class: "bless-heat__month",
98
+ "aria-hidden": "true",
99
+ style: h({
100
+ gridColumn: t + 2,
101
+ gridRow: 1
102
+ })
103
+ }, y(e), 5))), 128)),
104
+ (g(!0), c(a, null, v(L.value, (e, t) => (g(), c("span", {
105
+ key: `d${t}`,
106
+ class: "bless-heat__weekday",
107
+ "aria-hidden": "true",
108
+ style: h({
109
+ gridColumn: 1,
110
+ gridRow: t + 2
111
+ })
112
+ }, y(e), 5))), 128)),
113
+ (g(!0), c(a, null, v(P.value, (e, n) => (g(), c(a, { key: e.iso }, [e.shown ? (g(), c("button", {
114
+ key: 0,
115
+ type: "button",
116
+ class: m(["bless-heat__cell", { "bless-heat__cell--on": D.value === e.iso }]),
117
+ style: h({
118
+ gridColumn: Math.floor(n / 7) + 2,
119
+ gridRow: n % 7 + 2,
120
+ "--bless-heat-l": e.level / d.levels
121
+ }),
122
+ "data-date": e.iso,
123
+ "data-level": e.level,
124
+ tabindex: H.value === e.iso ? 0 : -1,
125
+ "aria-label": e.text,
126
+ "aria-pressed": D.value === e.iso,
127
+ onClick: (t) => D.value = D.value === e.iso ? null : e.iso,
128
+ onKeydown: (t) => G(e.iso, t),
129
+ onFocus: (t) => (V.value = e.iso, R.value = e.text),
130
+ onMouseenter: (t) => R.value = e.text,
131
+ onMouseleave: t[0] ||= (e) => R.value = "",
132
+ onBlur: t[1] ||= (e) => R.value = ""
133
+ }, null, 46, C)) : s("", !0)], 64))), 128))
134
+ ], 4)]), l("div", w, [l("span", T, y(R.value || `${N(F.value)} in ${d.weeks} weeks`), 1), d.legend ? (g(), c("span", E, [
135
+ t[2] ||= u(" Less ", -1),
136
+ (g(!0), c(a, null, v(d.levels + 1, (e) => (g(), c("i", {
137
+ key: e,
138
+ class: "bless-heat__cell bless-heat__swatch",
139
+ style: h({ "--bless-heat-l": (e - 1) / d.levels })
140
+ }, null, 4))), 128)),
141
+ t[3] ||= u(" More ", -1)
142
+ ])) : s("", !0)])], 8, x));
143
+ }
144
+ });
145
+ //#endregion
146
+ export { D as default };
@@ -0,0 +1 @@
1
+ .bless-hotspots{line-height:0;display:block;position:relative}.bless-hotspots--edit{cursor:crosshair}.bless-hotspots__img{width:100%;height:auto;display:block}.bless-hotspots__spot{line-height:normal;position:absolute;transform:translate(-50%,-50%)}.bless-hotspots__pin{box-sizing:border-box;min-width:24px;height:24px;padding:0 var(--bless-space-1);border:2px solid var(--bless-color-bg);background:var(--bless-color-text);color:var(--bless-color-on-text);font:inherit;font-size:var(--bless-text-xs);cursor:pointer;touch-action:none;font-weight:600}.bless-hotspots--edit .bless-hotspots__pin{cursor:grab}.bless-hotspots__pin--on{background:var(--bless-color-accent);color:var(--bless-color-on-accent)}.bless-hotspots__pin:focus-visible{outline:2px solid var(--bless-color-accent);outline-offset:2px}
@@ -0,0 +1,6 @@
1
+ import "./BlessHotspots.css";
2
+ import e from "./BlessHotspots.vue_vue_type_script_setup_true_lang.js";
3
+ //#region src/components/BlessHotspots.vue
4
+ var t = e;
5
+ //#endregion
6
+ export { t as default };
@@ -0,0 +1,49 @@
1
+ export interface BlessHotspot {
2
+ id: string | number;
3
+ /** position in percent of the stage, 0 to 100 */
4
+ x: number;
5
+ y: number;
6
+ /** names the pin for screen readers, and is the popover's text without a `#spot` slot */
7
+ label: string;
8
+ }
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
11
+ declare const __VLS_export: <S extends BlessHotspot = BlessHotspot>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
12
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<({
13
+ /** an image to pin onto; leave out and use the default slot for a diagram or anything else */
14
+ src?: string;
15
+ alt?: string;
16
+ /** click the stage to add a pin, drag to move one, Delete to remove it, arrows to nudge it */
17
+ editable?: boolean;
18
+ placement?: "top" | "bottom" | "left" | "right";
19
+ } & {
20
+ modelValue?: S[];
21
+ /** id of the pin whose popover is open */
22
+ active?: S["id"] | null;
23
+ }) & {
24
+ onAdd?: ((spot: S) => any) | undefined;
25
+ "onUpdate:modelValue"?: ((value: S[]) => any) | undefined;
26
+ onRemove?: ((spot: S) => any) | undefined;
27
+ "onUpdate:active"?: ((value: S["id"] | null) => any) | undefined;
28
+ }> & (typeof globalThis extends {
29
+ __VLS_PROPS_FALLBACK: infer P;
30
+ } ? P : {});
31
+ expose: (exposed: {}) => void;
32
+ attrs: any;
33
+ slots: {
34
+ default?: (props: {}) => any;
35
+ } & {
36
+ spot?: (props: {
37
+ spot: S;
38
+ index: number;
39
+ }) => any;
40
+ };
41
+ emit: (((evt: "add", spot: S) => void) & ((evt: "remove", spot: S) => void)) & (((event: "update:modelValue", value: S[]) => void) & ((event: "update:active", value: S["id"] | null) => void));
42
+ }>) => import('vue').VNode & {
43
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
44
+ };
45
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
46
+ [K in keyof T]: T[K];
47
+ } : {
48
+ [K in keyof T as K]: T[K];
49
+ }) & {};
@@ -0,0 +1,127 @@
1
+ import e from "./BlessPopover.js";
2
+ import { Fragment as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, mergeModels as c, normalizeClass as l, normalizeStyle as u, openBlock as d, ref as f, renderList as p, renderSlot as m, toDisplayString as h, useModel as g, withCtx as _ } from "vue";
3
+ //#region src/components/BlessHotspots.vue?vue&type=script&setup=true&lang.ts
4
+ var v = ["src", "alt"], y = [
5
+ "aria-label",
6
+ "aria-keyshortcuts",
7
+ "onPointerdown",
8
+ "onKeydown"
9
+ ], b = /*@__PURE__*/ s({
10
+ name: "BlessHotspots",
11
+ __name: "BlessHotspots",
12
+ props: /*@__PURE__*/ c({
13
+ src: {},
14
+ alt: { default: "" },
15
+ editable: { type: Boolean },
16
+ placement: { default: "top" }
17
+ }, {
18
+ modelValue: { default: () => [] },
19
+ modelModifiers: {},
20
+ active: { default: null },
21
+ activeModifiers: {}
22
+ }),
23
+ emits: /*@__PURE__*/ c(["add", "remove"], ["update:modelValue", "update:active"]),
24
+ setup(s, { emit: c }) {
25
+ let b = s, x = g(s, "modelValue"), S = g(s, "active"), C = c, w = f(), T = (e) => Math.min(100, Math.max(0, e)), E = (e) => {
26
+ let t = w.value.getBoundingClientRect();
27
+ return {
28
+ x: T((e.clientX - t.left) / t.width * 100),
29
+ y: T((e.clientY - t.top) / t.height * 100)
30
+ };
31
+ }, D = (e, t) => {
32
+ let n = x.value.slice();
33
+ n[e] = {
34
+ ...n[e],
35
+ ...t
36
+ }, x.value = n;
37
+ }, O = 0;
38
+ function k(e) {
39
+ if (!b.editable || e.target.closest(".bless-hotspots__spot")) return;
40
+ let t = {
41
+ id: `spot-${Date.now()}-${O++}`,
42
+ ...E(e),
43
+ label: `Spot ${x.value.length + 1}`
44
+ };
45
+ x.value = [...x.value, t], S.value = t.id, C("add", t);
46
+ }
47
+ let A = null, j = !1;
48
+ function M(e, t) {
49
+ b.editable && !t.button && (t.currentTarget.setPointerCapture?.(t.pointerId), A = {
50
+ i: e,
51
+ x: t.clientX,
52
+ y: t.clientY,
53
+ moved: !1
54
+ });
55
+ }
56
+ function N(e) {
57
+ A && (!A.moved && Math.hypot(e.clientX - A.x, e.clientY - A.y) < 4 || (A.moved = !0, D(A.i, E(e))));
58
+ }
59
+ function P() {
60
+ j = !!A?.moved, A = null;
61
+ }
62
+ function F(e) {
63
+ j && (j = !1, e.stopPropagation());
64
+ }
65
+ function I(e, t) {
66
+ if (!b.editable) return;
67
+ let n = t.shiftKey ? 5 : 1, r = {
68
+ ArrowLeft: [-n, 0],
69
+ ArrowRight: [n, 0],
70
+ ArrowUp: [0, -n],
71
+ ArrowDown: [0, n]
72
+ }, i = x.value[e];
73
+ r[t.key] ? (t.preventDefault(), D(e, {
74
+ x: T(i.x + r[t.key][0]),
75
+ y: T(i.y + r[t.key][1])
76
+ })) : (t.key === "Delete" || t.key === "Backspace") && (t.preventDefault(), x.value = x.value.filter((t, n) => n !== e), S.value === i.id && (S.value = null), C("remove", i));
77
+ }
78
+ return (c, f) => (d(), r("div", {
79
+ ref_key: "stage",
80
+ ref: w,
81
+ class: l(["bless-hotspots", { "bless-hotspots--edit": s.editable }]),
82
+ onClick: k
83
+ }, [m(c.$slots, "default", {}, () => [s.src ? (d(), r("img", {
84
+ key: 0,
85
+ src: s.src,
86
+ alt: s.alt,
87
+ class: "bless-hotspots__img",
88
+ draggable: "false"
89
+ }, null, 8, v)) : n("", !0)]), (d(!0), r(t, null, p(x.value, (t, n) => (d(), r("span", {
90
+ key: t.id,
91
+ class: "bless-hotspots__spot",
92
+ style: u({
93
+ left: `${t.x}%`,
94
+ top: `${t.y}%`
95
+ }),
96
+ onClickCapture: F
97
+ }, [o(e, {
98
+ arrow: "",
99
+ placement: s.placement,
100
+ open: S.value === t.id,
101
+ "onUpdate:open": (e) => S.value = e ? t.id : S.value === t.id ? null : S.value
102
+ }, {
103
+ trigger: _(() => [i("button", {
104
+ type: "button",
105
+ class: l(["bless-hotspots__pin", { "bless-hotspots__pin--on": S.value === t.id }]),
106
+ "aria-label": t.label,
107
+ "aria-keyshortcuts": s.editable ? "Delete" : void 0,
108
+ onPointerdown: (e) => M(n, e),
109
+ onPointermove: N,
110
+ onPointerup: P,
111
+ onPointercancel: P,
112
+ onKeydown: (e) => I(n, e)
113
+ }, h(n + 1), 43, y)]),
114
+ default: _(() => [m(c.$slots, "spot", {
115
+ spot: t,
116
+ index: n
117
+ }, () => [a(h(t.label), 1)])]),
118
+ _: 2
119
+ }, 1032, [
120
+ "placement",
121
+ "open",
122
+ "onUpdate:open"
123
+ ])], 36))), 128))], 2));
124
+ }
125
+ });
126
+ //#endregion
127
+ export { b as default };
@@ -0,0 +1 @@
1
+ .bless-canvas{box-sizing:border-box;background:var(--bless-color-surface);border:var(--bless-border-width) solid var(--bless-color-border);cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;width:100%;min-height:240px;font-family:var(--bless-font-sans);font-size:var(--bless-text-sm);color:var(--bless-color-text);position:relative;overflow:hidden}.bless-canvas--grid{background-image:radial-gradient(circle, color-mix(in srgb, var(--bless-color-text-muted) 45%, transparent) 1px, transparent 1.5px)}.bless-canvas--pan{cursor:grabbing}.bless-canvas:focus-visible{outline:2px solid var(--bless-color-accent);outline-offset:2px}.bless-canvas__layer{transform-origin:0 0;width:0;height:0;position:absolute;top:0;left:0}.bless-canvas__controls{gap:var(--bless-space-1);cursor:default;display:flex;position:absolute;inset-block-end:var(--bless-space-2);inset-inline-end:var(--bless-space-2)}.bless-canvas__live{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}
@@ -0,0 +1,6 @@
1
+ import "./BlessInfiniteCanvas.css";
2
+ import e, { blessCanvasKey as t } from "./BlessInfiniteCanvas.vue_vue_type_script_setup_true_lang.js";
3
+ //#region src/components/BlessInfiniteCanvas.vue
4
+ var n = e;
5
+ //#endregion
6
+ export { t as blessCanvasKey, n as default };
@@ -0,0 +1,91 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { CanvasView } from '../composables/canvasView';
3
+ export type { CanvasView } from '../composables/canvasView';
4
+ /** what a canvas hands to the things placed on it */
5
+ export interface BlessCanvasContext {
6
+ view: Ref<CanvasView>;
7
+ /** a pointer position in the page -> a point in the canvas' own (world) coordinates */
8
+ toWorld: (clientX: number, clientY: number) => {
9
+ x: number;
10
+ y: number;
11
+ };
12
+ }
13
+ export declare const blessCanvasKey: InjectionKey<BlessCanvasContext>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
17
+ minZoom?: number;
18
+ maxZoom?: number;
19
+ /** draw a dot grid that moves and scales with the view */
20
+ grid?: boolean;
21
+ /** the + / − / fit buttons in the corner */
22
+ controls?: boolean;
23
+ /** turn the plain mouse wheel into zoom (otherwise it pans, and Ctrl+wheel or a pinch zooms) */
24
+ wheelZoom?: boolean;
25
+ label?: string;
26
+ labels?: Partial<{
27
+ zoomIn: string;
28
+ zoomOut: string;
29
+ reset: string;
30
+ zoom: (percent: number) => string;
31
+ hint: string;
32
+ }>;
33
+ } & {
34
+ view?: CanvasView;
35
+ }, {
36
+ zoomBy: (factor: number, at?: {
37
+ x: number;
38
+ y: number;
39
+ }) => void;
40
+ reset: () => void;
41
+ fit: (rect: {
42
+ x: number;
43
+ y: number;
44
+ width: number;
45
+ height: number;
46
+ }, pad?: number) => void;
47
+ centerOn: (x: number, y: number) => void;
48
+ toWorld: (cx: number, cy: number) => {
49
+ x: number;
50
+ y: number;
51
+ };
52
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
53
+ "update:view": (value: CanvasView) => any;
54
+ }, string, import('vue').PublicProps, Readonly<{
55
+ minZoom?: number;
56
+ maxZoom?: number;
57
+ /** draw a dot grid that moves and scales with the view */
58
+ grid?: boolean;
59
+ /** the + / − / fit buttons in the corner */
60
+ controls?: boolean;
61
+ /** turn the plain mouse wheel into zoom (otherwise it pans, and Ctrl+wheel or a pinch zooms) */
62
+ wheelZoom?: boolean;
63
+ label?: string;
64
+ labels?: Partial<{
65
+ zoomIn: string;
66
+ zoomOut: string;
67
+ reset: string;
68
+ zoom: (percent: number) => string;
69
+ hint: string;
70
+ }>;
71
+ } & {
72
+ view?: CanvasView;
73
+ }> & Readonly<{
74
+ "onUpdate:view"?: ((value: CanvasView) => any) | undefined;
75
+ }>, {
76
+ label: string;
77
+ grid: boolean;
78
+ controls: boolean;
79
+ minZoom: number;
80
+ maxZoom: number;
81
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
82
+ default?: (props: {
83
+ view: CanvasView;
84
+ zoom: number;
85
+ }) => any;
86
+ }>;
87
+ type __VLS_WithSlots<T, S> = T & {
88
+ new (): {
89
+ $slots: S;
90
+ };
91
+ };