@nemme/js-sdk 0.10.0 → 1.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/README.md +25 -3
- package/dist/chunks/{client-C7-LfdBd.js → client-C3wRx9Wo.js} +2 -2
- package/dist/chunks/{client-C2tphX4E.js.map → client-C3wRx9Wo.js.map} +1 -1
- package/dist/chunks/{client-C2tphX4E.js → client-DhBV0jqm.js} +21 -10
- package/dist/chunks/{client-C7-LfdBd.js.map → client-DhBV0jqm.js.map} +1 -1
- package/dist/chunks/form-manager-BYkXaNNz.js +12 -0
- package/dist/chunks/form-manager-BYkXaNNz.js.map +1 -0
- package/dist/chunks/{form-manager-B6ielB39.js → form-manager-Cm1pBxZ2.js} +33 -32
- package/dist/chunks/form-manager-Cm1pBxZ2.js.map +1 -0
- package/dist/client.d.ts +6 -1
- package/dist/forms/question-text/question-text.d.ts +1 -0
- package/dist/forms.cjs +1 -1
- package/dist/forms.esm.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/js-sdk.css +2 -1
- package/dist/nemme-sdk.umd.js +4 -4
- package/dist/nemme-sdk.umd.js.map +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.esm.js +1 -1
- package/dist/types/forms.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunks/form-manager-B6ielB39.js.map +0 -1
- package/dist/chunks/form-manager-CVog992B.js +0 -12
- package/dist/chunks/form-manager-CVog992B.js.map +0 -1
|
@@ -1495,7 +1495,7 @@ var $e = ({ step: e, form: t, formState: n, onDismiss: r, onNextStep: i, onPrevi
|
|
|
1495
1495
|
});
|
|
1496
1496
|
}
|
|
1497
1497
|
if (e.questionType === "text") {
|
|
1498
|
-
let { title: s, description: l, image: u, maxChars: d, limited: f, required: p } = e,
|
|
1498
|
+
let { title: s, description: l, image: u, maxChars: d, limited: f, required: p, customPlaceholder: h, placeholder: g } = e, _ = n.responses[e.id] || "", v = (f && d ? _.length <= d : !0) && (p ? _.length > 0 : !0);
|
|
1499
1499
|
return /* @__PURE__ */ m(Wn, {
|
|
1500
1500
|
title: s,
|
|
1501
1501
|
icon: t.icon,
|
|
@@ -1505,11 +1505,12 @@ var $e = ({ step: e, form: t, formState: n, onDismiss: r, onNextStep: i, onPrevi
|
|
|
1505
1505
|
onQuit: () => r(n),
|
|
1506
1506
|
image: u,
|
|
1507
1507
|
maxCharacters: f ? d : void 0,
|
|
1508
|
-
|
|
1508
|
+
placeholder: h && g ? g : void 0,
|
|
1509
|
+
inputText: _,
|
|
1509
1510
|
setInputText: (t) => {
|
|
1510
1511
|
f && d && t.length > d || o(e.id, t);
|
|
1511
1512
|
},
|
|
1512
|
-
isValid:
|
|
1513
|
+
isValid: v,
|
|
1513
1514
|
hasPreviousStep: c.hasPreviousStep,
|
|
1514
1515
|
hasNextStep: c.hasNextStep
|
|
1515
1516
|
});
|
|
@@ -5665,24 +5666,24 @@ var K = On, q = ({ variant: e = "primary", size: t = "medium", text: n, iconBefo
|
|
|
5665
5666
|
case "medium": return "text-[15px] leading-[16px] -tracking-0,1";
|
|
5666
5667
|
}
|
|
5667
5668
|
}, Nn = {
|
|
5668
|
-
Di1: "text-[72px] font-
|
|
5669
|
-
Di2: "text-[60px] font-
|
|
5670
|
-
Di3: "text-[48px] font-
|
|
5671
|
-
T1: "text-[40px] font-
|
|
5672
|
-
T2: "text-[32px] font-
|
|
5673
|
-
T3: "text-[24px] font-
|
|
5674
|
-
H1: "text-[24px] font-
|
|
5675
|
-
H2: "text-[20px] font-
|
|
5676
|
-
H3: "text-[15px] font-
|
|
5677
|
-
H4: "text-[13px] font-
|
|
5678
|
-
B1B: "text-[15px] font-
|
|
5679
|
-
B1: "text-[15px] leading-[24px] -tracking-0,1",
|
|
5680
|
-
B1Button: "text-[15px] leading-[16px] -tracking-0,1",
|
|
5681
|
-
B2: "text-[13px] leading-[20px]",
|
|
5682
|
-
B2Button: "text-[13px] leading-[16px]",
|
|
5683
|
-
D1B: "text-[12px] font-
|
|
5684
|
-
D1: "text-[12px] leading-[16px]",
|
|
5685
|
-
M: "text-[10px] leading-[16px]"
|
|
5669
|
+
Di1: "text-[72px] font-medium leading-[90px] -tracking-2,5",
|
|
5670
|
+
Di2: "text-[60px] font-medium leading-[72px] -tracking-2,0",
|
|
5671
|
+
Di3: "text-[48px] font-medium leading-[60px] -tracking-1,5",
|
|
5672
|
+
T1: "text-[40px] font-medium leading-[48px] -tracking-1,5",
|
|
5673
|
+
T2: "text-[32px] font-medium leading-[40px] -tracking-1",
|
|
5674
|
+
T3: "text-[24px] font-medium leading-[32px] -tracking-0,5",
|
|
5675
|
+
H1: "text-[24px] font-medium leading-[32px] -tracking-0,5",
|
|
5676
|
+
H2: "text-[20px] font-medium leading-[24px]",
|
|
5677
|
+
H3: "text-[15px] font-medium leading-[20px]",
|
|
5678
|
+
H4: "text-[13px] font-medium leading-[16px]",
|
|
5679
|
+
B1B: "text-[15px] font-semibold leading-[24px] -tracking-0,1",
|
|
5680
|
+
B1: "text-[15px] font-regular leading-[24px] -tracking-0,1",
|
|
5681
|
+
B1Button: "text-[15px] font-regular leading-[16px] -tracking-0,1",
|
|
5682
|
+
B2: "text-[13px] font-regular leading-[20px]",
|
|
5683
|
+
B2Button: "text-[13px] font-regular leading-[16px]",
|
|
5684
|
+
D1B: "text-[12px] font-semibold leading-[16px]",
|
|
5685
|
+
D1: "text-[12px] font-regular leading-[16px]",
|
|
5686
|
+
M: "text-[10px] font-regular leading-[16px]"
|
|
5686
5687
|
}, J = ({ children: e, className: t, variant: n = "B1", significance: r = "primary", as: i }) => {
|
|
5687
5688
|
let a = i ?? Pn[n], o = Nn[n];
|
|
5688
5689
|
return /* @__PURE__ */ m(a, {
|
|
@@ -5802,8 +5803,8 @@ var Y = {
|
|
|
5802
5803
|
transparent: "#00000000",
|
|
5803
5804
|
grey: {
|
|
5804
5805
|
0: "#FFFFFF",
|
|
5805
|
-
5: "#
|
|
5806
|
-
10: "#
|
|
5806
|
+
5: "#F9F9FA",
|
|
5807
|
+
10: "#F2F2F5",
|
|
5807
5808
|
50: "#E5E5EA",
|
|
5808
5809
|
75: "#DEDEE1",
|
|
5809
5810
|
100: "#D1D1D6",
|
|
@@ -5971,7 +5972,7 @@ var Y = {
|
|
|
5971
5972
|
950: "#00000080"
|
|
5972
5973
|
}
|
|
5973
5974
|
};
|
|
5974
|
-
Y.grey[
|
|
5975
|
+
Y.grey[0], Y.grey[990], Y.grey[10], Y.grey[950], Y.grey[50], Y.grey[900], Y.grey[10], Y.grey[990], Y.grey[0], Y.grey[950], Y.grey[10], Y.grey[900], Y.grey[10], Y.grey[900], Y.grey[50], Y.grey[900], Y.grey[100], Y.grey[800], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["opacity-grey"][700], Y["opacity-grey"][200], Y["opacity-grey"][950], Y["opacity-grey"][990], Y.grey[1e3], Y.grey[0], Y.grey[500], Y.grey[400], Y.grey[400], Y.grey[500], Y.grey[400], Y.grey[400], Y.grey[0], Y.grey[1e3], Y.grey[100], Y.grey[700], Y["strong-blue"][600], Y["strong-blue"][300], Y["strong-blue"][400], Y["strong-blue"][500], Y["strong-blue"][600], Y["strong-blue"][600], Y["strong-blue"][50], Y["strong-blue"][950], Y["strong-blue"][950], Y["strong-blue"][50], Y.grey[100], Y.grey[700], Y.grey[1e3], Y.grey[0], Y.grey[900], Y.grey[100], Y.grey[0], Y.grey[1e3], Y.grey[100], Y.grey[700], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["opacity-grey"][700], Y["opacity-grey"][200], Y["opacity-grey"][600], Y["opacity-grey"][300], Y["banana-yellow"][400], Y["banana-yellow"][400], Y["banana-yellow"][100], Y["banana-yellow"][100], Y["banana-yellow"][50], Y["banana-yellow"][50], Y["banana-yellow"][5], Y["banana-yellow"][5], Y["banana-yellow"][800], Y["banana-yellow"][400], Y["bright-coral"][400], Y["bright-coral"][400], Y["bright-coral"][100], Y["bright-coral"][100], Y["bright-coral"][50], Y["bright-coral"][50], Y["bright-coral"][5], Y["bright-coral"][5], Y["bright-coral"][600], Y["bright-coral"][400], Y["minty-blue"][400], Y["minty-blue"][400], Y["minty-blue"][100], Y["minty-blue"][100], Y["minty-blue"][50], Y["minty-blue"][50], Y["minty-blue"][5], Y["minty-blue"][5], Y["minty-blue"][800], Y["minty-blue"][400], Y.grey[300], Y.grey[600], Y.grey[50], Y.grey[900], Y.grey[100], Y.grey[800], Y.grey[100], Y.grey[700], Y.grey[10], Y.grey[900], Y.grey[5], Y.grey[990], Y.grey[0], Y.grey[1e3], Y.green[10], Y.green[800], Y.green[400], Y.green[300], Y.green[600], Y.green[75], Y.green[800], Y.green[10], Y.yellow[10], Y.yellow[800], Y.yellow[400], Y.yellow[300], Y.yellow[600], Y.yellow[75], Y.yellow[800], Y.yellow[10], Y.red[10], Y.red[800], Y.red[400], Y.red[300], Y.red[600], Y.red[75], Y.red[800], Y.red[10], Y.grey[0], Y.grey[1e3], Y.grey[10], Y.grey[950], Y.grey[100], Y.grey[900], Y.grey[300], Y.grey[800], Y.grey[400], Y.grey[700], Y.grey[600], Y.grey[600], Y.grey[700], Y.grey[400], Y.grey[800], Y.grey[300], Y.grey[900], Y.grey[100], Y.grey[950], Y.grey[10], Y.grey[1e3], Y.grey[0], Y.red[400], Y.red[300], Y.red[600], Y.red[100], Y.orange[400], Y.orange[300], Y.orange[600], Y.orange[100], Y.yellow[400], Y.yellow[300], Y.yellow[600], Y.yellow[100], Y.green[400], Y.green[300], Y.green[600], Y.green[100], Y.mint[400], Y.mint[300], Y.mint[600], Y.mint[100], Y.teal[400], Y.teal[300], Y.teal[600], Y.teal[100], Y.cyan[400], Y.cyan[300], Y.cyan[600], Y.cyan[100], Y.blue[400], Y.blue[300], Y.blue[600], Y.blue[100], Y.indigo[400], Y.indigo[300], Y.indigo[600], Y.indigo[100], Y.purple[400], Y.purple[300], Y.purple[600], Y.purple[100], Y.pink[400], Y.pink[300], Y.pink[600], Y.pink[100], Y.brown[400], Y.brown[300], Y.brown[600], Y.brown[100];
|
|
5975
5976
|
//#endregion
|
|
5976
5977
|
//#region src/forms/question-wrapper.tsx
|
|
5977
5978
|
var Vn = ({ title: e, icon: t, description: n, image: r, children: i, onPrevious: a, onNext: o, onQuit: s, isValid: c, hasPreviousStep: l, hasNextStep: u }) => {
|
|
@@ -6105,8 +6106,8 @@ var Vn = ({ title: e, icon: t, description: n, image: r, children: i, onPrevious
|
|
|
6105
6106
|
fill: t
|
|
6106
6107
|
})]
|
|
6107
6108
|
});
|
|
6108
|
-
}, Wn = ({ title: e, icon: t, description: n, image: r, onPrevious: i, onNext: a, onQuit: o, inputText: s, setInputText: c, maxCharacters: l,
|
|
6109
|
-
let { t:
|
|
6109
|
+
}, Wn = ({ title: e, icon: t, description: n, image: r, onPrevious: i, onNext: a, onQuit: o, inputText: s, setInputText: c, maxCharacters: l, placeholder: u, isValid: d, hasPreviousStep: f, hasNextStep: p }) => {
|
|
6110
|
+
let { t: g } = Ze();
|
|
6110
6111
|
return /* @__PURE__ */ m(Vn, {
|
|
6111
6112
|
title: e,
|
|
6112
6113
|
icon: t,
|
|
@@ -6115,16 +6116,16 @@ var Vn = ({ title: e, icon: t, description: n, image: r, children: i, onPrevious
|
|
|
6115
6116
|
onPrevious: i,
|
|
6116
6117
|
onNext: a,
|
|
6117
6118
|
onQuit: o,
|
|
6118
|
-
isValid:
|
|
6119
|
-
hasPreviousStep:
|
|
6120
|
-
hasNextStep:
|
|
6119
|
+
isValid: d,
|
|
6120
|
+
hasPreviousStep: f,
|
|
6121
|
+
hasNextStep: p,
|
|
6121
6122
|
children: /* @__PURE__ */ h("div", {
|
|
6122
6123
|
className: "flex flex-col py-3 gap-2",
|
|
6123
6124
|
children: [l && /* @__PURE__ */ h("div", {
|
|
6124
6125
|
className: "flex items-center justify-between",
|
|
6125
6126
|
children: [/* @__PURE__ */ m(J, {
|
|
6126
6127
|
significance: "secondary",
|
|
6127
|
-
children:
|
|
6128
|
+
children: g("Max {{maxCharacters}} characters", { maxCharacters: l })
|
|
6128
6129
|
}), /* @__PURE__ */ m(J, {
|
|
6129
6130
|
significance: "secondary",
|
|
6130
6131
|
children: `${s.length}/${l}`
|
|
@@ -6137,7 +6138,7 @@ var Vn = ({ title: e, icon: t, description: n, image: r, children: i, onPrevious
|
|
|
6137
6138
|
children: s
|
|
6138
6139
|
}), /* @__PURE__ */ m("textarea", {
|
|
6139
6140
|
id: "primary",
|
|
6140
|
-
placeholder:
|
|
6141
|
+
placeholder: u ?? g("Type your answer here"),
|
|
6141
6142
|
className: K("absolute inset-0 resize-none", "overflow-hidden break-words outline-hidden resize-none material-medium", "rounded-lg py-3 px-4 min-h-20 border border-separator-opaque-light dark:border-separator-opaque-dark", "text-label-primary-light dark:text-label-primary-dark", Nn.B1),
|
|
6142
6143
|
value: s,
|
|
6143
6144
|
onChange: (e) => c(e.target.value)
|
|
@@ -7064,4 +7065,4 @@ var jr = z, Mr = class extends Error {
|
|
|
7064
7065
|
//#endregion
|
|
7065
7066
|
export { Nr as n, Mr as r, Pr as t };
|
|
7066
7067
|
|
|
7067
|
-
//# sourceMappingURL=form-manager-
|
|
7068
|
+
//# sourceMappingURL=form-manager-Cm1pBxZ2.js.map
|