UNPKG

@enact/sandstone

Version:

Large-screen/TV support library for Enact, containing a variety of UI components.

77 lines (74 loc) 2.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Panel = Panel; exports["default"] = void 0; var _react = require("react"); var _PanelsRouter = require("../internal/Panels/PanelsRouter"); /** * Panel that sets the children for * {@link sandstone/QuickGuidePanels.QuickGuidePanels|QuickGuidePanels}. * * @class Panel * @memberof sandstone/QuickGuidePanels * @ui * @public */ function Panel(_ref) { var ariaLabel = _ref['aria-label'], children = _ref.children, nextButton = _ref.nextButton, prevButton = _ref.prevButton; var set = (0, _react.useContext)(_PanelsRouter.PanelsContext); (0, _react.useEffect)(function () { if (set) { set({ 'aria-label': ariaLabel, children: children, nextButton: nextButton, prevButton: prevButton }); } }, [ariaLabel, children, nextButton, prevButton, set]); return null; } /** * The button to use in place of the standard next button. * * This prop accepts a component (e.g. `Button`), a component instance or a boolean value. * * If `false`, the button will not show. If set to a component, or `true`, the button will * show. This will override the setting of * {@link sandstone/QuickGuidePanels.QuickGuidePanelsBase.nextButtonVisibility|nextButtonVisibility}. * * Example: * ``` * nextButton={<Button icon="closex" aria-label="Quit">Close</Button>} * ``` * * @name nextButton * @memberof sandstone/QuickGuidePanels.Panel.prototype * @type {Boolean|Component} * @public */ /** * The button to use in place of the standard prev button. * * This prop accepts a component (e.g. `Button`), a component instance or a boolean value. * * If `false`, the button will not show. If set to a component, or `true`, the button will * show. This will override the setting of * {@link sandstone/QuickGuidePanels.QuickGuidePanelsBase.prevButtonVisibility|prevButtonVisibility}. * * Example: * ``` * prevButton={<Button icon="closex" aria-label="Back">Back</Button>} * ``` * * @name PrevButton * @memberof sandstone/QuickGuidePanels.Panel.prototype * @type {Boolean|Component} * @public */ var _default = exports["default"] = Panel;