@saasquatch/mint-components 1.14.7-4 → 1.14.7-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.
- package/dist/cjs/sqm-lead-checkbox-field-view-00116edf.js +84 -0
- package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +5 -82
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +65 -2
- package/dist/collection/components/sqm-lead-form/LeadCheckboxField.stories.js +5 -55
- package/dist/collection/components/sqm-lead-form/sqm-lead-checkbox-field-view.js +0 -1
- package/dist/collection/components/sqm-lead-form/sqm-lead-checkbox-field.js +2 -2
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
- package/dist/esm/sqm-lead-checkbox-field-view-f2d478ad.js +82 -0
- package/dist/esm/sqm-lead-checkbox-field.entry.js +9 -86
- package/dist/esm/sqm-stencilbook.entry.js +65 -2
- package/dist/esm-es5/sqm-lead-checkbox-field-view-f2d478ad.js +1 -0
- package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
- 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-09f5f6d1.system.js +1 -0
- package/dist/mint-components/{p-f60d1ae9.entry.js → p-11de051f.entry.js} +2 -2
- package/dist/mint-components/p-1780910e.entry.js +1 -0
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/p-6cb95e3c.js +1 -0
- package/dist/mint-components/p-87499562.system.entry.js +1 -0
- package/dist/mint-components/p-89926dbf.system.entry.js +1 -0
- package/dist/types/components/sqm-lead-form/LeadCheckboxField.stories.d.ts +0 -21
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/package.json +1 -1
- package/dist/mint-components/p-13ce4802.system.entry.js +0 -1
- package/dist/mint-components/p-3bf2b681.entry.js +0 -1
- package/dist/mint-components/p-eaf1a8a6.system.entry.js +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saasquatch/mint-components",
|
|
3
3
|
"title": "Mint Components",
|
|
4
|
-
"version": "1.14.7-
|
|
4
|
+
"version": "1.14.7-6",
|
|
5
5
|
"description": "A minimal design library with components for referral and loyalty experiences. Built with Shoelace components by Saasquatch.",
|
|
6
6
|
"icon": "https://res.cloudinary.com/saasquatch/image/upload/v1652219900/squatch-assets/For_Mint.svg",
|
|
7
7
|
"raisins": "docs/raisins.json",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++){t=arguments[a];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};System.register(["./p-f26aedcd.system.js","./p-48135f99.system.js","./p-bdb7d451.system.js","./p-6cd4f2b1.system.js","./p-4bd679a7.system.js","./p-6333265f.system.js","./p-1a673057.system.js","./p-1d704c40.system.js"],(function(e){"use strict";var t,a,n,o,i,s,r,l,c,d,h,u,b,v,f;return{setters:[function(e){t=e.h;a=e.r},function(e){n=e.i;o=e.k;i=e.f;s=e.n},function(e){r=e.i},function(e){l=e.i},function(e){c=e.c},function(e){d=e.a;h=e.g},function(e){u=e.j;b=e.a},function(e){v=e.L;f=e.R}],execute:function(){var g={ErrorStyle:{"&::part(control)":{background:"var(--sl-color-danger-10)",borderColor:"var(--sl-color-danger-500)",outline:"var(--sl-color-danger-500)"},"&:host":{"--focus-ring":"0 0 0 var(--sl-focus-ring-width) red !important"}},ErrorMessageStyle:{margin:0,marginTop:"5px",color:"var(--sl-color-danger-500)",fontSize:"var(--sl-input-help-text-font-size-medium)",fontFamily:"var(--sl-font-sans)",fontWeight:"var(--sl-font-weight-normal)"},FieldContainer:{"margin-bottom":"var(--sl-spacing-large)"}};var k="\n:host {\n margin: 0 auto;\n width: 100%;\n display: block;\n}\nsl-checkbox::part(label){\n font-size: var(--sl-input-label-font-size-small);\n font-weight: var(--sl-font-weight-normal);\n line-height: 20px;\n}\nsl-checkbox::part(base){\n align-items: start;\n}\n";u.setup(b());var m=u.createStyleSheet(g);var p=m.toString();function x(e){var a,n,o,i,s;var l=e.states,c=e.content,d=e.callbacks;var h=(a=l===null||l===void 0?void 0:l.leadFormState)===null||a===void 0?void 0:a.validationErrors;var u=function(e){var t=e.checkboxLabel;return r.formatMessage({id:"requiredFieldErrorMessage-"+t,defaultMessage:c.errorMessage},{checkboxLabel:t})};return t("div",{class:m.classes.FieldContainer,part:"sqm-base"},t("style",{type:"text/css"},k,p),t("sl-checkbox",Object.assign({exportparts:"label: input-label, base: input-base",name:"/"+c.checkboxName,checked:l.checked,"onSl-change":function(e){e.target.value=e.target.checked;d.setChecked(e.target.value)}},!c.checkboxOptional?{required:false}:[],{disabled:((n=l.leadFormState)===null||n===void 0?void 0:n.loading)||((o=l.leadFormState)===null||o===void 0?void 0:o.disabled),validationError:function(e){var t=e.value;if(!t&&!c.checkboxOptional){return u({checkboxLabel:c.checkboxLabel})}}},((s=(i=l.leadFormState)===null||i===void 0?void 0:i.validationErrors)===null||s===void 0?void 0:s[c.checkboxName])?{class:m.classes.ErrorStyle}:[]),r.formatMessage({id:c.checkboxName+"-message",defaultMessage:c.checkboxLabel},{labelLink:t("a",{href:c.checkboxLabelLink,target:"_blank"},c.checkboxLabelLinkText||c.checkboxLabelLink)})),(h===null||h===void 0?void 0:h[c.checkboxName])&&t("p",{class:m.classes.ErrorMessageStyle},u({checkboxLabel:c.checkboxLabel})))}function y(e){var t;var a=n(v);var s=o(false),r=s[0],l=s[1];i((function(){var t,n;if((t=a===null||a===void 0?void 0:a.initialData)===null||t===void 0?void 0:t[e.checkboxName]){l(!!((n=a===null||a===void 0?void 0:a.initialData)===null||n===void 0?void 0:n[e.checkboxName]))}}),[(t=a===null||a===void 0?void 0:a.initialData)===null||t===void 0?void 0:t[e.checkboxName]]);return{states:{leadFormState:a,checked:r},callbacks:{setChecked:l}}}var L=e("sqm_lead_checkbox_field",function(){function e(e){a(this,e);this.ignored=true;this.checkboxLabel="By signing up you agree to the {labelLink}";this.checkboxLabelLink="https://example.com";this.checkboxLabelLinkText="Terms and Conditions";this.errorMessage="Must be checked";this.checkboxOptional=false;s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=d([{attribute:"checkbox-name",value:this.checkboxName}]);if(!l()&&e){return t(f,{missingProps:e,heading:"An error occured while loading this form",subheading:"A technical problem prevented this checkbox field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"})}var a=__assign({},h(this));var n=l()?S(this):y(this),o=n.states,i=n.callbacks;return t(x,{states:o,content:a,callbacks:i})};return e}());function S(e){return c({states:{registrationFormState:{},checked:false},callbacks:{setChecked:function(){}}},e.demoData||{},{arrayMerge:function(e,t){return t}})}}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,r as s}from"./p-f708da7b.js";import{i as t,k as a,f as o,n as i}from"./p-cd651f81.js";import{i as r}from"./p-65069b66.js";import{i as l}from"./p-94a876b9.js";import{c as n}from"./p-c1086930.js";import{a as c,g as d}from"./p-9ec99ced.js";import{j as h,a as u}from"./p-cef45012.js";import{L as b,R as m}from"./p-f98a4354.js";h.setup(u());const p=h.createStyleSheet({ErrorStyle:{"&::part(control)":{background:"var(--sl-color-danger-10)",borderColor:"var(--sl-color-danger-500)",outline:"var(--sl-color-danger-500)"},"&:host":{"--focus-ring":"0 0 0 var(--sl-focus-ring-width) red !important"}},ErrorMessageStyle:{margin:0,marginTop:"5px",color:"var(--sl-color-danger-500)",fontSize:"var(--sl-input-help-text-font-size-medium)",fontFamily:"var(--sl-font-sans)",fontWeight:"var(--sl-font-weight-normal)"},FieldContainer:{"margin-bottom":"var(--sl-spacing-large)"}}),g=p.toString();function v(s){var t,a,o,i,l;const{states:n,content:c,callbacks:d}=s,h=null===(t=null==n?void 0:n.leadFormState)||void 0===t?void 0:t.validationErrors,u=({checkboxLabel:e})=>r.formatMessage({id:`requiredFieldErrorMessage-${e}`,defaultMessage:c.errorMessage},{checkboxLabel:e});return e("div",{class:p.classes.FieldContainer,part:"sqm-base"},e("style",{type:"text/css"},"\n:host {\n margin: 0 auto;\n width: 100%;\n display: block;\n}\nsl-checkbox::part(label){\n font-size: var(--sl-input-label-font-size-small);\n font-weight: var(--sl-font-weight-normal);\n line-height: 20px;\n}\nsl-checkbox::part(base){\n align-items: start;\n}\n",g),e("sl-checkbox",Object.assign({exportparts:"label: input-label, base: input-base",name:`/${c.checkboxName}`,checked:n.checked,"onSl-change":e=>{e.target.value=e.target.checked,d.setChecked(e.target.value)}},c.checkboxOptional?[]:{required:!1},{disabled:(null===(a=n.leadFormState)||void 0===a?void 0:a.loading)||(null===(o=n.leadFormState)||void 0===o?void 0:o.disabled),validationError:({value:e})=>{if(!e&&!c.checkboxOptional)return u({checkboxLabel:c.checkboxLabel})}},(null===(l=null===(i=n.leadFormState)||void 0===i?void 0:i.validationErrors)||void 0===l?void 0:l[c.checkboxName])?{class:p.classes.ErrorStyle}:[]),r.formatMessage({id:c.checkboxName+"-message",defaultMessage:c.checkboxLabel},{labelLink:e("a",{href:c.checkboxLabelLink,target:"_blank"},c.checkboxLabelLinkText||c.checkboxLabelLink)})),(null==h?void 0:h[c.checkboxName])&&e("p",{class:p.classes.ErrorMessageStyle},u({checkboxLabel:c.checkboxLabel})))}const f=class{constructor(e){s(this,e),this.ignored=!0,this.checkboxLabel="By signing up you agree to the {labelLink}",this.checkboxLabelLink="https://example.com",this.checkboxLabelLinkText="Terms and Conditions",this.errorMessage="Must be checked",this.checkboxOptional=!1,i(this)}disconnectedCallback(){}render(){const s=c([{attribute:"checkbox-name",value:this.checkboxName}]);if(!l()&&s)return e(m,{missingProps:s,heading:"An error occured while loading this form",subheading:"A technical problem prevented this checkbox field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"});const i={...d(this)},{states:r,callbacks:h}=l()?n({states:{registrationFormState:{},checked:!1},callbacks:{setChecked:()=>{}}},this.demoData||{},{arrayMerge:(e,s)=>s}):function(e){var s;const i=t(b),[r,l]=a(!1);return o((()=>{var s,t;(null===(s=null==i?void 0:i.initialData)||void 0===s?void 0:s[e.checkboxName])&&l(!!(null===(t=null==i?void 0:i.initialData)||void 0===t?void 0:t[e.checkboxName]))}),[null===(s=null==i?void 0:i.initialData)||void 0===s?void 0:s[e.checkboxName]]),{states:{leadFormState:i,checked:r},callbacks:{setChecked:l}}}(this);return e(v,{states:r,content:i,callbacks:h})}};export{f as sqm_lead_checkbox_field}
|