@onereach/ui-components 20.1.5 → 20.1.6
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.
|
@@ -33,6 +33,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
33
33
|
root: import("vue").Ref<HTMLButtonElement | undefined>;
|
|
34
34
|
rootStyles: import("vue").ComputedRef<string[]>;
|
|
35
35
|
contentStyles: import("vue").ComputedRef<string[]>;
|
|
36
|
+
contentContainerStyles: import("vue").ComputedRef<string[]>;
|
|
36
37
|
isVue3: boolean;
|
|
37
38
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "focus" | "blur")[], "click" | "focus" | "blur", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
39
|
type: {
|
|
@@ -50,7 +50,7 @@ var ButtonType;
|
|
|
50
50
|
|
|
51
51
|
const Button = [
|
|
52
52
|
// Layout
|
|
53
|
-
'layout-inline-row
|
|
53
|
+
'layout-inline-row',
|
|
54
54
|
// Overflow
|
|
55
55
|
'overflow-hidden',
|
|
56
56
|
// Interactivity
|
|
@@ -61,34 +61,60 @@ const Button = [
|
|
|
61
61
|
'typography-button'];
|
|
62
62
|
const ButtonVariants = {
|
|
63
63
|
[ButtonVariant.Contained]: [
|
|
64
|
+
// Layout
|
|
65
|
+
'layout-inline-row justify-center',
|
|
64
66
|
// Box
|
|
65
67
|
'min-w-[96px]',
|
|
66
68
|
// Spacing
|
|
67
|
-
'px-md md:px-md', 'py-sm+ md:py-sm',
|
|
68
|
-
// Elevation (enabled)
|
|
69
|
-
'enabled:shadow-button', 'dark:enabled:shadow-button-dark'],
|
|
69
|
+
'px-md md:px-md', 'py-sm+ md:py-sm'],
|
|
70
70
|
[ButtonVariant.Outlined]: [
|
|
71
|
+
// Layout
|
|
72
|
+
'layout-inline-row justify-center',
|
|
71
73
|
// Box
|
|
72
74
|
'min-w-[96px]',
|
|
73
75
|
// Spacing
|
|
74
|
-
'px-md* md:px-md*', 'py-sm+* md:py-sm*'
|
|
76
|
+
'px-md* md:px-md*', 'py-sm+* md:py-sm*'],
|
|
75
77
|
[ButtonVariant.Text]: [
|
|
78
|
+
// Layout
|
|
79
|
+
'layout-inline-row justify-center',
|
|
76
80
|
// Box
|
|
77
81
|
'min-w-[96px]',
|
|
78
82
|
// Spacing
|
|
79
|
-
'px-md md:px-md', 'py-sm+ md:py-sm'
|
|
83
|
+
'px-md md:px-md', 'py-sm+ md:py-sm'],
|
|
80
84
|
[ButtonVariant.Link]: [
|
|
85
|
+
// Layout
|
|
86
|
+
'layout-inline-row justify-center']
|
|
87
|
+
};
|
|
88
|
+
const ButtonContainerVariants = {
|
|
89
|
+
[ButtonVariant.Contained]: [
|
|
90
|
+
// Layout
|
|
91
|
+
'layout-inline-row', 'gap-sm+ md:gap-sm'],
|
|
92
|
+
[ButtonVariant.Outlined]: [
|
|
93
|
+
// Layout
|
|
94
|
+
'layout-inline-row', 'gap-sm+ md:gap-sm'],
|
|
95
|
+
[ButtonVariant.Text]: [
|
|
96
|
+
// Layout
|
|
97
|
+
'layout-inline-row', 'gap-sm+ md:gap-sm'],
|
|
98
|
+
[ButtonVariant.Link]: [
|
|
99
|
+
// Layout
|
|
100
|
+
'layout-inline-row',
|
|
81
101
|
// Spacing
|
|
82
102
|
'gap-xs']
|
|
83
103
|
};
|
|
84
104
|
const ButtonColors = {
|
|
85
105
|
'primary-contained': [
|
|
86
106
|
// Theme
|
|
87
|
-
'theme-preset-1-primary', 'dark:theme-preset-1-primary-dark'
|
|
107
|
+
'theme-preset-1-primary', 'dark:theme-preset-1-primary-dark',
|
|
108
|
+
// Elevation (enabled)
|
|
109
|
+
'enabled:shadow-button', 'dark:enabled:shadow-button-dark'],
|
|
88
110
|
'danger-contained': [
|
|
89
111
|
// Theme
|
|
90
|
-
'theme-preset-1-error', 'dark:theme-preset-1-error-dark'
|
|
91
|
-
|
|
112
|
+
'theme-preset-1-error', 'dark:theme-preset-1-error-dark',
|
|
113
|
+
// Elevation (enabled)
|
|
114
|
+
'enabled:shadow-button', 'dark:enabled:shadow-button-dark'],
|
|
115
|
+
'inherit-contained': [
|
|
116
|
+
// Elevation (enabled)
|
|
117
|
+
'enabled:shadow-button', 'dark:enabled:shadow-button-dark'],
|
|
92
118
|
'primary-outlined': [
|
|
93
119
|
// Theme
|
|
94
120
|
'theme-preset-3-primary', 'dark:theme-preset-3-primary-dark', 'theme-border-outline border-1', 'dark:theme-border-outline-dark',
|
|
@@ -133,7 +159,31 @@ const ButtonLoadingColors = {
|
|
|
133
159
|
'danger-link': ['interactivity-none', 'text-error-hover dark:text-error-hover-dark'],
|
|
134
160
|
'inherit-link': ['interactivity-none']
|
|
135
161
|
};
|
|
136
|
-
const
|
|
162
|
+
const ButtonContainerVariantsLoading = {
|
|
163
|
+
'contained': [
|
|
164
|
+
// Position
|
|
165
|
+
'relative', 'flex',
|
|
166
|
+
// Box
|
|
167
|
+
'w-full', 'h-full',
|
|
168
|
+
// Aligment
|
|
169
|
+
'items-center', 'justify-center'],
|
|
170
|
+
'outlined': [
|
|
171
|
+
// Position
|
|
172
|
+
'relative', 'flex',
|
|
173
|
+
// Box
|
|
174
|
+
'w-full', 'h-full',
|
|
175
|
+
// Aligment
|
|
176
|
+
'items-center', 'justify-center'],
|
|
177
|
+
'text': [
|
|
178
|
+
// Position
|
|
179
|
+
'relative', 'flex',
|
|
180
|
+
// Box
|
|
181
|
+
'w-full', 'h-full',
|
|
182
|
+
// Aligment
|
|
183
|
+
'items-center', 'justify-center'],
|
|
184
|
+
'link': ['contents']
|
|
185
|
+
};
|
|
186
|
+
const ButtonContentLoading = {
|
|
137
187
|
'contained': ['invisible'],
|
|
138
188
|
'outlined': ['invisible'],
|
|
139
189
|
'text': ['hidden'],
|
|
@@ -182,11 +232,13 @@ var script = defineComponent({
|
|
|
182
232
|
const root = ref();
|
|
183
233
|
// Styles
|
|
184
234
|
const rootStyles = computed(() => ['or-button-v3', ...Button, ...ButtonVariants[props.variant], ...ButtonColors[`${props.color}-${props.variant}`], ...(props.loading ? ButtonLoadingColors[`${props.color}-${props.variant}`] : [])]);
|
|
185
|
-
const
|
|
235
|
+
const contentContainerStyles = computed(() => [...ButtonContainerVariants[props.variant], ...(props.loading ? ButtonContainerVariantsLoading[props.variant] : [])]);
|
|
236
|
+
const contentStyles = computed(() => ['contents', ...(props.loading ? ButtonContentLoading[props.variant] : [])]);
|
|
186
237
|
return {
|
|
187
238
|
root,
|
|
188
239
|
rootStyles,
|
|
189
240
|
contentStyles,
|
|
241
|
+
contentContainerStyles,
|
|
190
242
|
isVue3
|
|
191
243
|
};
|
|
192
244
|
}
|
|
@@ -212,6 +264,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
212
264
|
focus: e => _ctx.$emit('focus', e),
|
|
213
265
|
blur: e => _ctx.$emit('blur', e)
|
|
214
266
|
}, true)), [createElementVNode("div", {
|
|
267
|
+
class: normalizeClass(_ctx.contentContainerStyles)
|
|
268
|
+
}, [createElementVNode("div", {
|
|
215
269
|
class: normalizeClass(_ctx.contentStyles)
|
|
216
270
|
}, [renderSlot(_ctx.$slots, "default")], 2 /* CLASS */), _ctx.loading ? (openBlock(), createElementBlock(Fragment, {
|
|
217
271
|
key: 0
|
|
@@ -223,7 +277,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
223
277
|
key: 1,
|
|
224
278
|
variant: "text",
|
|
225
279
|
text: _ctx.loadingText
|
|
226
|
-
}, null, 8 /* PROPS */, ["text"]))], 64 /* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true)], 16 /* FULL_PROPS */, _hoisted_1);
|
|
280
|
+
}, null, 8 /* PROPS */, ["text"]))], 64 /* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true)], 2 /* CLASS */)], 16 /* FULL_PROPS */, _hoisted_1);
|
|
227
281
|
}
|
|
228
282
|
|
|
229
283
|
script.render = render;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ButtonColor, ButtonVariant } from './props';
|
|
2
2
|
export declare const Button: string[];
|
|
3
3
|
export declare const ButtonVariants: Record<ButtonVariant, string[]>;
|
|
4
|
+
export declare const ButtonContainerVariants: Record<ButtonVariant, string[]>;
|
|
4
5
|
export declare const ButtonColors: Record<`${ButtonColor}-${ButtonVariant}`, string[]>;
|
|
5
6
|
export declare const ButtonLoadingColors: Record<`${ButtonColor}-${ButtonVariant}`, string[]>;
|
|
6
|
-
export declare const
|
|
7
|
+
export declare const ButtonContainerVariantsLoading: Record<ButtonVariant, string[]>;
|
|
8
|
+
export declare const ButtonContentLoading: Record<ButtonVariant, string[]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/ui-components",
|
|
3
|
-
"version": "20.1.
|
|
3
|
+
"version": "20.1.6",
|
|
4
4
|
"description": "Vue components library for v3",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@codemirror/view": "^6",
|
|
47
47
|
"@floating-ui/dom": "1.5.3",
|
|
48
48
|
"@lezer/highlight": "*",
|
|
49
|
-
"@onereach/styles": "^20.1.
|
|
50
|
-
"@onereach/ui-components-common": "^20.1.
|
|
49
|
+
"@onereach/styles": "^20.1.6",
|
|
50
|
+
"@onereach/ui-components-common": "^20.1.6",
|
|
51
51
|
"@splidejs/splide": "4.0.6",
|
|
52
52
|
"@tiptap/core": "2.0.3",
|
|
53
53
|
"@tiptap/extension-blockquote": "2.0.3",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"access": "public"
|
|
108
108
|
},
|
|
109
109
|
"npmUnpacked": "4.15.2",
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "b46e97a449cd736b8575738ae968fe5570ed5351"
|
|
111
111
|
}
|