@varlet/ui 3.5.4 → 3.6.0-alpha.1728668115499

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.
Files changed (44) hide show
  1. package/es/action-sheet/style/index.mjs +1 -1
  2. package/es/alert/Alert.mjs +136 -0
  3. package/es/alert/AlertSfc.css +0 -0
  4. package/es/alert/alert.css +1 -0
  5. package/es/alert/index.mjs +9 -0
  6. package/es/alert/props.mjs +23 -0
  7. package/es/alert/style/index.mjs +5 -0
  8. package/es/code/Code.mjs +67 -0
  9. package/es/code/CodeSfc.css +0 -0
  10. package/es/code/code.css +1 -0
  11. package/es/code/index.mjs +12 -0
  12. package/es/code/props.mjs +16 -0
  13. package/es/code/style/index.mjs +3 -0
  14. package/es/highlighter-provider/HighlighterProvider.mjs +26 -0
  15. package/es/highlighter-provider/index.mjs +11 -0
  16. package/es/highlighter-provider/props.mjs +11 -0
  17. package/es/highlighter-provider/provide.mjs +17 -0
  18. package/es/highlighter-provider/style/index.mjs +0 -0
  19. package/es/index.bundle.mjs +19 -1
  20. package/es/index.mjs +16 -1
  21. package/es/snackbar/style/index.mjs +1 -1
  22. package/es/style.css +1 -1
  23. package/es/style.mjs +3 -0
  24. package/es/themes/dark/alert.mjs +33 -0
  25. package/es/themes/dark/code.mjs +7 -0
  26. package/es/themes/dark/index.mjs +4 -2
  27. package/es/themes/md3-dark/alert.mjs +33 -0
  28. package/es/themes/md3-dark/code.mjs +7 -0
  29. package/es/themes/md3-dark/index.mjs +4 -2
  30. package/es/themes/md3-light/alert.mjs +33 -0
  31. package/es/themes/md3-light/code.mjs +7 -0
  32. package/es/themes/md3-light/index.mjs +4 -2
  33. package/es/varlet.esm.js +6019 -5671
  34. package/highlight/web-types.en-US.json +188 -1
  35. package/highlight/web-types.zh-CN.json +188 -1
  36. package/lib/style.css +1 -1
  37. package/lib/varlet.cjs.js +1913 -1533
  38. package/package.json +13 -12
  39. package/types/alert.d.ts +35 -0
  40. package/types/code.d.ts +19 -0
  41. package/types/highlighterProvider.d.ts +26 -0
  42. package/types/index.d.ts +6 -0
  43. package/types/styleVars.d.ts +30 -0
  44. package/umd/varlet.js +8 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.5.4",
3
+ "version": "3.6.0-alpha.1728668115499",
4
4
  "description": "A material like components library",
5
5
  "main": "lib/varlet.cjs.js",
6
6
  "module": "es/index.mjs",
@@ -48,26 +48,27 @@
48
48
  "@popperjs/core": "^2.11.6",
49
49
  "dayjs": "^1.10.4",
50
50
  "decimal.js": "^10.2.1",
51
- "@varlet/icons": "3.5.4",
52
- "@varlet/shared": "3.5.4",
53
- "@varlet/use": "3.5.4"
51
+ "@varlet/icons": "3.6.0-alpha.1728668115499",
52
+ "@varlet/shared": "3.6.0-alpha.1728668115499",
53
+ "@varlet/use": "3.6.0-alpha.1728668115499"
54
54
  },
55
55
  "devDependencies": {
56
- "@vue/runtime-core": "3.4.21",
57
- "@vue/test-utils": "2.4.1",
58
56
  "@types/node": "^18.7.18",
59
57
  "@vitest/coverage-istanbul": "2.0.5",
60
- "zod": "^3.23.8",
61
- "jsdom": "24.1.1",
62
- "vitest": "2.0.5",
58
+ "@vue/runtime-core": "3.4.21",
59
+ "@vue/test-utils": "2.4.1",
63
60
  "clipboard": "^2.0.6",
61
+ "jsdom": "24.1.1",
64
62
  "live-server": "^1.2.1",
63
+ "shiki": "^1.21.0",
65
64
  "typescript": "^5.1.5",
65
+ "vitest": "2.0.5",
66
66
  "vue": "3.4.21",
67
67
  "vue-router": "4.2.0",
68
- "@varlet/cli": "3.5.4",
69
- "@varlet/ui": "3.5.4",
70
- "@varlet/touch-emulator": "3.5.4"
68
+ "zod": "^3.23.8",
69
+ "@varlet/cli": "3.6.0-alpha.1728668115499",
70
+ "@varlet/touch-emulator": "3.6.0-alpha.1728668115499",
71
+ "@varlet/ui": "3.6.0-alpha.1728668115499"
71
72
  },
