233 lines
11 KiB
JavaScript
233 lines
11 KiB
JavaScript
"use strict";
|
|
(self["webpackChunk_woocommerce_storybook"] = self["webpackChunk_woocommerce_storybook"] || []).push([[1050],{
|
|
|
|
/***/ "../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/card/card-body/component.js":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
A: () => (/* binding */ card_body_component)
|
|
});
|
|
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/extends.js");
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js
|
|
var react = __webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js");
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/ui/context/context-connect.js
|
|
var context_connect = __webpack_require__("../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/ui/context/context-connect.js");
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/view/component.js
|
|
var component = __webpack_require__("../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/view/component.js");
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/ui/context/use-context-system.js + 1 modules
|
|
var use_context_system = __webpack_require__("../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/ui/context/use-context-system.js");
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/@emotion+react@11.11.1_@types+react@17.0.71_react@17.0.2/node_modules/@emotion/react/dist/emotion-react.browser.esm.js
|
|
var emotion_react_browser_esm = __webpack_require__("../../node_modules/.pnpm/@emotion+react@11.11.1_@types+react@17.0.71_react@17.0.2/node_modules/@emotion/react/dist/emotion-react.browser.esm.js");
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/utils/config-values.js
|
|
var config_values = __webpack_require__("../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/utils/config-values.js");
|
|
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/scrollable/styles.js
|
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
|
|
/**
|
|
* External dependencies
|
|
*/
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
|
|
const scrollableScrollbar = /*#__PURE__*/(0,emotion_react_browser_esm/* css */.AH)("@media only screen and ( min-device-width: 40em ){&::-webkit-scrollbar{height:12px;width:12px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-track{background:", config_values/* default */.A.colorScrollbarTrack, ";border-radius:8px;}&::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:", config_values/* default */.A.colorScrollbarThumb, ";border:2px solid rgba( 0, 0, 0, 0 );border-radius:7px;}&:hover::-webkit-scrollbar-thumb{background-color:", config_values/* default */.A.colorScrollbarThumbHover, ";}}" + ( true ? "" : 0), true ? "" : 0);
|
|
const Scrollable = true ? {
|
|
name: "13udsys",
|
|
styles: "height:100%"
|
|
} : 0;
|
|
const Content = true ? {
|
|
name: "bjn8wh",
|
|
styles: "position:relative"
|
|
} : 0;
|
|
const styles_smoothScroll = true ? {
|
|
name: "7zq9w",
|
|
styles: "scroll-behavior:smooth"
|
|
} : 0;
|
|
const scrollX = true ? {
|
|
name: "q33xhg",
|
|
styles: "overflow-x:auto;overflow-y:hidden"
|
|
} : 0;
|
|
const scrollY = true ? {
|
|
name: "103x71s",
|
|
styles: "overflow-x:hidden;overflow-y:auto"
|
|
} : 0;
|
|
const scrollAuto = true ? {
|
|
name: "umwchj",
|
|
styles: "overflow-y:auto"
|
|
} : 0;
|
|
//# sourceMappingURL=styles.js.map
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/utils/hooks/use-cx.js
|
|
var use_cx = __webpack_require__("../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/utils/hooks/use-cx.js");
|
|
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/scrollable/hook.js
|
|
/**
|
|
* WordPress dependencies
|
|
*/
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* eslint-disable jsdoc/valid-types */
|
|
|
|
/**
|
|
* @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'div'>} props
|
|
*/
|
|
|
|
/* eslint-enable jsdoc/valid-types */
|
|
|
|
function useScrollable(props) {
|
|
const {
|
|
className,
|
|
scrollDirection = 'y',
|
|
smoothScroll = false,
|
|
...otherProps
|
|
} = (0,use_context_system/* useContextSystem */.A)(props, 'Scrollable');
|
|
const cx = (0,use_cx/* useCx */.l)();
|
|
const classes = (0,react.useMemo)(() => cx(Scrollable, scrollableScrollbar, smoothScroll && styles_smoothScroll, scrollDirection === 'x' && scrollX, scrollDirection === 'y' && scrollY, scrollDirection === 'auto' && scrollAuto, className), [className, cx, scrollDirection, smoothScroll]);
|
|
return { ...otherProps,
|
|
className: classes
|
|
};
|
|
}
|
|
//# sourceMappingURL=hook.js.map
|
|
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/scrollable/component.js
|
|
|
|
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
* @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'div'>} props
|
|
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
*/
|
|
|
|
function component_Scrollable(props, forwardedRef) {
|
|
const scrollableProps = useScrollable(props);
|
|
return (0,react.createElement)(component/* default */.A, (0,esm_extends/* default */.A)({}, scrollableProps, {
|
|
ref: forwardedRef
|
|
}));
|
|
}
|
|
/**
|
|
* `Scrollable` is a layout component that content in a scrollable container.
|
|
*
|
|
* @example
|
|
* ```jsx
|
|
* import { __experimentalScrollable as Scrollable } from `@wordpress/components`;
|
|
*
|
|
* function Example() {
|
|
* return (
|
|
* <Scrollable style={ { maxHeight: 200 } }>
|
|
* <div style={ { height: 500 } }>...</div>
|
|
* </Scrollable>
|
|
* );
|
|
* }
|
|
* ```
|
|
*/
|
|
|
|
|
|
const ConnectedScrollable = (0,context_connect/* contextConnect */.KZ)(component_Scrollable, 'Scrollable');
|
|
/* harmony default export */ const scrollable_component = (ConnectedScrollable);
|
|
//# sourceMappingURL=component.js.map
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/card/styles.js
|
|
var styles = __webpack_require__("../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/card/styles.js");
|
|
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/card/card-body/hook.js
|
|
/**
|
|
* WordPress dependencies
|
|
*/
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
* @param {import('../../ui/context').WordPressComponentProps<import('../types').BodyProps, 'div'>} props
|
|
*/
|
|
|
|
function useCardBody(props) {
|
|
const {
|
|
className,
|
|
isScrollable = false,
|
|
isShady = false,
|
|
size = 'medium',
|
|
...otherProps
|
|
} = (0,use_context_system/* useContextSystem */.A)(props, 'CardBody');
|
|
const cx = (0,use_cx/* useCx */.l)();
|
|
const classes = (0,react.useMemo)(() => cx(styles/* Body */.nB, styles/* borderRadius */.Vq, styles/* cardPaddings */.L7[size], isShady && styles/* shady */.QC, // This classname is added for legacy compatibility reasons.
|
|
'components-card__body', className), [className, cx, isShady, size]);
|
|
return { ...otherProps,
|
|
className: classes,
|
|
isScrollable
|
|
};
|
|
}
|
|
//# sourceMappingURL=hook.js.map
|
|
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/card/card-body/component.js
|
|
|
|
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
* @param {import('../../ui/context').WordPressComponentProps<import('../types').BodyProps, 'div'>} props
|
|
* @param {import('react').ForwardedRef<any>} forwardedRef
|
|
*/
|
|
|
|
function CardBody(props, forwardedRef) {
|
|
const {
|
|
isScrollable,
|
|
...otherProps
|
|
} = useCardBody(props);
|
|
|
|
if (isScrollable) {
|
|
return (0,react.createElement)(scrollable_component, (0,esm_extends/* default */.A)({}, otherProps, {
|
|
ref: forwardedRef
|
|
}));
|
|
}
|
|
|
|
return (0,react.createElement)(component/* default */.A, (0,esm_extends/* default */.A)({}, otherProps, {
|
|
ref: forwardedRef
|
|
}));
|
|
}
|
|
/**
|
|
* `CardBody` renders an optional content area for a `Card`.
|
|
* Multiple `CardBody` components can be used within `Card` if needed.
|
|
*
|
|
* @example
|
|
* ```jsx
|
|
* import { Card, CardBody } from `@wordpress/components`;
|
|
*
|
|
* <Card>
|
|
* <CardBody>
|
|
* ...
|
|
* </CardBody>
|
|
* </Card>
|
|
* ```
|
|
*/
|
|
|
|
|
|
const ConnectedCardBody = (0,context_connect/* contextConnect */.KZ)(CardBody, 'CardBody');
|
|
/* harmony default export */ const card_body_component = (ConnectedCardBody);
|
|
//# sourceMappingURL=component.js.map
|
|
|
|
/***/ })
|
|
|
|
}]); |