@leaflink/stash 46.0.0 → 46.2.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.
package/dist/Module.js CHANGED
@@ -1,13 +1,13 @@
1
- import { defineComponent as i, onMounted as l, provide as s, computed as d, openBlock as p, createBlock as u, normalizeClass as b, unref as t, withCtx as m, renderSlot as c } from "vue";
1
+ import { defineComponent as i, onMounted as l, provide as s, computed as d, openBlock as p, createBlock as b, normalizeClass as u, unref as e, withCtx as m, renderSlot as c } from "vue";
2
2
  import o from "@leaflink/snitch";
3
3
  import { M as w } from "./Module.keys-2cc7d830.js";
4
4
  import { _ as v } from "./Box.vue_vue_type_script_setup_true_lang-69e5176b.js";
5
- import { M as e } from "./Module.types-3f78f2a0.js";
5
+ import { M as t } from "./Module.types-3f78f2a0.js";
6
6
  const y = /* @__PURE__ */ i({
7
7
  name: "ll-module",
8
8
  __name: "Module",
9
9
  props: {
10
- variant: { default: e.Box },
10
+ variant: { default: "box" },
11
11
  disablePadding: { type: Boolean },
12
12
  disableGutters: { type: Boolean },
13
13
  disableElevation: { type: Boolean },
@@ -17,16 +17,16 @@ const y = /* @__PURE__ */ i({
17
17
  const a = r;
18
18
  return l(() => {
19
19
  a.variant === "card" && o.warn('Card Modules are no longer a thing. You\'re probably looking for `<RadioGroup variant="card">`.'), a.variant === "list" && o.warn("Only used with deprecated ListView component. Use `table` variant with `Table` component instead.");
20
- }), s(w.key, { variant: d(() => a.variant) }), (n, f) => (p(), u(v, {
21
- class: b(["stash-module tw-flex tw-flex-col", {
22
- "tw-bg-transparent tw-shadow-none lg:tw-shadow": a.variant === t(e).Table,
23
- "tw-border tw-border-ice-500": a.variant === t(e).Card,
24
- "tw-mb-6 tw-bg-transparent tw-shadow-none lg:tw-shadow": a.variant === t(e).List
20
+ }), s(w.key, { variant: d(() => a.variant) }), (n, f) => (p(), b(v, {
21
+ class: u(["stash-module tw-flex tw-flex-col", {
22
+ "tw-bg-transparent tw-shadow-none lg:tw-shadow": a.variant === e(t).Table,
23
+ "tw-border tw-border-ice-500": a.variant === e(t).Card,
24
+ "tw-mb-6 tw-bg-transparent tw-shadow-none lg:tw-shadow": a.variant === e(t).List
25
25
  }]),
26
26
  "data-test": "stash-module",
27
27
  "disable-gutters": a.disableGutters,
28
28
  "disable-padding": a.disablePadding || ["card", "list", "table"].includes(a.variant),
29
- "disable-elevation": a.disableElevation || a.variant === t(e).Table || a.variant === t(e).Card || a.variant === t(e).List
29
+ "disable-elevation": a.disableElevation || a.variant === e(t).Table || a.variant === e(t).Card || a.variant === e(t).List
30
30
  }, {
31
31
  default: m(() => [
32
32
  c(n.$slots, "default")
@@ -37,7 +37,7 @@ const y = /* @__PURE__ */ i({
37
37
  });
38
38
  export {
39
39
  w as MODULE_INJECTION,
40
- e as ModuleVariant,
40
+ t as ModuleVariant,
41
41
  y as default
42
42
  };
43
43
  //# sourceMappingURL=Module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Module.js","sources":["../src/components/Module/Module.vue"],"sourcesContent":["<script lang=\"ts\">\n import Box, { type BoxProps } from '../Box/Box.vue';\n import { ModuleVariant, type ModuleVariants } from './Module.types';\n\n export * from './Module.keys';\n export * from './Module.types';\n\n export interface ModuleProps extends BoxProps {\n /**\n * Variant applied.\n *\n * Options: `box`, `card`, `list`.\n */\n variant?: ModuleVariants;\n }\n</script>\n\n<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import { computed, onMounted, provide } from 'vue';\n\n import { MODULE_INJECTION } from './Module.keys';\n\n defineOptions({\n name: 'll-module',\n });\n\n const props = withDefaults(defineProps<ModuleProps>(), {\n variant: ModuleVariant.Box,\n });\n\n onMounted(() => {\n if (props.variant === 'card') {\n logger.warn('Card Modules are no longer a thing. You\\'re probably looking for `<RadioGroup variant=\"card\">`.');\n }\n\n if (props.variant === 'list') {\n logger.warn('Only used with deprecated ListView component. Use `table` variant with `Table` component instead.');\n }\n });\n\n provide(MODULE_INJECTION.key, { variant: computed(() => props.variant) });\n</script>\n\n<template>\n <Box\n class=\"stash-module tw-flex tw-flex-col\"\n data-test=\"stash-module\"\n :class=\"{\n 'tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.Table,\n 'tw-border tw-border-ice-500': props.variant === ModuleVariant.Card,\n 'tw-mb-6 tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.List,\n }\"\n :disable-gutters=\"props.disableGutters\"\n :disable-padding=\"props.disablePadding || ['card', 'list', 'table'].includes(props.variant)\"\n :disable-elevation=\"\n props.disableElevation ||\n props.variant === ModuleVariant.Table ||\n props.variant === ModuleVariant.Card ||\n props.variant === ModuleVariant.List\n \"\n >\n <slot></slot>\n </Box>\n</template>\n"],"names":["onMounted","props","logger","provide","MODULE_INJECTION","computed"],"mappings":";;;;;;;;;;;;;;;;;AA+BE,WAAAA,EAAU,MAAM;AACV,MAAAC,EAAM,YAAY,UACpBC,EAAO,KAAK,iGAAiG,GAG3GD,EAAM,YAAY,UACpBC,EAAO,KAAK,mGAAmG;AAAA,IACjH,CACD,GAEOC,EAAAC,EAAiB,KAAK,EAAE,SAASC,EAAS,MAAMJ,EAAM,OAAO,EAAA,CAAG;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Module.js","sources":["../src/components/Module/Module.vue"],"sourcesContent":["<script lang=\"ts\">\n import Box, { type BoxProps } from '../Box/Box.vue';\n import { ModuleVariant, type ModuleVariants } from './Module.types';\n\n export * from './Module.keys';\n export * from './Module.types';\n\n export interface ModuleProps extends BoxProps {\n /**\n * Variant applied.\n *\n * Options: `box`, `card`, `list`.\n */\n variant?: ModuleVariants;\n }\n</script>\n\n<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import { computed, onMounted, provide } from 'vue';\n\n import { MODULE_INJECTION } from './Module.keys';\n\n defineOptions({\n name: 'll-module',\n });\n\n const props = withDefaults(defineProps<ModuleProps>(), {\n variant: 'box',\n });\n\n onMounted(() => {\n if (props.variant === 'card') {\n logger.warn('Card Modules are no longer a thing. You\\'re probably looking for `<RadioGroup variant=\"card\">`.');\n }\n\n if (props.variant === 'list') {\n logger.warn('Only used with deprecated ListView component. Use `table` variant with `Table` component instead.');\n }\n });\n\n provide(MODULE_INJECTION.key, { variant: computed(() => props.variant) });\n</script>\n\n<template>\n <Box\n class=\"stash-module tw-flex tw-flex-col\"\n data-test=\"stash-module\"\n :class=\"{\n 'tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.Table,\n 'tw-border tw-border-ice-500': props.variant === ModuleVariant.Card,\n 'tw-mb-6 tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.List,\n }\"\n :disable-gutters=\"props.disableGutters\"\n :disable-padding=\"props.disablePadding || ['card', 'list', 'table'].includes(props.variant)\"\n :disable-elevation=\"\n props.disableElevation ||\n props.variant === ModuleVariant.Table ||\n props.variant === ModuleVariant.Card ||\n props.variant === ModuleVariant.List\n \"\n >\n <slot></slot>\n </Box>\n</template>\n"],"names":["onMounted","props","logger","provide","MODULE_INJECTION","computed"],"mappings":";;;;;;;;;;;;;;;;;AA+BE,WAAAA,EAAU,MAAM;AACV,MAAAC,EAAM,YAAY,UACpBC,EAAO,KAAK,iGAAiG,GAG3GD,EAAM,YAAY,UACpBC,EAAO,KAAK,mGAAmG;AAAA,IACjH,CACD,GAEOC,EAAAC,EAAiB,KAAK,EAAE,SAASC,EAAS,MAAMJ,EAAM,OAAO,EAAA,CAAG;;;;;;;;;;;;;;;;;;"}
@@ -55,9 +55,9 @@ declare interface BoxProps {
55
55
  }
56
56
 
57
57
  declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModuleProps>, {
58
- variant: ModuleVariant;
58
+ variant: string;
59
59
  }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModuleProps>, {
60
- variant: ModuleVariant;
60
+ variant: string;
61
61
  }>>>, {
62
62
  variant: "table" | "list" | "box" | "card";
63
63
  }, {}>, {
@@ -1,14 +1,14 @@
1
- import { defineComponent as v, useCssModule as g, useSlots as k, ref as y, onBeforeMount as x, inject as M, computed as w, openBlock as l, createElementBlock as r, normalizeClass as n, unref as a, createElementVNode as u, renderSlot as d, createCommentVNode as i, createBlock as B, resolveDynamicComponent as C, withCtx as V, createTextVNode as E, toDisplayString as h } from "vue";
2
- import { M as p } from "./Module.keys-2cc7d830.js";
3
- import { M as o } from "./Module.types-3f78f2a0.js";
4
- import { _ as N } from "./_plugin-vue_export-helper-dad06003.js";
5
- const T = { class: "tw-flex tw-items-center" }, $ = {
1
+ import { defineComponent as M, useCssModule as C, useSlots as S, ref as B, inject as $, computed as u, openBlock as l, createElementBlock as r, normalizeClass as n, unref as a, createElementVNode as i, renderSlot as o, createCommentVNode as c, createBlock as p, resolveDynamicComponent as _, withCtx as b, createTextVNode as V, toDisplayString as v } from "vue";
2
+ import { M as y } from "./Module.keys-2cc7d830.js";
3
+ import { M as m } from "./Module.types-3f78f2a0.js";
4
+ import { _ as E } from "./_plugin-vue_export-helper-dad06003.js";
5
+ const N = { class: "tw-flex tw-items-center" }, z = {
6
6
  class: "stash-module-header__content__text",
7
7
  "data-test": "stash-module-header|content-text"
8
- }, z = {
8
+ }, D = {
9
9
  key: 0,
10
10
  class: "tw-mb-0 tw-mt-3"
11
- }, L = /* @__PURE__ */ v({
11
+ }, O = /* @__PURE__ */ M({
12
12
  name: "ll-module-header",
13
13
  __name: "ModuleHeader",
14
14
  props: {
@@ -18,15 +18,12 @@ const T = { class: "tw-flex tw-items-center" }, $ = {
18
18
  preventActionsWrap: { type: Boolean, default: !1 },
19
19
  underline: { type: Boolean, default: !1 }
20
20
  },
21
- setup(f) {
22
- const t = f, _ = g(), c = k(), s = y();
23
- x(() => {
24
- const e = M(p.key, p.defaults);
25
- if (!e.variant)
26
- throw new Error("ModuleHeader must be used within a Module component.");
27
- s.value = e.variant.value;
28
- });
29
- const b = w(() => {
21
+ setup(g) {
22
+ const t = g, k = C(), s = S(), d = B(), w = $(y.key, y.defaults);
23
+ if (!w.variant)
24
+ throw new Error("<ModuleHeader> must be used within a <Module> component.");
25
+ d.value = w.variant.value;
26
+ const f = u(() => {
30
27
  let e;
31
28
  switch (t.size) {
32
29
  case "small":
@@ -43,68 +40,74 @@ const T = { class: "tw-flex tw-items-center" }, $ = {
43
40
  break;
44
41
  }
45
42
  return e;
46
- }), m = w(() => {
47
- const e = s.value === o.Box || s.value === o.Table || s.value === o.List;
43
+ }), x = u(() => s.default ? s.default().length === 1 && typeof s.default()[0].children == "string" && typeof s.default()[0].type == "symbol" : !1), h = u(() => {
44
+ const e = ["box", "table", "list"].includes(d.value);
48
45
  return e && !t.underline ? "tw-mb-3 lg:tw-mb-6" : e && t.underline ? "tw-mb-3" : "";
49
46
  });
50
- return (e, H) => (l(), r("header", {
47
+ return (e, I) => (l(), r("header", {
51
48
  class: n(["stash-module-header tw-flex tw-flex-wrap tw-justify-between", {
52
- "tw-rounded-t tw-border-b tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-px-6": s.value === a(o).Card,
53
- "tw-mb-6 tw-rounded tw-bg-white tw-px-3 tw-pt-3 tw-shadow lg:tw-mb-0 lg:tw-rounded-b-none lg:tw-px-6 lg:tw-pt-6 lg:tw-shadow-none": s.value === a(o).Table || s.value === a(o).List,
49
+ "tw-rounded-t tw-border-b tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-px-6": d.value === a(m).Card,
50
+ "tw-mb-6 tw-rounded tw-bg-white tw-px-3 tw-pt-3 tw-shadow lg:tw-mb-0 lg:tw-rounded-b-none lg:tw-px-6 lg:tw-pt-6 lg:tw-shadow-none": d.value === a(m).Table || d.value === a(m).List,
54
51
  "tw-mb-3 tw-border-b tw-border-ice-200 lg:tw-mb-6": t.underline
55
52
  }]),
56
53
  "data-test": "stash-module-header"
57
54
  }, [
58
- u("div", {
59
- class: n(["stash-module-header__content tw-mr-6", m.value]),
55
+ i("div", {
56
+ class: n(["stash-module-header__content tw-mr-6", h.value]),
60
57
  "data-test": "stash-module-header|content"
61
58
  }, [
62
- u("div", T, [
63
- a(c).media && t.size === "large" ? (l(), r("div", {
59
+ i("div", N, [
60
+ a(s).media && t.size === "large" ? (l(), r("div", {
64
61
  key: 0,
65
- class: n(["stash-module-header__content__media tw-mr-3", a(_).media]),
62
+ class: n(["stash-module-header__content__media tw-mr-3", a(k).media]),
66
63
  "data-test": "stash-module-header|content-media"
67
64
  }, [
68
- d(e.$slots, "media")
69
- ], 2)) : i("", !0),
70
- u("div", $, [
71
- d(e.$slots, "title", {}, () => [
72
- t.title ? (l(), B(C(b.value), {
73
- key: 0,
74
- class: "tw-my-0"
75
- }, {
76
- default: V(() => [
77
- E(h(t.title), 1)
65
+ o(e.$slots, "media")
66
+ ], 2)) : c("", !0),
67
+ i("div", z, [
68
+ a(s).title ? o(e.$slots, "title", { key: 0 }) : x.value ? (l(), p(_(f.value), {
69
+ key: 1,
70
+ class: "stash-module-header__default_slot_string tw-my-0",
71
+ "data-test": "stash-module-header|default-slot-text"
72
+ }, {
73
+ default: b(() => [
74
+ o(e.$slots, "default")
75
+ ]),
76
+ _: 3
77
+ })) : o(e.$slots, "default", { key: 2 }, () => [
78
+ (l(), p(_(f.value), { class: "tw-my-0" }, {
79
+ default: b(() => [
80
+ V(v(t.title), 1)
78
81
  ]),
79
82
  _: 1
80
- })) : i("", !0)
83
+ }))
81
84
  ]),
82
- d(e.$slots, "description", {}, () => [
83
- t.description ? (l(), r("p", z, h(t.description), 1)) : i("", !0)
85
+ o(e.$slots, "description", {}, () => [
86
+ t.description ? (l(), r("p", D, v(t.description), 1)) : c("", !0)
84
87
  ])
85
88
  ])
86
89
  ])
87
90
  ], 2),
88
- a(c).actions ? (l(), r("div", {
91
+ a(s).actions ? (l(), r("div", {
89
92
  key: 0,
90
93
  class: n(["stash-module-header__actions tw-self-center", [
91
- m.value,
94
+ h.value,
92
95
  {
93
96
  "tw-w-full lg:tw-w-auto": !t.preventActionsWrap
94
97
  }
95
98
  ]]),
96
99
  "data-test": "stash-module-header|actions"
97
100
  }, [
98
- d(e.$slots, "actions")
99
- ], 2)) : i("", !0)
101
+ o(e.$slots, "actions")
102
+ ], 2)) : c("", !0)
100
103
  ], 2));
101
104
  }
102
- }), O = "_media_ktx8r_3", j = {
103
- media: O
104
- }, D = {
105
+ }), T = "_media_ktx8r_3", j = {
106
+ media: T
107
+ }, H = {
105
108
  $style: j
106
- }, J = /* @__PURE__ */ N(L, [["__cssModules", D]]);
109
+ }, U = /* @__PURE__ */ E(O, [["__cssModules", H]]);
107
110
  export {
108
- J as default
111
+ U as default
109
112
  };
110
113
  //# sourceMappingURL=ModuleHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleHeader.js","sources":["../src/components/ModuleHeader/ModuleHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, onBeforeMount, ref, useCssModule, useSlots } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n defineOptions({\n name: 'll-module-header',\n });\n\n export interface ModuleHeaderProps {\n /**\n * Header title. Will get overridden by the `title` slot if provided.\n */\n title?: string;\n\n /**\n * Size of the header.\n *\n * - `small` = `h4`\n * - `medium` = `h3`\n * - `large` = `h2`\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Header description, aka subtitle. Will get overridden by the `description` slot if provided.\n */\n description?: string;\n\n /**\n * Stop the actions slot from force-wrapping on medium and smalls screens.\n */\n preventActionsWrap?: boolean;\n\n /**\n * Displays a border at the bottom\n */\n underline?: boolean;\n }\n\n const props = withDefaults(defineProps<ModuleHeaderProps>(), {\n title: '',\n size: 'medium',\n description: '',\n preventActionsWrap: false,\n underline: false,\n });\n const classes = useCssModule();\n const slots = useSlots();\n const moduleVariant = ref();\n\n onBeforeMount(() => {\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('ModuleHeader must be used within a Module component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n });\n\n const is = computed(() => {\n let component;\n\n switch (props.size) {\n case 'small':\n component = 'h4';\n break;\n\n case 'medium':\n component = 'h3';\n break;\n\n case 'large':\n component = 'h2';\n break;\n\n default:\n component = 'h3';\n break;\n }\n\n return component;\n });\n\n const marginBottomClasses = computed(() => {\n const isBoxOrTableOrList =\n moduleVariant.value === ModuleVariant.Box ||\n moduleVariant.value === ModuleVariant.Table ||\n moduleVariant.value === ModuleVariant.List;\n\n if (isBoxOrTableOrList && !props.underline) {\n return 'tw-mb-3 lg:tw-mb-6';\n } else if (isBoxOrTableOrList && props.underline) {\n return 'tw-mb-3';\n } else {\n return '';\n }\n });\n</script>\n\n<template>\n <header\n class=\"stash-module-header tw-flex tw-flex-wrap tw-justify-between\"\n :class=\"{\n 'tw-rounded-t tw-border-b tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-px-6':\n moduleVariant === ModuleVariant.Card,\n 'tw-mb-6 tw-rounded tw-bg-white tw-px-3 tw-pt-3 tw-shadow lg:tw-mb-0 lg:tw-rounded-b-none lg:tw-px-6 lg:tw-pt-6 lg:tw-shadow-none':\n moduleVariant === ModuleVariant.Table || moduleVariant === ModuleVariant.List,\n 'tw-mb-3 tw-border-b tw-border-ice-200 lg:tw-mb-6': props.underline,\n }\"\n data-test=\"stash-module-header\"\n >\n <div\n class=\"stash-module-header__content tw-mr-6\"\n :class=\"marginBottomClasses\"\n data-test=\"stash-module-header|content\"\n >\n <div class=\"tw-flex tw-items-center\">\n <div\n v-if=\"slots.media && props.size === 'large'\"\n class=\"stash-module-header__content__media tw-mr-3\"\n :class=\"classes.media\"\n data-test=\"stash-module-header|content-media\"\n >\n <slot name=\"media\"></slot>\n </div>\n\n <div class=\"stash-module-header__content__text\" data-test=\"stash-module-header|content-text\">\n <!--\n @slot Header title\n @type String\n @default HTML header element with the `title` prop as the text.\n TODO: this doesn't work...\n -->\n <slot name=\"title\">\n <component :is=\"is\" v-if=\"props.title\" class=\"tw-my-0\">{{ props.title }}</component>\n </slot>\n\n <!--\n @slot Header title\n @type String\n @default HTML <p> element with the `description` prop as the text.\n -->\n <slot name=\"description\">\n <p v-if=\"props.description\" class=\"tw-mb-0 tw-mt-3\">{{ props.description }}</p>\n </slot>\n </div>\n </div>\n </div>\n\n <!-- todo: how can we pass a prop/class to actions in order to top align vs middle align? -->\n <div\n v-if=\"slots.actions\"\n class=\"stash-module-header__actions tw-self-center\"\n :class=\"[\n marginBottomClasses,\n {\n 'tw-w-full lg:tw-w-auto': !props.preventActionsWrap,\n },\n ]\"\n data-test=\"stash-module-header|actions\"\n >\n <slot name=\"actions\"></slot>\n </div>\n </header>\n</template>\n\n<style module>\n /* max size for media/marketing illustration icons we would be passing to the slot */\n .media {\n max-height: 58px;\n max-width: 58px;\n }\n</style>\n"],"names":["classes","useCssModule","slots","useSlots","moduleVariant","ref","onBeforeMount","moduleInjectedValues","inject","MODULE_INJECTION","is","computed","component","props","marginBottomClasses","isBoxOrTableOrList","ModuleVariant"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAgDQA,IAAUC,KACVC,IAAQC,KACRC,IAAgBC;AAEtB,IAAAC,EAAc,MAAM;AAClB,YAAMC,IAAuBC,EAAOC,EAAiB,KAAKA,EAAiB,QAAQ;AAC/E,UAAA,CAACF,EAAqB;AAClB,cAAA,IAAI,MAAM,sDAAsD;AAE1D,MAAAH,EAAA,QAAQG,EAAqB,QAAQ;AAAA,IAAA,CACpD;AAEK,UAAAG,IAAKC,EAAS,MAAM;AACpB,UAAAC;AAEJ,cAAQC,EAAM,MAAM;AAAA,QAClB,KAAK;AACS,UAAAD,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF;AACc,UAAAA,IAAA;AACZ;AAAA,MACJ;AAEO,aAAAA;AAAA,IAAA,CACR,GAEKE,IAAsBH,EAAS,MAAM;AACnC,YAAAI,IACJX,EAAc,UAAUY,EAAc,OACtCZ,EAAc,UAAUY,EAAc,SACtCZ,EAAc,UAAUY,EAAc;AAEpC,aAAAD,KAAsB,CAACF,EAAM,YACxB,uBACEE,KAAsBF,EAAM,YAC9B,YAEA;AAAA,IACT,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ModuleHeader.js","sources":["../src/components/ModuleHeader/ModuleHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, ref, useCssModule, useSlots } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n defineOptions({\n name: 'll-module-header',\n });\n\n export interface ModuleHeaderProps {\n /**\n * Header title. Will get overridden by the `title` slot if provided.\n */\n title?: string;\n\n /**\n * Size of the header.\n *\n * - `small` = `h4`\n * - `medium` = `h3`\n * - `large` = `h2`\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Header description, aka subtitle. Will get overridden by the `description` slot if provided.\n */\n description?: string;\n\n /**\n * Stop the actions slot from force-wrapping on medium and smalls screens.\n */\n preventActionsWrap?: boolean;\n\n /**\n * Displays a border at the bottom\n */\n underline?: boolean;\n }\n\n const props = withDefaults(defineProps<ModuleHeaderProps>(), {\n title: '',\n size: 'medium',\n description: '',\n preventActionsWrap: false,\n underline: false,\n });\n const classes = useCssModule();\n const slots = useSlots();\n\n // get the module variant from the parent module\n const moduleVariant = ref();\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('<ModuleHeader> must be used within a <Module> component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n\n const is = computed(() => {\n let component: string;\n\n switch (props.size) {\n case 'small':\n component = 'h4';\n break;\n\n case 'medium':\n component = 'h3';\n break;\n\n case 'large':\n component = 'h2';\n break;\n\n default:\n component = 'h3';\n break;\n }\n\n return component;\n });\n\n const isDefaultSlotSimpleString = computed(() => {\n if (!slots.default) {\n return false;\n }\n\n const defaultSlot = slots.default();\n return (\n defaultSlot.length === 1 &&\n typeof slots.default()[0].children === 'string' &&\n typeof slots.default()[0].type === 'symbol'\n );\n });\n\n const marginBottomClasses = computed(() => {\n const isBoxOrTableOrList = ['box', 'table', 'list'].includes(moduleVariant.value);\n\n if (isBoxOrTableOrList && !props.underline) {\n return 'tw-mb-3 lg:tw-mb-6';\n } else if (isBoxOrTableOrList && props.underline) {\n return 'tw-mb-3';\n } else {\n return '';\n }\n });\n</script>\n\n<template>\n <header\n class=\"stash-module-header tw-flex tw-flex-wrap tw-justify-between\"\n :class=\"{\n 'tw-rounded-t tw-border-b tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-px-6':\n moduleVariant === ModuleVariant.Card,\n 'tw-mb-6 tw-rounded tw-bg-white tw-px-3 tw-pt-3 tw-shadow lg:tw-mb-0 lg:tw-rounded-b-none lg:tw-px-6 lg:tw-pt-6 lg:tw-shadow-none':\n moduleVariant === ModuleVariant.Table || moduleVariant === ModuleVariant.List,\n 'tw-mb-3 tw-border-b tw-border-ice-200 lg:tw-mb-6': props.underline,\n }\"\n data-test=\"stash-module-header\"\n >\n <div\n class=\"stash-module-header__content tw-mr-6\"\n :class=\"marginBottomClasses\"\n data-test=\"stash-module-header|content\"\n >\n <div class=\"tw-flex tw-items-center\">\n <div\n v-if=\"slots.media && props.size === 'large'\"\n class=\"stash-module-header__content__media tw-mr-3\"\n :class=\"classes.media\"\n data-test=\"stash-module-header|content-media\"\n >\n <!-- @slot Place an illustration that sits next to the header title & description. -->\n <slot name=\"media\"></slot>\n </div>\n\n <div class=\"stash-module-header__content__text\" data-test=\"stash-module-header|content-text\">\n <!--\n @slot Header title. **Deprecated**: Use the default slot or the `title` prop instead.\n -->\n <slot v-if=\"slots.title\" name=\"title\"></slot>\n\n <template v-else-if=\"isDefaultSlotSimpleString\">\n <component\n :is=\"is\"\n class=\"stash-module-header__default_slot_string tw-my-0\"\n data-test=\"stash-module-header|default-slot-text\"\n >\n <!-- @slot Header title. -->\n <slot></slot>\n </component>\n </template>\n <!-- @slot Header title. Falls back to the `title` prop. -->\n <slot v-else>\n <component :is=\"is\" class=\"tw-my-0\">{{ props.title }}</component>\n </slot>\n\n <!--\n @slot Header description, aka subtitle. Falls back to the `description` prop.\n -->\n <slot name=\"description\">\n <p v-if=\"props.description\" class=\"tw-mb-0 tw-mt-3\">{{ props.description }}</p>\n </slot>\n </div>\n </div>\n </div>\n\n <!-- todo: how can we pass a prop/class to actions in order to top align vs middle align? -->\n <div\n v-if=\"slots.actions\"\n class=\"stash-module-header__actions tw-self-center\"\n :class=\"[\n marginBottomClasses,\n {\n 'tw-w-full lg:tw-w-auto': !props.preventActionsWrap,\n },\n ]\"\n data-test=\"stash-module-header|actions\"\n >\n <!-- @slot Add action buttons or other CTAs. -->\n <slot name=\"actions\"></slot>\n </div>\n </header>\n</template>\n\n<style module>\n /* max size for media/marketing illustration icons we would be passing to the slot */\n .media {\n max-height: 58px;\n max-width: 58px;\n }\n</style>\n"],"names":["classes","useCssModule","slots","useSlots","moduleVariant","ref","moduleInjectedValues","inject","MODULE_INJECTION","is","computed","component","props","isDefaultSlotSimpleString","marginBottomClasses","isBoxOrTableOrList"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAgDQA,IAAUC,KACVC,IAAQC,KAGRC,IAAgBC,KAChBC,IAAuBC,EAAOC,EAAiB,KAAKA,EAAiB,QAAQ;AAC/E,QAAA,CAACF,EAAqB;AAClB,YAAA,IAAI,MAAM,0DAA0D;AAE9D,IAAAF,EAAA,QAAQE,EAAqB,QAAQ;AAE7C,UAAAG,IAAKC,EAAS,MAAM;AACpB,UAAAC;AAEJ,cAAQC,EAAM,MAAM;AAAA,QAClB,KAAK;AACS,UAAAD,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF;AACc,UAAAA,IAAA;AACZ;AAAA,MACJ;AAEO,aAAAA;AAAA,IAAA,CACR,GAEKE,IAA4BH,EAAS,MACpCR,EAAM,UAISA,EAAM,UAEZ,WAAW,KACvB,OAAOA,EAAM,QAAU,EAAA,CAAC,EAAE,YAAa,YACvC,OAAOA,EAAM,UAAU,CAAC,EAAE,QAAS,WAP5B,EASV,GAEKY,IAAsBJ,EAAS,MAAM;AACnC,YAAAK,IAAqB,CAAC,OAAO,SAAS,MAAM,EAAE,SAASX,EAAc,KAAK;AAE5E,aAAAW,KAAsB,CAACH,EAAM,YACxB,uBACEG,KAAsBH,EAAM,YAC9B,YAEA;AAAA,IACT,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -54,6 +54,7 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
54
54
  }, {}>, {
55
55
  media?(_: {}): any;
56
56
  title?(_: {}): any;
57
+ default?(_: {}): any;
57
58
  description?(_: {}): any;
58
59
  actions?(_: {}): any;
59
60
  }>;
@@ -0,0 +1,29 @@
1
+ import { defineComponent as s, useSlots as n, openBlock as a, createElementBlock as r, renderSlot as o, createVNode as m } from "vue";
2
+ import p from "./Icon.js";
3
+ import "lodash-es/uniqueId";
4
+ import "./index-79ce320f.js";
5
+ import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
6
+ import "./_plugin-vue_export-helper-dad06003.js";
7
+ const i = {
8
+ "data-test": "stash-range-input",
9
+ class: "stash-range-input tw-flex tw-gap-3"
10
+ }, x = /* @__PURE__ */ s({
11
+ __name: "RangeInput",
12
+ setup(l) {
13
+ const t = n();
14
+ if (!(!!t.min && !!t.max))
15
+ throw new Error("RangeInput: please provide slots for min and max values.");
16
+ return (e, u) => (a(), r("div", i, [
17
+ o(e.$slots, "min"),
18
+ m(p, {
19
+ name: "transfer",
20
+ class: "tw-mb-2 tw-mt-auto"
21
+ }),
22
+ o(e.$slots, "max")
23
+ ]));
24
+ }
25
+ });
26
+ export {
27
+ x as default
28
+ };
29
+ //# sourceMappingURL=RangeInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RangeInput.js","sources":["../src/components/RangeInput/RangeInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n\n import Icon from '../Icon/Icon.vue';\n\n const slots = useSlots();\n\n const hasSlots = !!slots.min && !!slots.max;\n\n if (!hasSlots) {\n throw new Error('RangeInput: please provide slots for min and max values.');\n }\n</script>\n\n<template>\n <div data-test=\"stash-range-input\" class=\"stash-range-input tw-flex tw-gap-3\">\n <!-- @slot field for minimal value input -->\n <slot name=\"min\"></slot>\n\n <Icon name=\"transfer\" class=\"tw-mb-2 tw-mt-auto\" />\n <!-- @slot Field for maximal value input -->\n <slot name=\"max\"></slot>\n </div>\n</template>\n"],"names":["slots","useSlots"],"mappings":";;;;;;;;;;;;AAKE,UAAMA,IAAQC;AAId,QAAI,EAFa,CAAC,CAACD,EAAM,OAAO,CAAC,CAACA,EAAM;AAGhC,YAAA,IAAI,MAAM,0DAA0D;;;;;;;;;;;"}
@@ -0,0 +1,20 @@
1
+ import { AllowedComponentProps } from 'vue';
2
+ import { ComponentCustomProps } from 'vue';
3
+ import { ComponentOptionsMixin } from 'vue';
4
+ import { DefineComponent } from 'vue';
5
+ import { ExtractPropTypes } from 'vue';
6
+ import { VNodeProps } from 'vue';
7
+
8
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
9
+ new (): {
10
+ $slots: S;
11
+ };
12
+ };
13
+
14
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>>, {}, {}>, {
15
+ min?(_: {}): any;
16
+ max?(_: {}): any;
17
+ }>;
18
+ export default _default;
19
+
20
+ export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflink/stash",
3
- "version": "46.0.0",
3
+ "version": "46.2.0",
4
4
  "description": "LeafLink's design system.",
5
5
  "homepage": "https://stash.leaflink.com",
6
6
  "main": "./dist/index.ts",