@carbon/ibm-products-web-components
Version:
Carbon for IBM Products Web Components
41 lines (39 loc) • 1.06 kB
JavaScript
/**
* Copyright IBM Corp. 2020, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { signal } from "@lit-labs/signals";
//#region src/components/coachmark/coachmark-context.ts
/**
* @license
*
* Copyright IBM Corp. 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const coachmarkDetailsSignal = signal({
open: false,
floating: false
});
const resetCoachmarkDetailsSignal = () => {
coachmarkDetailsSignal.set({
open: false,
floating: false
});
};
const updateCoachmarkDetailsSignal = ({ name, detail }) => {
const currentValue = coachmarkDetailsSignal.get();
if (currentValue[name] !== detail) {
const newValue = {
...currentValue,
[name]: detail
};
coachmarkDetailsSignal.set(newValue);
}
};
//#endregion
export { coachmarkDetailsSignal, resetCoachmarkDetailsSignal, updateCoachmarkDetailsSignal };
//# sourceMappingURL=coachmark-context.js.map