(self["webpackChunk_woocommerce_storybook"] = self["webpackChunk_woocommerce_storybook"] || []).push([[6322],{ /***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/defineProperty.js": /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ A: () => (/* binding */ _defineProperty) /* harmony export */ }); /* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"); function _defineProperty(obj, key, value) { key = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /***/ }), /***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js": /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { A: () => (/* binding */ _toPropertyKey) }); // EXTERNAL MODULE: ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js var esm_typeof = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js"); ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPrimitive.js function _toPrimitive(input, hint) { if ((0,esm_typeof/* default */.A)(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if ((0,esm_typeof/* default */.A)(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return (0,esm_typeof/* default */.A)(key) === "symbol" ? key : String(key); } /***/ }), /***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js": /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ A: () => (/* binding */ _typeof) /* harmony export */ }); function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /***/ }), /***/ "../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js": /***/ ((module, exports) => { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; var nativeCodeString = '[native code]'; function classNames() { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg)) { if (arg.length) { var inner = classNames.apply(null, arg); if (inner) { classes.push(inner); } } } else if (argType === 'object') { if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { classes.push(arg.toString()); continue; } for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if ( true && module.exports) { classNames.default = classNames; module.exports = classNames; } else if (true) { // register as 'classnames', consistent with npm package name !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return classNames; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }), /***/ "../../packages/js/components/src/order-status/stories/order-status.story.js": /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { Basic: () => (/* binding */ Basic), "default": () => (/* binding */ order_status_story) }); // 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+i18n@4.6.1/node_modules/@wordpress/i18n/build-module/index.js + 3 modules var build_module = __webpack_require__("../../node_modules/.pnpm/@wordpress+i18n@4.6.1/node_modules/@wordpress/i18n/build-module/index.js"); // EXTERNAL MODULE: ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/defineProperty.js"); // EXTERNAL MODULE: ../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js var classnames = __webpack_require__("../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js"); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); // EXTERNAL MODULE: ../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js var prop_types = __webpack_require__("../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js"); var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types); ;// CONCATENATED MODULE: ../../packages/js/components/src/order-status/index.js /** * External dependencies */ /** * Use `OrderStatus` to display a badge with human-friendly text describing the current order status. * * @param {Object} props * @param {Object} props.order * @param {string} props.order.status * @param {string} props.className * @param {Object} props.orderStatusMap * @param {boolean} props.labelPositionToLeft * @return {Object} - */ var OrderStatus = function OrderStatus(_ref) { var status = _ref.order.status, className = _ref.className, orderStatusMap = _ref.orderStatusMap, _ref$labelPositionToL = _ref.labelPositionToLeft, labelPositionToLeft = _ref$labelPositionToL === void 0 ? false : _ref$labelPositionToL; var indicatorClasses = classnames_default()('woocommerce-order-status__indicator', (0,defineProperty/* default */.A)({}, 'is-' + status, true)); var label = orderStatusMap[status] || status; return (0,react.createElement)("div", { className: classnames_default()('woocommerce-order-status', className) }, labelPositionToLeft ? (0,react.createElement)(react.Fragment, null, label, (0,react.createElement)("span", { className: indicatorClasses })) : (0,react.createElement)(react.Fragment, null, (0,react.createElement)("span", { className: indicatorClasses }), label)); }; OrderStatus.propTypes = { /** * The order to display a status for. */ order: (prop_types_default()).object.isRequired, /** * Additional CSS classes. */ className: (prop_types_default()).string, /** * A map of status to label for order statuses. */ orderStatusMap: (prop_types_default()).object }; /* harmony default export */ const order_status = (OrderStatus); ;// CONCATENATED MODULE: ../../packages/js/components/src/order-status/stories/order-status.story.js /** * External dependencies */ var orderStatusMap = { processing: (0,build_module.__)('Processing Order', 'woocommerce'), pending: (0,build_module.__)('Pending Order', 'woocommerce'), completed: (0,build_module.__)('Completed Order', 'woocommerce') }; var Basic = function Basic() { return (0,react.createElement)("div", null, (0,react.createElement)(order_status, { order: { status: 'processing' }, orderStatusMap: orderStatusMap }), (0,react.createElement)(order_status, { order: { status: 'pending' }, orderStatusMap: orderStatusMap }), (0,react.createElement)(order_status, { order: { status: 'completed' }, orderStatusMap: orderStatusMap })); }; /* harmony default export */ const order_status_story = ({ title: 'WooCommerce Admin/components/OrderStatus', component: order_status }); Basic.parameters = { ...Basic.parameters, docs: { ...Basic.parameters?.docs, source: { originalSource: "() =>