@pequity/squirrel 6.0.13 → 6.1.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.
- package/dist/cjs/chunks/p-action-bar.js +4 -4
- package/dist/cjs/chunks/p-btn.js +204 -0
- package/dist/cjs/chunks/p-select-btn.js +5 -4
- package/dist/cjs/index.js +28 -23
- package/dist/cjs/inputClasses.js +6 -4
- package/dist/cjs/p-btn.js +2 -169
- package/dist/es/chunks/p-action-bar.js +8 -8
- package/dist/es/chunks/p-btn.js +205 -0
- package/dist/es/chunks/p-select-btn.js +5 -4
- package/dist/es/index.js +65 -60
- package/dist/es/inputClasses.js +6 -4
- package/dist/es/p-btn.js +2 -169
- package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +106 -46
- package/dist/squirrel/components/p-card/p-card.vue.d.ts +27 -14
- package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +43 -12
- package/dist/squirrel/components/p-close-btn/p-close-btn.vue.d.ts +1 -1
- package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +1 -1
- package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +15 -422
- package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +1 -3
- package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +13 -11
- package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +39 -14
- package/dist/squirrel/components/p-input/p-input.vue.d.ts +2 -2
- package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +2 -2
- package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +2 -2
- package/dist/squirrel/components/p-link/p-link.vue.d.ts +17 -13
- package/dist/squirrel/components/p-loading/p-loading.vue.d.ts +1 -3
- package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +240 -22
- package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +77 -10
- package/dist/squirrel/components/p-select/p-select.vue.d.ts +116 -14
- package/dist/squirrel/components/p-select-btn/p-select-btn.vue.d.ts +37 -13
- package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +14 -418
- package/dist/squirrel/components/p-table/p-table.vue.d.ts +61 -19
- package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +1 -1
- package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +1 -1
- package/dist/squirrel/components/p-table-td/p-table-td.vue.d.ts +23 -11
- package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +1 -1
- package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +1 -1
- package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +1 -1
- package/dist/squirrel/utils/inputClasses.d.ts +75 -25
- package/dist/squirrel/utils/inputClassesMixin.d.ts +1 -1
- package/dist/squirrel.css +2 -9
- package/package.json +25 -24
- package/squirrel/assets/squirrel.css +1 -1
- package/squirrel/components/p-action-bar/p-action-bar.stories.js +1 -2
- package/squirrel/components/p-btn/p-btn.spec.js +227 -161
- package/squirrel/components/p-btn/p-btn.stories.js +32 -8
- package/squirrel/components/p-btn/p-btn.vue +106 -73
- package/squirrel/components/p-dropdown/p-dropdown.vue +0 -1
- package/squirrel/components/p-file-upload/p-file-upload.vue +6 -16
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +1 -1
- package/squirrel/components/p-select/p-select.spec.js +1 -1
- package/squirrel/components/p-select-btn/p-select-btn.stories.js +45 -4
- package/squirrel/components/p-select-btn/p-select-btn.vue +2 -2
- package/squirrel/components/p-tabs/p-tabs.stories.js +2 -2
- package/squirrel/composables/useInputClasses.spec.js +3 -3
- package/squirrel/utils/inputClasses.ts +6 -4
- package/squirrel/utils/inputClassesMixin.spec.js +3 -3
- package/squirrel/assets/file-upload-drag-over-icon.svg +0 -5
- package/squirrel/assets/file-upload-upload-icon.svg +0 -5
- package/squirrel/assets/file-upload-x-icon-hover.svg +0 -8
- package/squirrel/assets/file-upload-x-icon.svg +0 -8
|
@@ -21,25 +21,36 @@
|
|
|
21
21
|
:disabled="!!$attrs.disabled || loading ? true : null"
|
|
22
22
|
:aria-disabled="$attrs.disabled"
|
|
23
23
|
>
|
|
24
|
-
<div :class="{ invisible: loading }"
|
|
24
|
+
<div :class="[{ invisible: loading }, classes.content]">
|
|
25
|
+
<PIcon v-if="icon" :icon="icon" :class="classes.icon" />
|
|
26
|
+
<span class="slot-wrapper empty:hidden">
|
|
27
|
+
<slot></slot>
|
|
28
|
+
</span>
|
|
29
|
+
<PIcon v-if="iconRight" :icon="iconRight" :class="classes.icon" />
|
|
30
|
+
</div>
|
|
25
31
|
<PRingLoader v-if="loading" :size="loaderSize" :class="classes.loader" />
|
|
26
32
|
</Component>
|
|
27
33
|
</template>
|
|
28
34
|
|
|
29
35
|
<script lang="ts">
|
|
30
36
|
import { type Size, SIZES } from '@squirrel/components/p-btn/p-btn.types';
|
|
37
|
+
import PIcon from '@squirrel/components/p-icon/p-icon.vue';
|
|
31
38
|
import PRingLoader from '@squirrel/components/p-ring-loader/p-ring-loader.vue';
|
|
32
39
|
import { isExternalLink } from '@squirrel/utils/link';
|
|
33
40
|
import { sanitizeUrl } from '@squirrel/utils/sanitization';
|
|
34
41
|
import { tv, type VariantProps } from 'tailwind-variants';
|
|
35
|
-
import {
|
|
36
|
-
import { type RouteLocationRaw
|
|
42
|
+
import { computed, type PropType } from 'vue';
|
|
43
|
+
import { type RouteLocationRaw } from 'vue-router';
|
|
44
|
+
|
|
45
|
+
type Icon = InstanceType<typeof PIcon>['$props']['icon'];
|
|
37
46
|
|
|
38
47
|
const btnClasses = {
|
|
39
48
|
slots: {
|
|
40
49
|
button:
|
|
41
50
|
'relative inline-block rounded font-medium outline-none disabled:pointer-events-none disabled:cursor-default disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-default aria-disabled:opacity-50',
|
|
51
|
+
content: 'flex items-center justify-center has-[.slot-wrapper:empty]:gap-0',
|
|
42
52
|
loader: 'absolute bottom-0 left-0 right-0 top-0 flex items-center justify-center font-medium',
|
|
53
|
+
icon: 'shrink-0',
|
|
43
54
|
},
|
|
44
55
|
variants: {
|
|
45
56
|
type: {
|
|
@@ -72,9 +83,21 @@ const btnClasses = {
|
|
|
72
83
|
'secondary-ghost-dark': { button: 'text-white hover:bg-p-purple-50', loader: 'text-p-blue-15' },
|
|
73
84
|
},
|
|
74
85
|
size: {
|
|
75
|
-
sm: {
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
sm: {
|
|
87
|
+
button: 'px-2 has-[.slot-wrapper:empty]:px-1 py-1 text-sm',
|
|
88
|
+
content: 'gap-1',
|
|
89
|
+
icon: 'text-lg',
|
|
90
|
+
},
|
|
91
|
+
md: {
|
|
92
|
+
button: 'px-6 has-[.slot-wrapper:empty]:px-2 py-2 text-base',
|
|
93
|
+
content: 'gap-2',
|
|
94
|
+
icon: 'text-xl',
|
|
95
|
+
},
|
|
96
|
+
lg: {
|
|
97
|
+
button: 'px-6 has-[.slot-wrapper:empty]:px-2.5 py-2.5 text-lg',
|
|
98
|
+
content: 'gap-2.5',
|
|
99
|
+
icon: 'text-2xl',
|
|
100
|
+
},
|
|
78
101
|
},
|
|
79
102
|
},
|
|
80
103
|
defaultVariants: {
|
|
@@ -84,87 +107,97 @@ const btnClasses = {
|
|
|
84
107
|
} as const;
|
|
85
108
|
|
|
86
109
|
const btn = tv(btnClasses);
|
|
110
|
+
|
|
87
111
|
const BUTTON_TYPES = Object.keys(btnClasses.variants.type);
|
|
88
112
|
const BUTTON_NATIVE_TYPES = ['button', 'submit', 'reset'] as const;
|
|
89
113
|
const LOADER_SIZES = { sm: 24, md: 30, lg: 40 } as const satisfies { [key in Size]: number };
|
|
90
114
|
|
|
91
115
|
type ButtonNativeType = (typeof BUTTON_NATIVE_TYPES)[number];
|
|
92
116
|
type ButtonType = NonNullable<VariantProps<typeof btn>['type']>;
|
|
117
|
+
</script>
|
|
93
118
|
|
|
94
|
-
|
|
119
|
+
<script setup lang="ts">
|
|
120
|
+
defineOptions({
|
|
95
121
|
name: 'PBtn',
|
|
96
|
-
components: {
|
|
97
|
-
PRingLoader,
|
|
98
|
-
RouterLink,
|
|
99
|
-
},
|
|
100
122
|
inheritAttrs: false,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* The button native type e.g button, submit, reset
|
|
114
|
-
*/
|
|
115
|
-
nativeType: {
|
|
116
|
-
type: String as PropType<ButtonNativeType>,
|
|
117
|
-
default: 'button',
|
|
118
|
-
validator(value: ButtonNativeType) {
|
|
119
|
-
return BUTTON_NATIVE_TYPES.includes(value);
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
/**
|
|
123
|
-
* The button size e.g sm, md, lg
|
|
124
|
-
*/
|
|
125
|
-
size: {
|
|
126
|
-
type: String as PropType<Size>,
|
|
127
|
-
default: 'md',
|
|
128
|
-
validator(value: Size) {
|
|
129
|
-
return SIZES.includes(value);
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
/**
|
|
133
|
-
* Whether the button is loading
|
|
134
|
-
*/
|
|
135
|
-
loading: {
|
|
136
|
-
type: Boolean,
|
|
137
|
-
default: false,
|
|
138
|
-
},
|
|
139
|
-
/**
|
|
140
|
-
* Whether the button is selected (sets aria-selected attribute)
|
|
141
|
-
*/
|
|
142
|
-
selected: {
|
|
143
|
-
type: Boolean,
|
|
144
|
-
default: false,
|
|
145
|
-
},
|
|
146
|
-
/**
|
|
147
|
-
* Exactly as the `to` prop in `RouterLink`, when used, it renders a link that triggers a navigation on click.
|
|
148
|
-
* See https://router.vuejs.org/api/#RouteLocationRaw
|
|
149
|
-
*/
|
|
150
|
-
to: {
|
|
151
|
-
type: [Object, String] as PropType<RouteLocationRaw>,
|
|
152
|
-
default: '',
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const props = defineProps({
|
|
126
|
+
/**
|
|
127
|
+
* The button style e.g primary, secondary, primary-outline, secondary-outline, error, success, primary-link
|
|
128
|
+
*/
|
|
129
|
+
type: {
|
|
130
|
+
type: String as PropType<ButtonType>,
|
|
131
|
+
default: 'primary',
|
|
132
|
+
validator(value: ButtonType) {
|
|
133
|
+
return BUTTON_TYPES.includes(value);
|
|
153
134
|
},
|
|
154
135
|
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
136
|
+
/**
|
|
137
|
+
* The button native type e.g button, submit, reset
|
|
138
|
+
*/
|
|
139
|
+
nativeType: {
|
|
140
|
+
type: String as PropType<ButtonNativeType>,
|
|
141
|
+
default: 'button',
|
|
142
|
+
validator(value: ButtonNativeType) {
|
|
143
|
+
return BUTTON_NATIVE_TYPES.includes(value);
|
|
160
144
|
},
|
|
161
|
-
|
|
162
|
-
|
|
145
|
+
},
|
|
146
|
+
/**
|
|
147
|
+
* The button size e.g sm, md, lg
|
|
148
|
+
*/
|
|
149
|
+
size: {
|
|
150
|
+
type: String as PropType<Size>,
|
|
151
|
+
default: 'md',
|
|
152
|
+
validator(value: Size) {
|
|
153
|
+
return SIZES.includes(value);
|
|
163
154
|
},
|
|
164
155
|
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
156
|
+
/**
|
|
157
|
+
* Whether the button is loading
|
|
158
|
+
*/
|
|
159
|
+
loading: {
|
|
160
|
+
type: Boolean,
|
|
161
|
+
default: false,
|
|
162
|
+
},
|
|
163
|
+
/**
|
|
164
|
+
* Whether the button is selected (sets aria-selected attribute)
|
|
165
|
+
*/
|
|
166
|
+
selected: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
default: false,
|
|
169
|
+
},
|
|
170
|
+
/**
|
|
171
|
+
* Exactly as the `to` prop in `RouterLink`, when used, it renders a link that triggers a navigation on click.
|
|
172
|
+
* See https://router.vuejs.org/api/#RouteLocationRaw
|
|
173
|
+
*/
|
|
174
|
+
to: {
|
|
175
|
+
type: [Object, String] as PropType<RouteLocationRaw>,
|
|
176
|
+
default: '',
|
|
168
177
|
},
|
|
178
|
+
/**
|
|
179
|
+
* The icon to display on the button
|
|
180
|
+
*/
|
|
181
|
+
icon: {
|
|
182
|
+
type: String as PropType<Icon>,
|
|
183
|
+
default: '',
|
|
184
|
+
},
|
|
185
|
+
iconRight: {
|
|
186
|
+
type: String as PropType<Icon>,
|
|
187
|
+
default: '',
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
const classes = computed(() => {
|
|
192
|
+
const { button, content, loader, icon } = btn({
|
|
193
|
+
type: props.type,
|
|
194
|
+
size: props.size,
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
return { button: button(), content: content(), loader: loader(), icon: icon() };
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
const loaderSize = computed(() => {
|
|
201
|
+
return Number(`${LOADER_SIZES[props.size]}`);
|
|
169
202
|
});
|
|
170
203
|
</script>
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
>
|
|
19
19
|
<div v-if="!maxFilesReached" class="flex h-28 flex-col items-center justify-center">
|
|
20
20
|
<div v-if="!isDraggingOver" class="flex flex-col items-center">
|
|
21
|
-
<
|
|
21
|
+
<PIcon icon="upload" width="32" class="text-p-gray-50" />
|
|
22
22
|
<div class="mt-2 text-p-gray-50">
|
|
23
23
|
Drag or <span class="text-p-blue-60">select {{ fileWord }}</span>
|
|
24
24
|
</div>
|
|
25
25
|
</div>
|
|
26
26
|
<div v-else class="flex flex-col items-center">
|
|
27
|
-
<
|
|
27
|
+
<PIcon icon="tdesign:drag-drop" width="32" class="text-primary" />
|
|
28
28
|
<div class="mt-2 text-p-purple-60">Drop {{ fileWord }}</div>
|
|
29
29
|
</div>
|
|
30
30
|
<input
|
|
@@ -52,10 +52,9 @@
|
|
|
52
52
|
@click.stop=""
|
|
53
53
|
>
|
|
54
54
|
<div class="truncate" :title="file.name">{{ file.name }}</div>
|
|
55
|
-
<button
|
|
56
|
-
class="
|
|
57
|
-
|
|
58
|
-
></button>
|
|
55
|
+
<button class="h-5 shrink-0 cursor-pointer overflow-hidden" @click.stop="removeFile(index)">
|
|
56
|
+
<PIcon icon="weui:close2-outlined" width="20" class="text-p-gray-60 hover:text-on-error" />
|
|
57
|
+
</button>
|
|
59
58
|
</div>
|
|
60
59
|
</div>
|
|
61
60
|
</div>
|
|
@@ -71,6 +70,7 @@
|
|
|
71
70
|
<script setup lang="ts">
|
|
72
71
|
import { type FileUploadFile } from '@squirrel/components/p-file-upload/p-file-upload.types';
|
|
73
72
|
import { formatBytes, getFileExtension } from '@squirrel/components/p-file-upload/p-file-upload.utils';
|
|
73
|
+
import PIcon from '@squirrel/components/p-icon/p-icon.vue';
|
|
74
74
|
import { useInputClasses } from '@squirrel/composables/useInputClasses';
|
|
75
75
|
import { uniq } from 'lodash-es';
|
|
76
76
|
import { computed, onMounted, type PropType, ref, shallowRef } from 'vue';
|
|
@@ -254,13 +254,3 @@ onMounted(() => {
|
|
|
254
254
|
}
|
|
255
255
|
});
|
|
256
256
|
</script>
|
|
257
|
-
|
|
258
|
-
<style scoped>
|
|
259
|
-
.bg-file-upload-x-icon {
|
|
260
|
-
background-image: url('@squirrel/assets/file-upload-x-icon.svg');
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.bg-file-upload-x-icon:hover {
|
|
264
|
-
background-image: url('@squirrel/assets/file-upload-x-icon-hover.svg');
|
|
265
|
-
}
|
|
266
|
-
</style>
|
|
@@ -45,7 +45,7 @@ const attrs = useAttrs();
|
|
|
45
45
|
const { labelClasses, errorMsgClasses } = useInputClasses(props);
|
|
46
46
|
|
|
47
47
|
// Computed
|
|
48
|
-
const datePickerProps = computed(() => {
|
|
48
|
+
const datePickerProps = computed<VueDatePickerProps>(() => {
|
|
49
49
|
const { modelValue: _, ...propsWithoutModelValue } = props;
|
|
50
50
|
const { class: classes, style, ...attrsWithoutClassAndStyle } = attrs;
|
|
51
51
|
|
|
@@ -52,9 +52,11 @@ export const Default = {
|
|
|
52
52
|
play: async ({ canvasElement }) => {
|
|
53
53
|
const canvas = within(canvasElement);
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
const btn = canvas.getByRole('button', { name: /Aleksandr Chappel/i });
|
|
56
56
|
|
|
57
|
-
await
|
|
57
|
+
await userEvent.click(btn);
|
|
58
|
+
|
|
59
|
+
await expect(btn.getAttribute('aria-selected')).toBe('true');
|
|
58
60
|
},
|
|
59
61
|
};
|
|
60
62
|
|
|
@@ -72,9 +74,9 @@ export const DisabledOption = {
|
|
|
72
74
|
play: async ({ canvasElement }) => {
|
|
73
75
|
const canvas = within(canvasElement);
|
|
74
76
|
|
|
75
|
-
const
|
|
77
|
+
const disabledBtn = canvas.getByRole('button', { name: /Van Deyes/i });
|
|
76
78
|
|
|
77
|
-
await expect(
|
|
79
|
+
await expect(disabledBtn.hasAttribute('disabled')).toBe(true);
|
|
78
80
|
await expect(canvas.getByText(/Meris/i).parentNode.hasAttribute('disabled')).toBe(false);
|
|
79
81
|
await expect(canvas.getByText(/Chick/i).parentNode.hasAttribute('disabled')).toBe(false);
|
|
80
82
|
},
|
|
@@ -245,3 +247,42 @@ export const MultipleSelected = {
|
|
|
245
247
|
},
|
|
246
248
|
},
|
|
247
249
|
};
|
|
250
|
+
|
|
251
|
+
export const WithIcons = {
|
|
252
|
+
args: {
|
|
253
|
+
items: [
|
|
254
|
+
{ value: 1, text: 'Aleksandr Chappel', icon: 'archive' },
|
|
255
|
+
{ value: 2, text: 'Van Deyes', icon: 'edit' },
|
|
256
|
+
{ value: 3, text: 'Meris Hardman', icon: 'delete' },
|
|
257
|
+
{ value: 4, text: 'Chick Catto', icon: 'send' },
|
|
258
|
+
{ value: 5, text: "Alys O'Flynn", icon: 'settings' },
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
parameters: {
|
|
262
|
+
docs: {
|
|
263
|
+
description: {
|
|
264
|
+
story: 'We can pass an `icon` attribute to the list of options to add an icon to an option.',
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export const WithIconsOnly = {
|
|
271
|
+
args: {
|
|
272
|
+
items: [
|
|
273
|
+
{ value: 1, icon: 'archive' },
|
|
274
|
+
{ value: 2, icon: 'edit' },
|
|
275
|
+
{ value: 3, icon: 'delete' },
|
|
276
|
+
{ value: 4, icon: 'send' },
|
|
277
|
+
{ value: 5, icon: 'settings' },
|
|
278
|
+
],
|
|
279
|
+
},
|
|
280
|
+
parameters: {
|
|
281
|
+
docs: {
|
|
282
|
+
description: {
|
|
283
|
+
story:
|
|
284
|
+
'We can pass an `icon` attribute without a `text` attribute to the list of options to only display an icon.',
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div :class="{ flex: grow }">
|
|
3
3
|
<div
|
|
4
4
|
v-for="(item, index) in items"
|
|
5
|
-
:key="item[itemValue]
|
|
5
|
+
:key="String(item[itemValue])"
|
|
6
6
|
v-tooltip="{ content: tooltipText(item) }"
|
|
7
7
|
:class="['inline-flex', { '*:px-0 *:py-0': noPadding, grow }]"
|
|
8
8
|
>
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
:size="size"
|
|
11
11
|
type="secondary-outline-blue"
|
|
12
12
|
:disabled="item.disabled"
|
|
13
|
+
:icon="String(item.icon)"
|
|
13
14
|
:class="{
|
|
14
15
|
'rounded-none': index !== 0 && index !== items.length - 1 && items.length > 1,
|
|
15
16
|
'rounded-br-none rounded-tr-none': index === 0 && items.length > 1,
|
|
@@ -31,7 +32,6 @@ import { type Size } from '@squirrel/components/p-btn/p-btn.types';
|
|
|
31
32
|
import PBtn from '@squirrel/components/p-btn/p-btn.vue';
|
|
32
33
|
|
|
33
34
|
type BtnGroupItem = Record<string, string | number | boolean>;
|
|
34
|
-
type Key = string | number;
|
|
35
35
|
|
|
36
36
|
type Props = {
|
|
37
37
|
modelValue?: string | number | null | BtnGroupItem[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PaginateRightIcon from '@squirrel/assets/pagination-right-icon.svg?inline';
|
|
2
2
|
import PTabs from '@squirrel/components/p-tabs/p-tabs.vue';
|
|
3
3
|
import { action } from '@storybook/addon-actions';
|
|
4
4
|
|
|
@@ -34,7 +34,7 @@ export const Default = {
|
|
|
34
34
|
{
|
|
35
35
|
title: 'Tab 2',
|
|
36
36
|
name: 'tab2',
|
|
37
|
-
icon:
|
|
37
|
+
icon: PaginateRightIcon,
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
title: 'Tab 3',
|
|
@@ -125,7 +125,7 @@ describe('useInputClasses', () => {
|
|
|
125
125
|
});
|
|
126
126
|
const baseSelectClasses = [
|
|
127
127
|
'appearance-none',
|
|
128
|
-
'bg-[right_1rem_center]',
|
|
128
|
+
'bg-[position:right_1rem_center]',
|
|
129
129
|
'bg-no-repeat',
|
|
130
130
|
'pr-10',
|
|
131
131
|
'squirrel-bg-chevron-down',
|
|
@@ -146,7 +146,7 @@ describe('useInputClasses', () => {
|
|
|
146
146
|
});
|
|
147
147
|
const baseSelectClasses = [
|
|
148
148
|
'appearance-none',
|
|
149
|
-
'bg-[right_0.675rem_center]',
|
|
149
|
+
'bg-[position:right_0.675rem_center]',
|
|
150
150
|
'bg-no-repeat',
|
|
151
151
|
'pr-8',
|
|
152
152
|
'squirrel-bg-chevron-down',
|
|
@@ -166,7 +166,7 @@ describe('useInputClasses', () => {
|
|
|
166
166
|
});
|
|
167
167
|
const baseSelectClasses = [
|
|
168
168
|
'appearance-none',
|
|
169
|
-
'bg-[right_1.25rem_center]',
|
|
169
|
+
'bg-[position:right_1.25rem_center]',
|
|
170
170
|
'bg-no-repeat',
|
|
171
171
|
'pr-12',
|
|
172
172
|
'squirrel-bg-chevron-down',
|
|
@@ -39,7 +39,9 @@ const inputClasses = tv({
|
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
rounded: {
|
|
42
|
-
true:
|
|
42
|
+
true: {
|
|
43
|
+
input: 'rounded-full',
|
|
44
|
+
},
|
|
43
45
|
},
|
|
44
46
|
},
|
|
45
47
|
compoundVariants: [
|
|
@@ -113,13 +115,13 @@ const selectClasses = tv({
|
|
|
113
115
|
variants: {
|
|
114
116
|
size: {
|
|
115
117
|
sm: {
|
|
116
|
-
input: 'bg-[right_0.675rem_center] pr-8',
|
|
118
|
+
input: 'bg-[position:right_0.675rem_center] pr-8',
|
|
117
119
|
},
|
|
118
120
|
md: {
|
|
119
|
-
input: 'bg-[right_1rem_center] pr-10',
|
|
121
|
+
input: 'bg-[position:right_1rem_center] pr-10',
|
|
120
122
|
},
|
|
121
123
|
lg: {
|
|
122
|
-
input: 'bg-[right_1.25rem_center] pr-12',
|
|
124
|
+
input: 'bg-[position:right_1.25rem_center] pr-12',
|
|
123
125
|
},
|
|
124
126
|
},
|
|
125
127
|
},
|
|
@@ -136,7 +136,7 @@ describe('inputClassesMixin', () => {
|
|
|
136
136
|
});
|
|
137
137
|
const baseSelectClasses = [
|
|
138
138
|
'appearance-none',
|
|
139
|
-
'bg-[right_1rem_center]',
|
|
139
|
+
'bg-[position:right_1rem_center]',
|
|
140
140
|
'bg-no-repeat',
|
|
141
141
|
'pr-10',
|
|
142
142
|
'squirrel-bg-chevron-down',
|
|
@@ -157,7 +157,7 @@ describe('inputClassesMixin', () => {
|
|
|
157
157
|
});
|
|
158
158
|
const baseSelectClasses = [
|
|
159
159
|
'appearance-none',
|
|
160
|
-
'bg-[right_0.675rem_center]',
|
|
160
|
+
'bg-[position:right_0.675rem_center]',
|
|
161
161
|
'bg-no-repeat',
|
|
162
162
|
'pr-8',
|
|
163
163
|
'squirrel-bg-chevron-down',
|
|
@@ -177,7 +177,7 @@ describe('inputClassesMixin', () => {
|
|
|
177
177
|
});
|
|
178
178
|
const baseSelectClasses = [
|
|
179
179
|
'appearance-none',
|
|
180
|
-
'bg-[right_1.25rem_center]',
|
|
180
|
+
'bg-[position:right_1.25rem_center]',
|
|
181
181
|
'bg-no-repeat',
|
|
182
182
|
'pr-12',
|
|
183
183
|
'squirrel-bg-chevron-down',
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M33 12H14V44H42V21L33 12Z" stroke="#1A123B" stroke-width="3" />
|
|
3
|
-
<path d="M9 36H6V4H25L28 7" stroke="#1A123B" stroke-width="3" />
|
|
4
|
-
<path d="M37 30H19M28 21V39" stroke="#1A123B" stroke-width="3" />
|
|
5
|
-
</svg>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M5.8335 6.25016L10.0002 2.0835L14.1668 6.25016" stroke="#767189" stroke-width="1.25" />
|
|
3
|
-
<path d="M10 2.0835V13.7502" stroke="#767189" stroke-width="1.25" />
|
|
4
|
-
<path d="M2.91675 15V18.3333H17.0834V15" stroke="#767189" stroke-width="1.25" />
|
|
5
|
-
</svg>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path
|
|
3
|
-
d="M0 8C0 9.58225 0.469192 11.129 1.34824 12.4446C2.22729 13.7602 3.47672 14.7855 4.93853 15.391C6.40034 15.9965 8.00887 16.155 9.56072 15.8463C11.1126 15.5376 12.538 14.7757 13.6569 13.6569C14.7757 12.538 15.5376 11.1126 15.8463 9.56072C16.155 8.00887 15.9965 6.40034 15.391 4.93853C14.7855 3.47672 13.7602 2.22729 12.4446 1.34824C11.129 0.469192 9.58225 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8ZM14.3333 8C14.3333 9.25262 13.9619 10.4771 13.266 11.5186C12.5701 12.5601 11.5809 13.3719 10.4237 13.8512C9.2664 14.3306 7.99298 14.456 6.76443 14.2116C5.53588 13.9673 4.40739 13.3641 3.52166 12.4783C2.63592 11.5926 2.03273 10.4641 1.78836 9.23557C1.54399 8.00703 1.66941 6.7336 2.14876 5.57634C2.62812 4.41907 3.43988 3.42994 4.48139 2.73403C5.5229 2.03811 6.74739 1.66667 8 1.66667C9.67916 1.66843 11.289 2.33626 12.4764 3.52361C13.6637 4.71096 14.3316 6.32084 14.3333 8Z"
|
|
4
|
-
fill="#BB1410" />
|
|
5
|
-
<path
|
|
6
|
-
d="M5.88634 4.71322C5.73075 4.55763 5.51972 4.47021 5.29967 4.47021C5.07963 4.47021 4.8686 4.55763 4.71301 4.71322C4.55741 4.86881 4.47 5.07984 4.47 5.29989C4.47 5.51993 4.55741 5.73096 4.71301 5.88655L6.71301 7.88655C6.72914 7.9021 6.74197 7.92074 6.75073 7.94136C6.7595 7.96198 6.76401 7.98415 6.76401 8.00655C6.76401 8.02896 6.7595 8.05113 6.75073 8.07175C6.74197 8.09237 6.72914 8.11101 6.71301 8.12655L4.71301 10.1266C4.63561 10.2034 4.57417 10.2948 4.53225 10.3955C4.49033 10.4962 4.46875 10.6042 4.46875 10.7132C4.46875 10.8223 4.49033 10.9303 4.53225 11.031C4.57417 11.1317 4.63561 11.223 4.71301 11.2999C4.78939 11.3781 4.88063 11.4403 4.98138 11.4827C5.08213 11.5251 5.19035 11.547 5.29967 11.547C5.409 11.547 5.51721 11.5251 5.61796 11.4827C5.71871 11.4403 5.80996 11.3781 5.88634 11.2999L7.88634 9.29989C7.91934 9.27037 7.96207 9.25405 8.00634 9.25405C8.05062 9.25405 8.09334 9.27037 8.12634 9.29989L10.1263 11.2999C10.2027 11.3781 10.294 11.4403 10.3947 11.4827C10.4955 11.5251 10.6037 11.547 10.713 11.547C10.8223 11.547 10.9305 11.5251 11.0313 11.4827C11.132 11.4403 11.2233 11.3781 11.2997 11.2999C11.3771 11.223 11.4385 11.1317 11.4804 11.031C11.5224 10.9303 11.5439 10.8223 11.5439 10.7132C11.5439 10.6042 11.5224 10.4962 11.4804 10.3955C11.4385 10.2948 11.3771 10.2034 11.2997 10.1266L9.29967 8.12655C9.27016 8.09355 9.25384 8.05083 9.25384 8.00655C9.25384 7.96228 9.27016 7.91955 9.29967 7.88655L11.2997 5.88655C11.4553 5.73096 11.5427 5.51993 11.5427 5.29989C11.5427 5.07984 11.4553 4.86881 11.2997 4.71322C11.1441 4.55763 10.9331 4.47021 10.713 4.47021C10.493 4.47021 10.2819 4.55763 10.1263 4.71322L8.12634 6.71322C8.09334 6.74274 8.05062 6.75906 8.00634 6.75906C7.96207 6.75906 7.91934 6.74274 7.88634 6.71322L5.88634 4.71322Z"
|
|
7
|
-
fill="#BB1410" />
|
|
8
|
-
</svg>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path
|
|
3
|
-
d="M0 8C0 9.58225 0.469192 11.129 1.34824 12.4446C2.22729 13.7602 3.47672 14.7855 4.93853 15.391C6.40034 15.9965 8.00887 16.155 9.56072 15.8463C11.1126 15.5376 12.538 14.7757 13.6569 13.6569C14.7757 12.538 15.5376 11.1126 15.8463 9.56072C16.155 8.00887 15.9965 6.40034 15.391 4.93853C14.7855 3.47672 13.7602 2.22729 12.4446 1.34824C11.129 0.469192 9.58225 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8ZM14.3333 8C14.3333 9.25262 13.9619 10.4771 13.266 11.5186C12.5701 12.5601 11.5809 13.3719 10.4237 13.8512C9.2664 14.3306 7.99298 14.456 6.76443 14.2116C5.53588 13.9673 4.40739 13.3641 3.52166 12.4783C2.63592 11.5926 2.03273 10.4641 1.78836 9.23557C1.54399 8.00703 1.66941 6.7336 2.14876 5.57634C2.62812 4.41907 3.43988 3.42994 4.48139 2.73403C5.5229 2.03811 6.74739 1.66667 8 1.66667C9.67916 1.66843 11.289 2.33626 12.4764 3.52361C13.6637 4.71096 14.3316 6.32084 14.3333 8Z"
|
|
4
|
-
fill="#718096" />
|
|
5
|
-
<path
|
|
6
|
-
d="M5.88634 4.71322C5.73075 4.55763 5.51972 4.47021 5.29967 4.47021C5.07963 4.47021 4.8686 4.55763 4.71301 4.71322C4.55741 4.86881 4.47 5.07984 4.47 5.29989C4.47 5.51993 4.55741 5.73096 4.71301 5.88655L6.71301 7.88655C6.72914 7.9021 6.74197 7.92074 6.75073 7.94136C6.7595 7.96198 6.76401 7.98415 6.76401 8.00655C6.76401 8.02896 6.7595 8.05113 6.75073 8.07175C6.74197 8.09237 6.72914 8.11101 6.71301 8.12655L4.71301 10.1266C4.63561 10.2034 4.57417 10.2948 4.53225 10.3955C4.49033 10.4962 4.46875 10.6042 4.46875 10.7132C4.46875 10.8223 4.49033 10.9303 4.53225 11.031C4.57417 11.1317 4.63561 11.223 4.71301 11.2999C4.78939 11.3781 4.88063 11.4403 4.98138 11.4827C5.08213 11.5251 5.19035 11.547 5.29967 11.547C5.409 11.547 5.51721 11.5251 5.61796 11.4827C5.71871 11.4403 5.80996 11.3781 5.88634 11.2999L7.88634 9.29989C7.91934 9.27037 7.96207 9.25405 8.00634 9.25405C8.05062 9.25405 8.09334 9.27037 8.12634 9.29989L10.1263 11.2999C10.2027 11.3781 10.294 11.4403 10.3947 11.4827C10.4955 11.5251 10.6037 11.547 10.713 11.547C10.8223 11.547 10.9305 11.5251 11.0313 11.4827C11.132 11.4403 11.2233 11.3781 11.2997 11.2999C11.3771 11.223 11.4385 11.1317 11.4804 11.031C11.5224 10.9303 11.5439 10.8223 11.5439 10.7132C11.5439 10.6042 11.5224 10.4962 11.4804 10.3955C11.4385 10.2948 11.3771 10.2034 11.2997 10.1266L9.29967 8.12655C9.27016 8.09355 9.25384 8.05083 9.25384 8.00655C9.25384 7.96228 9.27016 7.91955 9.29967 7.88655L11.2997 5.88655C11.4553 5.73096 11.5427 5.51993 11.5427 5.29989C11.5427 5.07984 11.4553 4.86881 11.2997 4.71322C11.1441 4.55763 10.9331 4.47021 10.713 4.47021C10.493 4.47021 10.2819 4.55763 10.1263 4.71322L8.12634 6.71322C8.09334 6.74274 8.05062 6.75906 8.00634 6.75906C7.96207 6.75906 7.91934 6.74274 7.88634 6.71322L5.88634 4.71322Z"
|
|
7
|
-
fill="#718096" />
|
|
8
|
-
</svg>
|