@leaflink/stash 42.4.3 → 42.5.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.
@@ -5,6 +5,7 @@ import { DateRangeSource } from 'v-calendar/dist/types/src/utils/date/range';
5
5
  import { DateRangeSource as DateRangeSource_2 } from 'v-calendar/dist/types/src/utils/date/range.js';
6
6
  import { DefineComponent } from 'vue';
7
7
  import { ExtractPropTypes } from 'vue';
8
+ import { PopoverOptions } from 'v-calendar/dist/types/src/utils/popovers';
8
9
  import { PropType } from 'vue';
9
10
  import { VNodeProps } from 'vue';
10
11
 
@@ -35,6 +36,10 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
35
36
  };
36
37
  };
37
38
 
39
+ declare interface DatePickerPopoverOptions extends Partial<PopoverOptions> {
40
+ positionFixed?: boolean;
41
+ }
42
+
38
43
  declare interface DatePickerProps {
39
44
  /**
40
45
  * Dates or date range objects that are available for selection or navigation.
@@ -52,6 +57,12 @@ declare interface DatePickerProps {
52
57
  * @see: https://vcalendar.io/api/v2.0/calendar.html#disabled-dates
53
58
  */
54
59
  disabledDates?: DateRangeSource[];
60
+ /**
61
+ * Adds default modifiers to make the calendar popover teleport; useful in preventing the calendar
62
+ * popover from getting hidden behind its containing element.
63
+ * Although we are not using vue teleport, this name is to future-proof the prop name for when the vCalendar is updated to use teleport internally.
64
+ */
65
+ enableTeleport?: boolean;
55
66
  /**
56
67
  * Error text to display. Replaces `hintText` (if provided) & adds error styling.
57
68
  */
@@ -124,6 +135,11 @@ declare interface DatePickerProps {
124
135
  * `placeholder' property for datepicker input
125
136
  */
126
137
  placeholder?: string;
138
+ /**
139
+ * Popover configuration; v-calendar uses Popover internally.
140
+ * @see https://v2--vcalendar.netlify.app/api/v2.0/datepicker.html#popover
141
+ */
142
+ popoverOptions?: DatePickerPopoverOptions;
127
143
  /**
128
144
  * `timezone` TZ DB time zone property
129
145
  * @see https://vcalendar.io/i18n/timezones.html
@@ -155,6 +171,7 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
155
171
  modelValue: string;
156
172
  name: string;
157
173
  placeholder: undefined;
174
+ enableTeleport: boolean;
158
175
  timeZone: string;
159
176
  }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
160
177
  "update:model-value": (date: string | number | Date) => void;
@@ -179,6 +196,7 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
179
196
  modelValue: string;
180
197
  name: string;
181
198
  placeholder: undefined;
199
+ enableTeleport: boolean;
182
200
  timeZone: string;
183
201
  }>>> & {
184
202
  onBlur?: (() => any) | undefined;
@@ -193,6 +211,7 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
193
211
  errorText: string;
194
212
  hintText: string;
195
213
  modelValue: string;
214
+ enableTeleport: boolean;
196
215
  mode: "time" | "date" | "dateTime";
197
216
  timeZone: string;
198
217
  format: string;
package/dist/Metric.js CHANGED
@@ -1,60 +1,60 @@
1
- import { defineComponent as b, useSlots as v, useCssModule as w, computed as r, openBlock as d, createElementBlock as i, normalizeClass as c, unref as t, createElementVNode as u, toDisplayString as m, renderSlot as y, createCommentVNode as x } from "vue";
2
- import { u as S } from "./uniqueId-847efe53.js";
3
- import { _ as h } from "./_plugin-vue_export-helper-dad06003.js";
1
+ import { defineComponent as p, useSlots as v, computed as n, openBlock as o, createElementBlock as i, normalizeClass as r, unref as a, createElementVNode as m, toDisplayString as u, renderSlot as _, createCommentVNode as b } from "vue";
2
+ import { u as f } from "./uniqueId-847efe53.js";
4
3
  import "./toString-7d5bf363.js";
5
4
  import "./isObjectLike-54341556.js";
6
- var s = /* @__PURE__ */ ((e) => (e.Small = "small", e.Standard = "standard", e))(s || {}), _ = /* @__PURE__ */ ((e) => (e.Accent = "accent", e.Naked = "naked", e))(_ || {});
7
- const z = ["id"], k = ["aria-labelledby"], C = /* @__PURE__ */ b({
5
+ var s = /* @__PURE__ */ ((t) => (t.Small = "small", t.Standard = "standard", t))(s || {}), l = /* @__PURE__ */ ((t) => (t.Accent = "accent", t.Naked = "naked", t))(l || {});
6
+ const x = ["id"], S = ["aria-labelledby"], k = {
7
+ key: 0,
8
+ class: "stash-metric__secondary tw-text-ice-700 tw-text-xs tw-mt-1",
9
+ "data-test": "stash-metric|secondary"
10
+ }, $ = /* @__PURE__ */ p({
8
11
  __name: "Metric",
9
12
  props: {
10
- value: { default: "" },
13
+ value: {},
11
14
  label: {},
12
- size: { default: "standard" },
13
15
  variant: { default: "naked" },
14
- accentColor: { default: "teal" }
16
+ accentColor: { default: "teal" },
17
+ size: { default: "standard" }
15
18
  },
16
- setup(e) {
17
- const a = e, p = v(), l = w(), o = r(() => S("metric-")), f = r(() => String(a.value));
18
- return (n, B) => (d(), i("div", {
19
- class: c(["stash-metric", [
20
- `size--${a.size}`,
19
+ setup(t) {
20
+ const e = t, w = v(), d = n(() => f("metric-")), h = n(() => String(e.value));
21
+ return (c, y) => (o(), i("div", {
22
+ class: r(["stash-metric", [
23
+ `stash-metric--${e.size}`,
21
24
  {
22
- [`${t(l).accent} stash-metric--accent tw-p-3 tw-shadow tw-rounded tw-border-l-12 tw-border-${n.accentColor}`]: a.variant === t(_).Accent
25
+ "stash-metric--naked": e.variant === a(l).Naked,
26
+ [`stash-metric--accent tw-bg-white tw-p-3 tw-shadow tw-rounded tw-border-l-12 tw-border-${c.accentColor}`]: e.variant === a(l).Accent
23
27
  }
24
28
  ]]),
25
29
  "data-test": "stash-metric"
26
30
  }, [
27
- u("div", {
28
- id: o.value,
29
- class: c(["tw-text-ice-700", [
30
- t(l).label,
31
- { "tw-text-xs": a.size === t(s).Small },
32
- { "tw-text-sm": a.size === t(s).Standard }
33
- ]])
34
- }, m(a.label), 11, z),
35
- u("div", {
36
- "aria-labelledby": o.value,
37
- class: c(["tw-text-ice-900 tw-font-medium", [{ "tw-text-base": a.size === t(s).Small }, { "tw-text-2xl": a.size === t(s).Standard }]])
38
- }, m(f.value), 11, k),
39
- t(p).secondary ? (d(), i("div", {
40
- key: 0,
41
- class: c(["text-ice-700 text-xs", t(l).secondary]),
42
- "data-test": "secondary"
43
- }, [
44
- y(n.$slots, "secondary")
45
- ], 2)) : x("", !0)
31
+ m("div", {
32
+ id: d.value,
33
+ class: r(["stash-metric__label tw-text-ice-700 tw-mb-1", [
34
+ {
35
+ "tw-text-xs": e.size === a(s).Small,
36
+ "tw-text-sm": e.size === a(s).Standard
37
+ }
38
+ ]]),
39
+ "data-test": "stash-metric|label"
40
+ }, u(e.label), 11, x),
41
+ m("div", {
42
+ "aria-labelledby": d.value,
43
+ class: r(["stash-metric__value tw-text-ice-900 tw-font-medium", {
44
+ "tw-text-base": e.size === a(s).Small,
45
+ "tw-text-2xl": e.size === a(s).Standard
46
+ }]),
47
+ "data-test": "stash-metric|value"
48
+ }, u(h.value), 11, S),
49
+ a(w).secondary ? (o(), i("div", k, [
50
+ _(c.$slots, "secondary")
51
+ ])) : b("", !0)
46
52
  ], 2));
47
53
  }
48
- }), M = "_label_8e515_2", $ = "_secondary_8e515_6", N = "_accent_8e515_11", g = {
49
- label: M,
50
- secondary: $,
51
- accent: N
52
- }, A = {
53
- $style: g
54
- }, j = /* @__PURE__ */ h(C, [["__cssModules", A]]);
54
+ });
55
55
  export {
56
- s as Sizes,
57
- _ as Variants,
58
- j as default
56
+ s as MetricSizes,
57
+ l as MetricVariants,
58
+ $ as default
59
59
  };
60
60
  //# sourceMappingURL=Metric.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Metric.js","sources":["../src/components/Metric/Metric.types.ts","../src/components/Metric/Metric.vue"],"sourcesContent":["export enum Sizes {\n Small = 'small',\n Standard = 'standard',\n}\n\nexport type Size = `${Sizes}`;\n\nexport enum Variants {\n Accent = 'accent',\n Naked = 'naked',\n}\n\nexport type Variant = `${Variants}`;\n","<script lang=\"ts\">\n export * from './Metric.types';\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, ComputedRef, useCssModule, useSlots } from 'vue';\n\n import { StashColor } from '../../../types/colors';\n import { Size, Sizes, Variant, Variants } from './Metric.types';\n\n export interface MetricProps {\n value: number | string;\n label: string;\n size?: Size;\n variant?: Variant;\n /**\n * Currently only used when the variant is `accent`\n */\n accentColor?: StashColor;\n }\n\n const props = withDefaults(defineProps<MetricProps>(), {\n size: 'standard',\n value: '',\n variant: 'naked',\n accentColor: 'teal',\n });\n\n const slots = useSlots();\n const classes = useCssModule();\n\n const fieldId = computed(() => uniqueId('metric-'));\n\n const computedValue: ComputedRef<string> = computed(() => String(props.value));\n</script>\n\n<template>\n <div\n class=\"stash-metric\"\n data-test=\"stash-metric\"\n :class=\"[\n `size--${props.size}`,\n {\n [`${classes.accent} stash-metric--accent tw-p-3 tw-shadow tw-rounded tw-border-l-12 tw-border-${accentColor}`]:\n props.variant === Variants.Accent,\n },\n ]\"\n >\n <div\n :id=\"fieldId\"\n class=\"tw-text-ice-700\"\n :class=\"[\n classes.label,\n { 'tw-text-xs': props.size === Sizes.Small },\n { 'tw-text-sm': props.size === Sizes.Standard },\n ]\"\n >\n {{ props.label }}\n </div>\n\n <div\n :aria-labelledby=\"fieldId\"\n class=\"tw-text-ice-900 tw-font-medium\"\n :class=\"[{ 'tw-text-base': props.size === Sizes.Small }, { 'tw-text-2xl': props.size === Sizes.Standard }]\"\n >\n {{ computedValue }}\n </div>\n\n <div v-if=\"slots.secondary\" class=\"text-ice-700 text-xs\" :class=\"classes.secondary\" data-test=\"secondary\">\n <slot name=\"secondary\"></slot>\n </div>\n </div>\n</template>\n\n<style module>\n .label {\n margin-bottom: 0.25rem; /* 4px */\n }\n\n .secondary {\n margin-top: 0.25rem; /* 4px */\n }\n\n /* bg-white also sets the border color, which causes conflicts in the payments app */\n .accent {\n background-color: white;\n }\n</style>\n"],"names":["Sizes","Variants","slots","useSlots","classes","useCssModule","fieldId","computed","uniqueId","computedValue","props"],"mappings":";;;;;AAAY,IAAAA,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,WAAW,YAFDA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;iBCsBJC,IAAQC,KACRC,IAAUC,KAEVC,IAAUC,EAAS,MAAMC,EAAS,SAAS,CAAC,GAE5CC,IAAqCF,EAAS,MAAM,OAAOG,EAAM,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Metric.js","sources":["../src/components/Metric/Metric.types.ts","../src/components/Metric/Metric.vue"],"sourcesContent":["export enum MetricSizes {\n Small = 'small',\n Standard = 'standard',\n}\n\nexport type MetricSize = `${MetricSizes}`;\n\nexport enum MetricVariants {\n Accent = 'accent',\n Naked = 'naked',\n}\n\nexport type MetricVariant = `${MetricVariants}`;\n","<script lang=\"ts\">\n export * from './Metric.types';\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, ComputedRef, useSlots } from 'vue';\n\n import { StashColor } from '../../../types/colors';\n import { MetricSize, MetricSizes, MetricVariant, MetricVariants } from './Metric.types';\n\n export interface MetricProps {\n /**\n * The primary text that will show in the metric.\n */\n value: number | string;\n\n /**\n * The label for the metric. Appears above the value.\n */\n label: string;\n\n /**\n * The variant of the metric. Defaults to `naked`.\n */\n variant?: MetricVariant;\n\n /**\n * The accent color for the metric. Defaults to `teal`. Currently only used when the variant = `accent`.\n */\n accentColor?: StashColor;\n\n /**\n * Controls the size of the metric via text size adjustments.\n */\n size?: MetricSize;\n }\n\n const props = withDefaults(defineProps<MetricProps>(), {\n size: 'standard',\n variant: 'naked',\n accentColor: 'teal',\n });\n\n const slots = useSlots();\n\n const fieldId = computed(() => uniqueId('metric-'));\n\n const computedValue: ComputedRef<string> = computed(() => String(props.value));\n</script>\n\n<template>\n <div\n class=\"stash-metric\"\n data-test=\"stash-metric\"\n :class=\"[\n `stash-metric--${props.size}`,\n {\n 'stash-metric--naked': props.variant === MetricVariants.Naked,\n [`stash-metric--accent tw-bg-white tw-p-3 tw-shadow tw-rounded tw-border-l-12 tw-border-${accentColor}`]:\n props.variant === MetricVariants.Accent,\n },\n ]\"\n >\n <div\n :id=\"fieldId\"\n class=\"stash-metric__label tw-text-ice-700 tw-mb-1\"\n data-test=\"stash-metric|label\"\n :class=\"[\n {\n 'tw-text-xs': props.size === MetricSizes.Small,\n 'tw-text-sm': props.size === MetricSizes.Standard,\n },\n ]\"\n >\n {{ props.label }}\n </div>\n\n <div\n :aria-labelledby=\"fieldId\"\n class=\"stash-metric__value tw-text-ice-900 tw-font-medium\"\n data-test=\"stash-metric|value\"\n :class=\"{\n 'tw-text-base': props.size === MetricSizes.Small,\n 'tw-text-2xl': props.size === MetricSizes.Standard,\n }\"\n >\n {{ computedValue }}\n </div>\n\n <div\n v-if=\"slots.secondary\"\n class=\"stash-metric__secondary tw-text-ice-700 tw-text-xs tw-mt-1\"\n data-test=\"stash-metric|secondary\"\n >\n <!-- @slot Supplementary information like a date, status, hint text, or secondary label. -->\n <slot name=\"secondary\"></slot>\n </div>\n </div>\n</template>\n"],"names":["MetricSizes","MetricVariants","slots","useSlots","fieldId","computed","uniqueId","computedValue","props"],"mappings":";;;;AAAY,IAAAA,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,WAAW,YAFDA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;iBCqCJC,IAAQC,KAERC,IAAUC,EAAS,MAAMC,EAAS,SAAS,CAAC,GAE5CC,IAAqCF,EAAS,MAAM,OAAOG,EAAM,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -35,17 +35,14 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
35
35
 
36
36
  declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MetricProps>, {
37
37
  size: string;
38
- value: string;
39
38
  variant: string;
40
39
  accentColor: string;
41
40
  }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MetricProps>, {
42
41
  size: string;
43
- value: string;
44
42
  variant: string;
45
43
  accentColor: string;
46
44
  }>>>, {
47
45
  size: "small" | "standard";
48
- value: string | number;
49
46
  variant: "accent" | "naked";
50
47
  accentColor: "blue" | "red" | "ice-700" | "green" | "royal" | "purple" | "ice" | "orange" | "seafoam" | "teal" | "yellow" | "purple-900" | "purple-800" | "purple-700" | "purple-600" | "purple-500" | "purple-400" | "purple-300" | "purple-200" | "purple-100" | "royal-900" | "royal-800" | "royal-700" | "royal-600" | "royal-500" | "royal-400" | "royal-300" | "royal-200" | "royal-100" | "blue-900" | "blue-800" | "blue-700" | "blue-600" | "blue-500" | "blue-400" | "blue-300" | "blue-200" | "blue-100" | "teal-900" | "teal-800" | "teal-700" | "teal-600" | "teal-500" | "teal-400" | "teal-300" | "teal-200" | "teal-100" | "green-900" | "green-800" | "green-700" | "green-600" | "green-500" | "green-400" | "green-300" | "green-200" | "green-100" | "seafoam-900" | "seafoam-800" | "seafoam-700" | "seafoam-600" | "seafoam-500" | "seafoam-400" | "seafoam-300" | "seafoam-200" | "seafoam-100" | "yellow-900" | "yellow-800" | "yellow-700" | "yellow-600" | "yellow-500" | "yellow-400" | "yellow-300" | "yellow-200" | "yellow-100" | "orange-900" | "orange-800" | "orange-700" | "orange-600" | "orange-500" | "orange-400" | "orange-300" | "orange-200" | "orange-100" | "red-900" | "red-800" | "red-700" | "red-600" | "red-500" | "red-400" | "red-300" | "red-200" | "red-100" | "ice-900" | "ice-800" | "ice-600" | "ice-500" | "ice-400" | "ice-300" | "ice-200" | "ice-100" | "white" | "black";
51
48
  }, {}>, {
@@ -54,23 +51,42 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
54
51
  export default _default;
55
52
 
56
53
  export declare interface MetricProps {
54
+ /**
55
+ * The primary text that will show in the metric.
56
+ */
57
57
  value: number | string;
58
+ /**
59
+ * The label for the metric. Appears above the value.
60
+ */
58
61
  label: string;
59
- size?: Size;
60
- variant?: Variant;
61
62
  /**
62
- * Currently only used when the variant is `accent`
63
+ * The variant of the metric. Defaults to `naked`.
64
+ */
65
+ variant?: MetricVariant;
66
+ /**
67
+ * The accent color for the metric. Defaults to `teal`. Currently only used when the variant = `accent`.
63
68
  */
64
69
  accentColor?: StashColor;
70
+ /**
71
+ * Controls the size of the metric via text size adjustments.
72
+ */
73
+ size?: MetricSize;
65
74
  }
66
75
 
67
- export declare type Size = `${Sizes}`;
76
+ export declare type MetricSize = `${MetricSizes}`;
68
77
 
69
- export declare enum Sizes {
78
+ export declare enum MetricSizes {
70
79
  Small = "small",
71
80
  Standard = "standard"
72
81
  }
73
82
 
83
+ export declare type MetricVariant = `${MetricVariants}`;
84
+
85
+ export declare enum MetricVariants {
86
+ Accent = "accent",
87
+ Naked = "naked"
88
+ }
89
+
74
90
  declare type StashColor = `${StashColors}`;
75
91
 
76
92
  declare enum StashColors {
@@ -178,11 +194,4 @@ declare enum StashColors {
178
194
  Black = "black"
179
195
  }
180
196
 
181
- export declare type Variant = `${Variants}`;
182
-
183
- export declare enum Variants {
184
- Accent = "accent",
185
- Naked = "naked"
186
- }
187
-
188
197
  export { }