@saasquatch/mint-components 2.1.8-1 → 2.1.8-10
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/{ShadowViewAddon-5ce32291.js → ShadowViewAddon-19755faf.js} +384 -98
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +50 -377
- package/dist/cjs/{sqm-big-stat_46.cjs.entry.js → sqm-big-stat_45.cjs.entry.js} +172 -351
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +168 -175
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/sqm-share-code/sqm-share-code.js +0 -1
- package/dist/collection/components/sqm-share-link/ShareLink.stories.js +142 -11
- package/dist/collection/components/sqm-share-link/UseShareLink.stories.js +14 -5
- package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +173 -0
- package/dist/collection/components/sqm-share-link/sqm-share-link.js +536 -26
- package/dist/collection/components/sqm-share-link/useShareLink.js +210 -6
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +0 -2
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/formDefinitions.js +37 -75
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +13 -688
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +1 -95
- package/dist/esm/{ShadowViewAddon-9d97b5d5.js → ShadowViewAddon-23d56d60.js} +386 -100
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_10.entry.js +50 -377
- package/dist/esm/{sqm-big-stat_46.entry.js → sqm-big-stat_45.entry.js} +177 -355
- package/dist/esm/sqm-stencilbook.entry.js +168 -175
- package/dist/esm-es5/ShadowViewAddon-23d56d60.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_45.entry.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-182b5b6a.js +503 -0
- package/dist/mint-components/{p-22e39d2c.entry.js → p-27ec70af.entry.js} +21 -90
- package/dist/mint-components/{p-499885aa.entry.js → p-47b630aa.entry.js} +2 -2
- package/dist/mint-components/p-644fca99.system.js +1 -0
- package/dist/mint-components/p-af8c2202.system.entry.js +1 -0
- package/dist/mint-components/p-ca098be1.system.js +1 -1
- package/dist/mint-components/p-cacb897d.system.entry.js +1 -0
- package/dist/mint-components/{p-a6621899.system.entry.js → p-ebe1eb7a.system.entry.js} +1 -1
- package/dist/mint-components/p-ff378015.entry.js +106 -0
- package/dist/types/components/sqm-share-link/ShareLink.stories.d.ts +10 -0
- package/dist/types/components/sqm-share-link/UseShareLink.stories.d.ts +6 -0
- package/dist/types/components/sqm-share-link/sqm-share-link-view.d.ts +37 -0
- package/dist/types/components/sqm-share-link/sqm-share-link.d.ts +107 -2
- package/dist/types/components/sqm-share-link/useShareLink.d.ts +27 -4
- package/dist/types/components/tax-and-cash/sqm-banking-info-form/formDefinitions.d.ts +0 -2
- package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +0 -4
- package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.d.ts +0 -165
- package/dist/types/components.d.ts +183 -380
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/collection/components/sqm-partner-info-modal/PartnerInfoModal.stories.js +0 -143
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +0 -90
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +0 -462
- package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +0 -180
- package/dist/esm-es5/ShadowViewAddon-9d97b5d5.js +0 -1
- package/dist/esm-es5/sqm-big-stat_46.entry.js +0 -1
- package/dist/mint-components/p-0f036907.system.js +0 -1
- package/dist/mint-components/p-adc4e263.js +0 -463
- package/dist/mint-components/p-b0253f4c.entry.js +0 -108
- package/dist/mint-components/p-d93e19e9.system.entry.js +0 -1
- package/dist/mint-components/p-e45a9966.system.entry.js +0 -1
- package/dist/types/components/sqm-partner-info-modal/PartnerInfoModal.stories.d.ts +0 -13
- package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal-view.d.ts +0 -41
- package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +0 -80
- package/dist/types/components/sqm-partner-info-modal/usePartnerInfoModal.d.ts +0 -16
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { intl } from "../../global/global";
|
|
3
|
+
import { createStyleSheet } from "../../styling/JSS";
|
|
4
|
+
import { CopyTextView } from "../views/copy-text-view";
|
|
5
|
+
const vanillaStyle = `
|
|
6
|
+
:host {
|
|
7
|
+
display: block;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
export function ShareLinkView(props) {
|
|
12
|
+
const { copyTextViewProps, customizeUrl, customizeLinkLabel, saveLabelText, cancelLabelText, successMessage, isEditing, editValue, domainPrefix, editsRemaining, maxEdits, limitReached, validationError, isValidating, isSaving, showSuccess, characterLimit, charactersRemaining, editLimitText, editLimitReachedText, supportLinkText, customizeDisabled, customizeDisabledTooltip, onCustomizeClick, onEditValueChange, onSave, onCancel, } = props;
|
|
13
|
+
const style = {
|
|
14
|
+
Container: {
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column",
|
|
17
|
+
gap: "var(--sl-spacing-x-small)",
|
|
18
|
+
width: "100%",
|
|
19
|
+
},
|
|
20
|
+
CustomizeLinkText: {
|
|
21
|
+
margin: "0",
|
|
22
|
+
fontSize: "var(--sl-font-size-small)",
|
|
23
|
+
fontWeight: "600",
|
|
24
|
+
cursor: "pointer",
|
|
25
|
+
color: "var(--sl-color-neutral-900)",
|
|
26
|
+
textAlign: "left",
|
|
27
|
+
"&:hover": {
|
|
28
|
+
textDecoration: "underline",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
CustomizeLinkDisabled: {
|
|
32
|
+
margin: "0",
|
|
33
|
+
fontSize: "var(--sl-font-size-small)",
|
|
34
|
+
fontWeight: "600",
|
|
35
|
+
color: "var(--sl-color-neutral-400)",
|
|
36
|
+
cursor: "default",
|
|
37
|
+
textAlign: "left",
|
|
38
|
+
},
|
|
39
|
+
EditContainer: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
flexDirection: "column",
|
|
42
|
+
gap: "var(--sl-spacing-x-small)",
|
|
43
|
+
width: "100%",
|
|
44
|
+
},
|
|
45
|
+
EditInputWrapper: {
|
|
46
|
+
display: "flex",
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
width: "100%",
|
|
49
|
+
border: "var(--sqm-border-thickness, 1px) solid var(--sqm-input-border-color, #d1d5db)",
|
|
50
|
+
borderRadius: "var(--sqm-border-radius-normal, 4px)",
|
|
51
|
+
background: "var(--sqm-input-background, #fff)",
|
|
52
|
+
overflow: "hidden",
|
|
53
|
+
"&:focus-within": {
|
|
54
|
+
borderColor: "#999999",
|
|
55
|
+
boxShadow: "0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color)",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
DomainPrefix: {
|
|
59
|
+
padding: "0 0 0 var(--sl-spacing-medium)",
|
|
60
|
+
fontSize: "var(--sl-font-size-medium)",
|
|
61
|
+
color: "var(--sl-color-neutral-500)",
|
|
62
|
+
whiteSpace: "nowrap",
|
|
63
|
+
userSelect: "none",
|
|
64
|
+
lineHeight: "var(--sl-input-height-medium)",
|
|
65
|
+
},
|
|
66
|
+
EditInput: {
|
|
67
|
+
flex: "1",
|
|
68
|
+
border: "none",
|
|
69
|
+
outline: "none",
|
|
70
|
+
padding: "0 var(--sl-spacing-medium) 0 0",
|
|
71
|
+
fontSize: "var(--sl-font-size-medium)",
|
|
72
|
+
fontFamily: "var(--sl-font-sans)",
|
|
73
|
+
color: "var(--sl-input-color)",
|
|
74
|
+
background: "transparent",
|
|
75
|
+
lineHeight: "var(--sl-input-height-medium)",
|
|
76
|
+
minWidth: "0",
|
|
77
|
+
},
|
|
78
|
+
EditLabel: {
|
|
79
|
+
margin: "0",
|
|
80
|
+
fontSize: "var(--sl-font-size-small)",
|
|
81
|
+
color: "var(--sl-color-neutral-500)",
|
|
82
|
+
},
|
|
83
|
+
HelperText: {
|
|
84
|
+
margin: "0",
|
|
85
|
+
fontSize: "var(--sl-font-size-small)",
|
|
86
|
+
color: "var(--sl-color-neutral-500)",
|
|
87
|
+
},
|
|
88
|
+
ErrorText: {
|
|
89
|
+
margin: "0",
|
|
90
|
+
fontSize: "var(--sl-font-size-small)",
|
|
91
|
+
color: "var(--sqm-danger-color-text, #dc2626)",
|
|
92
|
+
},
|
|
93
|
+
SuccessText: {
|
|
94
|
+
margin: "0",
|
|
95
|
+
fontSize: "var(--sl-font-size-small)",
|
|
96
|
+
color: "var(--sl-color-success-600, #16a34a)",
|
|
97
|
+
},
|
|
98
|
+
ActionRow: {
|
|
99
|
+
display: "flex",
|
|
100
|
+
gap: "var(--sl-spacing-medium)",
|
|
101
|
+
alignItems: "center",
|
|
102
|
+
},
|
|
103
|
+
SaveButton: {
|
|
104
|
+
cursor: "pointer",
|
|
105
|
+
fontFamily: "var(--sl-font-sans)",
|
|
106
|
+
fontSize: "var(--sl-font-size-small)",
|
|
107
|
+
fontWeight: "600",
|
|
108
|
+
padding: "var(--sl-spacing-x-small) var(--sl-spacing-medium)",
|
|
109
|
+
borderRadius: "var(--sqm-border-radius-normal, 4px)",
|
|
110
|
+
border: "1px solid var(--sl-color-neutral-900)",
|
|
111
|
+
background: "var(--sl-color-neutral-900)",
|
|
112
|
+
color: "#fff",
|
|
113
|
+
"&:disabled": {
|
|
114
|
+
opacity: "0.5",
|
|
115
|
+
cursor: "default",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
CancelButton: {
|
|
119
|
+
margin: "0",
|
|
120
|
+
fontSize: "var(--sl-font-size-small)",
|
|
121
|
+
fontWeight: "600",
|
|
122
|
+
cursor: "pointer",
|
|
123
|
+
background: "none",
|
|
124
|
+
border: "none",
|
|
125
|
+
padding: "0",
|
|
126
|
+
fontFamily: "var(--sl-font-sans)",
|
|
127
|
+
color: "var(--sl-color-neutral-500)",
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
const sheet = createStyleSheet(style);
|
|
131
|
+
const styleString = sheet.toString();
|
|
132
|
+
const errorMessageType = (validationError === null || validationError === void 0 ? void 0 : validationError.code) === "EXISTING_CODE_CONFLICT" ? "info" : "warning";
|
|
133
|
+
const showCharactersRemaining = charactersRemaining <= 7;
|
|
134
|
+
// Editing state
|
|
135
|
+
if (isEditing) {
|
|
136
|
+
return (h("div", { class: sheet.classes.Container },
|
|
137
|
+
h("style", { type: "text/css" },
|
|
138
|
+
styleString,
|
|
139
|
+
vanillaStyle),
|
|
140
|
+
h("p", { class: sheet.classes.EditLabel }, "Enter your link"),
|
|
141
|
+
h("div", { class: sheet.classes.EditInputWrapper },
|
|
142
|
+
h("span", { class: sheet.classes.DomainPrefix }, domainPrefix),
|
|
143
|
+
h("input", { class: sheet.classes.EditInput, type: "text", value: editValue, onInput: (e) => onEditValueChange(e.target.value), disabled: isSaving, maxLength: characterLimit })),
|
|
144
|
+
h("p", { class: sheet.classes.HelperText },
|
|
145
|
+
editLimitText,
|
|
146
|
+
showCharactersRemaining &&
|
|
147
|
+
` Characters remaining: ${charactersRemaining}`),
|
|
148
|
+
validationError && (h("sqm-form-message", { type: errorMessageType },
|
|
149
|
+
h("p", { part: "alert-title" }, validationError.title),
|
|
150
|
+
validationError.description)),
|
|
151
|
+
isValidating && h("p", { class: sheet.classes.HelperText }, "Validating..."),
|
|
152
|
+
h("div", { class: sheet.classes.ActionRow },
|
|
153
|
+
h("button", { class: sheet.classes.SaveButton, onClick: onSave, disabled: isSaving || isValidating || !!validationError || !editValue }, isSaving ? "Saving..." : saveLabelText),
|
|
154
|
+
h("button", { class: sheet.classes.CancelButton, onClick: onCancel, disabled: isSaving }, cancelLabelText))));
|
|
155
|
+
}
|
|
156
|
+
// Default / Customized / Limit reached states
|
|
157
|
+
return (h("div", { class: sheet.classes.Container },
|
|
158
|
+
h("style", { type: "text/css" },
|
|
159
|
+
styleString,
|
|
160
|
+
vanillaStyle),
|
|
161
|
+
h(CopyTextView, Object.assign({}, copyTextViewProps)),
|
|
162
|
+
showSuccess && h("p", { class: sheet.classes.SuccessText }, successMessage),
|
|
163
|
+
customizeUrl && (customizeDisabled ? (h("sl-tooltip", { content: customizeDisabledTooltip, placement: "top", style: { display: "inline-block", width: "fit-content" } },
|
|
164
|
+
h("p", { class: sheet.classes.CustomizeLinkDisabled }, customizeLinkLabel))) : (h("p", { class: limitReached
|
|
165
|
+
? sheet.classes.CustomizeLinkDisabled
|
|
166
|
+
: sheet.classes.CustomizeLinkText, onClick: limitReached ? undefined : onCustomizeClick }, customizeLinkLabel))),
|
|
167
|
+
customizeUrl && limitReached && (h("p", { class: sheet.classes.HelperText }, intl.formatMessage({
|
|
168
|
+
id: "editLimitReached",
|
|
169
|
+
defaultMessage: editLimitReachedText,
|
|
170
|
+
}, {
|
|
171
|
+
supportLink: (h("a", { target: "_blank", href: "https://example.com" }, supportLinkText)),
|
|
172
|
+
})))));
|
|
173
|
+
}
|