@phillips/seldon 1.269.0 → 1.270.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index12.js +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index7.cjs +1 -1
- package/dist/_virtual/index7.js +2 -3
- package/dist/_virtual/index8.cjs +1 -1
- package/dist/_virtual/index8.js +3 -2
- package/dist/components/AddToCalendar/calendarLinks.cjs +1 -1
- package/dist/components/AddToCalendar/calendarLinks.js +1 -1
- package/dist/node_modules/ics/dist/schema/index.cjs +1 -1
- package/dist/node_modules/ics/dist/schema/index.js +1 -1
- package/dist/node_modules/ics/dist/utils/index.cjs +1 -1
- package/dist/node_modules/ics/dist/utils/index.js +1 -1
- package/dist/node_modules/prop-types/index.cjs +1 -1
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/site-furniture/Footer/Footer.cjs +1 -1
- package/dist/site-furniture/Footer/Footer.d.ts +10 -1
- package/dist/site-furniture/Footer/Footer.js +24 -19
- package/dist/site-furniture/Footer/Footer.stories.d.ts +2 -1
- package/dist/site-furniture/Header/Header.cjs +1 -1
- package/dist/site-furniture/Header/Header.d.ts +5 -1
- package/dist/site-furniture/Header/Header.js +69 -68
- package/dist/site-furniture/Header/Header.stories.d.ts +2 -0
- package/package.json +1 -1
package/dist/_virtual/index12.js
CHANGED
package/dist/_virtual/index13.js
CHANGED
package/dist/_virtual/index7.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
package/dist/_virtual/index7.js
CHANGED
package/dist/_virtual/index8.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../node_modules/ics/dist/index.cjs");var r=e.__require();exports.distExports=r;
|
package/dist/_virtual/index8.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../_virtual/index8.cjs"),H=require("../../node_modules/date-fns/isValid.cjs"),m=require("../../node_modules/date-fns-tz/dist/esm/toZonedTime/index.cjs"),c=require("../../node_modules/date-fns/addHours.cjs"),a=require("../../node_modules/date-fns/format.cjs"),d={google:"https://calendar.google.com/calendar/u/0/r/eventedit",outlook:"https://outlook.office.com/calendar/0/deeplink/compose",yahoo:"https://calendar.yahoo.com/"},M=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return console.warn("Unable to determine user's timezone. Using UTC as a fallback."),"UTC"}},y=o=>new URLSearchParams(o),l=(o,t)=>{if(!t.start||!H.isValid(t.start))return console.error("Invalid event start date:",t),"#";const e=M(),n=m.toZonedTime(t.start,o==="google"?t.timezone:e),r=t.end?m.toZonedTime(t.end,o==="google"?t.timezone:e):null;switch(o){case"google":return h(n,r,t);case"outlook":return k(n,r,t);case"yahoo":return f(n,r,t);default:return console.error("Invalid calendar type:",o),"#"}},h=(o,t,e)=>{const n=y({text:e.title,dates:t?`${a.format(o,"yyyyMMdd'T'HHmmss")}/${a.format(t,"yyyyMMdd'T'HHmmss")}`:`${a.format(o,"yyyyMMdd'T'HHmmss")}/${a.format(c.addHours(o,1),"yyyyMMdd'T'HHmmss")}`,ctz:e.timezone,details:e.description,location:e.location}),r=new URL(d.google);return r.search=n.toString(),r.toString()},k=(o,t,e)=>{const n=y({path:"/calendar/action/compose",rru:"addevent",subject:e.title,startdt:a.format(o,"yyyy-MM-dd'T'HH:mm:ssXXX"),enddt:t?a.format(t,"yyyy-MM-dd'T'HH:mm:ssXXX"):a.format(c.addHours(o,1),"yyyy-MM-dd'T'HH:mm:ssXXX"),body:e.description,location:e.location,allday:"false"}),r=new URL(d.outlook);return r.search=n.toString(),r.toString()},f=(o,t,e)=>{const n=encodeURIComponent(e.title),r=encodeURIComponent(e.description),i=encodeURIComponent(e.location),s=a.format(o,"yyyyMMdd'T'HHmmss"),u=t?a.format(t,"yyyyMMdd'T'HHmmss"):a.format(c.addHours(o,1),"yyyyMMdd'T'HHmmss");return`${d.yahoo}?v=60&view=d&type=20&title=${n}&st=${s}&et=${u}&desc=${r}&in_loc=${i}`},p=o=>l("google",o),L=o=>l("outlook",o),C=o=>l("yahoo",o),U=o=>{if(!o.start){console.error("Invalid event start date:",o);return}const t=o.end?o.end:c.addHours(o.start,1);g.distExports.createEvent({title:o.title,description:o.description,start:[o.start.getFullYear(),o.start.getMonth()+1,o.start.getDate(),o.start.getHours(),o.start.getMinutes()],end:[t.getFullYear(),t.getMonth()+1,t.getDate(),t.getHours(),t.getMinutes()],location:o.location},(e,n)=>{if(e)console.error("Error creating iCalendar event:",e);else{const r=new File([n],`${o.title}.ics`,{type:"text/calendar"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=r.name,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}})};exports.generateCalendarFile=U;exports.generateGoogleCalendarLink=p;exports.generateOutlookOnlineLink=L;exports.generateYahooCalendarLink=C;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as u } from "../../_virtual/
|
|
1
|
+
import { d as u } from "../../_virtual/index8.js";
|
|
2
2
|
import { isValid as p } from "../../node_modules/date-fns/isValid.js";
|
|
3
3
|
import { toZonedTime as m } from "../../node_modules/date-fns-tz/dist/esm/toZonedTime/index.js";
|
|
4
4
|
import { addHours as i } from "../../node_modules/date-fns/addHours.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../../../_virtual/index13.cjs"),R=require("../../../../_virtual/index.esm.cjs");var b;function D(){if(b)return u.__exports;b=1,Object.defineProperty(u.__exports,"__esModule",{value:!0}),u.__exports.urlRegex=void 0,u.__exports.validateHeader=T,u.__exports.validateHeaderAndEvent=j;var e=v(R.default);function f(r){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(f=function(c){return c?n:t})(r)}function v(r,t){if(r&&r.__esModule)return r;if(r===null||o(r)!=="object"&&typeof r!="function")return{default:r};var n=f(t);if(n&&n.has(r))return n.get(r);var a={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in r)if(i!=="default"&&Object.prototype.hasOwnProperty.call(r,i)){var d=c?Object.getOwnPropertyDescriptor(r,i):null;d&&(d.get||d.set)?Object.defineProperty(a,i,d):a[i]=r[i]}return a.default=r,n&&n.set(r,a),a}function o(r){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(r)}function l(r,t){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);t&&(a=a.filter(function(c){return Object.getOwnPropertyDescriptor(r,c).enumerable})),n.push.apply(n,a)}return n}function m(r){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(a){O(r,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(n,a))})}return r}function O(r,t,n){return t=S(t),t in r?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r}function S(r){var t=x(r,"string");return o(t)==="symbol"?t:String(t)}function x(r,t){if(o(r)!=="object"||r===null)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var a=n.call(r,t);if(o(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}var p=u.__exports.urlRegex=/^(?:([a-z0-9+.-]+):\/\/)(?:\S+(?::\S*)?@)?(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/,s=function(t){var n=t.required;return e.lazy(function(a){return typeof a=="number"?e.number().integer().min(0):typeof a=="string"?e.string().required():!n&&typeof a>"u"?e.mixed().oneOf([void 0]):e.array().required().min(3).max(7).of(e.lazy(function(c,i){var d=i.parent.indexOf(i.value);return[e.number().integer(),e.number().integer().min(1).max(12),e.number().integer().min(1).max(31),e.number().integer().min(0).max(23),e.number().integer().min(0).max(60),e.number().integer().min(0).max(60)][d]}))})},g=e.object().shape({before:e.boolean(),weeks:e.number(),days:e.number(),hours:e.number(),minutes:e.number(),seconds:e.number()}).noUnknown(),y=e.object().shape({name:e.string(),email:e.string().email(),rsvp:e.boolean(),dir:e.string().matches(p),partstat:e.string(),role:e.string(),cutype:e.string(),xNumGuests:e.number()}).noUnknown(),_=e.object().shape({name:e.string(),email:e.string().email(),dir:e.string(),sentBy:e.string()}).noUnknown(),P=e.object().shape({action:e.string().matches(/^(audio|display|email)$/).required(),trigger:e.mixed().required(),description:e.string(),duration:g,repeat:e.number(),attach:e.string(),attachType:e.string(),summary:e.string(),attendee:y,"x-prop":e.mixed(),"iana-prop":e.mixed()}).noUnknown(),h={productId:e.string(),method:e.string(),calName:e.string()},w=e.object().shape(h).noUnknown(),q={summary:e.string(),timestamp:s({required:!1}),title:e.string(),uid:e.string(),sequence:e.number().integer().max(2147483647),start:s({required:!0}),duration:g,startType:e.string().matches(/^(utc|local)$/),startInputType:e.string().matches(/^(utc|local)$/),startOutputType:e.string().matches(/^(utc|local)$/),end:s({required:!1}),endInputType:e.string().matches(/^(utc|local)$/),endOutputType:e.string().matches(/^(utc|local)$/),description:e.string(),url:e.string().matches(p),geo:e.object().shape({lat:e.number(),lon:e.number()}),location:e.string(),status:e.string().matches(/^(TENTATIVE|CANCELLED|CONFIRMED)$/i),categories:e.array().of(e.string()),organizer:_,attendees:e.array().of(y),alarms:e.array().of(P),recurrenceRule:e.string(),busyStatus:e.string().matches(/^(TENTATIVE|FREE|BUSY|OOF)$/i),transp:e.string().matches(/^(TRANSPARENT|OPAQUE)$/i),classification:e.string(),created:s({required:!1}),lastModified:s({required:!1}),exclusionDates:e.array().of(s({required:!0})),htmlContent:e.string()},E=e.object().shape(m(m({},h),q)).test("xor","object should have end or duration (but not both)",function(r){var t=!!r.end,n=!!r.duration;return t&&!n||!t&&n||!t&&!n}).noUnknown();function T(r){try{var t=w.validateSync(r,{abortEarly:!1,strict:!0});return{error:null,value:t}}catch(n){return{error:Object.assign({},n),value:void 0}}}function j(r){try{var t=E.validateSync(r,{abortEarly:!1,strict:!0});return{error:null,value:t}}catch(n){return{error:Object.assign({},n),value:void 0}}}return u.__exports}exports.__require=D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../../../_virtual/index12.cjs"),q=require("./format-date.cjs"),b=require("./set-geolocation.cjs"),y=require("./set-contact.cjs"),O=require("./set-organizer.cjs"),P=require("./set-alarm.cjs"),v=require("./set-description.cjs"),j=require("./set-summary.cjs"),D=require("./format-duration.cjs"),p=require("./fold-line.cjs"),L=require("./set-location.cjs"),S=require("./encode-param-value.cjs");var n;function z(){return n||(n=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeParamValue",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(r,"foldLine",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"formatDate",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"formatDuration",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(r,"setAlarm",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(r,"setContact",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,"setDescription",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(r,"setGeolocation",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"setLocation",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(r,"setOrganizer",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(r,"setSummary",{enumerable:!0,get:function(){return l.default}});var i=t(q.__require()),a=t(b.__require()),o=t(y.__require()),c=t(O.__require()),f=t(P.__require()),_=t(v.__require()),l=t(j.__require()),d=t(D.__require()),s=t(p.__require()),m=t(L.__require()),g=t(S.__require());function t(e){return e&&e.__esModule?e:{default:e}}})(u.__exports)),u.__exports}exports.__require=z;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as u } from "../../../../_virtual/
|
|
1
|
+
import { __exports as u } from "../../../../_virtual/index12.js";
|
|
2
2
|
import { __require as g } from "./format-date.js";
|
|
3
3
|
import { __require as b } from "./set-geolocation.js";
|
|
4
4
|
import { __require as p } from "./set-contact.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../_virtual/index7.cjs"),t=require("./node_modules/react-is/index.cjs"),u=require("./factoryWithTypeCheckers.cjs"),s=require("./factoryWithThrowingShims.cjs");var r;function _(){if(r)return e.__module.exports;if(r=1,process.env.NODE_ENV!=="production"){var o=t.__require(),i=!0;e.__module.exports=u.__require()(o.isElement,i)}else e.__module.exports=s.__require()();return e.__module.exports}exports.__require=_;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../_virtual/
|
|
1
|
+
import { __module as r } from "../../_virtual/index7.js";
|
|
2
2
|
import { __require as s } from "./node_modules/react-is/index.js";
|
|
3
3
|
import { __require as t } from "./factoryWithTypeCheckers.js";
|
|
4
4
|
import { __require as p } from "./factoryWithThrowingShims.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),d=require("../../_virtual/index.cjs"),o=require("../../utils/index.cjs"),u=require("../../components/Text/types.cjs"),x=require("../../components/Text/Text.cjs"),i=require("../../components/Icon/Icon.cjs"),f=({children:l,className:a,copyright:n=`© ${o.defaultYear} Phillips Auctioneers, LLC`,id:t,logoHref:s="/",logoLinkComponent:c})=>{const r=c;return e.jsxs("footer",{"data-testid":t||"footer",id:t,className:d.default(`${o.px}-footer`,{className:a}),children:[e.jsx("div",{className:`${o.px}-footer__links`,children:l}),e.jsxs("div",{className:`${o.px}-footer__copyright`,children:[r?e.jsx(r,{href:s,"aria-label":"logoLink","data-testid":"footer-logo",className:`${o.px}-footer__logo`,children:e.jsx(i.default,{icon:"PhillipsLogo",width:"94px"})}):e.jsx("a",{href:s,"aria-label":"logo","data-testid":"footer-logo",className:`${o.px}-footer__logo`,children:e.jsx(i.default,{icon:"PhillipsLogo",width:"94px"})}),e.jsx(x.default,{variant:u.TextVariants.bodySmall,children:n})]})]})};exports.default=f;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentType } from 'react';
|
|
1
2
|
export interface FooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
2
3
|
/**
|
|
3
4
|
* Copyright data added to bottom of site
|
|
4
5
|
*/
|
|
5
6
|
copyright?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Logo href
|
|
9
|
+
*/
|
|
10
|
+
logoHref?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Logo link component to support SPA navigation (e.g. Remix <Link> or Next.js <Link>)
|
|
13
|
+
*/
|
|
14
|
+
logoLinkComponent?: ComponentType<ComponentPropsWithoutRef<'a'>>;
|
|
6
15
|
}
|
|
7
16
|
/**
|
|
8
17
|
* ## Overview
|
|
@@ -13,5 +22,5 @@ export interface FooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
13
22
|
*
|
|
14
23
|
* [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-footer--overview)
|
|
15
24
|
*/
|
|
16
|
-
declare const Footer: ({ children, className, copyright, id, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare const Footer: ({ children, className, copyright, id, logoHref, logoLinkComponent, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
26
|
export default Footer;
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { px as
|
|
4
|
-
import { TextVariants as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
children:
|
|
9
|
-
className:
|
|
10
|
-
copyright:
|
|
11
|
-
id:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import n from "../../_virtual/index.js";
|
|
3
|
+
import { px as t, defaultYear as d } from "../../utils/index.js";
|
|
4
|
+
import { TextVariants as p } from "../../components/Text/types.js";
|
|
5
|
+
import h from "../../components/Text/Text.js";
|
|
6
|
+
import l from "../../components/Icon/Icon.js";
|
|
7
|
+
const u = ({
|
|
8
|
+
children: s,
|
|
9
|
+
className: m,
|
|
10
|
+
copyright: c = `© ${d} Phillips Auctioneers, LLC`,
|
|
11
|
+
id: r,
|
|
12
|
+
logoHref: e = "/",
|
|
13
|
+
logoLinkComponent: f
|
|
14
|
+
}) => {
|
|
15
|
+
const a = f;
|
|
16
|
+
return /* @__PURE__ */ i("footer", { "data-testid": r || "footer", id: r, className: n(`${t}-footer`, { className: m }), children: [
|
|
17
|
+
/* @__PURE__ */ o("div", { className: `${t}-footer__links`, children: s }),
|
|
18
|
+
/* @__PURE__ */ i("div", { className: `${t}-footer__copyright`, children: [
|
|
19
|
+
a ? /* @__PURE__ */ o(a, { href: e, "aria-label": "logoLink", "data-testid": "footer-logo", className: `${t}-footer__logo`, children: /* @__PURE__ */ o(l, { icon: "PhillipsLogo", width: "94px" }) }) : /* @__PURE__ */ o("a", { href: e, "aria-label": "logo", "data-testid": "footer-logo", className: `${t}-footer__logo`, children: /* @__PURE__ */ o(l, { icon: "PhillipsLogo", width: "94px" }) }),
|
|
20
|
+
/* @__PURE__ */ o(h, { variant: p.bodySmall, children: c })
|
|
21
|
+
] })
|
|
22
|
+
] });
|
|
23
|
+
};
|
|
19
24
|
export {
|
|
20
|
-
|
|
25
|
+
u as default
|
|
21
26
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FooterProps } from './Footer';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ children, className, copyright, id, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ children, className, copyright, id, logoHref, logoLinkComponent, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
};
|
|
6
6
|
export default meta;
|
|
7
|
+
export declare const WithCustomLinkElement: () => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export declare const Playground: (props: FooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),o=require("../../_virtual/index.cjs"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),o=require("../../_virtual/index.cjs"),t=require("react"),G=require("../../components/Icon/Icon.cjs"),$=require("../../components/Navigation/Navigation.cjs"),S=require("../../patterns/LanguageSelector/LanguageSelector.cjs"),M=require("../../patterns/UserManagement/UserManagement.cjs"),J=require("../../providers/SeldonProvider/utils.cjs"),n=require("../../utils/index.cjs"),K=require("./hooks.cjs"),W=require("./utils.cjs"),X=require("../../utils/constants.cjs"),q=t.createContext(W.defaultHeaderContext),H=t.forwardRef(({logo:d=r.jsx(G.default,{icon:"PhillipsLogo"}),logoHref:u="/",logoLinkComponent:O,className:N,children:i,toggleOpenText:k="Open Menu",toggleCloseText:w="Close Menu",logoText:h="Home Page",disabled:g,bannerRef:l,skipToContentId:m="main",skipLinkLabel:P="Skip to main content",...R},a)=>{const p=n.findChildrenOfType(i,M.default),T=t.isValidElement(p?.[0])?t.cloneElement(p[0],{disabled:g}):"",f=n.findChildrenOfType(i,S.default),x=t.isValidElement(f?.[0])?t.cloneElement(f[0],{disabled:g}):"",[v,z]=t.useState(!1),L=n.findChildrenOfType(i,$.default),I=n.findChildrenExcludingTypes(i,[$.default,M.default,S.default]),{closeMenu:V,handleMenuToggle:A,isMenuOpen:c,toggleText:B}=K.useMobileMenu({toggleOpenText:k,toggleCloseText:w}),[Q,U]=t.useState(null),[_,b]=t.useState(l?.current?l.current.clientHeight:0),E=t.useRef(null);t.useEffect(()=>{const e=l?.current;if(!e)return;b(e.clientHeight);const s=new window.ResizeObserver(()=>{b(e.clientHeight)});return s.observe(e),()=>{s.disconnect()}},[l,_]),t.useEffect(()=>{const e=E.current;if(!e)return;const s=()=>{const F=e.offsetHeight;document.documentElement.style.setProperty("--header-height",`${F}px`)};s();const C=new window.ResizeObserver(s);return C.observe(e),()=>{C.disconnect()}},[]);const D=t.useCallback(e=>{E.current=e,typeof a=="function"?a(e):a&&(a.current=e)},[a]),j=O,y=typeof d=="object"?d:r.jsx("img",{alt:"Phillips","data-testid":"header-logo-img",src:d});return r.jsxs("header",{...R,className:o.default(`${n.px}-header`,N),ref:D,style:{"--banner-height":`${_}px`},children:[m&&r.jsx("a",{href:`#${m}`,className:`${n.px}-header__skip-link`,"data-testid":"skip-to-content",children:P}),r.jsxs("div",{className:`${n.px}-header__top-row`,children:[r.jsx(J.SSRMediaQuery.Media,{greaterThanOrEqual:X.Breakpoints.md,children:x}),r.jsxs("button",{"aria-label":B,"data-testid":"mobile-menu-toggle",type:"button",onClick:A,className:o.default(`${n.px}-header__toggle-btn`,{[`${n.px}-header__toggle-btn--open`]:c}),children:[r.jsx("span",{})," "]}),j?r.jsx(j,{href:u,"aria-label":h,"data-testid":"header-logo",className:`${n.px}-header__logo`,children:y}):r.jsx("a",{href:u,"aria-label":h,"data-testid":"header-logo",className:`${n.px}-header__logo`,children:y}),T]}),r.jsx("div",{className:o.default(`${n.px}-header__nav`,{[`${n.px}-header__nav--closed`]:!c}),children:r.jsxs(q.Provider,{value:{activeSubmenuId:Q,setActiveSubmenuId:U,isMenuOpen:c,isSearchExpanded:v,setIsSearchExpanded:z,closeMenu:V},children:[t.Children.map(L,e=>t.isValidElement(e)?t.cloneElement(e,{children:[...t.Children.toArray(e.props.children),x]}):e),I]})}),r.jsx("div",{className:o.default(`${n.px}-header__overlay`,{[`${n.px}-header__overlay--active`]:v})})]})});H.displayName="Header";exports.HeaderContext=q;exports.default=H;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as React, Component, ComponentProps, ReactElement } from 'react';
|
|
1
|
+
import { default as React, Component, ComponentProps, ComponentPropsWithoutRef, ReactElement } from 'react';
|
|
2
2
|
export interface HeaderProps extends ComponentProps<'header'> {
|
|
3
3
|
/**
|
|
4
4
|
* Logo src
|
|
@@ -8,6 +8,10 @@ export interface HeaderProps extends ComponentProps<'header'> {
|
|
|
8
8
|
* Logo href
|
|
9
9
|
*/
|
|
10
10
|
logoHref?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Logo link component to support SPA navigation (e.g. Remix <Link> or Next.js <Link>)
|
|
13
|
+
*/
|
|
14
|
+
logoLinkComponent?: React.ComponentType<ComponentPropsWithoutRef<'a'>>;
|
|
11
15
|
/**
|
|
12
16
|
* Toggle open text
|
|
13
17
|
*/
|
|
@@ -1,83 +1,84 @@
|
|
|
1
1
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import c from "../../_virtual/index.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { SSRMediaQuery as
|
|
9
|
-
import { findChildrenOfType as u, findChildrenExcludingTypes as
|
|
10
|
-
import { useMobileMenu as
|
|
11
|
-
import { defaultHeaderContext as
|
|
12
|
-
import { Breakpoints as
|
|
13
|
-
const
|
|
3
|
+
import n, { createContext as K, forwardRef as W, useState as h, useEffect as N } from "react";
|
|
4
|
+
import X from "../../components/Icon/Icon.js";
|
|
5
|
+
import w from "../../components/Navigation/Navigation.js";
|
|
6
|
+
import O from "../../patterns/LanguageSelector/LanguageSelector.js";
|
|
7
|
+
import k from "../../patterns/UserManagement/UserManagement.js";
|
|
8
|
+
import { SSRMediaQuery as Y } from "../../providers/SeldonProvider/utils.js";
|
|
9
|
+
import { findChildrenOfType as u, findChildrenExcludingTypes as Z, px as t } from "../../utils/index.js";
|
|
10
|
+
import { useMobileMenu as ee } from "./hooks.js";
|
|
11
|
+
import { defaultHeaderContext as te } from "./utils.js";
|
|
12
|
+
import { Breakpoints as ne } from "../../utils/constants.js";
|
|
13
|
+
const re = K(te), ae = W(
|
|
14
14
|
({
|
|
15
|
-
logo: d = /* @__PURE__ */ r(
|
|
16
|
-
logoHref:
|
|
17
|
-
|
|
15
|
+
logo: d = /* @__PURE__ */ r(X, { icon: "PhillipsLogo" }),
|
|
16
|
+
logoHref: g = "/",
|
|
17
|
+
logoLinkComponent: P,
|
|
18
|
+
className: R,
|
|
18
19
|
children: i,
|
|
19
|
-
toggleOpenText:
|
|
20
|
-
toggleCloseText:
|
|
21
|
-
logoText:
|
|
22
|
-
disabled:
|
|
20
|
+
toggleOpenText: z = "Open Menu",
|
|
21
|
+
toggleCloseText: L = "Close Menu",
|
|
22
|
+
logoText: p = "Home Page",
|
|
23
|
+
disabled: f,
|
|
23
24
|
bannerRef: s,
|
|
24
|
-
skipToContentId:
|
|
25
|
-
skipLinkLabel:
|
|
26
|
-
...
|
|
25
|
+
skipToContentId: _ = "main",
|
|
26
|
+
skipLinkLabel: j = "Skip to main content",
|
|
27
|
+
...I
|
|
27
28
|
}, a) => {
|
|
28
|
-
const
|
|
29
|
-
toggleOpenText:
|
|
30
|
-
toggleCloseText:
|
|
31
|
-
}), [
|
|
32
|
-
|
|
29
|
+
const v = u(i, k), T = n.isValidElement(v?.[0]) ? n.cloneElement(v[0], { disabled: f }) : "", b = u(i, O), E = n.isValidElement(b?.[0]) ? n.cloneElement(b[0], { disabled: f }) : "", [$, V] = h(!1), A = u(i, w), B = Z(i, [w, k, O]), { closeMenu: q, handleMenuToggle: Q, isMenuOpen: m, toggleText: U } = ee({
|
|
30
|
+
toggleOpenText: z,
|
|
31
|
+
toggleCloseText: L
|
|
32
|
+
}), [D, F] = h(null), [y, C] = h(s?.current ? s.current.clientHeight : 0), x = n.useRef(null);
|
|
33
|
+
N(() => {
|
|
33
34
|
const e = s?.current;
|
|
34
35
|
if (!e) return;
|
|
35
|
-
|
|
36
|
+
C(e.clientHeight);
|
|
36
37
|
const o = new window.ResizeObserver(() => {
|
|
37
|
-
|
|
38
|
+
C(e.clientHeight);
|
|
38
39
|
});
|
|
39
40
|
return o.observe(e), () => {
|
|
40
41
|
o.disconnect();
|
|
41
42
|
};
|
|
42
|
-
}, [s,
|
|
43
|
-
const e =
|
|
43
|
+
}, [s, y]), N(() => {
|
|
44
|
+
const e = x.current;
|
|
44
45
|
if (!e) return;
|
|
45
46
|
const o = () => {
|
|
46
|
-
const
|
|
47
|
-
document.documentElement.style.setProperty("--header-height", `${
|
|
47
|
+
const J = e.offsetHeight;
|
|
48
|
+
document.documentElement.style.setProperty("--header-height", `${J}px`);
|
|
48
49
|
};
|
|
49
50
|
o();
|
|
50
|
-
const
|
|
51
|
-
return
|
|
52
|
-
|
|
51
|
+
const S = new window.ResizeObserver(o);
|
|
52
|
+
return S.observe(e), () => {
|
|
53
|
+
S.disconnect();
|
|
53
54
|
};
|
|
54
55
|
}, []);
|
|
55
|
-
const
|
|
56
|
+
const G = n.useCallback(
|
|
56
57
|
(e) => {
|
|
57
|
-
|
|
58
|
+
x.current = e, typeof a == "function" ? a(e) : a && (a.current = e);
|
|
58
59
|
},
|
|
59
60
|
[a]
|
|
60
|
-
);
|
|
61
|
+
), H = P, M = typeof d == "object" ? d : /* @__PURE__ */ r("img", { alt: "Phillips", "data-testid": "header-logo-img", src: d });
|
|
61
62
|
return /* @__PURE__ */ l(
|
|
62
63
|
"header",
|
|
63
64
|
{
|
|
64
|
-
...
|
|
65
|
-
className: c(`${
|
|
66
|
-
ref:
|
|
67
|
-
style: { "--banner-height": `${
|
|
65
|
+
...I,
|
|
66
|
+
className: c(`${t}-header`, R),
|
|
67
|
+
ref: G,
|
|
68
|
+
style: { "--banner-height": `${y}px` },
|
|
68
69
|
children: [
|
|
69
|
-
|
|
70
|
-
/* @__PURE__ */ l("div", { className: `${
|
|
71
|
-
/* @__PURE__ */ r(
|
|
70
|
+
_ && /* @__PURE__ */ r("a", { href: `#${_}`, className: `${t}-header__skip-link`, "data-testid": "skip-to-content", children: j }),
|
|
71
|
+
/* @__PURE__ */ l("div", { className: `${t}-header__top-row`, children: [
|
|
72
|
+
/* @__PURE__ */ r(Y.Media, { greaterThanOrEqual: ne.md, children: E }),
|
|
72
73
|
/* @__PURE__ */ l(
|
|
73
74
|
"button",
|
|
74
75
|
{
|
|
75
|
-
"aria-label":
|
|
76
|
+
"aria-label": U,
|
|
76
77
|
"data-testid": "mobile-menu-toggle",
|
|
77
78
|
type: "button",
|
|
78
|
-
onClick:
|
|
79
|
-
className: c(`${
|
|
80
|
-
[`${
|
|
79
|
+
onClick: Q,
|
|
80
|
+
className: c(`${t}-header__toggle-btn`, {
|
|
81
|
+
[`${t}-header__toggle-btn--open`]: m
|
|
81
82
|
}),
|
|
82
83
|
children: [
|
|
83
84
|
/* @__PURE__ */ r("span", {}),
|
|
@@ -85,39 +86,39 @@ const ee = F(Y), te = G(
|
|
|
85
86
|
]
|
|
86
87
|
}
|
|
87
88
|
),
|
|
88
|
-
/* @__PURE__ */ r(
|
|
89
|
+
H ? /* @__PURE__ */ r(H, { href: g, "aria-label": p, "data-testid": "header-logo", className: `${t}-header__logo`, children: M }) : /* @__PURE__ */ r("a", { href: g, "aria-label": p, "data-testid": "header-logo", className: `${t}-header__logo`, children: M }),
|
|
89
90
|
T
|
|
90
91
|
] }),
|
|
91
|
-
/* @__PURE__ */ r("div", { className: c(`${
|
|
92
|
-
|
|
92
|
+
/* @__PURE__ */ r("div", { className: c(`${t}-header__nav`, { [`${t}-header__nav--closed`]: !m }), children: /* @__PURE__ */ l(
|
|
93
|
+
re.Provider,
|
|
93
94
|
{
|
|
94
95
|
value: {
|
|
95
|
-
activeSubmenuId:
|
|
96
|
-
setActiveSubmenuId:
|
|
96
|
+
activeSubmenuId: D,
|
|
97
|
+
setActiveSubmenuId: F,
|
|
97
98
|
isMenuOpen: m,
|
|
98
|
-
isSearchExpanded:
|
|
99
|
-
setIsSearchExpanded:
|
|
100
|
-
closeMenu:
|
|
99
|
+
isSearchExpanded: $,
|
|
100
|
+
setIsSearchExpanded: V,
|
|
101
|
+
closeMenu: q
|
|
101
102
|
},
|
|
102
103
|
children: [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
(e) =>
|
|
104
|
+
n.Children.map(
|
|
105
|
+
A,
|
|
106
|
+
(e) => n.isValidElement(e) ? n.cloneElement(e, {
|
|
106
107
|
children: [
|
|
107
|
-
...
|
|
108
|
-
|
|
108
|
+
...n.Children.toArray(e.props.children),
|
|
109
|
+
E
|
|
109
110
|
]
|
|
110
111
|
}) : e
|
|
111
112
|
),
|
|
112
|
-
|
|
113
|
+
B
|
|
113
114
|
]
|
|
114
115
|
}
|
|
115
116
|
) }),
|
|
116
117
|
/* @__PURE__ */ r(
|
|
117
118
|
"div",
|
|
118
119
|
{
|
|
119
|
-
className: c(`${
|
|
120
|
-
[`${
|
|
120
|
+
className: c(`${t}-header__overlay`, {
|
|
121
|
+
[`${t}-header__overlay--active`]: $
|
|
121
122
|
})
|
|
122
123
|
}
|
|
123
124
|
)
|
|
@@ -126,8 +127,8 @@ const ee = F(Y), te = G(
|
|
|
126
127
|
);
|
|
127
128
|
}
|
|
128
129
|
);
|
|
129
|
-
|
|
130
|
+
ae.displayName = "Header";
|
|
130
131
|
export {
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
re as HeaderContext,
|
|
133
|
+
ae as default
|
|
133
134
|
};
|
|
@@ -279,6 +279,7 @@ declare const meta: {
|
|
|
279
279
|
toggleOpenText?: string | undefined;
|
|
280
280
|
logo?: (React.ReactElement<React.Component> | string) | undefined;
|
|
281
281
|
logoHref?: string | undefined;
|
|
282
|
+
logoLinkComponent?: React.ComponentType<React.ComponentPropsWithoutRef<"a">> | undefined;
|
|
282
283
|
logoText?: string | undefined;
|
|
283
284
|
bannerRef?: React.MutableRefObject<HTMLDivElement | null> | undefined;
|
|
284
285
|
skipToContentId?: (string | null) | undefined;
|
|
@@ -306,6 +307,7 @@ declare const meta: {
|
|
|
306
307
|
};
|
|
307
308
|
};
|
|
308
309
|
export default meta;
|
|
310
|
+
export declare const WithCustomLinkElement: () => import("react/jsx-runtime").JSX.Element;
|
|
309
311
|
export declare const Playground: ({ authState, ...props }: HeaderProps & {
|
|
310
312
|
authState?: AuthState;
|
|
311
313
|
}) => import("react/jsx-runtime").JSX.Element;
|