@appmax_npm/ds-prime 1.0.0-alpha.24 → 1.0.0-alpha.25

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/button/index.d.ts CHANGED
@@ -1,7 +1,278 @@
1
- import { ButtonProps as PVButtonProps } from 'primevue/button';
2
- export * from 'primevue/button';
1
+ /**
2
+ *
3
+ * Button is an extension to standard button element with icons and theming.
4
+ *
5
+ * [Live Demo](https://www.primevue.org/button/)
6
+ *
7
+ * @module button
8
+ *
9
+ */
10
+ import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, HintedString, PassThrough } from '@primevue/core';
11
+ import type { ComponentHooks } from '@primevue/core/basecomponent';
12
+ import type { PassThroughOptions } from 'primevue/passthrough';
13
+ import { ButtonHTMLAttributes, VNode } from 'vue';
3
14
 
4
- export interface ButtonProps extends PVButtonProps {
15
+ export declare type ButtonPassThroughOptionType<T = any> = ButtonPassThroughAttributes | ((options: ButtonPassThroughMethodOptions<T>) => ButtonPassThroughAttributes | string) | string | null | undefined;
16
+
17
+ /**
18
+ * Custom passthrough(pt) option method.
19
+ */
20
+ export interface ButtonPassThroughMethodOptions<T> {
21
+ /**
22
+ * Defines instance.
23
+ */
24
+ instance: any;
25
+ /**
26
+ * Defines valid properties.
27
+ */
28
+ props: ButtonProps;
29
+ /**
30
+ * Defines current options.
31
+ */
32
+ context: ButtonContext;
33
+ /**
34
+ * Defines parent instance.
35
+ */
36
+ parent: T;
37
+ /**
38
+ * Defines passthrough(pt) options in global config.
39
+ */
40
+ global: object | undefined;
41
+ }
42
+
43
+ /**
44
+ * Custom passthrough(pt) options.
45
+ * @see {@link ButtonProps.pt}
46
+ */
47
+ export interface ButtonPassThroughOptions<T = any> {
48
+ /**
49
+ * Used to pass attributes to the root's DOM element.
50
+ */
51
+ root?: ButtonPassThroughOptionType<T>;
52
+ /**
53
+ * Used to pass attributes to the loading icon's DOM element.
54
+ */
55
+ loadingIcon?: ButtonPassThroughOptionType<T>;
56
+ /**
57
+ * Used to pass attributes to the icon's DOM element.
58
+ */
59
+ icon?: ButtonPassThroughOptionType<T>;
60
+ /**
61
+ * Used to pass attributes to the label's DOM element.
62
+ */
63
+ label?: ButtonPassThroughOptionType<T>;
64
+ /**
65
+ * Used to pass attributes to the Badge component.
66
+ */
67
+ pcBadge?: ButtonPassThroughOptionType<T>;
68
+ /**
69
+ * Used to manage all lifecycle hooks.
70
+ * @see {@link BaseComponent.ComponentHooks}
71
+ */
72
+ hooks?: ComponentHooks;
73
+ }
74
+
75
+ /**
76
+ * Custom passthrough attributes for each DOM elements
77
+ */
78
+ export interface ButtonPassThroughAttributes {
79
+ [key: string]: any;
80
+ }
81
+
82
+ /**
83
+ * Defines valid properties in Button component.
84
+ */
85
+ export interface ButtonProps extends ButtonHTMLAttributes {
86
+ /**
87
+ * Inline style of the button.
88
+ */
89
+ style?: any;
90
+ /**
91
+ * Style class of the button.
92
+ */
93
+ class?: any;
94
+ /**
95
+ * Text of the button.
96
+ */
97
+ label?: string | undefined;
98
+ /**
99
+ * Name of the icon.
100
+ */
101
+ icon?: string | undefined;
102
+ /**
103
+ * Position of the icon.
104
+ * @defaultValue left
105
+ */
106
+ iconPos?: 'left' | 'right' | 'top' | 'bottom' | undefined;
107
+ /**
108
+ * Style class of the icon.
109
+ */
110
+ iconClass?: string | undefined;
111
+ /**
112
+ * Value of the badge.
113
+ */
114
+ badge?: string | undefined;
115
+ /**
116
+ * Style class of the badge.
117
+ */
118
+ badgeClass?: string | undefined;
119
+ /**
120
+ * Severity type of the badge.
121
+ */
122
+ badgeSeverity?: HintedString<'secondary' | 'info' | 'success' | 'warn' | 'danger' | 'contrast'> | null | undefined;
123
+ /**
124
+ * Whether the button is in loading state.
125
+ * @defaultValue false
126
+ */
127
+ loading?: boolean | undefined;
128
+ /**
129
+ * Icon to display in loading state.
130
+ */
131
+ loadingIcon?: string | undefined;
132
+ /**
133
+ * Use to change the HTML tag of root element.
134
+ * @defaultValue BUTTON
135
+ */
136
+ as?: string | undefined;
137
+ /**
138
+ * When enabled, it changes the default rendered element for the one passed as a child element.
139
+ * @defaultValue false
140
+ */
141
+ asChild?: boolean | undefined;
142
+ /**
143
+ * Add a link style to the button.
144
+ * @defaultValue false
145
+ */
146
+ link?: boolean | undefined;
147
+ /**
148
+ * Defines the style of the button.
149
+ */
150
+ severity?: HintedString<'secondary' | 'success' | 'info' | 'warn' | 'help' | 'danger' | 'contrast'> | undefined;
151
+ /**
152
+ * Add a shadow to indicate elevation.
153
+ * @defaultValue false
154
+ */
155
+ raised?: boolean | undefined;
156
+ /**
157
+ * Add a circular border radius to the button.
158
+ * @defaultValue false
159
+ */
160
+ rounded?: boolean | undefined;
161
+ /**
162
+ * Add a textual class to the button without a background initially.
163
+ * @defaultValue false
164
+ */
165
+ text?: boolean | undefined;
166
+ /**
167
+ * Add a border class without a background initially.
168
+ * @defaultValue false
169
+ */
170
+ outlined?: boolean | undefined;
171
+ /**
172
+ * Defines the size of the button.
173
+ */
174
+ size?: 'small' | 'large' | undefined;
175
+ /**
176
+ * Add a plain textual class to the button without a background initially.
177
+ * @defaultValue false
178
+ */
179
+ plain?: boolean | undefined;
180
+ /**
181
+ * Spans 100% width of the container when enabled.
182
+ * @defaultValue null
183
+ */
184
+ fluid?: boolean | undefined;
185
+ /**
186
+ * It generates scoped CSS variables using design tokens for the component.
187
+ */
188
+ dt?: DesignToken<any>;
189
+ /**
190
+ * Used to pass attributes to DOM elements inside the component.
191
+ * @type {ButtonPassThroughOptions}
192
+ */
193
+ pt?: PassThrough<ButtonPassThroughOptions<any>>;
194
+ /**
195
+ * Used to configure passthrough(pt) options of the component.
196
+ * @type {PassThroughOptions}
197
+ */
198
+ ptOptions?: PassThroughOptions;
199
+ /**
200
+ * When enabled, it removes component related styles in the core.
201
+ * @defaultValue false
202
+ */
203
+ unstyled?: boolean;
204
+ }
205
+
206
+ /**
207
+ * Defines current options in Button component.
208
+ */
209
+ export interface ButtonContext {
210
+ /**
211
+ * Current disabled state of the element as a boolean.
212
+ * @defaultValue false
213
+ */
214
+ disabled: boolean;
215
+ }
216
+
217
+ /**
218
+ * Defines valid slots in Button component.
219
+ */
220
+ export interface ButtonSlots {
221
+ /**
222
+ * Custom content such as icons, images and text can be placed inside the button via the default slot. Note that when slot is used, label, icon and badge properties are not included.
223
+ */
224
+ default(): VNode[];
225
+ /**
226
+ * Custom icon template.
227
+ * @param {Object} scope - icon slot's params.
228
+ */
229
+ icon(scope: {
230
+ /**
231
+ * Style class of the icon.
232
+ */
233
+ class: string;
234
+ }): VNode[];
235
+ /**
236
+ * Custom loading icon template.
237
+ * @param {Object} scope - loading icon slot's params.
238
+ */
239
+ loadingicon(scope: {
240
+ /**
241
+ * Style class of the loading icon.
242
+ */
243
+ class: string;
244
+ }): VNode[];
245
+ }
246
+
247
+ /**
248
+ * Defines valid emits in Button component.
249
+ */
250
+ export interface ButtonEmitsOptions {}
251
+
252
+ export declare type ButtonEmits = EmitFn<ButtonEmitsOptions>;
253
+
254
+ /**
255
+ * **PrimeVue - Button**
256
+ *
257
+ * _Button is an extension to standard button element with icons and theming._
258
+ *
259
+ * [Live Demo](https://www.primevue.org/button/)
260
+ * --- ---
261
+ * ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
262
+ *
263
+ * @group Component
264
+ *
265
+ */
266
+ declare const Button: DefineComponent<ButtonProps, ButtonSlots, ButtonEmits>;
267
+
268
+ declare module 'vue' {
269
+ export interface GlobalComponents {
270
+ Button: GlobalComponentConstructor<ButtonProps, ButtonSlots, ButtonEmits>;
271
+ }
272
+ }
273
+
274
+ export default Button;
275
+ export interface ButtonProps {
5
276
  href?: string;
6
277
  to?: string | object;
7
278
  }
package/button/index.js CHANGED
@@ -1,24 +1,18 @@
1
- import { h } from 'vue';
2
- import PVButton from 'primevue/button';
3
-
4
- const Button = {
5
- name: 'Button',
1
+ import t from "primevue/button";
2
+ const n = {
3
+ name: "Button",
4
+ extends: t,
6
5
  props: {
6
+ as: String,
7
7
  href: String,
8
8
  to: [String, Object]
9
9
  },
10
10
  computed: {
11
11
  as() {
12
- if (this.as) return this.as;
13
- if (this.href) return 'a';
14
- if (this.to) return 'router-link';
15
- return 'button';
12
+ return this.as ? this.as : this.href ? "a" : this.to ? "router-link" : "button";
16
13
  }
17
- },
18
- render() {
19
- this.$props.as = this.as;
20
- return h(PVButton, this.$props, this.$slots);
21
14
  }
22
15
  };
23
-
24
- export default Button;
16
+ export {
17
+ n as default
18
+ };
package/config/preset.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { definePreset } from '@primevue/themes';
2
2
  import Lara from '@primevue/themes/lara';
3
- export var AmPreset = definePreset(Lara, {
3
+ export const AmPreset = definePreset(Lara, {
4
4
  primitive: {
5
5
  purple: {
6
6
  50: '#f7f3ff',
package/config/theme.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AmPreset } from './preset';
2
- export var AmDSPrimeConfig = {
2
+ export const AmDSPrimeConfig = {
3
3
  theme: {
4
4
  preset: AmPreset,
5
5
  options: {
package/index.js CHANGED
@@ -2,8 +2,8 @@ import Primevue from 'primevue/config';
2
2
  import { AmDSPrimeConfig } from './config/theme';
3
3
  import ToastService from 'primevue/toastservice';
4
4
  import './css/index.css';
5
- export var AmDSPrime = {
6
- install: function (app) {
5
+ export const AmDSPrime = {
6
+ install(app) {
7
7
  app.use(Primevue, AmDSPrimeConfig);
8
8
  app.use(ToastService);
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appmax_npm/ds-prime",
3
- "version": "1.0.0-alpha.24",
3
+ "version": "1.0.0-alpha.25",
4
4
  "description": "Design System da Appmax baseado no Primevue",
5
5
  "author": "Appmax",
6
6
  "type": "module",
@@ -10,10 +10,6 @@
10
10
  "./css/index.css": "./css/index.css"
11
11
  },
12
12
  "dependencies": {
13
- "@primevue/themes": "^4.0.4",
14
- "primevue": "^4.0.4"
15
- },
16
- "peerDependencies": {
17
- "vue": "^3.0.0"
13
+ "@primevue/themes": "^4.0.4"
18
14
  }
19
15
  }
package/tailwind/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export var AmTailwindConfig = {
1
+ export const AmTailwindConfig = {
2
2
  content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
3
3
  darkMode: 'class',
4
4
  theme: {