@opengovsg/confetti 0.0.9 → 0.0.11
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/build/index.d.ts +22 -17
- package/build/index.js +2 -1
- package/package.json +6 -4
package/build/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as MultiSelectQuestionProperties, c as StatementQuestionProperties, i as PublicGetSurveyOutput, l as TextQuestionProperties, n as ConfettiState, o as RatingQuestionProperties, r as Question, s as SingleSelectQuestionProperties, t as Answer } from "./types-COft9SvA.js";
|
|
2
2
|
import * as react0 from "react";
|
|
3
3
|
import { HTMLAttributes, PropsWithChildren } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/core/ConfettiController.d.ts
|
|
7
7
|
interface ConfettiControllerProps {
|
|
@@ -19,7 +19,7 @@ declare const ConfettiController: ({
|
|
|
19
19
|
shouldAutoSubmit,
|
|
20
20
|
onFinished,
|
|
21
21
|
children
|
|
22
|
-
}: ConfettiControllerProps) =>
|
|
22
|
+
}: ConfettiControllerProps) => react_jsx_runtime2.JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/core/ConfettiProvider.d.ts
|
|
25
25
|
interface ConfettiContextValue {
|
|
@@ -53,7 +53,7 @@ declare const ConfettiProvider: ({
|
|
|
53
53
|
metadata,
|
|
54
54
|
isSurveyVisible: isSurveyVisibleInput,
|
|
55
55
|
apiBaseUrl
|
|
56
|
-
}: ConfettiProviderProps) =>
|
|
56
|
+
}: ConfettiProviderProps) => react_jsx_runtime2.JSX.Element | null;
|
|
57
57
|
declare const useConfetti: () => ConfettiContextValue;
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/components/Confetti.d.ts
|
|
@@ -63,7 +63,7 @@ declare const Confetti: ({
|
|
|
63
63
|
onFinished,
|
|
64
64
|
shouldAutoSubmit,
|
|
65
65
|
...props
|
|
66
|
-
}: ConfettiProps & Pick<ConfettiControllerProps, "children" | "shouldAutoSubmit">) =>
|
|
66
|
+
}: ConfettiProps & Pick<ConfettiControllerProps, "children" | "shouldAutoSubmit">) => react_jsx_runtime2.JSX.Element;
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region src/components/ThankYouMessage.d.ts
|
|
69
69
|
interface ThankYouMessageProps {
|
|
@@ -80,7 +80,7 @@ declare const ThankYouMessage: ({
|
|
|
80
80
|
title,
|
|
81
81
|
description,
|
|
82
82
|
classNames
|
|
83
|
-
}: ThankYouMessageProps) =>
|
|
83
|
+
}: ThankYouMessageProps) => react_jsx_runtime2.JSX.Element | null;
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region src/components/container/PopoverContainer.d.ts
|
|
86
86
|
interface PopoverContainerProps {
|
|
@@ -102,7 +102,7 @@ declare const PopoverContainer: ({
|
|
|
102
102
|
containerProps,
|
|
103
103
|
onDismiss,
|
|
104
104
|
closeOnFinishMs
|
|
105
|
-
}: PopoverContainerProps) =>
|
|
105
|
+
}: PopoverContainerProps) => react_jsx_runtime2.JSX.Element;
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region src/components/questions/types.d.ts
|
|
108
108
|
type Question$1 = PublicGetSurveyOutput['questions'][number];
|
|
@@ -125,7 +125,7 @@ declare const SurveyQuestionFactory: ({
|
|
|
125
125
|
question,
|
|
126
126
|
onChange,
|
|
127
127
|
error
|
|
128
|
-
}: SurveyQuestionFactoryProps) =>
|
|
128
|
+
}: SurveyQuestionFactoryProps) => react_jsx_runtime2.JSX.Element;
|
|
129
129
|
//#endregion
|
|
130
130
|
//#region src/components/questions/Rating.d.ts
|
|
131
131
|
interface RatingProps extends BaseFieldProps {
|
|
@@ -160,7 +160,7 @@ declare const Rating: ({
|
|
|
160
160
|
id,
|
|
161
161
|
error,
|
|
162
162
|
required
|
|
163
|
-
}: RatingProps) =>
|
|
163
|
+
}: RatingProps) => react_jsx_runtime2.JSX.Element;
|
|
164
164
|
//#endregion
|
|
165
165
|
//#region src/components/questions/FreeText.d.ts
|
|
166
166
|
interface FreeTextProps extends BaseFieldProps {
|
|
@@ -184,7 +184,7 @@ declare const FreeText: ({
|
|
|
184
184
|
classNames,
|
|
185
185
|
required,
|
|
186
186
|
error
|
|
187
|
-
}: FreeTextProps) =>
|
|
187
|
+
}: FreeTextProps) => react_jsx_runtime2.JSX.Element;
|
|
188
188
|
//#endregion
|
|
189
189
|
//#region src/components/questions/SingleChoice.d.ts
|
|
190
190
|
interface SingleChoiceProps extends BaseFieldProps {
|
|
@@ -214,7 +214,7 @@ declare const SingleChoice: ({
|
|
|
214
214
|
id,
|
|
215
215
|
required,
|
|
216
216
|
error
|
|
217
|
-
}: SingleChoiceProps) =>
|
|
217
|
+
}: SingleChoiceProps) => react_jsx_runtime2.JSX.Element;
|
|
218
218
|
//#endregion
|
|
219
219
|
//#region src/components/questions/MultiChoice.d.ts
|
|
220
220
|
interface MultiChoiceProps extends BaseFieldProps {
|
|
@@ -247,7 +247,7 @@ declare const MultiChoice: ({
|
|
|
247
247
|
id,
|
|
248
248
|
required,
|
|
249
249
|
error
|
|
250
|
-
}: MultiChoiceProps) =>
|
|
250
|
+
}: MultiChoiceProps) => react_jsx_runtime2.JSX.Element;
|
|
251
251
|
//#endregion
|
|
252
252
|
//#region src/components/questions/Statement.d.ts
|
|
253
253
|
interface StatementProps extends BaseFieldProps {
|
|
@@ -265,7 +265,7 @@ declare const Statement: ({
|
|
|
265
265
|
title,
|
|
266
266
|
description,
|
|
267
267
|
classNames
|
|
268
|
-
}: StatementProps) =>
|
|
268
|
+
}: StatementProps) => react_jsx_runtime2.JSX.Element;
|
|
269
269
|
//#endregion
|
|
270
270
|
//#region src/components/presentation/Flow.d.ts
|
|
271
271
|
type ChildField = (_: {
|
|
@@ -284,7 +284,7 @@ declare const Flow: ({
|
|
|
284
284
|
children,
|
|
285
285
|
question,
|
|
286
286
|
isLastQuestion
|
|
287
|
-
}: FlowProps) =>
|
|
287
|
+
}: FlowProps) => react_jsx_runtime2.JSX.Element;
|
|
288
288
|
//#endregion
|
|
289
289
|
//#region src/components/presentation/Embed.d.ts
|
|
290
290
|
declare const Embed: ({
|
|
@@ -294,10 +294,10 @@ declare const Embed: ({
|
|
|
294
294
|
}: PropsWithChildren<{
|
|
295
295
|
isCompleted: boolean;
|
|
296
296
|
onSubmit: () => void;
|
|
297
|
-
}>) =>
|
|
297
|
+
}>) => react_jsx_runtime2.JSX.Element;
|
|
298
298
|
//#endregion
|
|
299
299
|
//#region src/templates/EmbeddedConfetti.d.ts
|
|
300
|
-
declare const EmbeddedConfetti: (props: ConfettiProps) =>
|
|
300
|
+
declare const EmbeddedConfetti: (props: ConfettiProps) => react_jsx_runtime2.JSX.Element;
|
|
301
301
|
//#endregion
|
|
302
302
|
//#region src/templates/PopoverConfetti.d.ts
|
|
303
303
|
interface PopoverConfettiProps extends ConfettiProps {
|
|
@@ -308,14 +308,19 @@ interface PopoverConfettiProps extends ConfettiProps {
|
|
|
308
308
|
* @default 3000
|
|
309
309
|
*/
|
|
310
310
|
closeOnFinishMs?: number | null;
|
|
311
|
+
/**
|
|
312
|
+
* Callback is invoked when the popover is explicitly dismissed.
|
|
313
|
+
*/
|
|
314
|
+
onDismiss?: () => void;
|
|
311
315
|
}
|
|
312
316
|
declare const PopoverConfetti: ({
|
|
317
|
+
onDismiss,
|
|
313
318
|
closeOnFinishMs,
|
|
314
319
|
...props
|
|
315
|
-
}: PopoverConfettiProps) =>
|
|
320
|
+
}: PopoverConfettiProps) => react_jsx_runtime2.JSX.Element;
|
|
316
321
|
//#endregion
|
|
317
322
|
//#region src/templates/StepperConfetti.d.ts
|
|
318
|
-
declare const StepperConfetti: (props: ConfettiProps) =>
|
|
323
|
+
declare const StepperConfetti: (props: ConfettiProps) => react_jsx_runtime2.JSX.Element;
|
|
319
324
|
//#endregion
|
|
320
325
|
//#region src/hooks/useVisibleAfterDelay.d.ts
|
|
321
326
|
interface UseVisibleAfterDelayOptions {
|
package/build/index.js
CHANGED
|
@@ -1356,10 +1356,11 @@ const EmbeddedConfetti = (props) => {
|
|
|
1356
1356
|
|
|
1357
1357
|
//#endregion
|
|
1358
1358
|
//#region src/templates/PopoverConfetti.tsx
|
|
1359
|
-
const PopoverConfetti = ({ closeOnFinishMs, ...props }) => {
|
|
1359
|
+
const PopoverConfetti = ({ onDismiss, closeOnFinishMs, ...props }) => {
|
|
1360
1360
|
return /* @__PURE__ */ jsx(ConfettiProvider, {
|
|
1361
1361
|
...props,
|
|
1362
1362
|
children: /* @__PURE__ */ jsx(PopoverContainer, {
|
|
1363
|
+
onDismiss,
|
|
1363
1364
|
closeOnFinishMs,
|
|
1364
1365
|
children: ({ setIsFinished }) => /* @__PURE__ */ jsx(ConfettiController, {
|
|
1365
1366
|
shouldAutoSubmit: true,
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengovsg/confetti",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "Widgets for Confetti",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"repository": "https://github.com/hfpg2026/confetti",
|
|
9
9
|
"homepage": "https://github.com/hfpg2026/confetti",
|
|
10
|
+
"main": "./build/index.js",
|
|
11
|
+
"types": "./build/index.d.ts",
|
|
10
12
|
"exports": {
|
|
11
13
|
".": {
|
|
12
14
|
"import": "./build/index.js",
|
|
@@ -43,10 +45,10 @@
|
|
|
43
45
|
"prettier": "^3.7.4",
|
|
44
46
|
"tsdown": "0.19.0",
|
|
45
47
|
"typescript": "^5.9.3",
|
|
46
|
-
"@confetti/
|
|
48
|
+
"@confetti/eslint-config": "0.0.0",
|
|
47
49
|
"@confetti/prettier-config": "0.0.0",
|
|
48
|
-
"@confetti/
|
|
49
|
-
"@confetti/
|
|
50
|
+
"@confetti/tsconfig": "0.0.0",
|
|
51
|
+
"@confetti/validators": "0.0.0"
|
|
50
52
|
},
|
|
51
53
|
"prettier": "@confetti/prettier-config",
|
|
52
54
|
"scripts": {
|