dou-ui 0.1.0-alpha.1 → 0.1.0-alpha.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","names":["_sfc_main"],"sources":["../../../src/components/alert/alert.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CloseIcon } from '@dou-ui/icons'\nimport { computed, ref } from 'vue'\nimport { useNamespace } from '../../utils/namespace'\nimport { toneIcon } from '../../utils/tone-icons'\nimport { useLocale } from '../config-provider/use-config'\nimport type { AlertEmits, AlertProps, AlertSlots } from './alert'\n\ndefineOptions({ name: 'DouAlert' })\n\nconst props = withDefaults(defineProps<AlertProps>(), {\n tone: 'neutral',\n closable: false,\n showIcon: true,\n})\nconst emit = defineEmits<AlertEmits>()\nconst slots = defineSlots<AlertSlots>()\n\nconst ns = useNamespace('alert')\nconst { t } = useLocale()\nconst visible = ref(true)\n\n// Warnings and errors interrupt a screen reader; everything else waits its turn.\nconst role = computed(() =>\n props.tone === 'warning' || props.tone === 'danger' ? 'alert' : 'status',\n)\nconst hasTitle = computed(() => !!props.title || !!slots.title)\nconst Icon = () => toneIcon(props.tone)\n\nfunction close(event: MouseEvent) {\n visible.value = false\n emit('close', event)\n}\n</script>\n\n<template>\n <div v-if=\"visible\" :class=\"[ns.b(), ns.m(tone), ns.is('titled', hasTitle)]\" :role=\"role\">\n <span v-if=\"showIcon\" :class=\"ns.e('icon')\">\n <slot name=\"icon\"><Icon /></slot>\n </span>\n <div :class=\"ns.e('content')\">\n <div v-if=\"hasTitle\" :class=\"ns.e('title')\">\n <slot name=\"title\">{{ title }}</slot>\n </div>\n <div v-if=\"slots.default\" :class=\"ns.e('description')\"><slot /></div>\n </div>\n <div v-if=\"slots.action\" :class=\"ns.e('action')\"><slot name=\"action\" /></div>\n <button\n v-if=\"closable\"\n type=\"button\"\n :class=\"ns.e('close')\"\n :aria-label=\"t('alert.close')\"\n @click=\"close\"\n >\n <CloseIcon />\n </button>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"alert.js","names":["_sfc_main"],"sources":["../../../src/components/alert/alert.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CloseIcon } from '@dou-ui/icons'\nimport { computed, ref } from 'vue'\nimport { useNamespace } from '../../utils/namespace'\nimport { toneIcon } from '../../utils/tone-icons'\nimport { useLocale } from '../config-provider/use-config'\nimport type { AlertEmits, AlertProps, AlertSlots } from './alert'\n\ndefineOptions({ name: 'DouAlert' })\n\nconst props = withDefaults(defineProps<AlertProps>(), {\n tone: 'neutral',\n closable: false,\n showIcon: true,\n})\nconst emit = defineEmits<AlertEmits>()\nconst slots = defineSlots<AlertSlots>()\n\nconst ns = useNamespace('alert')\nconst { t } = useLocale()\nconst visible = ref(true)\n\n// Warnings and errors interrupt a screen reader; everything else waits its turn.\nconst role = computed(() =>\n props.tone === 'warning' || props.tone === 'danger' ? 'alert' : 'status',\n)\nconst hasTitle = computed(() => !!props.title || !!slots.title)\nconst Icon = () => toneIcon(props.tone)\n\nfunction close(event: MouseEvent) {\n visible.value = false\n emit('close', event)\n}\n</script>\n\n<template>\n <div v-if=\"visible\" :class=\"[ns.b(), ns.m(tone), ns.is('titled', hasTitle)]\" :role=\"role\">\n <span v-if=\"showIcon\" :class=\"ns.e('icon')\">\n <slot name=\"icon\"><Icon /></slot>\n </span>\n <!-- text and actions share a wrapping row: when the text would get\n narrower than --dou-alert-text-min, the actions drop below it -->\n <div :class=\"ns.e('body')\">\n <div :class=\"ns.e('content')\">\n <div v-if=\"hasTitle\" :class=\"ns.e('title')\">\n <slot name=\"title\">{{ title }}</slot>\n </div>\n <div v-if=\"slots.default\" :class=\"ns.e('description')\"><slot /></div>\n </div>\n <div v-if=\"slots.action\" :class=\"ns.e('action')\"><slot name=\"action\" /></div>\n </div>\n <button\n v-if=\"closable\"\n type=\"button\"\n :class=\"ns.e('close')\"\n :aria-label=\"t('alert.close')\"\n @click=\"close\"\n >\n <CloseIcon />\n </button>\n </div>\n</template>\n"],"mappings":""}
@@ -50,19 +50,18 @@ var alert_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
50
50
  key: 0,
