@hulkapps/app-manager-vue 1.0.2 → 2.0.2
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/app-manager-vue.esm.js +39044 -15119
- package/dist/app-manager-vue.min.js +9 -2
- package/dist/app-manager-vue.ssr.js +37559 -15018
- package/dist/hulkapps-app-manager.css +13284 -0
- package/dist/hulkapps-app-manager.min.css +1 -0
- package/package.json +9 -4
- package/src/components/Marketing/Banners.vue +43 -40
- package/src/components/Plans/AppManagerPlan.vue +518 -0
- package/src/components/Plans/PlanBanners.vue +50 -0
- package/src/components/Plans/YearlyPlanPromotion.vue +40 -0
- package/src/components/polaris-vue/src/components/PActionList/PActionList.vue +68 -0
- package/src/components/polaris-vue/src/components/PActionList/components/PActionListItem/PActionListItem.vue +91 -0
- package/src/components/polaris-vue/src/components/PActionList/components/PActionListSection/PActionListSection.vue +68 -0
- package/src/components/polaris-vue/src/components/PActionMenu/PActionMenu.vue +54 -0
- package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuActions/PActionMenuActions.vue +197 -0
- package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuMenuAction/PActionMenuMenuAction.vue +97 -0
- package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuMenuGroup/PActionMenuMenuGroup.vue +54 -0
- package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuRollupActions/PActionMenuRollupActions.vue +43 -0
- package/src/components/polaris-vue/src/components/PAvatar/PAvatar.vue +104 -0
- package/src/components/polaris-vue/src/components/PBadge/PBadge.vue +86 -0
- package/src/components/polaris-vue/src/components/PBanner/PBanner.vue +132 -0
- package/src/components/polaris-vue/src/components/PBreadcrumbs/PBreadcrumbs.vue +99 -0
- package/src/components/polaris-vue/src/components/PButton/PButton.vue +396 -0
- package/src/components/polaris-vue/src/components/PButton/components/PButtonsFrom/PButtonsFrom.vue +47 -0
- package/src/components/polaris-vue/src/components/PButton/components/PUnstyledButton/PUnstyledButton.vue +340 -0
- package/src/components/polaris-vue/src/components/PButtonGroup/PButtonGroup.vue +76 -0
- package/src/components/polaris-vue/src/components/PButtonGroup/components/PButtonGroupItem/PButtonGroupItem.vue +11 -0
- package/src/components/polaris-vue/src/components/PCaption/PCaption.vue +29 -0
- package/src/components/polaris-vue/src/components/PCard/PCard.vue +118 -0
- package/src/components/polaris-vue/src/components/PCard/components/PCardFooter/PCardFooter.vue +11 -0
- package/src/components/polaris-vue/src/components/PCard/components/PCardHeader/PCardHeader.vue +69 -0
- package/src/components/polaris-vue/src/components/PCard/components/PCardSection/PCardSection.vue +54 -0
- package/src/components/polaris-vue/src/components/PCard/components/PCardSubsection/PCardSubsection.vue +12 -0
- package/src/components/polaris-vue/src/components/PConnected/PConnected.vue +44 -0
- package/src/components/polaris-vue/src/components/PConnected/components/PConnectedItem/PConnectedItem.vue +41 -0
- package/src/components/polaris-vue/src/components/PDataTable/PDataTable.vue +541 -0
- package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableCell/PDataTableCell.vue +213 -0
- package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableCellNew/PDataTableCellNew.vue +162 -0
- package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableCol/PDataTableCol.vue +75 -0
- package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableRow/PDataTableRow.vue +15 -0
- package/src/components/polaris-vue/src/components/PDisplayText/PDisplayText.vue +56 -0
- package/src/components/polaris-vue/src/components/PEmptyState/PEmptyState.vue +154 -0
- package/src/components/polaris-vue/src/components/PFieldError/PFieldError.vue +41 -0
- package/src/components/polaris-vue/src/components/PFilter/PFilter.vue +252 -0
- package/src/components/polaris-vue/src/components/PFilter/components/PFilterItem/PFilterItem.vue +11 -0
- package/src/components/polaris-vue/src/components/PFilter/components/PFilterItemWrapper/PFilterItemWrapper.vue +32 -0
- package/src/components/polaris-vue/src/components/PHeading/PHeading.vue +33 -0
- package/src/components/polaris-vue/src/components/PIcon/PIcon.vue +121 -0
- package/src/components/polaris-vue/src/components/PIcon/ShopifyIcons.vue +217 -0
- package/src/components/polaris-vue/src/components/PImage/PImage.vue +49 -0
- package/src/components/polaris-vue/src/components/PLayout/PLayout.vue +42 -0
- package/src/components/polaris-vue/src/components/PLayout/components/PLayoutSection/PLayoutSection.vue +55 -0
- package/src/components/polaris-vue/src/components/PLink/PLink.vue +90 -0
- package/src/components/polaris-vue/src/components/POptionalTag/POptionalTag.vue +23 -0
- package/src/components/polaris-vue/src/components/PPage/PPage.vue +136 -0
- package/src/components/polaris-vue/src/components/PPage/components/PPageHeader/PPageHeader.vue +191 -0
- package/src/components/polaris-vue/src/components/PPage/components/PPageHeaderTitle/PPageHeaderTitle.vue +63 -0
- package/src/components/polaris-vue/src/components/PPagination/PPagination.vue +119 -0
- package/src/components/polaris-vue/src/components/PPopover/PPopover.vue +298 -0
- package/src/components/polaris-vue/src/components/PPopover/components/PPopoverOverlay/PPopoverOverlay.vue +66 -0
- package/src/components/polaris-vue/src/components/PPopover/components/PPositionedOverlay/PPositionedOverlay.vue +289 -0
- package/src/components/polaris-vue/src/components/PSpinner/PSpinner.vue +60 -0
- package/src/components/polaris-vue/src/components/PStack/PStack.vue +84 -0
- package/src/components/polaris-vue/src/components/PStack/components/PStackItem/PStackItem.vue +49 -0
- package/src/components/polaris-vue/src/components/PSubheading/PSubheading.vue +36 -0
- package/src/components/polaris-vue/src/components/PTag/PTag.vue +89 -0
- package/src/components/polaris-vue/src/components/PTextContainer/PTextContainer.vue +41 -0
- package/src/components/polaris-vue/src/components/PTextField/PTextField.vue +229 -0
- package/src/components/polaris-vue/src/components/PTextField/components/PFieldResizer/PFieldResizer.vue +79 -0
- package/src/components/polaris-vue/src/components/PTextField/components/PInput/PInput.vue +473 -0
- package/src/components/polaris-vue/src/components/PTextField/components/PSpinner/PSpinner.vue +47 -0
- package/src/components/polaris-vue/src/components/PTextStyle/PTextStyle.vue +60 -0
- package/src/components/polaris-vue/src/components/PThumbnail/PThumbnail.vue +71 -0
- package/src/components/polaris-vue/src/components/PToggle/PToggle.vue +81 -0
- package/src/components/polaris-vue/src/components/PUnstyledLink/PUnstyledLink.vue +67 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="(to || href) ? 'PUnstyledLink' : 'button'"
|
|
4
|
+
:class="className"
|
|
5
|
+
:id="id"
|
|
6
|
+
:aria-label="accessibilityLabel"
|
|
7
|
+
:role="role"
|
|
8
|
+
@click="$emit('click', $event)"
|
|
9
|
+
@focus="$emit('focus', $event)"
|
|
10
|
+
@blur="$emit('blur', $event)"
|
|
11
|
+
|
|
12
|
+
:url="href"
|
|
13
|
+
:to="to"
|
|
14
|
+
:external="external"
|
|
15
|
+
:download="download"
|
|
16
|
+
|
|
17
|
+
:type="type"
|
|
18
|
+
:disabled="disabled"
|
|
19
|
+
:aria-busy="loading ? true : undefined"
|
|
20
|
+
:aria-controls="ariaControls"
|
|
21
|
+
:aria-expanded="ariaExpanded"
|
|
22
|
+
:aria-describedby="ariaDescribedBy"
|
|
23
|
+
:aria-pressed="pressed"
|
|
24
|
+
@keydown="$emit('keyDown', $event)"
|
|
25
|
+
@keyup="$emit('keyup', $event)"
|
|
26
|
+
@keypress="$emit('keyPress', $event)"
|
|
27
|
+
>
|
|
28
|
+
<span class="Polaris-Button__Content">
|
|
29
|
+
<span v-if="loading" class="Polaris-Button__Spinner">
|
|
30
|
+
<PSpinner size="small" :color="spinnerColor"/>
|
|
31
|
+
</span>
|
|
32
|
+
<span v-if="icon" :class="iconClassName">
|
|
33
|
+
<PIcon :source="loading ? 'placeholder' : icon"/>
|
|
34
|
+
</span>
|
|
35
|
+
<span v-if="!hasNoChildren" :class="childMarkupClassName" :key="disabled ? 'text-disabled' : 'text'">
|
|
36
|
+
<!-- @slot The content to display content inside the button -->
|
|
37
|
+
<slot/>
|
|
38
|
+
</span>
|
|
39
|
+
<span v-if="disclosure" class="Polaris-Button__Icon">
|
|
40
|
+
<div :class="disclosureIconClassName">
|
|
41
|
+
<PIcon :source="loading ? 'placeholder' : 'CaretDownMinor'"/>
|
|
42
|
+
</div>
|
|
43
|
+
</span>
|
|
44
|
+
</span>
|
|
45
|
+
</component>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import { PIcon } from '../../../../components/PIcon';
|
|
50
|
+
import { PSpinner } from '../../../../components/PSpinner';
|
|
51
|
+
import { PUnstyledLink } from '../../../../components/PUnstyledLink';
|
|
52
|
+
import StringValidator from '../../../../utilities/validators/StringValidator';
|
|
53
|
+
import { classNames, variationName } from "../../../../utilities/css";
|
|
54
|
+
|
|
55
|
+
const Size = ['slim', 'medium', 'large'];
|
|
56
|
+
const TextAlign = ['left', 'right', 'center', null];
|
|
57
|
+
const Type = ['submit', 'reset', 'button'];
|
|
58
|
+
const DEFAULT_SIZE = 'medium';
|
|
59
|
+
|
|
60
|
+
export default {
|
|
61
|
+
name: 'PUnstyledButton',
|
|
62
|
+
components: {
|
|
63
|
+
PIcon, PSpinner, PUnstyledLink,
|
|
64
|
+
},
|
|
65
|
+
props: {
|
|
66
|
+
/**
|
|
67
|
+
* Visually hidden text for screen readers
|
|
68
|
+
*/
|
|
69
|
+
accessibilityLabel: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: null,
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Id of the element the button controls
|
|
75
|
+
*/
|
|
76
|
+
ariaControls: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: null,
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* Indicates the ID of the element that describes the button
|
|
82
|
+
*/
|
|
83
|
+
ariaDescribedBy: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: null,
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* Tells screen reader the controlled element is expanded
|
|
89
|
+
*/
|
|
90
|
+
ariaExpanded: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: false,
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* Define aria-controls, aria-haspopup, aria-owns
|
|
96
|
+
*/
|
|
97
|
+
ariaProps: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: false,
|
|
100
|
+
},
|
|
101
|
+
/**
|
|
102
|
+
* Indicates a dangerous or potentially negative action
|
|
103
|
+
*/
|
|
104
|
+
destructive: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: false,
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Indicates a dangerous or potentially negative text
|
|
110
|
+
*/
|
|
111
|
+
destructiveText: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: false,
|
|
114
|
+
},
|
|
115
|
+
/**
|
|
116
|
+
* Disables the button, disallowing merchant interaction
|
|
117
|
+
*/
|
|
118
|
+
disabled: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: false,
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* Displays the button with a disclosure icon.
|
|
124
|
+
*/
|
|
125
|
+
disclosure: {
|
|
126
|
+
type: [Boolean, String],
|
|
127
|
+
default: false,
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* Tells the browser to download the url instead of opening it. Provides a hint for the downloaded filename
|
|
131
|
+
* if it is a string value
|
|
132
|
+
*/
|
|
133
|
+
download: {
|
|
134
|
+
type: [Boolean, String],
|
|
135
|
+
default: false,
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* Forces url to open in a new tab
|
|
139
|
+
*/
|
|
140
|
+
external: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: false,
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* Allows the button to grow to the width of its container
|
|
146
|
+
*/
|
|
147
|
+
fullWidth: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
default: false,
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* A destination to link to, rendered in the href attribute of a link
|
|
153
|
+
*/
|
|
154
|
+
href: {
|
|
155
|
+
type: String,
|
|
156
|
+
default: undefined,
|
|
157
|
+
},
|
|
158
|
+
/**
|
|
159
|
+
* Icon to display to the left of the button content
|
|
160
|
+
* for available icon list.
|
|
161
|
+
*/
|
|
162
|
+
icon: {
|
|
163
|
+
type: String,
|
|
164
|
+
default: null,
|
|
165
|
+
},
|
|
166
|
+
/**
|
|
167
|
+
* Check if button is connected or not
|
|
168
|
+
*/
|
|
169
|
+
isConnectedDisclosure: {
|
|
170
|
+
type: Boolean,
|
|
171
|
+
default: false,
|
|
172
|
+
},
|
|
173
|
+
/**
|
|
174
|
+
* A unique identifier for the button
|
|
175
|
+
*/
|
|
176
|
+
id: {
|
|
177
|
+
type: String,
|
|
178
|
+
default: null,
|
|
179
|
+
},
|
|
180
|
+
/**
|
|
181
|
+
* Replaces button text with a spinner while a background action is being performed
|
|
182
|
+
*/
|
|
183
|
+
loading: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
default: false,
|
|
186
|
+
},
|
|
187
|
+
/**
|
|
188
|
+
* Makes `plain` and `outline` Button colors
|
|
189
|
+
* (text, borders, icons) the same as the current text color.
|
|
190
|
+
*
|
|
191
|
+
* Also adds an underline to `plain` Buttons
|
|
192
|
+
*/
|
|
193
|
+
monochrome: {
|
|
194
|
+
type: Boolean,
|
|
195
|
+
default: false,
|
|
196
|
+
},
|
|
197
|
+
/**
|
|
198
|
+
* Gives the button a subtle alternative to the default button styling, appropriate for certain backdrops
|
|
199
|
+
*/
|
|
200
|
+
outline: {
|
|
201
|
+
type: Boolean,
|
|
202
|
+
default: false,
|
|
203
|
+
},
|
|
204
|
+
/**
|
|
205
|
+
* Renders a button that looks like a link
|
|
206
|
+
*/
|
|
207
|
+
plain: {
|
|
208
|
+
type: Boolean,
|
|
209
|
+
default: false,
|
|
210
|
+
},
|
|
211
|
+
/**
|
|
212
|
+
* Renders a button without border
|
|
213
|
+
*/
|
|
214
|
+
plainAction: {
|
|
215
|
+
type: Boolean,
|
|
216
|
+
default: false,
|
|
217
|
+
},
|
|
218
|
+
/**
|
|
219
|
+
* Sets the button in a pressed state
|
|
220
|
+
*/
|
|
221
|
+
pressed: {
|
|
222
|
+
type: Boolean,
|
|
223
|
+
default: false,
|
|
224
|
+
},
|
|
225
|
+
/**
|
|
226
|
+
* Provides extra visual weight and identifies
|
|
227
|
+
* the primary action in a set of buttons
|
|
228
|
+
*/
|
|
229
|
+
primary: {
|
|
230
|
+
type: Boolean,
|
|
231
|
+
default: false,
|
|
232
|
+
},
|
|
233
|
+
/**
|
|
234
|
+
* Removes underline from button text (including on interaction) when `monochrome` and `plain` are true
|
|
235
|
+
*/
|
|
236
|
+
removeUnderline: {
|
|
237
|
+
type: Boolean,
|
|
238
|
+
default: false,
|
|
239
|
+
},
|
|
240
|
+
/**
|
|
241
|
+
* A valid WAI-ARIA role to define the semantic value of this element
|
|
242
|
+
*/
|
|
243
|
+
role: {
|
|
244
|
+
type: String,
|
|
245
|
+
default: null,
|
|
246
|
+
},
|
|
247
|
+
/**
|
|
248
|
+
* Changes the size of the button, giving it more or less padding
|
|
249
|
+
*/
|
|
250
|
+
size: {
|
|
251
|
+
type: String,
|
|
252
|
+
default: 'medium',
|
|
253
|
+
...StringValidator('size', Size),
|
|
254
|
+
},
|
|
255
|
+
/**
|
|
256
|
+
* Changes the inner text alignment of the button
|
|
257
|
+
*/
|
|
258
|
+
textAlign: {
|
|
259
|
+
type: String,
|
|
260
|
+
default: null,
|
|
261
|
+
...StringValidator('textAlign', TextAlign),
|
|
262
|
+
},
|
|
263
|
+
/**
|
|
264
|
+
* VueRouter link | link object
|
|
265
|
+
*/
|
|
266
|
+
to: {
|
|
267
|
+
type: [String, Object],
|
|
268
|
+
},
|
|
269
|
+
/**
|
|
270
|
+
* Type of the button
|
|
271
|
+
*/
|
|
272
|
+
type: {
|
|
273
|
+
type: String,
|
|
274
|
+
default: 'button',
|
|
275
|
+
...StringValidator('type', Type),
|
|
276
|
+
},
|
|
277
|
+
/**
|
|
278
|
+
* Button content
|
|
279
|
+
*/
|
|
280
|
+
value: {
|
|
281
|
+
type: [String, Number, Array],
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
computed: {
|
|
285
|
+
className() {
|
|
286
|
+
return classNames(
|
|
287
|
+
'Polaris-Button',
|
|
288
|
+
this.primary && 'Polaris-Button--primary',
|
|
289
|
+
this.outline && 'Polaris-Button--outline',
|
|
290
|
+
this.destructive && 'Polaris-Button--destructive',
|
|
291
|
+
!this.destructive && this.destructiveText && 'Polaris-Button--destructiveText',
|
|
292
|
+
this.isDisabled && 'Polaris-Button--disabled',
|
|
293
|
+
this.loading && 'Polaris-Button--loading',
|
|
294
|
+
this.plain && 'Polaris-Button--plain',
|
|
295
|
+
this.plainAction && 'Polaris-Button--plainAction',
|
|
296
|
+
this.pressed && !this.disabled && !this.href && 'Polaris-Button--pressed',
|
|
297
|
+
this.monochrome && 'Polaris-Button--monochrome',
|
|
298
|
+
this.size && this.size !== DEFAULT_SIZE && `Polaris-Button--${variationName('size', this.size)}`,
|
|
299
|
+
this.textAlign && `Polaris-Button--${variationName('textAlign', this.textAlign)}`,
|
|
300
|
+
this.fullWidth && 'Polaris-Button--fullWidth',
|
|
301
|
+
this.icon && this.hasNoChildren && 'Polaris-Button--iconOnly',
|
|
302
|
+
this.isConnectedDisclosure && 'Polaris-Button--connectedDisclosure',
|
|
303
|
+
this.monochrome && 'Polaris-Button--monochrome',
|
|
304
|
+
);
|
|
305
|
+
},
|
|
306
|
+
disclosureIconClassName() {
|
|
307
|
+
return classNames(
|
|
308
|
+
'Polaris-Button__DisclosureIcon',
|
|
309
|
+
this.disclosure === 'up' && 'Polaris-Button__DisclosureIconFacingUp',
|
|
310
|
+
this.loading && 'Polaris-Button__Hidden',
|
|
311
|
+
);
|
|
312
|
+
},
|
|
313
|
+
childMarkupClassName() {
|
|
314
|
+
return classNames(
|
|
315
|
+
'Polaris-Button__Text',
|
|
316
|
+
this.removeUnderline && 'Polaris-Button--removeUnderline',
|
|
317
|
+
);
|
|
318
|
+
},
|
|
319
|
+
isDisabled() {
|
|
320
|
+
return this.disabled || this.loading;
|
|
321
|
+
},
|
|
322
|
+
hasNoChildren() {
|
|
323
|
+
return (this.$slots.default || []).length === 0;
|
|
324
|
+
},
|
|
325
|
+
spinnerColor() {
|
|
326
|
+
return this.primary || this.destructive ? 'white' : 'inkLightest';
|
|
327
|
+
},
|
|
328
|
+
iconClassName() {
|
|
329
|
+
return classNames(
|
|
330
|
+
'Polaris-Button__Icon',
|
|
331
|
+
this.loading && 'Polaris-Button--hidden'
|
|
332
|
+
);
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
}
|
|
336
|
+
</script>
|
|
337
|
+
|
|
338
|
+
<style scoped>
|
|
339
|
+
|
|
340
|
+
</style>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { classNames } from '../../utilities/css';
|
|
3
|
+
import ComponentHelpers from '../../ComponentHelpers';
|
|
4
|
+
import { PButtonGroupItem } from '../../components/PButtonGroup/components/PButtonGroupItem';
|
|
5
|
+
|
|
6
|
+
const Spacing = 'extraTight' | 'tight' | 'loose';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* <br/>
|
|
10
|
+
* <h4 style="font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue,
|
|
11
|
+
* sans-serif;">Button group displays multiple related actions stacked or in a horizontal row to help with arrangement
|
|
12
|
+
* and spacing.</h4>
|
|
13
|
+
*/
|
|
14
|
+
export default {
|
|
15
|
+
name: 'PButtonGroup',
|
|
16
|
+
components: {
|
|
17
|
+
PButtonGroupItem,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
/**
|
|
21
|
+
* Remove top left and right border radius
|
|
22
|
+
*/
|
|
23
|
+
segmented: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Buttons will stretch/shrink to occupy the full width
|
|
29
|
+
*/
|
|
30
|
+
fullWidth: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* Remove top left and right border radius
|
|
36
|
+
*/
|
|
37
|
+
connectedTop: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* Remove top left and right border radius
|
|
43
|
+
*/
|
|
44
|
+
spacing: {
|
|
45
|
+
type: [String, Spacing],
|
|
46
|
+
default: null,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
computed: {
|
|
50
|
+
className() {
|
|
51
|
+
return classNames(
|
|
52
|
+
'Polaris-ButtonGroup',
|
|
53
|
+
this.segmented && 'Polaris-ButtonGroup--segmented',
|
|
54
|
+
this.fullWidth && 'Polaris-ButtonGroup--fullWidth',
|
|
55
|
+
this.connectedTop && 'Polaris-ButtonGroup--connectedTop',
|
|
56
|
+
this.spacing && `Polaris-ButtonGroup--${this.spacing}`,
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
render(createElement) {
|
|
61
|
+
return createElement('div', {
|
|
62
|
+
class: this.className,
|
|
63
|
+
attrs: {
|
|
64
|
+
'data-buttongroup-segmented': this.segmented,
|
|
65
|
+
'data-buttongroup-full-width': this.fullWidth,
|
|
66
|
+
'data-buttongroup-connected-top': this.connectedTop,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
ComponentHelpers.wrapNodesWithComponent(
|
|
70
|
+
createElement,
|
|
71
|
+
this.$slots.default || [], PButtonGroupItem
|
|
72
|
+
),
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<p class="Polaris-Caption" :id="id">
|
|
3
|
+
<!-- @slot Add content to use as a graph label or timestamp -->
|
|
4
|
+
<slot/>
|
|
5
|
+
</p>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* <br/>
|
|
12
|
+
* <h4 style="font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue,
|
|
13
|
+
* sans-serif;">Caption text size is smaller than the recommended size for general reading. On web, it should be
|
|
14
|
+
* used only in a graph or as a timestamp for a list item. On Android and iOS, it can also be used as help text or
|
|
15
|
+
* as other kinds of secondary text for list items.</h4>
|
|
16
|
+
*/
|
|
17
|
+
export default {
|
|
18
|
+
name: 'PCaption',
|
|
19
|
+
props: {
|
|
20
|
+
/**
|
|
21
|
+
* Id for the element
|
|
22
|
+
*/
|
|
23
|
+
id: {
|
|
24
|
+
type: [String, Number],
|
|
25
|
+
default: null
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="className">
|
|
3
|
+
<template
|
|
4
|
+
v-if="$slots.hasOwnProperty('title') || title || $slots.hasOwnProperty('short_description') || shortDescription">
|
|
5
|
+
<PCardHeader :actions="actions">
|
|
6
|
+
<!-- @slot Title content for the card -->
|
|
7
|
+
<slot slot="title" name="title" v-if="$slots.hasOwnProperty('title') || title">
|
|
8
|
+
<PHeading>{{ title }}</PHeading>
|
|
9
|
+
</slot>
|
|
10
|
+
<!-- @slot Short Description content for the card -->
|
|
11
|
+
<slot slot="short_description" name="short_description"
|
|
12
|
+
v-if="$slots.hasOwnProperty('short_description') || shortDescription">
|
|
13
|
+
<PCaption>{{ shortDescription }}</PCaption>
|
|
14
|
+
</slot>
|
|
15
|
+
<template slot="children" v-if="$slots.hasOwnProperty('children')">
|
|
16
|
+
<!-- @slot Inner content of the card -->
|
|
17
|
+
<slot name="children"/>
|
|
18
|
+
</template>
|
|
19
|
+
</PCardHeader>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<template v-if="$slots.hasOwnProperty('default')">
|
|
23
|
+
<template v-if="sectioned">
|
|
24
|
+
<PCardSection>
|
|
25
|
+
<!-- @slot Body content for the card -->
|
|
26
|
+
<slot name="default"/>
|
|
27
|
+
</PCardSection>
|
|
28
|
+
</template>
|
|
29
|
+
<template v-else>
|
|
30
|
+
<!-- @slot Body content for the card -->
|
|
31
|
+
<slot name="default"/>
|
|
32
|
+
</template>
|
|
33
|
+
</template>
|
|
34
|
+
<div v-else>
|
|
35
|
+
<slot/>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<template v-if="$slots.hasOwnProperty('footer')">
|
|
39
|
+
<PCardFooter>
|
|
40
|
+
<!-- @slot Footer content for the card -->
|
|
41
|
+
<slot name="footer"/>
|
|
42
|
+
</PCardFooter>
|
|
43
|
+
</template>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
import { classNames } from '../../utilities/css';
|
|
49
|
+
import { PCardHeader } from '../../components/PCard/components/PCardHeader';
|
|
50
|
+
import { PCardSection } from '../../components/PCard/components/PCardSection';
|
|
51
|
+
import { PCardFooter } from '../../components/PCard/components/PCardFooter';
|
|
52
|
+
import { PHeading } from '../../components/PHeading';
|
|
53
|
+
import { PCaption } from '../../components/PCaption';
|
|
54
|
+
import { PButtonGroup } from '../../components/PButtonGroup';
|
|
55
|
+
import { PLink } from '../../components/PLink';
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* <br/>
|
|
59
|
+
* <h4 style="font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue,
|
|
60
|
+
* sans-serif;">Cards are used to group similar concepts and tasks together to make Shopify easier for merchants to
|
|
61
|
+
* scan, read, and get things done.</h4>
|
|
62
|
+
*/
|
|
63
|
+
export default {
|
|
64
|
+
name: 'PCard',
|
|
65
|
+
components: {
|
|
66
|
+
PCardFooter, PCardHeader, PCardSection, PHeading, PCaption, PButtonGroup, PLink,
|
|
67
|
+
},
|
|
68
|
+
props: {
|
|
69
|
+
/**
|
|
70
|
+
* Title content for the card. **Deprecated** Actions will be removed on future releases,
|
|
71
|
+
* use PCardHeader instead props.
|
|
72
|
+
*/
|
|
73
|
+
title: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: null,
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* Card description. **Deprecated** ShortDescription will be removed on future releases,
|
|
79
|
+
* use PCardHeader instead props.
|
|
80
|
+
*/
|
|
81
|
+
shortDescription: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: null,
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* A less prominent card
|
|
87
|
+
*/
|
|
88
|
+
subdued: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false,
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Auto wrap content in section
|
|
94
|
+
*/
|
|
95
|
+
sectioned: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: false,
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* Actions for Header. **Deprecated** Actions will be removed on future releases,
|
|
101
|
+
* use PCardHeader instead props.
|
|
102
|
+
*/
|
|
103
|
+
actions: {
|
|
104
|
+
type: [Array, String],
|
|
105
|
+
default: null,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
computed: {
|
|
109
|
+
className() {
|
|
110
|
+
return classNames(
|
|
111
|
+
'Polaris-Card',
|
|
112
|
+
this.subdued && 'Polaris-Card__Section--subdued',
|
|
113
|
+
);
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
}
|
|
117
|
+
</script>
|
|
118
|
+
|
package/src/components/polaris-vue/src/components/PCard/components/PCardHeader/PCardHeader.vue
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="Polaris-Card__Header">
|
|
3
|
+
<PStack alignment="baseline">
|
|
4
|
+
<PStackItem fill>
|
|
5
|
+
<slot name="title">
|
|
6
|
+
<PHeading>{{ title }}</PHeading>
|
|
7
|
+
</slot>
|
|
8
|
+
</PStackItem>
|
|
9
|
+
<PStackItem>
|
|
10
|
+
<PButtonGroup v-if="actions" connectedTop>
|
|
11
|
+
<component
|
|
12
|
+
v-for="(action, key) in actions" :key="key"
|
|
13
|
+
:is="(action.to ? 'PLink' : 'PButton')"
|
|
14
|
+
plain
|
|
15
|
+
:href="action.url ? action.url : null"
|
|
16
|
+
:to="action.to ? action.to : null"
|
|
17
|
+
v-on="action.onAction ? { click: action.onAction } : {}"
|
|
18
|
+
>
|
|
19
|
+
{{ action.content }}
|
|
20
|
+
</component>
|
|
21
|
+
</PButtonGroup>
|
|
22
|
+
</PStackItem>
|
|
23
|
+
<PStackItem v-if="$slots.hasOwnProperty('children')">
|
|
24
|
+
<slot name="children"/>
|
|
25
|
+
</PStackItem>
|
|
26
|
+
</PStack>
|
|
27
|
+
<PStack>
|
|
28
|
+
<PStackItem>
|
|
29
|
+
<span class="Polaris-Card__TagLine">
|
|
30
|
+
<template>
|
|
31
|
+
<slot name="short_description">
|
|
32
|
+
{{ shortDescription }}
|
|
33
|
+
</slot>
|
|
34
|
+
</template>
|
|
35
|
+
</span>
|
|
36
|
+
</PStackItem>
|
|
37
|
+
</PStack>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import { PStack } from '../../../../components/PStack';
|
|
43
|
+
import { PStackItem } from '../../../../components/PStack/components/PStackItem';
|
|
44
|
+
import { PHeading } from '../../../../components/PHeading';
|
|
45
|
+
import { PButtonGroup } from '../../../../components/PButtonGroup';
|
|
46
|
+
import { PButton } from '../../../../components/PButton';
|
|
47
|
+
import { PLink } from '../../../../components/PLink';
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
name: 'PCardHeader',
|
|
51
|
+
components: {
|
|
52
|
+
PStack, PStackItem, PHeading, PButtonGroup, PButton, PLink,
|
|
53
|
+
},
|
|
54
|
+
props: {
|
|
55
|
+
title: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: null,
|
|
58
|
+
},
|
|
59
|
+
shortDescription: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: null,
|
|
62
|
+
},
|
|
63
|
+
actions: {
|
|
64
|
+
type: [Array, String],
|
|
65
|
+
default: null,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
</script>
|