@mantine-vue/core 1.1.3 → 2.0.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.
@@ -1,4 +1,6 @@
1
1
  import { type PropType } from 'vue';
2
+ import type { TextVariant } from '../Text/Text';
3
+ export type AnchorVariant = TextVariant;
2
4
  export declare const Anchor: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
5
  component: {
4
6
  type: StringConstructor;
@@ -13,7 +15,7 @@ export declare const Anchor: import("vue").DefineComponent<import("vue").Extract
13
15
  default: boolean;
14
16
  };
15
17
  variant: {
16
- type: PropType<"text" | "gradient">;
18
+ type: PropType<AnchorVariant>;
17
19
  default: undefined;
18
20
  };
19
21
  classNames: {
@@ -44,7 +46,7 @@ export declare const Anchor: import("vue").DefineComponent<import("vue").Extract
44
46
  default: boolean;
45
47
  };
46
48
  variant: {
47
- type: PropType<"text" | "gradient">;
49
+ type: PropType<AnchorVariant>;
48
50
  default: undefined;
49
51
  };
50
52
  classNames: {
@@ -60,7 +62,7 @@ export declare const Anchor: import("vue").DefineComponent<import("vue").Extract
60
62
  default: undefined;
61
63
  };
62
64
  }>> & Readonly<{}>, {
63
- variant: "gradient" | "text";
65
+ variant: TextVariant;
64
66
  classNames: Function | Record<string, any>;
65
67
  styles: Function | Record<string, any>;
66
68
  underline: "always" | "never" | "hover" | "not-hover";
@@ -1,5 +1,6 @@
1
1
  import { type PropType } from 'vue';
2
- export type BadgeVariant = 'filled' | 'light' | 'outline' | 'dot' | 'transparent' | 'white' | 'default' | 'gradient' | (string & {});
2
+ import { type MantineVariant } from '../../core';
3
+ export type BadgeVariant = 'filled' | 'light' | 'outline' | 'dot' | 'transparent' | 'white' | 'default' | 'gradient';
3
4
  export declare const Badge: import("../..").WithBoxProps<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
5
  component: {
5
6
  type: StringConstructor;
@@ -40,7 +41,7 @@ export declare const Badge: import("../..").WithBoxProps<import("vue").DefineCom
40
41
  default: undefined;
41
42
  };
42
43
  variant: {
43
- type: PropType<BadgeVariant>;
44
+ type: PropType<MantineVariant<BadgeVariant>>;
44
45
  default: undefined;
45
46
  };
46
47
  classNames: {
@@ -101,7 +102,7 @@ export declare const Badge: import("../..").WithBoxProps<import("vue").DefineCom
101
102
  default: undefined;
102
103
  };
103
104
  variant: {
104
- type: PropType<BadgeVariant>;
105
+ type: PropType<MantineVariant<BadgeVariant>>;
105
106
  default: undefined;
106
107
  };
107
108
  classNames: {
@@ -123,7 +124,7 @@ export declare const Badge: import("../..").WithBoxProps<import("vue").DefineCom
123
124
  }>> & Readonly<{}>, {
124
125
  color: string;
125
126
  autoContrast: boolean;
126
- variant: BadgeVariant;
127
+ variant: MantineVariant<BadgeVariant>;
127
128
  gradient: {
128
129
  from: string;
129
130
  to: string;
@@ -1,7 +1,7 @@
1
1
  import { type CSSProperties, type PropType, type SlotsType, type VNodeChild } from 'vue';
2
- import { type BoxProps, MantineSize, MantineRadius } from '../../core';
2
+ import { type BoxProps, MantineSize, MantineRadius, type MantineVariant } from '../../core';
3
3
  export type ButtonSize = MantineSize | `compact-${MantineSize}` | (string & {});
4
- export type ButtonVariant = 'filled' | 'light' | 'outline' | 'transparent' | 'white' | 'subtle' | 'default' | 'gradient' | (string & {});
4
+ export type ButtonVariant = 'filled' | 'light' | 'outline' | 'transparent' | 'white' | 'subtle' | 'default' | 'gradient';
5
5
  export interface ButtonSlots {
6
6
  default?: () => VNodeChild;
7
7
  leftSection?: () => VNodeChild;
@@ -39,7 +39,7 @@ export interface ButtonProps extends BoxProps {
39
39
  /** Component or element used as the root */
40
40
  component?: string;
41
41
  /** Visual variant */
42
- variant?: ButtonVariant;
42
+ variant?: MantineVariant<ButtonVariant>;
43
43
  'data-disabled'?: boolean;
44
44
  classNames?: Record<string, string> | ((...args: any[]) => Record<string, string>);
45
45
  styles?: Record<string, any> | ((...args: any[]) => Record<string, any>);
@@ -99,7 +99,7 @@ export declare const Button: import("../..").WithBoxProps<{
99
99
  default: undefined;
100
100
  };
101
101
  variant: {
102
- type: PropType<ButtonVariant>;
102
+ type: PropType<MantineVariant<ButtonVariant>>;
103
103
  default: undefined;
104
104
  };
105
105
  mod: {
@@ -135,7 +135,7 @@ export declare const Button: import("../..").WithBoxProps<{
135
135
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
136
136
  color: string;
137
137
  autoContrast: boolean;
138
- variant: ButtonVariant;
138
+ variant: MantineVariant<ButtonVariant>;
139
139
  gradient: {
140
140
  from: string;
141
141
  to: string;
@@ -215,7 +215,7 @@ export declare const Button: import("../..").WithBoxProps<{
215
215
  default: undefined;
216
216
  };
217
217
  variant: {
218
- type: PropType<ButtonVariant>;
218
+ type: PropType<MantineVariant<ButtonVariant>>;
219
219
  default: undefined;
220
220
  };
221
221
  mod: {
@@ -251,7 +251,7 @@ export declare const Button: import("../..").WithBoxProps<{
251
251
  }>, {}, {}, {}, {
252
252
  color: string;
253
253
  autoContrast: boolean;
254
- variant: ButtonVariant;
254
+ variant: MantineVariant<ButtonVariant>;
255
255
  gradient: {
256
256
  from: string;
257
257
  to: string;
@@ -328,7 +328,7 @@ export declare const Button: import("../..").WithBoxProps<{
328
328
  default: undefined;
329
329
  };
330
330
  variant: {
331
- type: PropType<ButtonVariant>;
331
+ type: PropType<MantineVariant<ButtonVariant>>;
332
332
  default: undefined;
333
333
  };
334
334
  mod: {
@@ -364,7 +364,7 @@ export declare const Button: import("../..").WithBoxProps<{
364
364
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
365
365
  color: string;
366
366
  autoContrast: boolean;
367
- variant: ButtonVariant;
367
+ variant: MantineVariant<ButtonVariant>;
368
368
  gradient: {
369
369
  from: string;
370
370
  to: string;
@@ -1,4 +1,5 @@
1
1
  import { type PropType } from 'vue';
2
+ export type CloseButtonVariant = 'subtle' | 'transparent';
2
3
  export declare const CloseButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
4
  component: {
4
5
  type: StringConstructor;
@@ -16,7 +17,7 @@ export declare const CloseButton: import("vue").DefineComponent<import("vue").Ex
16
17
  default: undefined;
17
18
  };
18
19
  variant: {
19
- type: PropType<"subtle" | "transparent">;
20
+ type: PropType<CloseButtonVariant>;
20
21
  default: undefined;
21
22
  };
22
23
  __staticSelector: {
@@ -58,7 +59,7 @@ export declare const CloseButton: import("vue").DefineComponent<import("vue").Ex
58
59
  default: undefined;
59
60
  };
60
61
  variant: {
61
- type: PropType<"subtle" | "transparent">;
62
+ type: PropType<CloseButtonVariant>;
62
63
  default: undefined;
63
64
  };
64
65
  __staticSelector: {
@@ -82,7 +83,7 @@ export declare const CloseButton: import("vue").DefineComponent<import("vue").Ex
82
83
  default: boolean;
83
84
  };
84
85
  }>> & Readonly<{}>, {
85
- variant: "transparent" | "subtle";
86
+ variant: CloseButtonVariant;
86
87
  classNames: Function | Record<string, any>;
87
88
  styles: Function | Record<string, any>;
88
89
  disabled: boolean;
@@ -4,6 +4,8 @@ export type PinInputStylesNames = 'root' | 'pinInput' | 'input';
4
4
  export type PinInputCssVariables = {
5
5
  root: '--pin-input-size';
6
6
  };
7
+ export type PinInputTypeAttribute = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {});
8
+ export type PinInputMode = 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
7
9
  export interface PinInputProps {
8
10
  name?: string;
9
11
  form?: string;
@@ -25,8 +27,8 @@ export interface PinInputProps {
25
27
  mask?: boolean;
26
28
  length?: number;
27
29
  readOnly?: boolean;
28
- inputType?: string;
29
- inputMode?: string;
30
+ inputType?: PinInputTypeAttribute;
31
+ inputMode?: PinInputMode;
30
32
  ariaLabel?: string;
31
33
  hiddenInputProps?: Record<string, any>;
32
34
  rootRef?: VueRefTarget<HTMLDivElement>;
@@ -120,11 +122,11 @@ export declare const PinInput: import("../..").WithBoxProps<import("vue").Define
120
122
  default: boolean;
121
123
  };
122
124
  inputType: {
123
- type: StringConstructor;
125
+ type: PropType<PinInputTypeAttribute>;
124
126
  default: undefined;
125
127
  };
126
128
  inputMode: {
127
- type: StringConstructor;
129
+ type: PropType<PinInputMode>;
128
130
  default: undefined;
129
131
  };
130
132
  ariaLabel: {
@@ -251,11 +253,11 @@ export declare const PinInput: import("../..").WithBoxProps<import("vue").Define
251
253
  default: boolean;
252
254
  };
253
255
  inputType: {
254
- type: StringConstructor;
256
+ type: PropType<PinInputTypeAttribute>;
255
257
  default: undefined;
256
258
  };
257
259
  inputMode: {
258
- type: StringConstructor;
260
+ type: PropType<PinInputMode>;
259
261
  default: undefined;
260
262
  };
261
263
  ariaLabel: {
@@ -324,11 +326,11 @@ export declare const PinInput: import("../..").WithBoxProps<import("vue").Define
324
326
  inputRef: VueRefTarget<HTMLInputElement>;
325
327
  rootRef: VueRefTarget<HTMLDivElement>;
326
328
  readOnly: boolean;
327
- inputMode: string;
329
+ inputMode: PinInputMode;
328
330
  autoFocus: boolean;
329
331
  manageFocus: boolean;
330
332
  oneTimeCode: boolean;
331
- inputType: string;
333
+ inputType: PinInputTypeAttribute;
332
334
  ariaLabel: string;
333
335
  getInputProps: (index: number) => Record<string, any>;
334
336
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
@@ -1,4 +1,4 @@
1
- import { type PropType } from 'vue';
1
+ import { type CSSProperties, type PropType } from 'vue';
2
2
  export type TableVariant = 'default' | 'vertical';
3
3
  export type TableStylesNames = 'table' | 'thead' | 'tbody' | 'tfoot' | 'tr' | 'th' | 'td' | 'caption';
4
4
  export interface TableData {
@@ -10,7 +10,7 @@ export interface TableData {
10
10
  export declare const Table: import("../..").WithBoxProps<{
11
11
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
12
12
  layout: {
13
- type: PropType<string>;
13
+ type: PropType<CSSProperties["tableLayout"]>;
14
14
  default: undefined;
15
15
  };
16
16
  captionSide: {
@@ -105,7 +105,7 @@ export declare const Table: import("../..").WithBoxProps<{
105
105
  classNames: Function | Record<string, any>;
106
106
  styles: Function | Record<string, any>;
107
107
  mod: any;
108
- layout: string;
108
+ layout: import("csstype").Property.TableLayout | undefined;
109
109
  captionSide: "top" | "bottom";
110
110
  borderColor: string;
111
111
  vars: Function | Record<string, any>;
@@ -131,7 +131,7 @@ export declare const Table: import("../..").WithBoxProps<{
131
131
  Defaults: {};
132
132
  }, Readonly<import("vue").ExtractPropTypes<{
133
133
  layout: {
134
- type: PropType<string>;
134
+ type: PropType<CSSProperties["tableLayout"]>;
135
135
  default: undefined;
136
136
  };
137
137
  captionSide: {
@@ -226,7 +226,7 @@ export declare const Table: import("../..").WithBoxProps<{
226
226
  classNames: Function | Record<string, any>;
227
227
  styles: Function | Record<string, any>;
228
228
  mod: any;
229
- layout: string;
229
+ layout: import("csstype").Property.TableLayout | undefined;
230
230
  captionSide: "top" | "bottom";
231
231
  borderColor: string;
232
232
  vars: Function | Record<string, any>;
@@ -249,7 +249,7 @@ export declare const Table: import("../..").WithBoxProps<{
249
249
  __isSuspense?: never;
250
250
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
251
251
  layout: {
252
- type: PropType<string>;
252
+ type: PropType<CSSProperties["tableLayout"]>;
253
253
  default: undefined;
254
254
  };
255
255
  captionSide: {
@@ -344,7 +344,7 @@ export declare const Table: import("../..").WithBoxProps<{
344
344
  classNames: Function | Record<string, any>;
345
345
  styles: Function | Record<string, any>;
346
346
  mod: any;
347
- layout: string;
347
+ layout: import("csstype").Property.TableLayout | undefined;
348
348
  captionSide: "top" | "bottom";
349
349
  borderColor: string;
350
350
  vars: Function | Record<string, any>;
@@ -1,5 +1,6 @@
1
1
  import { type PropType } from 'vue';
2
- type TextTruncate = 'end' | 'start' | boolean;
2
+ export type TextTruncate = 'end' | 'start' | boolean;
3
+ export type TextVariant = 'text' | 'gradient';
3
4
  export declare const Text: import("../..").WithBoxProps<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
5
  component: {
5
6
  type: StringConstructor;
@@ -43,7 +44,7 @@ export declare const Text: import("../..").WithBoxProps<import("vue").DefineComp
43
44
  default: undefined;
44
45
  };
45
46
  variant: {
46
- type: PropType<"text" | "gradient">;
47
+ type: PropType<TextVariant>;
47
48
  default: undefined;
48
49
  };
49
50
  mod: {
@@ -111,7 +112,7 @@ export declare const Text: import("../..").WithBoxProps<import("vue").DefineComp
111
112
  default: undefined;
112
113
  };
113
114
  variant: {
114
- type: PropType<"text" | "gradient">;
115
+ type: PropType<TextVariant>;
115
116
  default: undefined;
116
117
  };
117
118
  mod: {
@@ -135,7 +136,7 @@ export declare const Text: import("../..").WithBoxProps<import("vue").DefineComp
135
136
  default: boolean;
136
137
  };
137
138
  }>> & Readonly<{}>, {
138
- variant: "gradient" | "text";
139
+ variant: TextVariant;
139
140
  gradient: {
140
141
  from: string;
141
142
  to: string;
@@ -155,4 +156,3 @@ export declare const Text: import("../..").WithBoxProps<import("vue").DefineComp
155
156
  __staticSelector: string;
156
157
  truncate: TextTruncate;
157
158
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
158
- export {};
@@ -1,5 +1,6 @@
1
1
  import { type PropType } from 'vue';
2
- export type ThemeIconVariant = 'filled' | 'light' | 'outline' | 'transparent' | 'white' | 'default' | 'gradient' | (string & {});
2
+ import { type MantineVariant } from '../../core';
3
+ export type ThemeIconVariant = 'filled' | 'light' | 'outline' | 'transparent' | 'white' | 'default' | 'gradient';
3
4
  export declare const ThemeIcon: import("../..").WithBoxProps<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
5
  size: PropType<string | number>;
5
6
  color: {
@@ -20,7 +21,7 @@ export declare const ThemeIcon: import("../..").WithBoxProps<import("vue").Defin
20
21
  default: undefined;
21
22
  };
22
23
  variant: {
23
- type: PropType<ThemeIconVariant>;
24
+ type: PropType<MantineVariant<ThemeIconVariant>>;
24
25
  default: undefined;
25
26
  };
26
27
  classNames: {
@@ -61,7 +62,7 @@ export declare const ThemeIcon: import("../..").WithBoxProps<import("vue").Defin
61
62
  default: undefined;
62
63
  };
63
64
  variant: {
64
- type: PropType<ThemeIconVariant>;
65
+ type: PropType<MantineVariant<ThemeIconVariant>>;
65
66
  default: undefined;
66
67
  };
67
68
  classNames: {
@@ -83,7 +84,7 @@ export declare const ThemeIcon: import("../..").WithBoxProps<import("vue").Defin
83
84
  }>> & Readonly<{}>, {
84
85
  color: string;
85
86
  autoContrast: boolean;
86
- variant: ThemeIconVariant;
87
+ variant: MantineVariant<ThemeIconVariant>;
87
88
  gradient: {
88
89
  from: string;
89
90
  to: string;
@@ -4,15 +4,15 @@ import type { BoxProps } from '../Box';
4
4
  * Mantine style props (m, mt, p, w, h, bg, c, …) and Box layout props
5
5
  * (hiddenFrom, visibleFrom, mod, …) are available for autocomplete/IntelliSense
6
6
  * and type-checking.
7
- *
8
- * Runtime is untouched: these props already pass through to the underlying Box
9
- * as fall-through attributes. The merge happens at the instance level
10
- * (`InstanceType<C> & { $props: BoxProps }`) so the component's own props,
11
- * slots, emits and static members (e.g. `Group`) are all preserved.
12
7
  */
8
+ type InstanceOf<C> = C extends new (...args: any[]) => infer I ? I : object;
9
+ type OwnProps<C> = InstanceOf<C> extends {
10
+ $props: infer P;
11
+ } ? P : object;
13
12
  export type WithBoxProps<C> = C & {
14
- new (): (C extends new (...args: any[]) => infer I ? I : object) & {
15
- $props: BoxProps;
13
+ new (): InstanceOf<C> & {
14
+ $props: OwnProps<C> & Omit<BoxProps, keyof OwnProps<C>>;
16
15
  };
17
16
  };
18
17
  export declare function withBoxProps<C>(component: C): WithBoxProps<C>;
18
+ export {};
@@ -4,6 +4,7 @@ export type MantineStyle = CSSProperties;
4
4
  export type MantineClassNames = Record<string, string>;
5
5
  export type MantineStyles = Record<string, MantineStyle>;
6
6
  export type MantineVars = Record<string, Record<string, string | undefined>>;
7
+ export type MantineVariant<T extends string> = T | (string & {});
7
8
  export interface MantineComponentTheme {
8
9
  classNames?: MantineClassNames | ((theme: MantineTheme, props: any) => MantineClassNames);
9
10
  styles?: MantineStyles | ((theme: MantineTheme, props: any) => MantineStyles);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantine-vue/core",
3
- "version": "1.1.3",
3
+ "version": "2.0.0",
4
4
  "description": "Vue component foundation architecturally equivalent to @mantine/core",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -44,8 +44,8 @@
44
44
  "vue": "^3.5.0"
45
45
  },
46
46
  "peerDependencies": {
47
- "@mantine-vue/hooks": "1.1.3",
48
- "@mantine-vue/utils": "1.1.3",
47
+ "@mantine-vue/hooks": "2.0.0",
48
+ "@mantine-vue/utils": "2.0.0",
49
49
  "vue": "^3.5.0"
50
50
  }
51
51
  }