51
51
  class: normalizeClass(unref(ns).e("icon"))
52
52
  }, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(Icon)])], 2)) : createCommentVNode("", true),
53
- createElementVNode("div", { class: normalizeClass(unref(ns).e("content")) }, [hasTitle.value ? (openBlock(), createElementBlock("div", {
53
+ createElementVNode("div", { class: normalizeClass(unref(ns).e("body")) }, [createElementVNode("div", { class: normalizeClass(unref(ns).e("content")) }, [hasTitle.value ? (openBlock(), createElementBlock("div", {
54
54
  key: 0,
55
55
  class: normalizeClass(unref(ns).e("title"))
56
56
  }, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2)) : createCommentVNode("", true), slots.default ? (openBlock(), createElementBlock("div", {
57
57
  key: 1,
58
58
  class: normalizeClass(unref(ns).e("description"))
59
- }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("", true)], 2),
60
- slots.action ? (openBlock(), createElementBlock("div", {
61
- key: 1,
59
+ }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("", true)], 2), slots.action ? (openBlock(), createElementBlock("div", {
60
+ key: 0,
62
61
  class: normalizeClass(unref(ns).e("action"))
63
- }, [renderSlot(_ctx.$slots, "action")], 2)) : createCommentVNode("", true),
62
+ }, [renderSlot(_ctx.$slots, "action")], 2)) : createCommentVNode("", true)], 2),
64
63
  __props.closable ? (openBlock(), createElementBlock("button", {
65
- key: 2,
64
+ key: 1,
66
65
  type: "button",
67
66
  class: normalizeClass(unref(ns).e("close")),
68
67
  "aria-label": unref(t)("alert.close"),
@@ -1 +1 @@
1
- {"version":3,"file":"alert.vue_vue_type_script_setup_true_lang.js","names":["_useSlots","_openBlock","_createElementBlock","_normalizeClass","_unref","_renderSlot","_createVNode","_createCommentVNode","_createElementVNode","_createTextVNode","_toDisplayString"],"sources":["../../../src/components/alert/alert.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CloseIcon } from '@dou-ui/icons'\nimport { computed, ref } from 'vue'\nimport { useNamespace } from '../../utils/namespace'\nimport { toneIcon } from '../../utils/tone-icons'\nimport { useLocale } from '../config-provider/use-config'\nimport type { AlertEmits, AlertProps, AlertSlots } from './alert'\n\ndefineOptions({ name: 'DouAlert' })\n\nconst props = withDefaults(defineProps<AlertProps>(), {\n tone: 'neutral',\n closable: false,\n showIcon: true,\n})\nconst emit = defineEmits<AlertEmits>()\nconst slots = defineSlots<AlertSlots>()\n\nconst ns = useNamespace('alert')\nconst { t } = useLocale()\nconst visible = ref(true)\n\n// Warnings and errors interrupt a screen reader; everything else waits its turn.\nconst role = computed(() =>\n props.tone === 'warning' || props.tone === 'danger' ? 'alert' : 'status',\n)\nconst hasTitle = computed(() => !!props.title || !!slots.title)\nconst Icon = () => toneIcon(props.tone)\n\nfunction close(event: MouseEvent) {\n visible.value = false\n emit('close', event)\n}\n</script>\n\n<template>\n <div v-if=\"visible\" :class=\"[ns.b(), ns.m(tone), ns.is('titled', hasTitle)]\" :role=\"role\">\n <span v-if=\"showIcon\" :class=\"ns.e('icon')\">\n <slot name=\"icon\"><Icon /></slot>\n </span>\n <div :class=\"ns.e('content')\">\n <div v-if=\"hasTitle\" :class=\"ns.e('title')\">\n <slot name=\"title\">{{ title }}</slot>\n </div>\n <div v-if=\"slots.default\" :class=\"ns.e('description')\"><slot /></div>\n </div>\n <div v-if=\"slots.action\" :class=\"ns.e('action')\"><slot name=\"action\" /></div>\n <button\n v-if=\"closable\"\n type=\"button\"\n :class=\"ns.e('close')\"\n :aria-label=\"t('alert.close')\"\n @click=\"close\"\n >\n <CloseIcon />\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EAKd,MAAM,OAAO;EACb,MAAM,QAAQA,SAAA;EAEd,MAAM,KAAK,aA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,GAAAC,mBAA6E,OAAA;;KAAnD,OAAKC,eAAEC,MAAA,EAAA,CAAE,CAAC,EAAC,QAAA,CAAA;I,IAAYC,WAAsB,KAAA,QAAA,QAAA,C;IAE/D,QAAA,YADRJ,UAAA,GAAAC,mBAQS,UAAA;;KANP,MAAK;KACJ,OAAKC,eAAEC,MAAA,EAAA,CAAE,CAAC,EAAC,OAAA,CAAA;KACX,cAAYA,MAAA,CAAA,CAAC,CAAA,aAAA;KACb,SAAO;I,IAERE,YAAaF,MAAA,SAAA,CAAA,C"}
1
+ {"version":3,"file":"alert.vue_vue_type_script_setup_true_lang.js","names":["_useSlots","_openBlock","_createElementBlock","_normalizeClass","_unref","_renderSlot","_createVNode","_createCommentVNode","_createElementVNode","_createTextVNode","_toDisplayString"],"sources":["../../../src/components/alert/alert.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CloseIcon } from '@dou-ui/icons'\nimport { computed, ref } from 'vue'\nimport { useNamespace } from '../../utils/namespace'\nimport { toneIcon } from '../../utils/tone-icons'\nimport { useLocale } from '../config-provider/use-config'\nimport type { AlertEmits, AlertProps, AlertSlots } from './alert'\n\ndefineOptions({ name: 'DouAlert' })\n\nconst props = withDefaults(defineProps<AlertProps>(), {\n tone: 'neutral',\n closable: false,\n showIcon: true,\n})\nconst emit = defineEmits<AlertEmits>()\nconst slots = defineSlots<AlertSlots>()\n\nconst ns = useNamespace('alert')\nconst { t } = useLocale()\nconst visible = ref(true)\n\n// Warnings and errors interrupt a screen reader; everything else waits its turn.\nconst role = computed(() =>\n props.tone === 'warning' || props.tone === 'danger' ? 'alert' : 'status',\n)\nconst hasTitle = computed(() => !!props.title || !!slots.title)\nconst Icon = () => toneIcon(props.tone)\n\nfunction close(event: MouseEvent) {\n visible.value = false\n emit('close', event)\n}\n</script>\n\n<template>\n <div v-if=\"visible\" :class=\"[ns.b(), ns.m(tone), ns.is('titled', hasTitle)]\" :role=\"role\">\n <span v-if=\"showIcon\" :class=\"ns.e('icon')\">\n <slot name=\"icon\"><Icon /></slot>\n </span>\n <!-- text and actions share a wrapping row: when the text would get\n narrower than --dou-alert-text-min, the actions drop below it -->\n <div :class=\"ns.e('body')\">\n <div :class=\"ns.e('content')\">\n <div v-if=\"hasTitle\" :class=\"ns.e('title')\">\n <slot name=\"title\">{{ title }}</slot>\n </div>\n <div v-if=\"slots.default\" :class=\"ns.e('description')\"><slot /></div>\n </div>\n <div v-if=\"slots.action\" :class=\"ns.e('action')\"><slot name=\"action\" /></div>\n </div>\n <button\n v-if=\"closable\"\n type=\"button\"\n :class=\"ns.e('close')\"\n :aria-label=\"t('alert.close')\"\n @click=\"close\"\n >\n <CloseIcon />\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EAKd,MAAM,OAAO;EACb,MAAM,QAAQA,SAAA;EAEd,MAAM,KAAK,aAAa,OAAO;EAC/B,MAAM,EAAE,MAAM,UAAU;EACxB,MAAM,UAAU,IAAI,IAAI;EAGxB,MAAM,OAAO,eACX,MAAM,SAAS,aAAa,MAAM,SAAS,WAAW,UAAU,QAClE;EACA,MAAM,WAAW,eAAe,CAAC,CAAC,MAAM,SAAS,CAAC,CAAC,MAAM,KAAK;EAC9D,MAAM,aAAa,SAAS,MAAM,IAAI;EAEtC,SAAS,MAAM,OAAmB;GAChC,QAAQ,QAAQ;GAChB,KAAK,SAAS,KAAK;EACrB;;GAIa,OAAA,QAAA,SAAXC,UAAA,GAAAC,mBAwBM,OAAA;;IAxBe,OAAKC,eAAA;KAAGC,MAAA,EAAA,CAAE,CAAC,EAAC;KAAIA,MAAA,EAAA,CAAE,CAAC,EAAE,QAAA,IAAI;KAAGA,MAAA,EAAA,CAAE,CAAC,GAAE,UAAW,SAAA,KAAQ;IAAA,CAAA;IAAK,MAAM,KAAA;;IACtE,QAAA,YAAZH,UAAA,GAAAC,mBAEO,QAAA;;KAFgB,OAAKC,eAAEC,MAAA,EAAA,CAAE,CAAC,EAAC,MAA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