@dialpad/dialtone 9.71.0-beta.2 → 9.71.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/tokens/doc.json +9757 -9757
- package/dist/vue3/common/sr_only_close_button.vue.cjs +4 -4
- package/dist/vue3/common/sr_only_close_button.vue.cjs.map +1 -1
- package/dist/vue3/common/sr_only_close_button.vue.js +4 -4
- package/dist/vue3/common/sr_only_close_button.vue.js.map +1 -1
- package/dist/vue3/common/storybook_utils.cjs +8 -0
- package/dist/vue3/common/storybook_utils.cjs.map +1 -0
- package/dist/vue3/common/storybook_utils.js +8 -0
- package/dist/vue3/common/storybook_utils.js.map +1 -0
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/components/avatar/avatar.vue.cjs +41 -30
- package/dist/vue3/components/avatar/avatar.vue.cjs.map +1 -1
- package/dist/vue3/components/avatar/avatar.vue.js +43 -32
- package/dist/vue3/components/avatar/avatar.vue.js.map +1 -1
- package/dist/vue3/components/chip/chip.vue.cjs +7 -4
- package/dist/vue3/components/chip/chip.vue.cjs.map +1 -1
- package/dist/vue3/components/chip/chip.vue.js +7 -4
- package/dist/vue3/components/chip/chip.vue.js.map +1 -1
- package/dist/vue3/components/collapsible/collapsible.vue.cjs +6 -12
- package/dist/vue3/components/collapsible/collapsible.vue.cjs.map +1 -1
- package/dist/vue3/components/collapsible/collapsible.vue.js +6 -12
- package/dist/vue3/components/collapsible/collapsible.vue.js.map +1 -1
- package/dist/vue3/components/datepicker/modules/month-year-picker.vue.cjs +17 -5
- package/dist/vue3/components/datepicker/modules/month-year-picker.vue.cjs.map +1 -1
- package/dist/vue3/components/datepicker/modules/month-year-picker.vue.js +17 -5
- package/dist/vue3/components/datepicker/modules/month-year-picker.vue.js.map +1 -1
- package/dist/vue3/components/emoji_picker/modules/emoji_search.vue.cjs +9 -3
- package/dist/vue3/components/emoji_picker/modules/emoji_search.vue.cjs.map +1 -1
- package/dist/vue3/components/emoji_picker/modules/emoji_search.vue.js +9 -3
- package/dist/vue3/components/emoji_picker/modules/emoji_search.vue.js.map +1 -1
- package/dist/vue3/components/image_viewer/image_viewer.vue.cjs +5 -4
- package/dist/vue3/components/image_viewer/image_viewer.vue.cjs.map +1 -1
- package/dist/vue3/components/image_viewer/image_viewer.vue.js +5 -4
- package/dist/vue3/components/image_viewer/image_viewer.vue.js.map +1 -1
- package/dist/vue3/components/list_item/list_item.vue.cjs +5 -4
- package/dist/vue3/components/list_item/list_item.vue.cjs.map +1 -1
- package/dist/vue3/components/list_item/list_item.vue.js +5 -4
- package/dist/vue3/components/list_item/list_item.vue.js.map +1 -1
- package/dist/vue3/components/modal/modal.vue.cjs +7 -4
- package/dist/vue3/components/modal/modal.vue.cjs.map +1 -1
- package/dist/vue3/components/modal/modal.vue.js +7 -4
- package/dist/vue3/components/modal/modal.vue.js.map +1 -1
- package/dist/vue3/components/notice/notice_action.vue.cjs +7 -4
- package/dist/vue3/components/notice/notice_action.vue.cjs.map +1 -1
- package/dist/vue3/components/notice/notice_action.vue.js +7 -4
- package/dist/vue3/components/notice/notice_action.vue.js.map +1 -1
- package/dist/vue3/components/pagination/pagination.vue.cjs +15 -10
- package/dist/vue3/components/pagination/pagination.vue.cjs.map +1 -1
- package/dist/vue3/components/pagination/pagination.vue.js +15 -10
- package/dist/vue3/components/pagination/pagination.vue.js.map +1 -1
- package/dist/vue3/components/popover/popover_header_footer.vue.cjs +7 -4
- package/dist/vue3/components/popover/popover_header_footer.vue.cjs.map +1 -1
- package/dist/vue3/components/popover/popover_header_footer.vue.js +7 -4
- package/dist/vue3/components/popover/popover_header_footer.vue.js.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs +5 -4
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js +5 -4
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.cjs +11 -7
- package/dist/vue3/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.js +11 -7
- package/dist/vue3/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.cjs +7 -4
- package/dist/vue3/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.js +7 -4
- package/dist/vue3/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs +7 -14
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.js +8 -15
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.cjs +6 -4
- package/dist/vue3/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.js +6 -4
- package/dist/vue3/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.js.map +1 -1
- package/dist/vue3/recipes/header/settings_menu_button/settings_menu_button.vue.cjs +12 -6
- package/dist/vue3/recipes/header/settings_menu_button/settings_menu_button.vue.cjs.map +1 -1
- package/dist/vue3/recipes/header/settings_menu_button/settings_menu_button.vue.js +12 -6
- package/dist/vue3/recipes/header/settings_menu_button/settings_menu_button.vue.js.map +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.cjs +7 -27
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.cjs.map +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.js +8 -28
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.cjs +4 -13
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.js +5 -14
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.cjs +7 -13
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.js +8 -14
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/general_row.vue.cjs +13 -9
- package/dist/vue3/recipes/leftbar/general_row/general_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/general_row.vue.js +13 -9
- package/dist/vue3/recipes/leftbar/general_row/general_row.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.cjs +5 -4
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.js +5 -4
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/group_row/group_row.vue.cjs +7 -4
- package/dist/vue3/recipes/leftbar/group_row/group_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/group_row/group_row.vue.js +7 -4
- package/dist/vue3/recipes/leftbar/group_row/group_row.vue.js.map +1 -1
- package/dist/vue3/style.css +111 -111
- package/dist/vue3/types/common/storybook_utils.d.ts +25 -0
- package/dist/vue3/types/common/storybook_utils.d.ts.map +1 -0
- package/dist/vue3/types/components/avatar/avatar.vue.d.ts +34 -6
- package/dist/vue3/types/components/avatar/avatar.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/chip/chip.vue.d.ts +1 -1
- package/dist/vue3/types/components/collapsible/collapsible.vue.d.ts +1 -1
- package/dist/vue3/types/components/collapsible/collapsible.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/list_item/list_item.vue.d.ts +8 -2
- package/dist/vue3/types/components/list_item/list_item.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/notice/notice_action.vue.d.ts +4 -5
- package/dist/vue3/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/split_button/split_button-omega.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +1 -0
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/item_layout/contact_info/contact_info.vue.d.ts +3 -3
- package/dist/vue3/types/recipes/leftbar/callbox/callbox.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +1 -0
- package/dist/vue3/types/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vue3 = require("@dialpad/dialtone-icons/vue3");
|
|
3
2
|
const vue = require("vue");
|
|
4
3
|
const _pluginVue_exportHelper = require("../_virtual/_plugin-vue_export-helper.cjs");
|
|
4
|
+
const icon = require("../components/icon/icon.vue.cjs");
|
|
5
5
|
const button = require("../components/button/button.vue.cjs");
|
|
6
6
|
const _sfc_main = {
|
|
7
7
|
name: "SrOnlyCloseButton",
|
|
8
8
|
components: {
|
|
9
|
-
|
|
9
|
+
DtIcon: icon,
|
|
10
10
|
DtButton: button
|
|
11
11
|
},
|
|
12
12
|
props: {
|
|
@@ -27,7 +27,7 @@ const _sfc_main = {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
30
|
-
const
|
|
30
|
+
const _component_dt_icon = vue.resolveComponent("dt-icon");
|
|
31
31
|
const _component_dt_button = vue.resolveComponent("dt-button");
|
|
32
32
|
return vue.openBlock(), vue.createBlock(_component_dt_button, {
|
|
33
33
|
id: "sr-only-close-button",
|
|
@@ -38,7 +38,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
38
38
|
onKeydown: vue.withKeys(vue.withModifiers($options.close, ["prevent", "stop"]), ["space"])
|
|
39
39
|
}, {
|
|
40
40
|
default: vue.withCtx(() => [
|
|
41
|
-
vue.createVNode(
|
|
41
|
+
vue.createVNode(_component_dt_icon, { name: "close" })
|
|
42
42
|
]),
|
|
43
43
|
_: 1
|
|
44
44
|
}, 8, ["aria-label", "onClick", "onKeydown"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sr_only_close_button.vue.cjs","sources":["../../common/sr_only_close_button.vue"],"sourcesContent":["<template>\n <dt-button\n id=\"sr-only-close-button\"\n data-qa=\"dt-sr-only-close-button\"\n class=\"d-vi-visible-sr\"\n :aria-label=\"visuallyHiddenCloseLabel\"\n @click=\"close\"\n @keydown.space.prevent.stop=\"close\"\n >\n <dt-icon
|
|
1
|
+
{"version":3,"file":"sr_only_close_button.vue.cjs","sources":["../../common/sr_only_close_button.vue"],"sourcesContent":["<template>\n <dt-button\n id=\"sr-only-close-button\"\n data-qa=\"dt-sr-only-close-button\"\n class=\"d-vi-visible-sr\"\n :aria-label=\"visuallyHiddenCloseLabel\"\n @click=\"close\"\n @keydown.space.prevent.stop=\"close\"\n >\n <dt-icon name=\"close\" />\n </dt-button>\n</template>\n\n<script>\nimport { DtIcon } from '@/components/icon';\nimport { DtButton } from '@/components/button';\n\nexport default {\n name: 'SrOnlyCloseButton',\n components: {\n DtIcon,\n DtButton,\n },\n\n props: {\n /**\n * Label for the visually hidden close button\n * Required if visuallyHiddenClose is set to `true`\n */\n visuallyHiddenCloseLabel: {\n type: String,\n default: null,\n },\n },\n\n emits: ['close'],\n\n methods: {\n close () {\n this.$emit('close');\n },\n },\n};\n</script>\n"],"names":["DtIcon","DtButton","_createBlock","_createVNode"],"mappings":";;;;;AAiBA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAAA;AAAAA,IACA,UAAAC;AAAAA,EACD;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,0BAA0B;AAAA,MACxB,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACF;AAAA,EAED,OAAO,CAAC,OAAO;AAAA,EAEf,SAAS;AAAA,IACP,QAAS;AACP,WAAK,MAAM,OAAO;AAAA,IACnB;AAAA,EACF;AACH;;;;0BAzCEC,IASY,YAAA,sBAAA;AAAA,IARV,IAAG;AAAA,IACH,WAAQ;AAAA,IACR,OAAM;AAAA,IACL,cAAY,OAAwB;AAAA,IACpC,SAAO,SAAK;AAAA,IACZ,0CAA4B,SAAK,OAAA,CAAA,WAAA,MAAA,CAAA,GAAA,CAAA,OAAA,CAAA;AAAA;yBAElC,MAAwB;AAAA,MAAxBC,IAAAA,YAAwB,oBAAA,EAAf,MAAK,QAAO,CAAA;AAAA;;;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DtIconClose } from "@dialpad/dialtone-icons/vue3";
|
|
2
1
|
import { resolveComponent, openBlock, createBlock, withKeys, withModifiers, withCtx, createVNode } from "vue";
|
|
3
2
|
import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
import DtIcon from "../components/icon/icon.vue.js";
|
|
4
4
|
import DtButton from "../components/button/button.vue.js";
|
|
5
5
|
const _sfc_main = {
|
|
6
6
|
name: "SrOnlyCloseButton",
|
|
7
7
|
components: {
|
|
8
|
-
|
|
8
|
+
DtIcon,
|
|
9
9
|
DtButton
|
|
10
10
|
},
|
|
11
11
|
props: {
|
|
@@ -26,7 +26,7 @@ const _sfc_main = {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
29
|
-
const
|
|
29
|
+
const _component_dt_icon = resolveComponent("dt-icon");
|
|
30
30
|
const _component_dt_button = resolveComponent("dt-button");
|
|
31
31
|
return openBlock(), createBlock(_component_dt_button, {
|
|
32
32
|
id: "sr-only-close-button",
|
|
@@ -37,7 +37,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
37
37
|
onKeydown: withKeys(withModifiers($options.close, ["prevent", "stop"]), ["space"])
|
|
38
38
|
}, {
|
|
39
39
|
default: withCtx(() => [
|
|
40
|
-
createVNode(
|
|
40
|
+
createVNode(_component_dt_icon, { name: "close" })
|
|
41
41
|
]),
|
|
42
42
|
_: 1
|
|
43
43
|
}, 8, ["aria-label", "onClick", "onKeydown"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sr_only_close_button.vue.js","sources":["../../common/sr_only_close_button.vue"],"sourcesContent":["<template>\n <dt-button\n id=\"sr-only-close-button\"\n data-qa=\"dt-sr-only-close-button\"\n class=\"d-vi-visible-sr\"\n :aria-label=\"visuallyHiddenCloseLabel\"\n @click=\"close\"\n @keydown.space.prevent.stop=\"close\"\n >\n <dt-icon
|
|
1
|
+
{"version":3,"file":"sr_only_close_button.vue.js","sources":["../../common/sr_only_close_button.vue"],"sourcesContent":["<template>\n <dt-button\n id=\"sr-only-close-button\"\n data-qa=\"dt-sr-only-close-button\"\n class=\"d-vi-visible-sr\"\n :aria-label=\"visuallyHiddenCloseLabel\"\n @click=\"close\"\n @keydown.space.prevent.stop=\"close\"\n >\n <dt-icon name=\"close\" />\n </dt-button>\n</template>\n\n<script>\nimport { DtIcon } from '@/components/icon';\nimport { DtButton } from '@/components/button';\n\nexport default {\n name: 'SrOnlyCloseButton',\n components: {\n DtIcon,\n DtButton,\n },\n\n props: {\n /**\n * Label for the visually hidden close button\n * Required if visuallyHiddenClose is set to `true`\n */\n visuallyHiddenCloseLabel: {\n type: String,\n default: null,\n },\n },\n\n emits: ['close'],\n\n methods: {\n close () {\n this.$emit('close');\n },\n },\n};\n</script>\n"],"names":["_createBlock","_createVNode"],"mappings":";;;;AAiBA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,EACD;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,0BAA0B;AAAA,MACxB,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACF;AAAA,EAED,OAAO,CAAC,OAAO;AAAA,EAEf,SAAS;AAAA,IACP,QAAS;AACP,WAAK,MAAM,OAAO;AAAA,IACnB;AAAA,EACF;AACH;;;;sBAzCEA,YASY,sBAAA;AAAA,IARV,IAAG;AAAA,IACH,WAAQ;AAAA,IACR,OAAM;AAAA,IACL,cAAY,OAAwB;AAAA,IACpC,SAAO,SAAK;AAAA,IACZ,kCAA4B,SAAK,OAAA,CAAA,WAAA,MAAA,CAAA,GAAA,CAAA,OAAA,CAAA;AAAA;qBAElC,MAAwB;AAAA,MAAxBC,YAAwB,oBAAA,EAAf,MAAK,QAAO,CAAA;AAAA;;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const iconNames = require("@dialpad/dialtone-icons/icons.js");
|
|
4
|
+
function getIconNames() {
|
|
5
|
+
return [void 0, ...iconNames];
|
|
6
|
+
}
|
|
7
|
+
exports.getIconNames = getIconNames;
|
|
8
|
+
//# sourceMappingURL=storybook_utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storybook_utils.cjs","sources":["../../common/storybook_utils.js"],"sourcesContent":["import iconNames from '@dialpad/dialtone-icons/icons.js';\nimport illustrationNames from '@dialpad/dialtone-icons/illustrations.js';\n\n/**\n * Will use a Vue SFC to render the template rather than a template string.\n * This is useful for more complex components that are hard to work with and\n * get messy when rendered via a template string. Will pass args and argTypes\n * into the component so it is able to be live edited with storybook controls addon.\n * @param {object} args storybook control args\n * @param {component} templateComponent vue component template for rendering to storybook.\n * Note this should not be the component itself,\n * but rather the usage of that component.\n * @returns {component} the template component with props and args added.\n */\nexport const createTemplateFromVueFile = (args, argTypes, templateComponent) => ({\n components: { templateComponent },\n setup () {\n return { args };\n },\n template: '<template-component v-bind=\"args\"></template-component>',\n});\n\n/**\n * Gets the full list of icon component names from the dialtone package\n * @returns {string[]} icon component names\n */\nexport function getIconNames () {\n return [undefined, ...iconNames];\n}\n\n/**\n * Gets the full list of icon component names from the dialtone package\n * @returns {string[]} icon component names\n */\nexport function getIllustrationNames () {\n return [undefined, ...illustrationNames];\n}\n\nexport const generateTemplate = (component,\n { props = [], excludeProps = [], customProps = [], childTemplate } = {}) => {\n if (!component) {\n console.warn('Generate template: Please provide a component');\n return '';\n }\n\n const { name, props: componentProps } = component;\n const finalProps = props.length ? props : Object.keys(componentProps);\n const normalizedName = name.split(/(?=[A-Z])/).join('-').toLowerCase();\n\n const startFragment = `<${normalizedName}`;\n\n const propFragments = finalProps\n .filter(prop => !excludeProps.includes(prop))\n .map(prop => `:${prop}=\"${prop}\"`);\n\n const endFragment = childTemplate ? `>${childTemplate}</${normalizedName}>` : ' />';\n\n return [startFragment, ...propFragments, ...customProps, endFragment].join(' ');\n};\n\nexport default {\n generateTemplate,\n createTemplateFromVueFile,\n getIllustrationNames,\n getIconNames,\n};\n"],"names":[],"mappings":";;;AA0BO,SAAS,eAAgB;AAC9B,SAAO,CAAC,QAAW,GAAG,SAAS;AACjC;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storybook_utils.js","sources":["../../common/storybook_utils.js"],"sourcesContent":["import iconNames from '@dialpad/dialtone-icons/icons.js';\nimport illustrationNames from '@dialpad/dialtone-icons/illustrations.js';\n\n/**\n * Will use a Vue SFC to render the template rather than a template string.\n * This is useful for more complex components that are hard to work with and\n * get messy when rendered via a template string. Will pass args and argTypes\n * into the component so it is able to be live edited with storybook controls addon.\n * @param {object} args storybook control args\n * @param {component} templateComponent vue component template for rendering to storybook.\n * Note this should not be the component itself,\n * but rather the usage of that component.\n * @returns {component} the template component with props and args added.\n */\nexport const createTemplateFromVueFile = (args, argTypes, templateComponent) => ({\n components: { templateComponent },\n setup () {\n return { args };\n },\n template: '<template-component v-bind=\"args\"></template-component>',\n});\n\n/**\n * Gets the full list of icon component names from the dialtone package\n * @returns {string[]} icon component names\n */\nexport function getIconNames () {\n return [undefined, ...iconNames];\n}\n\n/**\n * Gets the full list of icon component names from the dialtone package\n * @returns {string[]} icon component names\n */\nexport function getIllustrationNames () {\n return [undefined, ...illustrationNames];\n}\n\nexport const generateTemplate = (component,\n { props = [], excludeProps = [], customProps = [], childTemplate } = {}) => {\n if (!component) {\n console.warn('Generate template: Please provide a component');\n return '';\n }\n\n const { name, props: componentProps } = component;\n const finalProps = props.length ? props : Object.keys(componentProps);\n const normalizedName = name.split(/(?=[A-Z])/).join('-').toLowerCase();\n\n const startFragment = `<${normalizedName}`;\n\n const propFragments = finalProps\n .filter(prop => !excludeProps.includes(prop))\n .map(prop => `:${prop}=\"${prop}\"`);\n\n const endFragment = childTemplate ? `>${childTemplate}</${normalizedName}>` : ' />';\n\n return [startFragment, ...propFragments, ...customProps, endFragment].join(' ');\n};\n\nexport default {\n generateTemplate,\n createTemplateFromVueFile,\n getIllustrationNames,\n getIconNames,\n};\n"],"names":[],"mappings":";AA0BO,SAAS,eAAgB;AAC9B,SAAO,CAAC,QAAW,GAAG,SAAS;AACjC;"}
|