@transferwise/components 0.0.0-experimental-5598332 → 0.0.0-experimental-cbc00a7
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/ListItem/ListItem.js +2 -32
- package/build/ListItem/ListItem.js.map +1 -1
- package/build/ListItem/ListItem.mjs +3 -33
- package/build/ListItem/ListItem.mjs.map +1 -1
- package/build/Snackbar/Snackbar.js +107 -105
- package/build/Snackbar/Snackbar.js.map +1 -1
- package/build/Snackbar/Snackbar.mjs +109 -104
- package/build/Snackbar/Snackbar.mjs.map +1 -1
- package/build/Snackbar/SnackbarContext.js.map +1 -1
- package/build/Snackbar/SnackbarContext.mjs.map +1 -1
- package/build/Snackbar/SnackbarPortal.js +12 -0
- package/build/Snackbar/SnackbarPortal.js.map +1 -0
- package/build/Snackbar/SnackbarPortal.mjs +8 -0
- package/build/Snackbar/SnackbarPortal.mjs.map +1 -0
- package/build/Snackbar/SnackbarProvider.js +23 -27
- package/build/Snackbar/SnackbarProvider.js.map +1 -1
- package/build/Snackbar/SnackbarProvider.mjs +24 -28
- package/build/Snackbar/SnackbarProvider.mjs.map +1 -1
- package/build/Snackbar/constants.js +8 -0
- package/build/Snackbar/constants.js.map +1 -0
- package/build/Snackbar/constants.mjs +5 -0
- package/build/Snackbar/constants.mjs.map +1 -0
- package/build/Snackbar/useSnackbarManager.js +119 -0
- package/build/Snackbar/useSnackbarManager.js.map +1 -0
- package/build/Snackbar/useSnackbarManager.mjs +115 -0
- package/build/Snackbar/useSnackbarManager.mjs.map +1 -0
- package/build/i18n/th.json +1 -1
- package/build/i18n/th.json.js +1 -1
- package/build/i18n/th.json.mjs +1 -1
- package/build/i18n/zh-CN.json +0 -1
- package/build/i18n/zh-CN.json.js +0 -1
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +0 -1
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/main.css +113 -61
- package/build/styles/Snackbar/Snackbar.css +116 -64
- package/build/styles/main.css +113 -61
- package/build/types/Body/Body.d.ts +2 -2
- package/build/types/IconButton/IconButton.d.ts +1 -1
- package/build/types/ListItem/ListItem.d.ts +0 -2
- package/build/types/ListItem/ListItem.d.ts.map +1 -1
- package/build/types/MoneyInput/MoneyInput.d.ts +1 -1
- package/build/types/MoneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/Snackbar/Snackbar.d.ts +10 -8
- package/build/types/Snackbar/Snackbar.d.ts.map +1 -1
- package/build/types/Snackbar/Snackbar.types.d.ts +19 -0
- package/build/types/Snackbar/Snackbar.types.d.ts.map +1 -0
- package/build/types/Snackbar/SnackbarContext.d.ts +2 -2
- package/build/types/Snackbar/SnackbarContext.d.ts.map +1 -1
- package/build/types/Snackbar/SnackbarPortal.d.ts +4 -0
- package/build/types/Snackbar/SnackbarPortal.d.ts.map +1 -0
- package/build/types/Snackbar/SnackbarProvider.d.ts.map +1 -1
- package/build/types/Snackbar/constants.d.ts +3 -0
- package/build/types/Snackbar/constants.d.ts.map +1 -0
- package/build/types/Snackbar/useSnackbar.d.ts +1 -1
- package/build/types/Snackbar/useSnackbar.d.ts.map +1 -1
- package/build/types/Snackbar/useSnackbarManager.d.ts +16 -0
- package/build/types/Snackbar/useSnackbarManager.d.ts.map +1 -0
- package/build/types/Title/Title.d.ts +2 -2
- package/build/types/Upload/Steps/UploadImageStep/UploadImageStep.d.ts +1 -1
- package/build/types/UploadInput/UploadItem/UploadItemLink.d.ts +1 -1
- package/package.json +3 -3
- package/src/ListItem/ListItem.test.tsx +0 -42
- package/src/ListItem/ListItem.tsx +2 -23
- package/src/Snackbar/Snackbar.css +116 -64
- package/src/Snackbar/Snackbar.less +121 -60
- package/src/Snackbar/Snackbar.test.tsx +122 -133
- package/src/Snackbar/Snackbar.tsx +95 -96
- package/src/Snackbar/Snackbar.types.ts +21 -0
- package/src/Snackbar/SnackbarContext.ts +2 -2
- package/src/Snackbar/SnackbarPortal.tsx +8 -0
- package/src/Snackbar/SnackbarProvider.test.tsx +289 -0
- package/src/Snackbar/SnackbarProvider.tsx +19 -18
- package/src/Snackbar/_stories/Snackbar.rtl.test.story.tsx +16 -6
- package/src/Snackbar/_stories/Snackbar.story.tsx +62 -1
- package/src/Snackbar/_stories/Snackbar.test.story.tsx +26 -5
- package/src/Snackbar/constants.ts +2 -0
- package/src/Snackbar/useSnackbarManager.ts +122 -0
- package/src/i18n/th.json +1 -1
- package/src/i18n/zh-CN.json +0 -1
- package/src/main.css +113 -61
- package/src/ListItem/ListItem.ssr.test.tsx +0 -115
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
const emptyState = {
|
|
8
|
+
active: null,
|
|
9
|
+
activeHasRendered: false,
|
|
10
|
+
announcementKey: 0,
|
|
11
|
+
pending: null,
|
|
12
|
+
visible: false
|
|
13
|
+
};
|
|
14
|
+
const snackbarManagerReducer = (state, action) => {
|
|
15
|
+
switch (action.type) {
|
|
16
|
+
case 'show':
|
|
17
|
+
if (!state.active || !state.activeHasRendered) {
|
|
18
|
+
// Batched creates collapse to the latest instance before anything has entered.
|
|
19
|
+
return {
|
|
20
|
+
active: action.instance,
|
|
21
|
+
activeHasRendered: false,
|
|
22
|
+
announcementKey: state.announcementKey + 1,
|
|
23
|
+
pending: null,
|
|
24
|
+
visible: true
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
// Keep the active content until it exits; newer creates replace only the pending instance.
|
|
28
|
+
return {
|
|
29
|
+
...state,
|
|
30
|
+
pending: action.instance,
|
|
31
|
+
visible: false
|
|
32
|
+
};
|
|
33
|
+
case 'rendered':
|
|
34
|
+
if (state.active?.id !== action.instanceId || state.activeHasRendered) {
|
|
35
|
+
return state;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
...state,
|
|
39
|
+
activeHasRendered: true
|
|
40
|
+
};
|
|
41
|
+
case 'dismiss':
|
|
42
|
+
if (!state.active) {
|
|
43
|
+
return state;
|
|
44
|
+
}
|
|
45
|
+
return state.activeHasRendered ? {
|
|
46
|
+
...state,
|
|
47
|
+
visible: false
|
|
48
|
+
} : {
|
|
49
|
+
...emptyState,
|
|
50
|
+
announcementKey: state.announcementKey
|
|
51
|
+
};
|
|
52
|
+
case 'exited':
|
|
53
|
+
// Ignore callbacks from an instance that has already been replaced.
|
|
54
|
+
if (state.active?.id !== action.instanceId) {
|
|
55
|
+
return state;
|
|
56
|
+
}
|
|
57
|
+
if (state.pending) {
|
|
58
|
+
return {
|
|
59
|
+
active: state.pending,
|
|
60
|
+
activeHasRendered: false,
|
|
61
|
+
announcementKey: state.announcementKey + 1,
|
|
62
|
+
pending: null,
|
|
63
|
+
visible: true
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
...emptyState,
|
|
68
|
+
announcementKey: state.announcementKey
|
|
69
|
+
};
|
|
70
|
+
default:
|
|
71
|
+
return state;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
/** Owns one active Snackbar and its latest replacement, waiting for exit before the next enters. */
|
|
75
|
+
const useSnackbarManager = () => {
|
|
76
|
+
const [state, dispatch] = React.useReducer(snackbarManagerReducer, emptyState);
|
|
77
|
+
const nextInstanceId = React.useRef(0);
|
|
78
|
+
const showSnackbar = React.useCallback(props => {
|
|
79
|
+
nextInstanceId.current += 1;
|
|
80
|
+
dispatch({
|
|
81
|
+
type: 'show',
|
|
82
|
+
instance: {
|
|
83
|
+
id: nextInstanceId.current,
|
|
84
|
+
props
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}, []);
|
|
88
|
+
const dismissSnackbar = React.useCallback(() => dispatch({
|
|
89
|
+
type: 'dismiss'
|
|
90
|
+
}), []);
|
|
91
|
+
const handleExited = React.useCallback(() => {
|
|
92
|
+
if (state.active) {
|
|
93
|
+
dispatch({
|
|
94
|
+
type: 'exited',
|
|
95
|
+
instanceId: state.active.id
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}, [state.active]);
|
|
99
|
+
React.useEffect(() => {
|
|
100
|
+
if (state.active && state.visible && !state.activeHasRendered) {
|
|
101
|
+
// Later creates can now wait for this instance's exit instead of coalescing before render.
|
|
102
|
+
dispatch({
|
|
103
|
+
type: 'rendered',
|
|
104
|
+
instanceId: state.active.id
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}, [state.active, state.activeHasRendered, state.visible]);
|
|
108
|
+
return {
|
|
109
|
+
active: state.active,
|
|
110
|
+
announcementKey: state.announcementKey,
|
|
111
|
+
dismissSnackbar,
|
|
112
|
+
handleExited,
|
|
113
|
+
showSnackbar,
|
|
114
|
+
visible: state.visible
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
exports.default = useSnackbarManager;
|
|
119
|
+
//# sourceMappingURL=useSnackbarManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSnackbarManager.js","sources":["../../src/Snackbar/useSnackbarManager.ts"],"sourcesContent":["import { useCallback, useEffect, useReducer, useRef } from 'react';\n\nimport type { SnackbarCreationProps } from './Snackbar.types';\n\ntype SnackbarInstance = {\n id: number;\n props: SnackbarCreationProps;\n};\n\ntype SnackbarManagerState = {\n active: SnackbarInstance | null;\n activeHasRendered: boolean;\n announcementKey: number;\n pending: SnackbarInstance | null;\n visible: boolean;\n};\n\ntype SnackbarManagerAction =\n | { type: 'show'; instance: SnackbarInstance }\n | { type: 'rendered'; instanceId: number }\n | { type: 'dismiss' }\n | { type: 'exited'; instanceId: number };\n\nconst emptyState: SnackbarManagerState = {\n active: null,\n activeHasRendered: false,\n announcementKey: 0,\n pending: null,\n visible: false,\n};\n\nconst snackbarManagerReducer = (\n state: SnackbarManagerState,\n action: SnackbarManagerAction,\n): SnackbarManagerState => {\n switch (action.type) {\n case 'show':\n if (!state.active || !state.activeHasRendered) {\n // Batched creates collapse to the latest instance before anything has entered.\n return {\n active: action.instance,\n activeHasRendered: false,\n announcementKey: state.announcementKey + 1,\n pending: null,\n visible: true,\n };\n }\n\n // Keep the active content until it exits; newer creates replace only the pending instance.\n return { ...state, pending: action.instance, visible: false };\n case 'rendered':\n if (state.active?.id !== action.instanceId || state.activeHasRendered) {\n return state;\n }\n\n return { ...state, activeHasRendered: true };\n case 'dismiss':\n if (!state.active) {\n return state;\n }\n\n return state.activeHasRendered\n ? { ...state, visible: false }\n : { ...emptyState, announcementKey: state.announcementKey };\n case 'exited':\n // Ignore callbacks from an instance that has already been replaced.\n if (state.active?.id !== action.instanceId) {\n return state;\n }\n\n if (state.pending) {\n return {\n active: state.pending,\n activeHasRendered: false,\n announcementKey: state.announcementKey + 1,\n pending: null,\n visible: true,\n };\n }\n\n return { ...emptyState, announcementKey: state.announcementKey };\n default:\n return state;\n }\n};\n\n/** Owns one active Snackbar and its latest replacement, waiting for exit before the next enters. */\nconst useSnackbarManager = () => {\n const [state, dispatch] = useReducer(snackbarManagerReducer, emptyState);\n const nextInstanceId = useRef(0);\n\n const showSnackbar = useCallback((props: SnackbarCreationProps) => {\n nextInstanceId.current += 1;\n dispatch({ type: 'show', instance: { id: nextInstanceId.current, props } });\n }, []);\n\n const dismissSnackbar = useCallback(() => dispatch({ type: 'dismiss' }), []);\n\n const handleExited = useCallback(() => {\n if (state.active) {\n dispatch({ type: 'exited', instanceId: state.active.id });\n }\n }, [state.active]);\n\n useEffect(() => {\n if (state.active && state.visible && !state.activeHasRendered) {\n // Later creates can now wait for this instance's exit instead of coalescing before render.\n dispatch({ type: 'rendered', instanceId: state.active.id });\n }\n }, [state.active, state.activeHasRendered, state.visible]);\n\n return {\n active: state.active,\n announcementKey: state.announcementKey,\n dismissSnackbar,\n handleExited,\n showSnackbar,\n visible: state.visible,\n };\n};\n\nexport default useSnackbarManager;\n"],"names":["emptyState","active","activeHasRendered","announcementKey","pending","visible","snackbarManagerReducer","state","action","type","instance","id","instanceId","useSnackbarManager","dispatch","useReducer","nextInstanceId","useRef","showSnackbar","useCallback","props","current","dismissSnackbar","handleExited","useEffect"],"mappings":";;;;;;AAuBA,MAAMA,UAAU,GAAyB;AACvCC,EAAAA,MAAM,EAAE,IAAI;AACZC,EAAAA,iBAAiB,EAAE,KAAK;AACxBC,EAAAA,eAAe,EAAE,CAAC;AAClBC,EAAAA,OAAO,EAAE,IAAI;AACbC,EAAAA,OAAO,EAAE;CACV;AAED,MAAMC,sBAAsB,GAAGA,CAC7BC,KAA2B,EAC3BC,MAA6B,KACL;EACxB,QAAQA,MAAM,CAACC,IAAI;AACjB,IAAA,KAAK,MAAM;MACT,IAAI,CAACF,KAAK,CAACN,MAAM,IAAI,CAACM,KAAK,CAACL,iBAAiB,EAAE;AAC7C;QACA,OAAO;UACLD,MAAM,EAAEO,MAAM,CAACE,QAAQ;AACvBR,UAAAA,iBAAiB,EAAE,KAAK;AACxBC,UAAAA,eAAe,EAAEI,KAAK,CAACJ,eAAe,GAAG,CAAC;AAC1CC,UAAAA,OAAO,EAAE,IAAI;AACbC,UAAAA,OAAO,EAAE;SACV;AACH,MAAA;AAEA;MACA,OAAO;AAAE,QAAA,GAAGE,KAAK;QAAEH,OAAO,EAAEI,MAAM,CAACE,QAAQ;AAAEL,QAAAA,OAAO,EAAE;OAAO;AAC/D,IAAA,KAAK,UAAU;AACb,MAAA,IAAIE,KAAK,CAACN,MAAM,EAAEU,EAAE,KAAKH,MAAM,CAACI,UAAU,IAAIL,KAAK,CAACL,iBAAiB,EAAE;AACrE,QAAA,OAAOK,KAAK;AACd,MAAA;MAEA,OAAO;AAAE,QAAA,GAAGA,KAAK;AAAEL,QAAAA,iBAAiB,EAAE;OAAM;AAC9C,IAAA,KAAK,SAAS;AACZ,MAAA,IAAI,CAACK,KAAK,CAACN,MAAM,EAAE;AACjB,QAAA,OAAOM,KAAK;AACd,MAAA;MAEA,OAAOA,KAAK,CAACL,iBAAiB,GAC1B;AAAE,QAAA,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AW,CAAC,EAAE,EAAE,CAAC;AAE5E,EAAA,MAAMc,YAAY,GAAGJ,iBAAW,CAAC,MAAK;IACpC,IAAIZ,KAAK,CAACN,MAAM,EAAE;AAChBa,MAAAA,QAAQ,CAAC;AAAEL,QAAAA,IAAI,EAAE,QAAQ;AAAEG,QAAAA,UAAU,EAAEL,KAAK,CAACN,MAAM,CAACU;AAAE,OAAE,CAAC;AAC3D,IAAA;AACF,EAAA,CAAC,EAAE,CAACJ,KAAK,CAACN,MAAM,CAAC,CAAC;AAElBuB,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,IAAIjB,KAAK,CAACN,MAAM,IAAIM,KAAK,CAACF,OAAO,IAAI,CAACE,KAAK,CAACL,iBAAiB,EAAE;AAC7D;AACAY,MAAAA,QAAQ,CAAC;AAAEL,QAAAA,IAAI,EAAE,UAAU;AAAEG,QAAAA,UAAU,EAAEL,KAAK,CAACN,MAAM,CAACU;AAAE,OAAE,CAAC;AAC7D,IAAA;AACF,EAAA,CAAC,EAAE,CAACJ,KAAK,CAACN,MAAM,EAAEM,KAAK,CAACL,iBAAiB,EAAEK,KAAK,CAACF,OAAO,CAAC,CAAC;EAE1D,OAAO;IACLJ,MAAM,EAAEM,KAAK,CAACN,MAAM;IACpBE,eAAe,EAAEI,KAAK,CAACJ,eAAe;IACtCmB,eAAe;IACfC,YAAY;IACZL,YAAY;IACZb,OAAO,EAAEE,KAAK,CAACF;GAChB;AACH;;"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { useReducer, useRef, useCallback, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const emptyState = {
|
|
4
|
+
active: null,
|
|
5
|
+
activeHasRendered: false,
|
|
6
|
+
announcementKey: 0,
|
|
7
|
+
pending: null,
|
|
8
|
+
visible: false
|
|
9
|
+
};
|
|
10
|
+
const snackbarManagerReducer = (state, action) => {
|
|
11
|
+
switch (action.type) {
|
|
12
|
+
case 'show':
|
|
13
|
+
if (!state.active || !state.activeHasRendered) {
|
|
14
|
+
// Batched creates collapse to the latest instance before anything has entered.
|
|
15
|
+
return {
|
|
16
|
+
active: action.instance,
|
|
17
|
+
activeHasRendered: false,
|
|
18
|
+
announcementKey: state.announcementKey + 1,
|
|
19
|
+
pending: null,
|
|
20
|
+
visible: true
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
// Keep the active content until it exits; newer creates replace only the pending instance.
|
|
24
|
+
return {
|
|
25
|
+
...state,
|
|
26
|
+
pending: action.instance,
|
|
27
|
+
visible: false
|
|
28
|
+
};
|
|
29
|
+
case 'rendered':
|
|
30
|
+
if (state.active?.id !== action.instanceId || state.activeHasRendered) {
|
|
31
|
+
return state;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
...state,
|
|
35
|
+
activeHasRendered: true
|
|
36
|
+
};
|
|
37
|
+
case 'dismiss':
|
|
38
|
+
if (!state.active) {
|
|
39
|
+
return state;
|
|
40
|
+
}
|
|
41
|
+
return state.activeHasRendered ? {
|
|
42
|
+
...state,
|
|
43
|
+
visible: false
|
|
44
|
+
} : {
|
|
45
|
+
...emptyState,
|
|
46
|
+
announcementKey: state.announcementKey
|
|
47
|
+
};
|
|
48
|
+
case 'exited':
|
|
49
|
+
// Ignore callbacks from an instance that has already been replaced.
|
|
50
|
+
if (state.active?.id !== action.instanceId) {
|
|
51
|
+
return state;
|
|
52
|
+
}
|
|
53
|
+
if (state.pending) {
|
|
54
|
+
return {
|
|
55
|
+
active: state.pending,
|
|
56
|
+
activeHasRendered: false,
|
|
57
|
+
announcementKey: state.announcementKey + 1,
|
|
58
|
+
pending: null,
|
|
59
|
+
visible: true
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
...emptyState,
|
|
64
|
+
announcementKey: state.announcementKey
|
|
65
|
+
};
|
|
66
|
+
default:
|
|
67
|
+
return state;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
/** Owns one active Snackbar and its latest replacement, waiting for exit before the next enters. */
|
|
71
|
+
const useSnackbarManager = () => {
|
|
72
|
+
const [state, dispatch] = useReducer(snackbarManagerReducer, emptyState);
|
|
73
|
+
const nextInstanceId = useRef(0);
|
|
74
|
+
const showSnackbar = useCallback(props => {
|
|
75
|
+
nextInstanceId.current += 1;
|
|
76
|
+
dispatch({
|
|
77
|
+
type: 'show',
|
|
78
|
+
instance: {
|
|
79
|
+
id: nextInstanceId.current,
|
|
80
|
+
props
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}, []);
|
|
84
|
+
const dismissSnackbar = useCallback(() => dispatch({
|
|
85
|
+
type: 'dismiss'
|
|
86
|
+
}), []);
|
|
87
|
+
const handleExited = useCallback(() => {
|
|
88
|
+
if (state.active) {
|
|
89
|
+
dispatch({
|
|
90
|
+
type: 'exited',
|
|
91
|
+
instanceId: state.active.id
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}, [state.active]);
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
if (state.active && state.visible && !state.activeHasRendered) {
|
|
97
|
+
// Later creates can now wait for this instance's exit instead of coalescing before render.
|
|
98
|
+
dispatch({
|
|
99
|
+
type: 'rendered',
|
|
100
|
+
instanceId: state.active.id
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}, [state.active, state.activeHasRendered, state.visible]);
|
|
104
|
+
return {
|
|
105
|
+
active: state.active,
|
|
106
|
+
announcementKey: state.announcementKey,
|
|
107
|
+
dismissSnackbar,
|
|
108
|
+
handleExited,
|
|
109
|
+
showSnackbar,
|
|
110
|
+
visible: state.visible
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export { useSnackbarManager as default };
|
|
115
|
+
//# sourceMappingURL=useSnackbarManager.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSnackbarManager.mjs","sources":["../../src/Snackbar/useSnackbarManager.ts"],"sourcesContent":["import { useCallback, useEffect, useReducer, useRef } from 'react';\n\nimport type { SnackbarCreationProps } from './Snackbar.types';\n\ntype SnackbarInstance = {\n id: number;\n props: SnackbarCreationProps;\n};\n\ntype SnackbarManagerState = {\n active: SnackbarInstance | null;\n activeHasRendered: boolean;\n announcementKey: number;\n pending: SnackbarInstance | null;\n visible: boolean;\n};\n\ntype SnackbarManagerAction =\n | { type: 'show'; instance: SnackbarInstance }\n | { type: 'rendered'; instanceId: number }\n | { type: 'dismiss' }\n | { type: 'exited'; instanceId: number };\n\nconst emptyState: SnackbarManagerState = {\n active: null,\n activeHasRendered: false,\n announcementKey: 0,\n pending: null,\n visible: false,\n};\n\nconst snackbarManagerReducer = (\n state: SnackbarManagerState,\n action: SnackbarManagerAction,\n): SnackbarManagerState => {\n switch (action.type) {\n case 'show':\n if (!state.active || !state.activeHasRendered) {\n // Batched creates collapse to the latest instance before anything has entered.\n return {\n active: action.instance,\n activeHasRendered: false,\n announcementKey: state.announcementKey + 1,\n pending: null,\n visible: true,\n };\n }\n\n // Keep the active content until it exits; newer creates replace only the pending instance.\n return { ...state, pending: action.instance, visible: false };\n case 'rendered':\n if (state.active?.id !== action.instanceId || state.activeHasRendered) {\n return state;\n }\n\n return { ...state, activeHasRendered: true };\n case 'dismiss':\n if (!state.active) {\n return state;\n }\n\n return state.activeHasRendered\n ? { ...state, visible: false }\n : { ...emptyState, announcementKey: state.announcementKey };\n case 'exited':\n // Ignore callbacks from an instance that has already been replaced.\n if (state.active?.id !== action.instanceId) {\n return state;\n }\n\n if (state.pending) {\n return {\n active: state.pending,\n activeHasRendered: false,\n announcementKey: state.announcementKey + 1,\n pending: null,\n visible: true,\n };\n }\n\n return { ...emptyState, announcementKey: state.announcementKey };\n default:\n return state;\n }\n};\n\n/** Owns one active Snackbar and its latest replacement, waiting for exit before the next enters. */\nconst useSnackbarManager = () => {\n const [state, dispatch] = useReducer(snackbarManagerReducer, emptyState);\n const nextInstanceId = useRef(0);\n\n const showSnackbar = useCallback((props: SnackbarCreationProps) => {\n nextInstanceId.current += 1;\n dispatch({ type: 'show', instance: { id: nextInstanceId.current, props } });\n }, []);\n\n const dismissSnackbar = useCallback(() => dispatch({ type: 'dismiss' }), []);\n\n const handleExited = useCallback(() => {\n if (state.active) {\n dispatch({ type: 'exited', instanceId: state.active.id });\n }\n }, [state.active]);\n\n useEffect(() => {\n if (state.active && state.visible && !state.activeHasRendered) {\n // Later creates can now wait for this instance's exit instead of coalescing before render.\n dispatch({ type: 'rendered', instanceId: state.active.id });\n }\n }, [state.active, state.activeHasRendered, state.visible]);\n\n return {\n active: state.active,\n announcementKey: state.announcementKey,\n dismissSnackbar,\n handleExited,\n showSnackbar,\n visible: state.visible,\n };\n};\n\nexport default useSnackbarManager;\n"],"names":["emptyState","active","activeHasRendered","announcementKey","pending","visible","snackbarManagerReducer","state","action","type","instance","id","instanceId","useSnackbarManager","dispatch","useReducer","nextInstanceId","useRef","showSnackbar","useCallback","props","current","dismissSnackbar","handleExited","useEffect"],"mappings":";;AAuBA,MAAMA,UAAU,GAAyB;AACvCC,EAAAA,MAAM,EAAE,IAAI;AACZC,EAAAA,iBAAiB,EAAE,KAAK;AACxBC,EAAAA,eAAe,EAAE,CAAC;AAClBC,EAAAA,OAAO,EAAE,IAAI;AACbC,EAAAA,OAAO,EAAE;CACV;AAED,MAAMC,sBAAsB,GAAGA,CAC7BC,KAA2B,EAC3BC,MAA6B,KACL;EACxB,QAAQA,MAAM,CAACC,IAAI;AACjB,IAAA,KAAK,MAAM;MACT,IAAI,CAACF,KAAK,CAACN,MAAM,IAAI,CAACM,KAAK,CAACL,iBAAiB,EAAE;AAC7C;QACA,OAAO;UACLD,MAAM,EAAEO,MAAM,CAACE,QAAQ;AACvBR,UAAAA,iBAAiB,EAAE,KAAK;AACxBC,UAAAA,eAAe,EAAEI,KAAK,CAACJ,eAAe,GAAG,CAAC;AAC1CC,UAAAA,OAAO,EAAE,IAAI;AACbC,UAAAA,OAAO,EAAE;SACV;AACH,MAAA;AAEA;MACA,OAAO;AAAE,QAAA,GAAGE,KAAK;Q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CAACN,MAAM;IACpBE,eAAe,EAAEI,KAAK,CAACJ,eAAe;IACtCmB,eAAe;IACfC,YAAY;IACZL,YAAY;IACZb,OAAO,EAAEE,KAAK,CAACF;GAChB;AACH;;"}
|
package/build/i18n/th.json
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
|
|
36
36
|
"neptune.PhoneNumberInput.countryCodeLabel": "รหัสประเทศ",
|
|
37
37
|
"neptune.PhoneNumberInput.phoneNumberLabel": "หมายเลขโทรศัพท์",
|
|
38
|
-
"neptune.PhoneNumberInput.phoneNumberPrefix": "
|
|
38
|
+
"neptune.PhoneNumberInput.phoneNumberPrefix": "คำนำหน้า",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "ค้นหา...",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
|
|
41
41
|
"neptune.StatusIcon.iconLabel.error": "ข้อผิดพลาด:",
|
package/build/i18n/th.json.js
CHANGED
|
@@ -39,7 +39,7 @@ var th = {
|
|
|
39
39
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
|
|
40
40
|
"neptune.PhoneNumberInput.countryCodeLabel": "รหัสประเทศ",
|
|
41
41
|
"neptune.PhoneNumberInput.phoneNumberLabel": "หมายเลขโทรศัพท์",
|
|
42
|
-
"neptune.PhoneNumberInput.phoneNumberPrefix": "
|
|
42
|
+
"neptune.PhoneNumberInput.phoneNumberPrefix": "คำนำหน้า",
|
|
43
43
|
"neptune.Select.searchPlaceholder": "ค้นหา...",
|
|
44
44
|
"neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
|
|
45
45
|
"neptune.StatusIcon.iconLabel.error": "ข้อผิดพลาด:",
|
package/build/i18n/th.json.mjs
CHANGED
|
@@ -35,7 +35,7 @@ var th = {
|
|
|
35
35
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "เลือกตัวเลือก...",
|
|
36
36
|
"neptune.PhoneNumberInput.countryCodeLabel": "รหัสประเทศ",
|
|
37
37
|
"neptune.PhoneNumberInput.phoneNumberLabel": "หมายเลขโทรศัพท์",
|
|
38
|
-
"neptune.PhoneNumberInput.phoneNumberPrefix": "
|
|
38
|
+
"neptune.PhoneNumberInput.phoneNumberPrefix": "คำนำหน้า",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "ค้นหา...",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
|
|
41
41
|
"neptune.StatusIcon.iconLabel.error": "ข้อผิดพลาด:",
|
package/build/i18n/zh-CN.json
CHANGED
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "选择其中一项...",
|
|
36
36
|
"neptune.PhoneNumberInput.countryCodeLabel": "国家/地区代码",
|
|
37
37
|
"neptune.PhoneNumberInput.phoneNumberLabel": "电话号码",
|
|
38
|
-
"neptune.PhoneNumberInput.phoneNumberPrefix": "前缀",
|
|
39
38
|
"neptune.Select.searchPlaceholder": "搜索",
|
|
40
39
|
"neptune.SelectInput.noResultsFound": "找不到结果",
|
|
41
40
|
"neptune.StatusIcon.iconLabel.error": "错误:",
|
package/build/i18n/zh-CN.json.js
CHANGED
|
@@ -39,7 +39,6 @@ var zhCN = {
|
|
|
39
39
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "选择其中一项...",
|
|
40
40
|
"neptune.PhoneNumberInput.countryCodeLabel": "国家/地区代码",
|
|
41
41
|
"neptune.PhoneNumberInput.phoneNumberLabel": "电话号码",
|
|
42
|
-
"neptune.PhoneNumberInput.phoneNumberPrefix": "前缀",
|
|
43
42
|
"neptune.Select.searchPlaceholder": "搜索",
|
|
44
43
|
"neptune.SelectInput.noResultsFound": "找不到结果",
|
|
45
44
|
"neptune.StatusIcon.iconLabel.error": "错误:",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zh-CN.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zh-CN.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -35,7 +35,6 @@ var zhCN = {
|
|
|
35
35
|
"neptune.PhoneNumberInput.SelectInput.placeholder": "选择其中一项...",
|
|
36
36
|
"neptune.PhoneNumberInput.countryCodeLabel": "国家/地区代码",
|
|
37
37
|
"neptune.PhoneNumberInput.phoneNumberLabel": "电话号码",
|
|
38
|
-
"neptune.PhoneNumberInput.phoneNumberPrefix": "前缀",
|
|
39
38
|
"neptune.Select.searchPlaceholder": "搜索",
|
|
40
39
|
"neptune.SelectInput.noResultsFound": "找不到结果",
|
|
41
40
|
"neptune.StatusIcon.iconLabel.error": "错误:",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zh-CN.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zh-CN.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/main.css
CHANGED
|
@@ -26174,83 +26174,135 @@ button.np-link {
|
|
|
26174
26174
|
box-shadow: inset 1px 0 0 0 rgba(0,0,0,0.10196);
|
|
26175
26175
|
box-shadow: inset 1px 0 0 0 var(--color-border-neutral);
|
|
26176
26176
|
}
|
|
26177
|
-
.
|
|
26178
|
-
|
|
26177
|
+
.wds-Snackbar {
|
|
26178
|
+
display: flex;
|
|
26179
|
+
justify-content: center;
|
|
26180
|
+
box-sizing: border-box;
|
|
26181
|
+
padding-inline: 16px;
|
|
26182
|
+
padding-inline: var(--size-16);
|
|
26183
|
+
padding-block-end: calc(16px + env(safe-area-inset-bottom));
|
|
26184
|
+
padding-block-end: calc(var(--size-16) + env(safe-area-inset-bottom));
|
|
26179
26185
|
position: fixed;
|
|
26180
26186
|
inset-block-end: 0;
|
|
26181
|
-
inset-inline
|
|
26182
|
-
inset-inline-end: 0;
|
|
26187
|
+
inset-inline: 0;
|
|
26183
26188
|
z-index: 1060;
|
|
26184
26189
|
}
|
|
26185
|
-
|
|
26186
|
-
|
|
26187
|
-
|
|
26188
|
-
|
|
26189
|
-
|
|
26190
|
-
|
|
26191
|
-
|
|
26192
|
-
|
|
26190
|
+
@media (min-width: 600px) {
|
|
26191
|
+
.wds-Snackbar {
|
|
26192
|
+
padding-block-end: 24px;
|
|
26193
|
+
padding-block-end: var(--size-24);
|
|
26194
|
+
}
|
|
26195
|
+
}
|
|
26196
|
+
.wds-Snackbar-container {
|
|
26197
|
+
--Prompt-border-radius: var(--radius-medium);
|
|
26198
|
+
--Prompt-gap: var(--size-8);
|
|
26199
|
+
--Prompt-padding-x: var(--size-12);
|
|
26200
|
+
--Prompt-padding-y: var(--size-12);
|
|
26201
|
+
box-sizing: border-box;
|
|
26202
|
+
max-inline-size: 480px;
|
|
26193
26203
|
text-align: start;
|
|
26194
|
-
font-size: 0.875rem;
|
|
26195
|
-
font-size: var(--font-size-14);
|
|
26196
|
-
margin-block: 0;
|
|
26197
|
-
margin-inline: 16px;
|
|
26198
|
-
margin-inline: var(--size-16);
|
|
26199
|
-
padding-block: 8px;
|
|
26200
|
-
padding-block: var(--size-8);
|
|
26201
|
-
padding-inline: 16px;
|
|
26202
|
-
padding-inline: var(--size-16);
|
|
26203
|
-
inline-size: calc(100% - 32px);
|
|
26204
|
-
inline-size: calc(100% - var(--size-32));
|
|
26205
|
-
transition: 400ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
26206
26204
|
}
|
|
26207
|
-
.
|
|
26208
|
-
|
|
26209
|
-
position: relative;
|
|
26210
|
-
background: var(--color-contrast-theme);
|
|
26211
|
-
border-radius: 10px;
|
|
26212
|
-
border-radius: var(--radius-small);
|
|
26213
|
-
color: var(--color-contrast-overlay);
|
|
26205
|
+
.wds-Snackbar-container .wds-prompt__content-wrapper--with-dismiss {
|
|
26206
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
26214
26207
|
}
|
|
26215
|
-
|
|
26216
|
-
|
|
26217
|
-
|
|
26218
|
-
|
|
26219
|
-
inline-size: 100%;
|
|
26220
|
-
content: "";
|
|
26221
|
-
position: absolute;
|
|
26222
|
-
inset-inline-start: 0;
|
|
26223
|
-
inset-block-start: 0;
|
|
26224
|
-
z-index: -1;
|
|
26225
|
-
background-color: rgba(134,167,189,0.10196);
|
|
26226
|
-
background-color: var(--color-background-neutral);
|
|
26208
|
+
@media (min-width: 600px) {
|
|
26209
|
+
.wds-Snackbar-container .wds-prompt__content-wrapper--with-dismiss {
|
|
26210
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
26211
|
+
}
|
|
26227
26212
|
}
|
|
26228
|
-
.
|
|
26229
|
-
|
|
26230
|
-
|
|
26213
|
+
.wds-Snackbar-container .wds-prompt__media-wrapper {
|
|
26214
|
+
display: flex;
|
|
26215
|
+
align-items: center;
|
|
26216
|
+
min-block-size: max(32px, 1lh);
|
|
26217
|
+
min-block-size: max(var(--size-32), 1lh);
|
|
26218
|
+
padding-block-start: 0;
|
|
26219
|
+
color: var(--color-sentiment-content-primary);
|
|
26220
|
+
}
|
|
26221
|
+
.wds-Snackbar-container .wds-prompt__media-wrapper:has(+ .wds-Snackbar__content .wds-Snackbar__action) {
|
|
26222
|
+
min-block-size: max(32px, calc(1lh + 5px * 2));
|
|
26223
|
+
min-block-size: max(var(--size-32), calc(1lh + var(--size-5) * 2));
|
|
26224
|
+
}
|
|
26225
|
+
.wds-Snackbar__media-asset {
|
|
26226
|
+
display: flex;
|
|
26227
|
+
}
|
|
26228
|
+
.wds-Snackbar__media-asset svg {
|
|
26229
|
+
inline-size: 24px;
|
|
26230
|
+
inline-size: var(--size-24);
|
|
26231
|
+
block-size: 24px;
|
|
26232
|
+
block-size: var(--size-24);
|
|
26233
|
+
}
|
|
26234
|
+
.wds-Snackbar-container .wds-prompt__dismiss {
|
|
26235
|
+
display: none;
|
|
26236
|
+
align-self: flex-start;
|
|
26237
|
+
margin-block-start: calc(4px - 1px);
|
|
26238
|
+
margin-block-start: calc(var(--size-4) - 1px);
|
|
26231
26239
|
}
|
|
26232
26240
|
@media (min-width: 600px) {
|
|
26233
|
-
.
|
|
26234
|
-
|
|
26235
|
-
max-inline-size: 600px;
|
|
26241
|
+
.wds-Snackbar-container .wds-prompt__dismiss {
|
|
26242
|
+
display: flex;
|
|
26236
26243
|
}
|
|
26237
26244
|
}
|
|
26238
|
-
.
|
|
26245
|
+
.wds-Snackbar__action {
|
|
26239
26246
|
flex-shrink: 0;
|
|
26240
|
-
margin-inline-start: 16px;
|
|
26241
|
-
margin-inline-start: var(--size-16);
|
|
26242
26247
|
}
|
|
26243
|
-
.
|
|
26244
|
-
|
|
26245
|
-
|
|
26248
|
+
.wds-Snackbar__content {
|
|
26249
|
+
display: flex;
|
|
26250
|
+
align-items: flex-start;
|
|
26251
|
+
gap: 8px;
|
|
26252
|
+
gap: var(--size-8);
|
|
26253
|
+
flex: 1 0 0;
|
|
26254
|
+
min-block-size: 32px;
|
|
26255
|
+
min-block-size: var(--size-32);
|
|
26256
|
+
min-inline-size: 0;
|
|
26246
26257
|
}
|
|
26247
|
-
.
|
|
26248
|
-
|
|
26249
|
-
|
|
26258
|
+
.wds-Snackbar__message {
|
|
26259
|
+
display: flex;
|
|
26260
|
+
flex-direction: column;
|
|
26261
|
+
justify-content: center;
|
|
26262
|
+
inline-size: auto;
|
|
26263
|
+
flex: 1 0 0;
|
|
26264
|
+
min-inline-size: 0;
|
|
26265
|
+
align-self: stretch;
|
|
26250
26266
|
}
|
|
26251
|
-
|
|
26252
|
-
|
|
26253
|
-
|
|
26267
|
+
.wds-Snackbar__body {
|
|
26268
|
+
display: block;
|
|
26269
|
+
font-weight: 500;
|
|
26270
|
+
font-weight: var(--font-weight-medium);
|
|
26271
|
+
}
|
|
26272
|
+
.wds-Snackbar-container-appear,
|
|
26273
|
+
.wds-Snackbar-container-enter {
|
|
26274
|
+
opacity: 0;
|
|
26275
|
+
transform: translateY(80px) scale(0.5);
|
|
26276
|
+
}
|
|
26277
|
+
.wds-Snackbar-container-appear-active,
|
|
26278
|
+
.wds-Snackbar-container-enter-active {
|
|
26279
|
+
opacity: 1;
|
|
26280
|
+
transform: translateY(0) scale(1);
|
|
26281
|
+
transition: opacity 150ms linear, transform var(--Snackbar-enter-duration) cubic-bezier(0, 0, 0, 1);
|
|
26282
|
+
}
|
|
26283
|
+
.wds-Snackbar-container-exit {
|
|
26284
|
+
opacity: 1;
|
|
26285
|
+
transform: translateY(0) scale(1);
|
|
26286
|
+
}
|
|
26287
|
+
.wds-Snackbar-container-exit-active {
|
|
26288
|
+
opacity: 0;
|
|
26289
|
+
transform: translateY(80px) scale(0.5);
|
|
26290
|
+
transition: opacity 50ms linear 50ms, transform var(--Snackbar-exit-duration) cubic-bezier(1, 0, 1, 1);
|
|
26291
|
+
}
|
|
26292
|
+
@media (prefers-reduced-motion: reduce) {
|
|
26293
|
+
.wds-Snackbar-container-appear,
|
|
26294
|
+
.wds-Snackbar-container-appear-active,
|
|
26295
|
+
.wds-Snackbar-container-enter,
|
|
26296
|
+
.wds-Snackbar-container-enter-active,
|
|
26297
|
+
.wds-Snackbar-container-exit {
|
|
26298
|
+
opacity: 1;
|
|
26299
|
+
transform: none;
|
|
26300
|
+
transition: none;
|
|
26301
|
+
}
|
|
26302
|
+
.wds-Snackbar-container-exit-active {
|
|
26303
|
+
opacity: 0;
|
|
26304
|
+
transform: none;
|
|
26305
|
+
transition: none;
|
|
26254
26306
|
}
|
|
26255
26307
|
}
|
|
26256
26308
|
.status-circle.negative,
|