8 |
9 | export type ExtractMaybeRef = P extends MaybeRef ? T : P
10 |
11 | /**
12 | * 包裹进 ref
13 | *
14 | * @param val
15 | */
16 | export function wrapInRef(val: T) {
17 | return (isRef(val) ? val : ref(val)) as Ref>
18 | }
19 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/alert/docs/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | category: Feedback 反馈组件
4 | wai-aria: https://www.w3.org/TR/wai-aria-practices/#alert
5 | ---
6 |
7 | # 警告提示 Alert
8 |
9 | ## 演示
10 |
11 | :::include
12 |
13 | basic.md icon.md
14 |
15 | type.md density.md
16 |
17 | variant.md shape.md
18 |
19 | closable.md close-text.md
20 |
21 | append.md loading.md
22 |
23 | :::
24 |
25 | ## API
26 |
27 | << * {
12 | opacity: 1 !important;
13 | width: 100% !important;
14 | height: 100% !important;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/input/docs/auto-resize.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 自动调整尺寸
4 |
5 | 通过设置 `auto-resize` 可以使 `input` 自调节宽度,`textarea` 自调节高度。
6 |
7 | ```html
8 |
9 |
10 |
11 | ```
12 |
13 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/radio/docs/items.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 数据驱动
4 |
5 | 使用 `items` 数据驱动渲染单选框。
6 |
7 | ```html
8 |
13 |
14 |
19 | ```
20 |
21 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/composables/scroll-strategy/close.ts:
--------------------------------------------------------------------------------
1 | // Utils
2 | import { bindScroll } from './util'
3 |
4 | // Types
5 | import type { ScrollStrategyData } from './index'
6 |
7 | export function closeScrollStrategy(data: ScrollStrategyData, _name: string) {
8 | function onScroll(_e: Event) {
9 | data.isActive.value = false
10 | }
11 |
12 | bindScroll(data.activatorEl.value ?? data.contentEl.value, onScroll)
13 | }
14 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/avatar/docs/shape.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 形状
4 |
5 | 头像可以是方的和圆的。
6 |
7 | ```html
8 |
9 |
10 |
11 |
12 |
13 | ```
14 |
15 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/breadcrumb/docs/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | category: Navigation 导航
4 | wai-aria: https://www.w3.org/TR/wai-aria-practices/#breadcrumb
5 | ---
6 |
7 | # 面包屑 Breadcrumb
8 |
9 | `breadcrumb` 、`breadcrumb-item`。
10 |
11 | 其中 breadcrumb-item 是 button 的包装。
12 |
13 | ## 演示
14 |
15 | :::include
16 |
17 | basic.md separator.md
18 |
19 | route.md icon.md
20 |
21 | :::
22 |
23 | ## API
24 |
25 | <<
7 | Contained
8 | Primary
9 | Error
10 | Disabled
11 |
12 | ```
13 |
14 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/lazy/docs/basic.md:
--------------------------------------------------------------------------------
1 | :::demo
2 | # 基本用法
3 |
4 | ```html
5 |
6 |
7 |
8 |
9 |
10 |
14 |
15 |
16 |
17 | ```
18 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/notification-provider/styles/notification-provider.scss:
--------------------------------------------------------------------------------
1 | .ve-notification-provider {
2 | display: flex;
3 | justify-content: end;
4 | padding: 8px;
5 |
6 | li {
7 | list-style-type: none;
8 |
9 | + li {
10 | margin-top: 8px;
11 | }
12 | }
13 |
14 | .ve-alert {
15 | --ve-card---padding-y: 16px;
16 | }
17 |
18 | .ve-alert .ve-card {
19 | display: inline-block;
20 | }
21 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/composables/density/styles/_variables.scss:
--------------------------------------------------------------------------------
1 | @use '../../../styles/tools/functions';
2 |
3 | $densities: (
4 | 'ultra-high': -2,
5 | 'high': -1,
6 | 'medium': 0,
7 | 'low': 1,
8 | 'ultra-low': 2,
9 | ) !default;
10 |
11 | $density-props: () !default;
12 | $density-props: functions.map-deep-merge(
13 | (
14 | 'use-density': true,
15 | 'densities': $densities,
16 | ),
17 | $density-props
18 | );
--------------------------------------------------------------------------------
/packages/markdown/src/plugins/code.ts:
--------------------------------------------------------------------------------
1 | // Types
2 | import type { PluginSimple } from '../types'
3 |
4 | export const codePlugin: PluginSimple = md => {
5 | md.renderer.rules.code_inline = (tokens, index) => {
6 | const token = tokens[index]
7 | const attrs = md.renderer.renderAttrs(token)
8 | const html = md.utils.escapeHtml(token.content)
9 | return `${ html }`
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/card/index.ts:
--------------------------------------------------------------------------------
1 | export { Card } from './card'
2 | export { CardImage } from './card-image'
3 | export { CardAvatar } from './card-avatar'
4 | export { CardHeader } from './card-header'
5 | export { CardHeaderText } from './card-header-text'
6 | export { CardTitle } from './card-title'
7 | export { CardSubtitle } from './card-subtitle'
8 | export { CardActions } from './card-actions'
9 | export { CardText } from './card-text'
10 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/checkbox/docs/items.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 数据驱动
4 |
5 | 使用 `items` 数据驱动渲染复选框。
6 |
7 | ```html
8 |
13 |
14 |
19 | ```
20 |
21 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/code/docs/color.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 背景颜色
4 |
5 | ```html
6 |
11 | console.log('code')
12 |
13 |
14 |
24 | ```
25 |
26 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/grid/styles/container.scss:
--------------------------------------------------------------------------------
1 | @forward 'variables';
2 | @use 'variables' as *;
3 | @use '../../../styles/settings/grid' as *;
4 | @use 'mixins' as *;
5 |
6 | .ve-container {
7 | width: 100%;
8 | padding: $container-padding-x;
9 | margin-right: auto;
10 | margin-left: auto;
11 |
12 | @include make-container-max-widths($container-max-widths, $grid-breakpoints);
13 |
14 | &--fluid {
15 | max-width: 100%
16 | }
17 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/composables/tag/index.ts:
--------------------------------------------------------------------------------
1 | // Utils
2 | import { propsFactory } from '@veno-ui/utils'
3 | import type { ExtractPropTypes } from 'vue'
4 |
5 | // Types
6 |
7 | export type TagProps = ExtractPropTypes>
8 |
9 | // Composables
10 | export const makeTagProps = propsFactory({
11 | /**
12 | * @zh 指定在根元素上使用的自定义标签
13 | */
14 | tag: {
15 | type: String,
16 | default: 'div',
17 | },
18 | }, 'tag')
19 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/composables/refs/index.ts:
--------------------------------------------------------------------------------
1 | // Utils
2 | import { onBeforeUpdate, ref } from 'vue'
3 |
4 | // Types
5 | import type { Ref } from 'vue'
6 |
7 | export function useRefs () {
8 | const refs = ref<(T | undefined)[]>([]) as Ref<(T | undefined)[]>
9 |
10 | onBeforeUpdate(() => (refs.value = []))
11 |
12 | function updateRef(e: any, i: number) {
13 | refs.value[i] = e
14 | }
15 |
16 | return { refs, updateRef }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/composables/scrollbar/styles/_tools.scss:
--------------------------------------------------------------------------------
1 | @use 'sass:map';
2 | @use 'variables';
3 | @use '../../../styles/tools/functions';
4 | @use '../../../styles/tools/scrollbar' as tools;
5 |
6 | @mixin use-scrollbar($props: ()) {
7 | $props: functions.map-deep-merge(variables.$scrollbar-props, $props);
8 |
9 | @if map.get($props, 'use-scrollbar') {
10 | &--beautify-scrollbar {
11 | @include tools.scrollbar();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/alert/docs/type.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 提示类型
4 |
5 | 警告提示有 `success`、`info`、`warning`、`error` 四种类型。
6 |
7 | ```html
8 |
9 | This is an info alert.
10 | This is an success alert.
11 | This is an warning alert.
12 | This is an error alert.
13 |
14 | ```
15 |
16 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/card/docs/density.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 卡片密度
4 |
5 | ```html
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | ```
14 |
15 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/paper/docs/color.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 颜色
4 |
5 | ```html
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | ```
16 |
17 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/tag/docs/size.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 不同大小的标签
4 |
5 | 标签的尺寸有 `x-small` - 特小(默认)、`small` - 小、`medium` - 中等、`large` - 大、`x-large` - 特大。
6 |
7 | ```html
8 |
9 | XSmall
10 | Small
11 | Medium
12 | Large
13 | XLarge
14 |
15 | ```
16 |
17 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/timescale/docs/basic.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 基本用法
4 |
5 | ```html
6 |
7 |
8 |
9 | ```
10 |
11 | ```js
12 | import { defineComponent, ref } from 'vue'
13 |
14 | export default defineComponent({
15 | setup() {
16 | return {
17 | scale: ref(1),
18 | }
19 | }
20 | })
21 | ```
22 |
23 | :::
24 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/transition/fade-in-expand-transition.ts:
--------------------------------------------------------------------------------
1 | // Styles
2 | import './styles/fade-in-expand-transition.scss'
3 |
4 | // Utils
5 | import { createJavascriptTransition } from './utils/create-transition'
6 | import { fadeInExpandTransitionGenerator } from './utils/expand-transition-generator'
7 |
8 | export const FadeInExpandTransition = createJavascriptTransition(
9 | 've-fade-in-expand-transition',
10 | fadeInExpandTransitionGenerator(),
11 | )
12 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/form/docs/inline.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 内联表单
4 |
5 | 使用 `inline` 指定表单下控件为内联样式。
6 |
7 | ```html
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | ```
16 |
17 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/icon/icon-class.tsx:
--------------------------------------------------------------------------------
1 | // Utils
2 | import { defineComponent } from '../../utils'
3 |
4 | // Composables
5 | import { makeIconSetProps } from '../../composables/icon/make-icon-props'
6 |
7 | export const IconClass = defineComponent({
8 | name: 'VeIconClass',
9 |
10 | props: makeIconSetProps(),
11 |
12 | setup(props) {
13 | return () => {
14 | return
15 | }
16 | },
17 | })
18 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/message-provider/docs/closable.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 可关闭的
4 |
5 | ```html
6 | Closable
7 | ```
8 |
9 | ```js
10 | import { defineComponent } from 'vue'
11 | import { message } from 'veno-ui'
12 |
13 | export default defineComponent({
14 | setup() {
15 | return {
16 | message,
17 | }
18 | },
19 | })
20 | ```
21 |
22 | :::
23 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/icon/icon-ligature.tsx:
--------------------------------------------------------------------------------
1 | // Utils
2 | import { defineComponent } from '../../utils'
3 |
4 | // Composables
5 | import { makeIconSetProps } from '../../composables/icon/make-icon-props'
6 |
7 | export const IconLigature = defineComponent({
8 | name: 'VeIconLigature',
9 |
10 | props: makeIconSetProps(),
11 |
12 | setup(props) {
13 | return () => {
14 | return { props.icon as string }
15 | }
16 | },
17 | })
18 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/tag-group/styles/tag-group.scss:
--------------------------------------------------------------------------------
1 | @use '../../../styles/tools';
2 | @use '../../../styles/settings';
3 |
4 | // Blocks
5 | .ve-tag-group {
6 | display: flex;
7 | flex-wrap: wrap;
8 | max-width: 100%;
9 | min-width: 0;
10 | overflow-x: auto;
11 | padding: 3px 0 3px 6px;
12 |
13 | .ve-tag {
14 | margin: 3px 6px 3px 0;
15 | }
16 |
17 | // Modifiers
18 | &--column {
19 | flex-wrap: wrap;
20 | white-space: normal;
21 | }
22 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/transition/styles/fade-in-expand-transition.scss:
--------------------------------------------------------------------------------
1 | @use '../../../styles/tools';
2 |
3 | .ve-fade-in-expand-transition {
4 | @include tools.use-transition(.3s, visible);
5 |
6 | &-leave-from,
7 | &-enter-to {
8 | transform: scale(1);
9 | opacity: 1;
10 | }
11 |
12 | &-leave-to,
13 | &-enter-from {
14 | transform: scale(0.85);
15 | opacity: 0;
16 | margin-top: 0 !important;
17 | margin-bottom: 0 !important;
18 | }
19 | }
--------------------------------------------------------------------------------
/packages/markdown/src/plugins/table.ts:
--------------------------------------------------------------------------------
1 | // Types
2 | import type { PluginSimple } from '../types'
3 | import type { RenderRule } from 'markdown-it/lib/renderer'
4 |
5 | export const tablePlugin: PluginSimple = function (md) {
6 | const render: RenderRule = (tokens, index) => {
7 | tokens[index].tag = 've-table'
8 | return md.renderer.renderToken(tokens, index, md.options)
9 | }
10 | md.renderer.rules.table_open = render
11 | md.renderer.rules.table_close = render
12 | }
13 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/select/docs/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | category: Form 表单组件
3 | ---
4 |
5 | # 选择器 Select
6 |
7 | 弹出下拉菜单供用户选择,支持多选。
8 |
9 | 当选项少于 5 项时,建议直接使用 Radio 将选项平铺。
10 |
11 | ## 演示
12 |
13 | :::include
14 |
15 | basic.md
16 |
17 | max-height.md
18 |
19 | custom-text-value.md
20 |
21 | multiple.md
22 |
23 | filterable.md
24 |
25 | search.md
26 |
27 | slots-item.md
28 |
29 | slots-tag.md
30 |
31 | slots-no-data.md
32 |
33 | :::
34 |
35 | ## API
36 |
37 | <<
7 |
11 | 提示
12 |
13 |
14 |
18 | 提示
19 |
20 |
21 | ```
22 |
23 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/breadcrumb/docs/separator.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 自定义分隔符
4 |
5 | 通过 separator 插槽自定义分隔符。
6 |
7 | ```html
8 |
9 | Home
10 | Channel
11 | News
12 |
13 |
14 |
15 |
16 | ```
17 |
18 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/icon/docs/custom-preset.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 自定义预设图标
4 |
5 | ```ts
6 | import { createVeno } from 'veno-ui'
7 |
8 | const veno = createVeno({
9 | // 自定义预设图标集合
10 | icons: {
11 | aliases: {
12 | light: 'M12,18V6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z'
13 | }
14 | },
15 | // ...其他选项
16 | })
17 |
18 | export default veno
19 | ```
20 |
21 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/transition/styles/menu-transition.scss:
--------------------------------------------------------------------------------
1 | @use '../../../styles/tools';
2 |
3 | .ve-menu-transition {
4 | @include tools.use-transition();
5 |
6 | &-enter-from,
7 | &-appear-from,
8 | &-leave-to {
9 | transform: scaleY(0.9);
10 | transform-origin: 0 0;
11 | opacity: 0;
12 | }
13 |
14 | &-enter-to,
15 | &-appear-to,
16 | &-leave-from {
17 | transform: scaleY(1);
18 | transform-origin: 0 0;
19 | opacity: 1;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/styles/tools/_transition.scss:
--------------------------------------------------------------------------------
1 | @use '../settings/transition' as settings;
2 |
3 | @mixin use-transition($duration: .3s, $overflow: inherit) {
4 | &-enter-active {
5 | overflow: $overflow;
6 | transition: $duration settings.$standard-easing;
7 | }
8 |
9 | &-leave-active {
10 | overflow: $overflow;
11 | transition: $duration settings.$standard-easing;
12 | }
13 |
14 | &-move {
15 | transition: transform .5s settings.$standard-easing;
16 | }
17 | }
--------------------------------------------------------------------------------
/packages/markdown/src/plugins/paragraph.ts:
--------------------------------------------------------------------------------
1 | // Types
2 | import type { PluginSimple } from '../types'
3 | import type { RenderRule } from 'markdown-it/lib/renderer'
4 |
5 | export const paragraphPlugin: PluginSimple = function (md) {
6 | const render: RenderRule = (tokens, index) => {
7 | tokens[index].tag = 've-p'
8 | return md.renderer.renderToken(tokens, index, md.options)
9 | }
10 | md.renderer.rules.paragraph_close = render
11 | md.renderer.rules.paragraph_open = render
12 | }
13 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/transition/styles/scale-transition.scss:
--------------------------------------------------------------------------------
1 | @use '../../../styles/tools';
2 |
3 | .ve-scale-transition {
4 | @include tools.use-transition();
5 |
6 | &-enter-active,
7 | &-leave-active {
8 | transition-property: transform, opacity;
9 | }
10 |
11 | &-enter-from,
12 | &-leave-to {
13 | opacity: 0;
14 | transform: scale(.85);
15 | }
16 |
17 | &-enter-to,
18 | &-leave-from {
19 | opacity: 1;
20 | transform: scale(1);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/composables/position/styles/_tools.scss:
--------------------------------------------------------------------------------
1 | @use 'sass:map';
2 | @use 'variables';
3 | @use '../../../styles/tools/functions';
4 |
5 | @mixin use-position($props: ()) {
6 | $props: functions.map-deep-merge(variables.$position-props, $props);
7 | $important: map.get($props, 'position-important');
8 |
9 | @each $position in map.get($props, 'positions') {
10 | &--#{$position} {
11 | position: #{$position} if($important, !important, null);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/transition/index.ts:
--------------------------------------------------------------------------------
1 | export { FadeTransition } from './fade-transition'
2 | export { ScaleTransition } from './scale-transition'
3 | export { ExpandTransition, ExpandXTransition } from './expand-transition'
4 | export { DialogTransition } from './dialog-transition'
5 | export { MenuTransition } from './menu-transition'
6 | export { FadeInExpandTransition } from './fade-in-expand-transition'
7 | export { SlideRightFadeInExpandTransition } from './slide-right-fade-in-expand-transition'
8 |
--------------------------------------------------------------------------------
/packages/markdown/rollup.config.js:
--------------------------------------------------------------------------------
1 | require('esbuild-register')
2 |
3 | module.exports = require('../../scripts/rollup.config.ts').createConfig({
4 | external: [
5 | '@veno-ui/utils',
6 | 'markdown-it',
7 | 'gray-matter',
8 | 'markdown-it-anchor',
9 | 'markdown-it-emoji/lib/data/full.json',
10 | 'diacritics',
11 | 'markdown-it/lib/common/html_blocks',
12 | 'markdown-it/lib/common/html_re',
13 | 'markdown-it/lib/token',
14 | 'markdown-it-container',
15 | ],
16 | })
17 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/button/docs/color.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 按钮颜色
4 |
5 | ```html
6 |
7 | Primary
8 | Secondary
9 | Success
10 | Warning
11 | Error
12 | Info
13 | #8a2be2
14 |
15 | ```
16 |
17 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/button/docs/shape.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 按钮形状
4 |
5 | 按钮的形状有 `tile` - 方的砖块、`rounded` - 带点圆角(默认)、`pill` - 药丸、`circle` - 圆圈。
6 |
7 | ```html
8 |
9 | Tile
10 | Rounded
11 | Pill
12 | Circle
13 |
14 | ```
15 |
16 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/carousel/styles/carousel-activator.scss:
--------------------------------------------------------------------------------
1 | .ve-carousel-activator {
2 | height: 8px;
3 | width: 8px;
4 | background-color: currentColor;
5 | opacity: .3;
6 | border-radius: 4px;
7 | cursor: pointer;
8 | outline: none;
9 | transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
10 | transition-property: width, opacity, background-color;
11 |
12 | &--active {
13 | opacity: 1;
14 | width: 16px;
15 | }
16 |
17 | & + & {
18 | margin-left: 12px;
19 | }
20 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/tag/docs/shape.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 不同形状的标签
4 |
5 | ```html
6 |
7 | 艺术家
8 | 艺术家
9 | 艺术家
10 |
11 | ```
12 |
13 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/date-picker/docs/range.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 时间范围
4 |
5 | ```html
6 |
13 |
14 |
15 | ```
16 |
17 | ```js
18 | import { defineComponent, ref } from 'vue'
19 |
20 | export default defineComponent({
21 | setup() {
22 | return {
23 | value: ref([]),
24 | }
25 | }
26 | })
27 | ```
28 |
29 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/date-picker/key.ts:
--------------------------------------------------------------------------------
1 | import type { ComputedRef, InjectionKey, Ref } from 'vue'
2 | import type { DateInstance } from '../../composables'
3 |
4 | export interface DateRangeInstance {
5 | selected: ComputedRef
6 | select: (value: string) => void
7 | inRange: (value: number) => boolean
8 | preview: (value: boolean) => void
9 | isPreview: Ref
10 | }
11 |
12 | export const DateRangeKey: InjectionKey = Symbol.for('veno-ui:date-range')
13 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/form/styles/form.scss:
--------------------------------------------------------------------------------
1 | // Blocks
2 | .ve-form {
3 | // Modifiers
4 | &--inline {
5 | display: flex;
6 | flex-direction: row;
7 | flex-wrap: wrap;
8 | }
9 |
10 | &--vertical:not(#{&}--inline),
11 | &--horizontal:not(#{&}--inline) {
12 | .ve-form-control--hide-details + .ve-form-control--hide-details {
13 | margin-top: 8px;
14 | }
15 | }
16 |
17 | &--inline {
18 | .ve-form-control--hide-details {
19 | margin: 4px;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/tag/docs/group.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 标签组
4 |
5 | ```html
6 |
7 | Tag1
8 | Tag2
9 |
10 |
11 |
12 | ```
13 |
14 | ```js
15 | import { defineComponent, ref } from 'vue'
16 |
17 | export default defineComponent({
18 | setup() {
19 | return {
20 | value: ref('tag1'),
21 | }
22 | }
23 | })
24 | ```
25 |
26 | :::
--------------------------------------------------------------------------------
/packages/docs/src/layouts/default.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/carousel/styles/carousel.scss:
--------------------------------------------------------------------------------
1 | @use '../../../styles/tools';
2 | @use '../../../styles/settings';
3 |
4 | .ve-carousel {
5 | position: relative;
6 | overflow: hidden;
7 | @include tools.use-paper((
8 | 'use-size': false,
9 | 'use-density': false,
10 | ));
11 |
12 | &__controls {
13 | position: absolute;
14 | bottom: 16px;
15 | left: 0;
16 | width: 100%;
17 | display: flex;
18 | justify-content: center;
19 | align-items: center;
20 | }
21 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/transition/styles/slide-right-fade-in-expand-transition.scss:
--------------------------------------------------------------------------------
1 | @use '../../../styles/tools';
2 |
3 | .ve-slide-right-fade-in-expand-transition {
4 | @include tools.use-transition(.3s, visible);
5 |
6 | &-leave-from,
7 | &-enter-to {
8 | transform: translateX(0);
9 | opacity: 1;
10 | }
11 |
12 | &-leave-to,
13 | &-enter-from {
14 | transform: translateX(100%);
15 | opacity: 0;
16 | margin-top: 0 !important;
17 | margin-bottom: 0 !important;
18 | }
19 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/app/styles/app.scss:
--------------------------------------------------------------------------------
1 | @forward 'variables';
2 | @use 'variables' as *;
3 | @use '../../../styles/tools';
4 |
5 | .ve-app {
6 | background-color: rgb(var(--ve-theme-background));
7 | color: rgb(var(--ve-theme-on-background));
8 | @include tools.use-layout();
9 |
10 | &__wrapper {
11 | position: relative;
12 | display: flex;
13 | flex: 1 1 auto;
14 | backface-visibility: hidden;
15 | min-height: 100vh;
16 | max-width: 100%;
17 | }
18 | }
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/list/styles/list-group.scss:
--------------------------------------------------------------------------------
1 | @forward 'variables';
2 | @use 'variables' as *;
3 | @use '../../../styles/tools';
4 |
5 | // Blocks
6 | .ve-list-group {
7 | --ve-parent-padding: var(--ve-indent-padding, 0px);
8 |
9 | &--prepend {
10 | --ve-parent-padding: calc(var(--ve-list-item-avatar---height, 28px) + var(--ve-indent-padding, 0px));
11 | }
12 |
13 | &__items {
14 | --ve-indent-padding: calc(var(--ve-list-item---padding-x, 12px) + var(--ve-parent-padding, 0px));
15 | }
16 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/transition/slide-right-fade-in-expand-transition.ts:
--------------------------------------------------------------------------------
1 | // Styles
2 | import './styles/slide-right-fade-in-expand-transition.scss'
3 |
4 | // Utils
5 | import { createJavascriptTransition } from './utils/create-transition'
6 | import { fadeInExpandTransitionGenerator } from './utils/expand-transition-generator'
7 |
8 | export const SlideRightFadeInExpandTransition = createJavascriptTransition(
9 | 've-slide-right-fade-in-expand-transition',
10 | fadeInExpandTransitionGenerator(),
11 | )
12 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/date-picker/styles/date-picker.scss:
--------------------------------------------------------------------------------
1 | // Blocks
2 | .ve-date-picker {
3 | // Elements
4 |
5 | // InputControl
6 | .ve-input-control,
7 | .ve-input-control__input {
8 | cursor: pointer;
9 | }
10 |
11 | // InputControlAppendInner
12 | .ve-input-control--dirty:hover .ve-input-control__clearable + .ve-input-control__append-inner {
13 | display: none;
14 | }
15 |
16 | .ve-input-control__append-inner .ve-icon {
17 | opacity: var(--ve-medium-emphasis-opacity);
18 | }
19 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/badge/docs/max.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 最大值
4 |
5 | ```html
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | ```
24 |
25 | :::
26 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/form/docs/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | category: Form 表单组件
3 | ---
4 |
5 | # 表单 Form
6 |
7 | ## 演示
8 |
9 | :::include
10 |
11 | basic.md
12 |
13 | items.md
14 |
15 | inline.md
16 |
17 | :::
18 |
19 | ## API
20 |
21 | - 表单控件 form-control
22 | - 输入控件 input-control
23 | - 选择控件 selection-control
24 | - 选择组控件 selection-group-control
25 | - 原生控件 native-control
26 |
27 | <<
8 | Start
9 | Finish
10 |
11 |
12 |
13 | ```
14 |
15 | ```js
16 | import { defineComponent, ref } from 'vue'
17 |
18 | export default defineComponent({
19 | setup() {
20 | return {
21 | progress: ref(),
22 | }
23 | }
24 | })
25 | ```
26 |
27 | :::
--------------------------------------------------------------------------------
/packages/vite-plugin-markdown/src/options.ts:
--------------------------------------------------------------------------------
1 | // Types
2 | import type { Options, ResolvedOptions } from './types'
3 |
4 | const DEFAULT_OPTIONS = {
5 | root: null,
6 | include: /\.md$/,
7 | customSfcBlocks: ['route', 'i18n'],
8 | markdownOptions: {},
9 | markdownUses: [],
10 | markdownSetup: () => {},
11 | wrapper: 'div',
12 | transforms: {},
13 | }
14 |
15 | export function resolveOptions(userOptions?: Options): ResolvedOptions {
16 | return Object.assign(DEFAULT_OPTIONS, userOptions || {}) as ResolvedOptions
17 | }
18 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/tooltip/docs/transition.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 去除动画
4 |
5 | ```html
6 |
7 |
12 | 提示
13 |
14 |
15 |
20 | 提示
21 |
22 |
23 | ```
24 |
25 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/badge/docs/location.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 位置
4 |
5 | ```html
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | ```
24 |
25 | :::
26 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/pagination/styles/pagination.scss:
--------------------------------------------------------------------------------
1 | .ve-pagination {
2 | display: flex;
3 | align-items: center;
4 |
5 | &__wrapper {
6 | display: inline-flex;
7 | list-style-type: none;
8 | justify-content: center;
9 | }
10 |
11 | &__item,
12 | &__first,
13 | &__prev,
14 | &__next,
15 | &__last {
16 | margin: 4px;
17 | }
18 |
19 | &__per-page,
20 | &__quick-jumper {
21 | margin: 4px 6px;
22 | }
23 |
24 | &__quick-jumper {
25 | display: flex;
26 | align-items: center;
27 | }
28 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/styles/settings/_transition.scss:
--------------------------------------------------------------------------------
1 | // Mapping from transition to easings:
2 | // fast-out-slow-in -> standard
3 | // linear-out-slow-in -> decelerated
4 | // fast-out-linear-in -> accelerated
5 | // ease-in-out -> standard or accelerated depending on usage
6 | // fast-in-fast-out -> accelerated
7 | // swing -> standard
8 |
9 | // 标准曲线。
10 | $standard-easing: cubic-bezier(0.4, 0, 0.2, 1);
11 | // 减速曲线,常用于物体进入。
12 | $decelerated-easing: cubic-bezier(0.0, 0, 0.2, 1);
13 | // 加速曲线,常用于物体离开。
14 | $accelerated-easing: cubic-bezier(0.4, 0, 1, 1);
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/messages/styles/messages.scss:
--------------------------------------------------------------------------------
1 | .ve-messages {
2 | color: rgba(var(--ve-theme-on-surface), var(--ve-medium-emphasis-opacity));
3 | flex: 1 1 auto;
4 | font-size: 12px;
5 | min-height: 14px;
6 | min-width: 1px; // Ensure takes up space with no messages and inside of flex
7 | position: relative;
8 |
9 | &__message {
10 | line-height: 12px;
11 | word-break: break-word;
12 | overflow-wrap: break-word;
13 | word-wrap: break-word;
14 | hyphens: auto;
15 | transition-duration: 150ms;
16 | }
17 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/layout/docs/app-layout.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 应用布局
4 |
5 | `app` 基于 `layout` 封装,`header` 、`drawer` 基于 `layout-item` 封装。
6 |
7 | 此处作为演示填写的 `position="absolute"`,实际使用默认值即可。
8 |
9 | ```html
10 |
11 |
12 |
13 |
14 |
15 |
16 | ```
17 |
18 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/composables/nested/active-strategies/classicActiveStrategy.ts:
--------------------------------------------------------------------------------
1 | // Types
2 | import type { ActiveStrategyFn } from '.'
3 |
4 | /**
5 | * Class 激活策略。
6 | *
7 | * @param single
8 | */
9 | export const classicActiveStrategy = (single?: boolean): ActiveStrategyFn => {
10 | return ({ id, value, active }) => {
11 | const newActive: Set = single ? new Set() : active
12 |
13 | if (value) {
14 | newActive.add(id)
15 | } else {
16 | newActive.delete(id)
17 | }
18 |
19 | return newActive
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/styles/settings/_rounded.scss:
--------------------------------------------------------------------------------
1 | @use 'sass:math';
2 | @use '../tools/functions';
3 |
4 | $border-radius: 4px !default;
5 |
6 | $rounded: () !default;
7 | $rounded: functions.map-deep-merge(
8 | (
9 | 0: 0,
10 | null: $border-radius,
11 | 'xs': 0,
12 | 'sm': math.div($border-radius, 2),
13 | 'md': $border-radius,
14 | 'lg': $border-radius * 2,
15 | 'xl': $border-radius * 6,
16 | 'pill': 9999px,
17 | 'circle': 50%,
18 | 'shaped': $border-radius * 6 0
19 | ),
20 | $rounded
21 | );
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/avatar/docs/basic.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 基本用法
4 |
5 | ```html
6 |
7 |
8 |
9 |
10 |
11 |
12 | ```
13 |
14 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/composables/size/styles/_tools.scss:
--------------------------------------------------------------------------------
1 | @use 'sass:map';
2 | @use 'sass:string';
3 | @use 'variables';
4 | @use '../../../styles/tools/functions';
5 | @use '../../../styles/settings/variables' as settings;
6 |
7 | @mixin use-size($props: ()) {
8 | $props: functions.map-deep-merge(variables.$size-props, $props);
9 |
10 | @if map.get($props, 'use-size') {
11 | @each $name, $multiplier in map.get($props, 'sizes') {
12 | &--size-#{$name} {
13 | --ve-size-offset: #{$multiplier * settings.$spacer};
14 | }
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/dialog/docs/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | category: Feedback 反馈组件
3 | ---
4 |
5 | # 对话框 Dialog
6 |
7 | 对话框是 `modal` 窗体的一种类型,它通常在应用程序内容之前呈现,来提供一些关键信息,或者要求用户做出决策。 对话框出现的时候会禁用应用程序的所有功能,只有被确认、被取消或已采取其他必要的操作时,对话框会从屏幕中消失。
8 |
9 | 对话框会带有目的性地打断工作流程,所以请您谨慎使用。
10 |
11 | ## 演示
12 |
13 | :::include
14 |
15 | basic.md
16 |
17 | persistent.md
18 |
19 | form.md
20 |
21 | v-model.md
22 |
23 | scrollable.md
24 |
25 | nested.md
26 |
27 | menu-dialog.md
28 |
29 | dimension.md
30 |
31 | fullscreen.md
32 |
33 | :::
34 |
35 | ## API
36 |
37 | <<
9 | This is an info alert.
10 | This is an info alert.
11 | This is an info alert.
12 | This is an info alert.
13 | This is an info alert.
14 |
15 | ```
16 |
17 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/badge/docs/basic.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 基本用法
4 |
5 | ```html
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | ```
22 |
23 | :::
24 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/button/docs/outlined.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 描边按钮
4 |
5 | ```html
6 |
7 | Outlined
8 | Primary
9 | Error
10 | Dashed
11 | Dotted
12 | Disabled
13 |
14 | ```
15 |
16 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/button/docs/size.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 按钮尺寸
4 |
5 | 按钮的尺寸有 `x-small` - 特小、`small` - 小、`medium` - 中等(默认)、`large` - 大、`x-large` - 特大。
6 |
7 | ```html
8 |
9 | XSmall
10 | Small
11 | Medium
12 | Large
13 | XLarge
14 |
15 | ```
16 |
17 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/card/docs/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | category: Data 数据展示
4 | ---
5 |
6 | # 卡片 Card
7 |
8 | ## 演示
9 |
10 | :::include
11 |
12 | basic.md density.md
13 |
14 | shape.md personal-card-concise.md
15 |
16 | click.md personal-card.md
17 |
18 | slot.md
19 |
20 | :::
21 |
22 | ## API
23 |
24 | << {
15 | require('./lib.fix.ts')
16 | }).catch((error) => {
17 | console.error(error)
18 | process.exit(1)
19 | })
20 |
21 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/button/docs/group.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 组合按钮
4 |
5 | ```html
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | ```
23 |
24 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/card/styles/card-actions.scss:
--------------------------------------------------------------------------------
1 | .ve-card-actions {
2 | // CSS Variables
3 | // --ve-card-actions---padding-x var(--ve-card---padding-x, 12px)
4 | // --ve-card-actions---padding-y var(--ve-card---padding-y, 12px)
5 | --ve-padding-x: var(--ve-card-actions---padding-x, var(--ve-card---padding-x, 12px));
6 | --ve-padding-y: calc(var(--ve-card-actions---padding-y, var(--ve-card---padding-y, 12px)) + var(--ve-density-offset, 0px));
7 | align-items: center;
8 | display: flex;
9 | flex: 1 1 0;
10 | padding: var(--ve-padding-y) var(--ve-padding-x);
11 | }
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/transition/expand-transition.ts:
--------------------------------------------------------------------------------
1 | // Styles
2 | import './styles/expand-transition.scss'
3 |
4 | // Utils
5 | import { createJavascriptTransition } from './utils/create-transition'
6 | import { expandTransitionGenerator } from './utils/expand-transition-generator'
7 |
8 | export const ExpandTransition = createJavascriptTransition(
9 | 've-expand-transition',
10 | expandTransitionGenerator(),
11 | )
12 |
13 | export const ExpandXTransition = createJavascriptTransition(
14 | 've-expand-x-transition',
15 | expandTransitionGenerator('', true),
16 | )
17 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/typography/headers.ts:
--------------------------------------------------------------------------------
1 | // Styles
2 | import './styles/headers.scss'
3 |
4 | // Utils
5 | import { createSimpleFunctional } from '@veno-ui/utils'
6 |
7 | export const H1 = createSimpleFunctional('ve-h1', 'h1', 'VeH1')
8 | export const H2 = createSimpleFunctional('ve-h2', 'h2', 'VeH2')
9 | export const H3 = createSimpleFunctional('ve-h3', 'h3', 'VeH3')
10 | export const H4 = createSimpleFunctional('ve-h4', 'h4', 'VeH4')
11 | export const H5 = createSimpleFunctional('ve-h5', 'h5', 'VeH5')
12 | export const H6 = createSimpleFunctional('ve-h6', 'h6', 'VeH6')
13 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/composables/elevation/styles/_tools.scss:
--------------------------------------------------------------------------------
1 | @use 'sass:map';
2 | @use 'sass:string';
3 | @use 'variables';
4 | @use '../../../styles/tools/functions';
5 | @use '../../../styles/tools/elevation' as tools;
6 |
7 | @mixin use-elevation($props: ()) {
8 | $props: functions.map-deep-merge(variables.$elevation-props, $props);
9 |
10 | @if map.get($props, 'use-elevation') {
11 | $z: 24;
12 | @while $z >= 0 {
13 | &--elevation-#{$z} {
14 | @include tools.elevation($z, $important: true);
15 | }
16 | $z: $z - 1;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/composables/loading/index.ts:
--------------------------------------------------------------------------------
1 | // Utils
2 | import { computed } from 'vue'
3 | import { getCurrentInstanceName, propsFactory } from '@veno-ui/utils'
4 |
5 | export interface LoadingProps {
6 | loading?: boolean
7 | }
8 |
9 | export const makeLoadingProps = propsFactory({
10 | loading: Boolean,
11 | }, 'loading')
12 |
13 | export function useLoading(
14 | props: LoadingProps,
15 | name = getCurrentInstanceName(),
16 | ) {
17 | return {
18 | loadingClasses: computed(() => ({
19 | [`${ name }--loading`]: props.loading,
20 | })),
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/card/docs/slot.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 所有可用的组件(插槽)
4 |
5 | ```html
6 |
7 | Media
8 |
9 | Prepend
10 |
11 | Title
12 | Subtitle
13 |
14 | Append
15 |
16 | Text
17 | Actions
18 |
19 | ```
20 |
21 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/dialog/docs/persistent.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 点击外面不关闭
4 |
5 | ```html
6 |
7 |
8 | Dialog
9 |
10 |
11 |
12 |
13 |
14 | 取消
15 | 确认
16 |
17 |
18 |
19 | ```
20 |
21 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/list/docs/basic.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 基本用法
4 |
5 | ```html
6 |
7 | Subtitle
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | ```
18 |
19 | :::
--------------------------------------------------------------------------------
/packages/veno-ui/src/components/message-provider/docs/variant.md:
--------------------------------------------------------------------------------
1 | :::demo
2 |
3 | # 变体
4 |
5 | ```html
6 |
7 | Contained
8 | ContainedText
9 |
10 | ```
11 |
12 | ```js
13 | import { defineComponent } from 'vue'
14 | import { message } from 'veno-ui'
15 |
16 | export default defineComponent({
17 | setup() {
18 | return {
19 | message,
20 | }
21 | },
22 | })
23 | ```
24 |
25 | :::
26 |
--------------------------------------------------------------------------------
/packages/markdown/src/plugins/hoist.ts:
--------------------------------------------------------------------------------
1 | // Types
2 | import type { PluginSimple } from '../types'
3 |
4 | // hoist