@carbon/ibm-products-web-components
Version:
Carbon for IBM Products Web Components
55 lines (53 loc) • 1.4 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 "../../globals/settings.js";
import { signal } from "@lit-labs/signals";
//#region src/components/tearsheet-preview/tearsheet-signal.ts
/**
* @license
*
* Copyright IBM Corp. 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.
*/
/**
* Block class for tearsheet component
*/
const blockClass = `c4p--tearsheet__next`;
const defaultTearsheetSignal = {
hasCloseIcon: true,
fullyCollapsed: false,
disableHeaderCollapse: false,
variant: "wide",
isSm: false,
open: false,
hasAILabel: false,
uniqueId: "",
closeIconDescription: "Close",
hideCloseButton: false,
onClose: null
};
const tearsheetSignal = signal(defaultTearsheetSignal);
/**
* Update one or more properties in the tearsheet signal
*/
const updateTearsheetSignals = (updates) => {
tearsheetSignal.set({
...tearsheetSignal.get(),
...updates
});
};
/**
* Reset tearsheet signal to default values
*/
const resetTearsheetSignal = () => {
tearsheetSignal.set(defaultTearsheetSignal);
};
//#endregion
export { blockClass, defaultTearsheetSignal, resetTearsheetSignal, tearsheetSignal, updateTearsheetSignals };
//# sourceMappingURL=tearsheet-signal.js.map