72
73
  "scripts": {
73
74
  "dev": "varlet-cli dev",
@@ -0,0 +1,35 @@
1
+ import { VNode } from 'vue'
2
+ import { VarComponent, BasicAttributes, SetPropsDefaults, ListenerProp } from './varComponent'
3
+
4
+ export declare const alertProps: Record<keyof AlertProps, any>
5
+
6
+ export type AlertType = 'info' | 'success' | 'warning' | 'danger'
7
+
8
+ export type AlertVariant = 'tonal' | 'outlined' | 'standard'
9
+
10
+ export interface AlertProps extends BasicAttributes {
11
+ type?: AlertType
12
+ variant?: AlertVariant
13
+ color?: string
14
+ title?: string
15
+ message?: string
16
+ closeable?: boolean
17
+ elevation?: boolean | string | number
18
+ onClose?: ListenerProp<(e: Event) => void>
19
+ }
20
+
21
+ export class Alert extends VarComponent {
22
+ static setPropsDefaults: SetPropsDefaults<AlertProps>
23
+
24
+ $props: AlertProps
25
+
26
+ $slots: {
27
+ default(): VNode[]
28
+ content(): VNode[]
29
+ title(): VNode[]
30
+ icon(): VNode[]
31
+ 'close-icon'(): VNode[]
32
+ }
33
+ }
34
+
35
+ export class _AlertComponent extends Alert {}
@@ -0,0 +1,19 @@
1
+ import { VarComponent, BasicAttributes, SetPropsDefaults } from './varComponent'
2
+
3
+ export declare const codeProps: Record<keyof CodeProps, any>
4
+
5
+ export interface CodeProps extends BasicAttributes {
6
+ code?: string
7
+ language?: string
8
+ theme?: string
9
+ wordWrap?: boolean
10
+ trim?: boolean
11
+ }
12
+
13
+ export class Code extends VarComponent {
14
+ static setPropsDefaults: SetPropsDefaults<CodeProps>
15
+
16
+ $props: CodeProps
17
+ }
18
+
19
+ export class _CodeComponent extends Code {}
@@ -0,0 +1,26 @@
1
+ import { VarComponent, BasicAttributes, SetPropsDefaults } from './varComponent'
2
+
3
+ export declare const highlighterProps: Record<keyof HighlighterProviderProps, any>
4
+
5
+ export interface CodeToHtmlOptions {
6
+ lang?: string
7
+ theme?: string
8
+ }
9
+
10
+ export interface Highlighter {
11
+ codeToHtml: (code: string, options: CodeToHtmlOptions) => Promise<string>
12
+ }
13
+
14
+ export interface HighlighterProviderProps extends BasicAttributes {
15
+ highlighter?: Highlighter
16
+ theme?: string
17
+ tag?: string
18
+ }
19
+
20
+ export class HighlighterProvider extends VarComponent {
21
+ static setPropsDefaults: SetPropsDefaults<HighlighterProviderProps>
22
+
23
+ $props: HighlighterProviderProps
24
+ }
25
+
26
+ export class _HighlighterProviderComponent extends HighlighterProvider {}
package/types/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export const version: string
4
4
  export const install: (app: App) => void
5
5
 
6
6
  export * from './actionSheet'
7
+ export * from './alert'
7
8
  export * from './appBar'
8
9
  export * from './autoComplete'
9
10
  export * from './avatar'
@@ -21,6 +22,7 @@ export * from './cell'
21
22
  export * from './checkbox'
22
23
  export * from './checkboxGroup'
23
24
  export * from './chip'
25
+ export * from './code'
24
26
  export * from './col'
25
27
  export * from './collapse'
26
28
  export * from './collapseItem'
@@ -37,6 +39,7 @@ export * from './fab'
37
39
  export * from './floatingPanel'
38
40
  export * from './form'
39
41
  export * from './formDetails'
42
+ export * from './highlighterProvider'
40
43
  export * from './hover'
41
44
  export * from './hoverOverlay'
42
45
  export * from './icon'
@@ -98,6 +101,7 @@ export * from './watermark'
98
101
  declare module 'vue' {
99
102
  export interface GlobalComponents {
100
103
  VarActionSheet: typeof import('@varlet/ui')['_ActionSheetComponent']
104
+ VarAlert: typeof import('@varlet/ui')['_AlertComponent']
101
105
  VarAppBar: typeof import('@varlet/ui')['_AppBarComponent']
102
106
  VarAutoComplete: typeof import('@varlet/ui')['_AutoCompleteComponent']
103
107
  VarAvatar: typeof import('@varlet/ui')['_AvatarComponent']
@@ -115,6 +119,7 @@ declare module 'vue' {
115
119
  VarCheckbox: typeof import('@varlet/ui')['_CheckboxComponent']
116
120
  VarCheckboxGroup: typeof import('@varlet/ui')['_CheckboxGroupComponent']
117
121
  VarChip: typeof import('@varlet/ui')['_ChipComponent']
122
+ VarCode: typeof import('@varlet/ui')['_CodeComponent']
118
123
  VarCol: typeof import('@varlet/ui')['_ColComponent']
119
124
  VarCollapse: typeof import('@varlet/ui')['_CollapseComponent']
120
125
  VarCollapseItem: typeof import('@varlet/ui')['_CollapseItemComponent']
@@ -131,6 +136,7 @@ declare module 'vue' {
131
136
  VarFloatingPanel: typeof import('@varlet/ui')['_FloatingPanelComponent']
132
137
  VarForm: typeof import('@varlet/ui')['_FormComponent']
133
138
  VarFormDetails: typeof import('@varlet/ui')['_FormDetailsComponent']
139
+ VarHighlighterProvider: typeof import('@varlet/ui')['_HighlighterProviderComponent']
134
140
  VarHoverOverlay: typeof import('@varlet/ui')['_HoverOverlayComponent']
135
141
  VarIcon: typeof import('@varlet/ui')['_IconComponent']
136
142
  VarImage: typeof import('@varlet/ui')['_ImageComponent']
@@ -22,6 +22,34 @@ interface BaseStyleVars {
22
22
  '--action-sheet-action-item-disabled-color'?: string
23
23
  '--action-sheet-icon-margin'?: string
24
24
  '--action-sheet-icon-size'?: string
25
+ '--alert-padding'?: string
26
+ '--alert-border-radius'?: string
27
+ '--alert-icon-size'?: string
28
+ '--alert-icon-margin'?: string
29
+ '--alert-close-icon-size'?: string
30
+ '--alert-close-icon-margin'?: string
31
+ '--alert-standard-info-text-color'?: string
32
+ '--alert-standard-danger-text-color'?: string
33
+ '--alert-standard-success-text-color'?: string
34
+ '--alert-standard-warning-text-color'?: string
35
+ '--alert-danger-background'?: string
36
+ '--alert-success-background'?: string
37
+ '--alert-warning-background'?: string
38
+ '--alert-info-background'?: string
39
+ '--alert-tonal-danger-background'?: string
40
+ '--alert-tonal-success-background'?: string
41
+ '--alert-tonal-warning-background'?: string
42
+ '--alert-tonal-info-background'?: string
43
+ '--alert-tonal-danger-text-color'?: string
44
+ '--alert-tonal-success-text-color'?: string
45
+ '--alert-tonal-warning-text-color'?: string
46
+ '--alert-tonal-info-text-color'?: string
47
+ '--alert-message-font-size'?: string
48
+ '--alert-title-font-size'?: string
49
+ '--alert-title-font-weight'?: string
50
+ '--alert-message-margin-top'?: string
51
+ '--alert-message-line-height'?: string
52
+ '--alert-title-line-height'?: string
25
53
  '--app-bar-color'?: string
26
54
  '--app-bar-text-color'?: string
27
55
  '--app-bar-height'?: string
@@ -224,6 +252,8 @@ interface BaseStyleVars {
224
252
  '--chip-small-font-size'?: string
225
253
  '--chip-normal-font-size'?: string
226
254
  '--chip-large-font-size'?: string
255
+ '--code-line-height'?: string
256
+ '--code-font-size'?: string
227
257
  '--collapse-background'?: string
228
258
  '--collapse-text-color'?: string
229
259
  '--collapse-header-font-size'?: string