@pixelated-tech/components 3.11.8 → 3.12.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/components/admin/site-health/site-health-accessibility.js +6 -0
- package/dist/components/admin/site-health/site-health-axe-core.js +6 -0
- package/dist/components/admin/site-health/site-health-cloudwatch.js +10 -0
- package/dist/components/admin/site-health/site-health-dependency-vulnerabilities.js +6 -0
- package/dist/components/admin/site-health/site-health-github.js +10 -0
- package/dist/components/admin/site-health/site-health-google-analytics.js +10 -0
- package/dist/components/admin/site-health/site-health-google-search-console.js +10 -0
- package/dist/components/admin/site-health/site-health-mock-context.js +8 -0
- package/dist/components/admin/site-health/site-health-on-site-seo.js +6 -0
- package/dist/components/admin/site-health/site-health-overview.js +6 -0
- package/dist/components/admin/site-health/site-health-performance.js +6 -0
- package/dist/components/admin/site-health/site-health-security.js +6 -0
- package/dist/components/admin/site-health/site-health-seo.js +6 -0
- package/dist/components/admin/site-health/site-health-template.js +28 -0
- package/dist/components/admin/site-health/site-health-uptime.js +6 -0
- package/dist/components/config/config.server.js +8 -0
- package/dist/components/general/404.js +6 -0
- package/dist/components/general/accordion.js +11 -0
- package/dist/components/general/buzzwordbingo.js +18 -0
- package/dist/components/general/callout.js +65 -2
- package/dist/components/general/carousel.drag.js +12 -0
- package/dist/components/general/carousel.js +50 -0
- package/dist/components/general/faq-accordion.js +15 -0
- package/dist/components/general/global-error.js +12 -0
- package/dist/components/general/hero.js +13 -0
- package/dist/components/general/loading.js +10 -1
- package/dist/components/general/markdown.js +6 -0
- package/dist/components/general/menu-accordion.js +30 -1
- package/dist/components/general/menu-expando.js +24 -1
- package/dist/components/general/menu-simple.js +21 -0
- package/dist/components/general/metadata.components.js +10 -0
- package/dist/components/general/microinteractions.js +22 -0
- package/dist/components/general/modal.js +12 -0
- package/dist/components/general/nerdjoke.js +11 -1
- package/dist/components/general/proxy-handler.js +7 -7
- package/dist/components/general/recipe.js +46 -1
- package/dist/components/general/resume.js +82 -0
- package/dist/components/general/schema-blogposting.js +6 -0
- package/dist/components/general/schema-localbusiness.js +36 -0
- package/dist/components/general/schema-recipe.js +20 -0
- package/dist/components/general/semantic.js +178 -0
- package/dist/components/general/sidepanel.js +26 -0
- package/dist/components/general/sitemap.js +50 -0
- package/dist/components/general/skeleton-loading.css +5 -5
- package/dist/components/general/skeleton-loading.js +11 -2
- package/dist/components/general/skeleton.js +15 -0
- package/dist/components/general/smartimage.js +48 -2
- package/dist/components/general/splitscroll.js +21 -10
- package/dist/components/general/styleguide.js +6 -0
- package/dist/components/general/tab.js +12 -0
- package/dist/components/general/table.js +12 -0
- package/dist/components/general/tiles.js +32 -1
- package/dist/components/general/timeline.js +22 -0
- package/dist/components/integrations/calendly.js +10 -0
- package/dist/components/integrations/cloudinary.js +16 -0
- package/dist/components/integrations/contentful.delivery.js +84 -0
- package/dist/components/integrations/contentful.items.components.js +46 -0
- package/dist/components/integrations/flickr.js +34 -0
- package/dist/components/integrations/google.reviews.components.js +14 -0
- package/dist/components/integrations/googleanalytics.js +14 -0
- package/dist/components/integrations/googlemap.js +20 -0
- package/dist/components/integrations/googlesearch.js +6 -0
- package/dist/components/integrations/gravatar.components.js +59 -0
- package/dist/components/integrations/hubspot.components.js +30 -0
- package/dist/components/integrations/instagram.components.js +18 -0
- package/dist/components/integrations/lipsum.js +45 -0
- package/dist/components/integrations/loremipsum.js +13 -1
- package/dist/components/integrations/socialcard.js +20 -1
- package/dist/components/integrations/wordpress.components.js +40 -0
- package/dist/components/integrations/wordpress.functions.js +24 -0
- package/dist/components/integrations/yelp.js +8 -0
- package/dist/components/shoppingcart/ebay.components.js +70 -0
- package/dist/components/shoppingcart/ebay.functions.js +52 -0
- package/dist/components/shoppingcart/shoppingcart.components.js +89 -0
- package/dist/components/sitebuilder/config/CompoundFontSelector.js +32 -0
- package/dist/components/sitebuilder/config/ConfigBuilder.js +8 -0
- package/dist/components/sitebuilder/config/FontSelector.js +40 -0
- package/dist/components/sitebuilder/form/formbuilder.js +10 -1
- package/dist/components/sitebuilder/form/formcomponents.js +325 -6
- package/dist/components/sitebuilder/form/formengine.js +35 -1
- package/dist/components/sitebuilder/form/formextractor.js +33 -1
- package/dist/components/sitebuilder/form/formutils.js +0 -4
- package/dist/components/sitebuilder/form/formvalidator.js +6 -0
- package/dist/components/sitebuilder/page/components/ComponentPropertiesForm.js +8 -0
- package/dist/components/sitebuilder/page/components/ComponentSelector.js +10 -0
- package/dist/components/sitebuilder/page/components/ComponentTree.js +20 -0
- package/dist/components/sitebuilder/page/components/PageBuilderUI.js +6 -0
- package/dist/components/sitebuilder/page/components/PageEngine.js +20 -0
- package/dist/components/sitebuilder/page/components/SaveLoadSection.js +10 -0
- package/dist/config/pixelated.config.json.enc +1 -1
- package/dist/index.js +1 -0
- package/dist/index.server.js +1 -0
- package/dist/scripts/pixelated-eslint-plugin.js +56 -0
- package/dist/scripts/release.sh +12 -21
- package/dist/types/components/admin/site-health/site-health-accessibility.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-accessibility.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-axe-core.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-axe-core.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-cloudwatch.d.ts +3 -0
- package/dist/types/components/admin/site-health/site-health-cloudwatch.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-dependency-vulnerabilities.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-dependency-vulnerabilities.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-github.d.ts +3 -0
- package/dist/types/components/admin/site-health/site-health-github.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-google-analytics.d.ts +3 -0
- package/dist/types/components/admin/site-health/site-health-google-analytics.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-google-search-console.d.ts +3 -0
- package/dist/types/components/admin/site-health/site-health-google-search-console.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-mock-context.d.ts +8 -0
- package/dist/types/components/admin/site-health/site-health-mock-context.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-on-site-seo.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-on-site-seo.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-overview.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-overview.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-performance.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-performance.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-security.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-security.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-seo.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-seo.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-template.d.ts +12 -0
- package/dist/types/components/admin/site-health/site-health-template.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-uptime.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-uptime.d.ts.map +1 -1
- package/dist/types/components/config/config.server.d.ts +2 -0
- package/dist/types/components/config/config.server.d.ts.map +1 -1
- package/dist/types/components/general/404.d.ts +1 -0
- package/dist/types/components/general/404.d.ts.map +1 -1
- package/dist/types/components/general/accordion.d.ts +2 -0
- package/dist/types/components/general/accordion.d.ts.map +1 -1
- package/dist/types/components/general/buzzwordbingo.d.ts +3 -0
- package/dist/types/components/general/buzzwordbingo.d.ts.map +1 -1
- package/dist/types/components/general/callout.d.ts +24 -0
- package/dist/types/components/general/callout.d.ts.map +1 -1
- package/dist/types/components/general/carousel.d.ts +13 -0
- package/dist/types/components/general/carousel.d.ts.map +1 -1
- package/dist/types/components/general/carousel.drag.d.ts +4 -0
- package/dist/types/components/general/carousel.drag.d.ts.map +1 -1
- package/dist/types/components/general/faq-accordion.d.ts +5 -0
- package/dist/types/components/general/faq-accordion.d.ts.map +1 -1
- package/dist/types/components/general/global-error.d.ts +4 -0
- package/dist/types/components/general/global-error.d.ts.map +1 -1
- package/dist/types/components/general/hero.d.ts +4 -0
- package/dist/types/components/general/hero.d.ts.map +1 -1
- package/dist/types/components/general/loading.d.ts +1 -0
- package/dist/types/components/general/loading.d.ts.map +1 -1
- package/dist/types/components/general/markdown.d.ts +1 -0
- package/dist/types/components/general/markdown.d.ts.map +1 -1
- package/dist/types/components/general/menu-accordion.d.ts +7 -0
- package/dist/types/components/general/menu-accordion.d.ts.map +1 -1
- package/dist/types/components/general/menu-expando.d.ts +6 -0
- package/dist/types/components/general/menu-expando.d.ts.map +1 -1
- package/dist/types/components/general/menu-simple.d.ts +6 -0
- package/dist/types/components/general/menu-simple.d.ts.map +1 -1
- package/dist/types/components/general/metadata.components.d.ts +3 -0
- package/dist/types/components/general/metadata.components.d.ts.map +1 -1
- package/dist/types/components/general/microinteractions.d.ts +9 -0
- package/dist/types/components/general/microinteractions.d.ts.map +1 -1
- package/dist/types/components/general/modal.d.ts +4 -0
- package/dist/types/components/general/modal.d.ts.map +1 -1
- package/dist/types/components/general/nerdjoke.d.ts +2 -0
- package/dist/types/components/general/nerdjoke.d.ts.map +1 -1
- package/dist/types/components/general/proxy-handler.d.ts +7 -7
- package/dist/types/components/general/proxy-handler.d.ts.map +1 -1
- package/dist/types/components/general/recipe.d.ts +13 -0
- package/dist/types/components/general/recipe.d.ts.map +1 -1
- package/dist/types/components/general/resume.d.ts +21 -0
- package/dist/types/components/general/resume.d.ts.map +1 -1
- package/dist/types/components/general/schema-blogposting.d.ts +1 -0
- package/dist/types/components/general/schema-blogposting.d.ts.map +1 -1
- package/dist/types/components/general/schema-localbusiness.d.ts +16 -0
- package/dist/types/components/general/schema-localbusiness.d.ts.map +1 -1
- package/dist/types/components/general/schema-recipe.d.ts +1 -0
- package/dist/types/components/general/schema-recipe.d.ts.map +1 -1
- package/dist/types/components/general/semantic.d.ts +67 -0
- package/dist/types/components/general/semantic.d.ts.map +1 -1
- package/dist/types/components/general/sidepanel.d.ts +11 -0
- package/dist/types/components/general/sidepanel.d.ts.map +1 -1
- package/dist/types/components/general/sitemap.d.ts +19 -0
- package/dist/types/components/general/sitemap.d.ts.map +1 -1
- package/dist/types/components/general/skeleton-loading.d.ts +3 -6
- package/dist/types/components/general/skeleton-loading.d.ts.map +1 -1
- package/dist/types/components/general/skeleton.d.ts +5 -0
- package/dist/types/components/general/skeleton.d.ts.map +1 -1
- package/dist/types/components/general/smartimage.d.ts +22 -0
- package/dist/types/components/general/smartimage.d.ts.map +1 -1
- package/dist/types/components/general/splitscroll.d.ts +18 -40
- package/dist/types/components/general/splitscroll.d.ts.map +1 -1
- package/dist/types/components/general/styleguide.d.ts +1 -0
- package/dist/types/components/general/styleguide.d.ts.map +1 -1
- package/dist/types/components/general/tab.d.ts +4 -0
- package/dist/types/components/general/tab.d.ts.map +1 -1
- package/dist/types/components/general/table.d.ts +4 -0
- package/dist/types/components/general/table.d.ts.map +1 -1
- package/dist/types/components/general/tiles.d.ts +12 -1
- package/dist/types/components/general/tiles.d.ts.map +1 -1
- package/dist/types/components/general/timeline.d.ts +5 -0
- package/dist/types/components/general/timeline.d.ts.map +1 -1
- package/dist/types/components/integrations/calendly.d.ts +3 -0
- package/dist/types/components/integrations/calendly.d.ts.map +1 -1
- package/dist/types/components/integrations/cloudinary.d.ts +4 -0
- package/dist/types/components/integrations/cloudinary.d.ts.map +1 -1
- package/dist/types/components/integrations/contentful.delivery.d.ts +22 -0
- package/dist/types/components/integrations/contentful.delivery.d.ts.map +1 -1
- package/dist/types/components/integrations/contentful.items.components.d.ts +10 -0
- package/dist/types/components/integrations/contentful.items.components.d.ts.map +1 -1
- package/dist/types/components/integrations/flickr.d.ts +11 -0
- package/dist/types/components/integrations/flickr.d.ts.map +1 -1
- package/dist/types/components/integrations/google.reviews.components.d.ts +5 -0
- package/dist/types/components/integrations/google.reviews.components.d.ts.map +1 -1
- package/dist/types/components/integrations/googleanalytics.d.ts +3 -0
- package/dist/types/components/integrations/googleanalytics.d.ts.map +1 -1
- package/dist/types/components/integrations/googlemap.d.ts +8 -0
- package/dist/types/components/integrations/googlemap.d.ts.map +1 -1
- package/dist/types/components/integrations/googlesearch.d.ts +1 -0
- package/dist/types/components/integrations/googlesearch.d.ts.map +1 -1
- package/dist/types/components/integrations/gravatar.components.d.ts +35 -0
- package/dist/types/components/integrations/gravatar.components.d.ts.map +1 -1
- package/dist/types/components/integrations/hubspot.components.d.ts +9 -0
- package/dist/types/components/integrations/hubspot.components.d.ts.map +1 -1
- package/dist/types/components/integrations/instagram.components.d.ts +7 -0
- package/dist/types/components/integrations/instagram.components.d.ts.map +1 -1
- package/dist/types/components/integrations/lipsum.d.ts +14 -0
- package/dist/types/components/integrations/lipsum.d.ts.map +1 -0
- package/dist/types/components/integrations/loremipsum.d.ts +4 -0
- package/dist/types/components/integrations/loremipsum.d.ts.map +1 -1
- package/dist/types/components/integrations/socialcard.d.ts +4 -0
- package/dist/types/components/integrations/socialcard.d.ts.map +1 -1
- package/dist/types/components/integrations/wordpress.components.d.ts +14 -0
- package/dist/types/components/integrations/wordpress.components.d.ts.map +1 -1
- package/dist/types/components/integrations/wordpress.functions.d.ts +6 -0
- package/dist/types/components/integrations/wordpress.functions.d.ts.map +1 -1
- package/dist/types/components/integrations/yelp.d.ts +2 -0
- package/dist/types/components/integrations/yelp.d.ts.map +1 -1
- package/dist/types/components/shoppingcart/ebay.components.d.ts +15 -0
- package/dist/types/components/shoppingcart/ebay.components.d.ts.map +1 -1
- package/dist/types/components/shoppingcart/ebay.functions.d.ts +12 -0
- package/dist/types/components/shoppingcart/ebay.functions.d.ts.map +1 -1
- package/dist/types/components/shoppingcart/shoppingcart.components.d.ts +30 -0
- package/dist/types/components/shoppingcart/shoppingcart.components.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/config/CompoundFontSelector.d.ts +12 -0
- package/dist/types/components/sitebuilder/config/CompoundFontSelector.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/config/ConfigBuilder.d.ts +2 -0
- package/dist/types/components/sitebuilder/config/ConfigBuilder.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/config/FontSelector.d.ts +16 -0
- package/dist/types/components/sitebuilder/config/FontSelector.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formbuilder.d.ts +5 -1
- package/dist/types/components/sitebuilder/form/formbuilder.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formcomponents.d.ts +129 -0
- package/dist/types/components/sitebuilder/form/formcomponents.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formengine.d.ts +5 -0
- package/dist/types/components/sitebuilder/form/formengine.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formextractor.d.ts +6 -0
- package/dist/types/components/sitebuilder/form/formextractor.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formutils.d.ts +0 -2
- package/dist/types/components/sitebuilder/form/formutils.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formvalidator.d.ts +1 -0
- package/dist/types/components/sitebuilder/form/formvalidator.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/ComponentPropertiesForm.d.ts +2 -0
- package/dist/types/components/sitebuilder/page/components/ComponentPropertiesForm.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/ComponentSelector.d.ts +3 -0
- package/dist/types/components/sitebuilder/page/components/ComponentSelector.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/ComponentTree.d.ts +8 -0
- package/dist/types/components/sitebuilder/page/components/ComponentTree.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/PageBuilderUI.d.ts +1 -0
- package/dist/types/components/sitebuilder/page/components/PageBuilderUI.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/PageEngine.d.ts +8 -0
- package/dist/types/components/sitebuilder/page/components/PageEngine.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/SaveLoadSection.d.ts +3 -0
- package/dist/types/components/sitebuilder/page/components/SaveLoadSection.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.server.d.ts +1 -0
- package/dist/types/scripts/pixelated-eslint-plugin.d.ts +18 -0
- package/dist/types/stories/general/skeleton-loading.stories.d.ts +1 -1
- package/dist/types/stories/general/skeleton-loading.stories.d.ts.map +1 -1
- package/dist/types/stories/integrations/lipsum.stories.d.ts +38 -0
- package/dist/types/stories/integrations/lipsum.stories.d.ts.map +1 -0
- package/dist/types/stories/shoppingcart/shoppingcart.stories.d.ts +3 -1
- package/dist/types/stories/shoppingcart/shoppingcart.stories.d.ts.map +1 -1
- package/dist/types/tests/args.test.d.ts +2 -0
- package/dist/types/tests/args.test.d.ts.map +1 -0
- package/dist/types/tests/lipsum.test.d.ts +2 -0
- package/dist/types/tests/lipsum.test.d.ts.map +1 -0
- package/dist/types/tests/storybook-docgen.test.d.ts +2 -0
- package/dist/types/tests/storybook-docgen.test.d.ts.map +1 -0
- package/package.json +12 -9
|
@@ -3,10 +3,22 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import './global-error.css';
|
|
6
|
+
/**
|
|
7
|
+
* GlobalErrorUI — displays a global error state with message, retry action and optional maintainer contact link.
|
|
8
|
+
*
|
|
9
|
+
* @param {any} [props.error] - Error object; may include message and stack for diagnostics.
|
|
10
|
+
* @param {function} [props.reset] - Optional retry/reset callback to attempt the failed action again.
|
|
11
|
+
* @param {object} [props.siteInfo] - Site-level information (used to render contact email/link when available).
|
|
12
|
+
* @param {string} [props.className] - Additional CSS class(es) to apply to the root element.
|
|
13
|
+
*/
|
|
6
14
|
GlobalErrorUI.propTypes = {
|
|
15
|
+
/** Error object; message and stack will be shown when details are expanded. */
|
|
7
16
|
error: PropTypes.any,
|
|
17
|
+
/** Optional retry/reset function called when the user clicks 'Try again'. */
|
|
8
18
|
reset: PropTypes.func,
|
|
19
|
+
/** Optional site information (used to build a contact mailto link when an email is available). */
|
|
9
20
|
siteInfo: PropTypes.object,
|
|
21
|
+
/** Additional class names to apply to the component root. */
|
|
10
22
|
className: PropTypes.string,
|
|
11
23
|
};
|
|
12
24
|
export function GlobalErrorUI({ error = null, reset, siteInfo, className = '' }) {
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import "./hero.css";
|
|
4
|
+
/**
|
|
5
|
+
* Hero — Full-width hero section rendered using a background image.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} [props.img] - Background image URL (required).
|
|
8
|
+
* @param {string} [props.imgAlt] - Alternative text for the background image (optional).
|
|
9
|
+
* @param {oneOf} [props.variant] - Layout variant: 'static' (background image only) or 'anchored' (anchored content).
|
|
10
|
+
* @param {oneOfType} [props.height] - Height for the hero (e.g., '60vh' or a numeric pixel value).
|
|
11
|
+
* @param {node} [props.children] - Optional content rendered inside the hero container.
|
|
12
|
+
*/
|
|
4
13
|
Hero.propTypes = {
|
|
14
|
+
/** Background image URL (required) */
|
|
5
15
|
img: PropTypes.string.isRequired,
|
|
6
16
|
// imgAlt: PropTypes.string.isRequired,
|
|
17
|
+
/** Layout variant: 'static' or 'anchored' */
|
|
7
18
|
variant: PropTypes.oneOf(['static', 'anchored']),
|
|
19
|
+
/** Height for hero section (string like '60vh' or number) */
|
|
8
20
|
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
21
|
+
/** Child nodes to render over the background */
|
|
9
22
|
children: PropTypes.node,
|
|
10
23
|
};
|
|
11
24
|
export function Hero({ img, /* imgAlt, */ variant = 'static', height = '60vh', children }) {
|
|
@@ -7,11 +7,20 @@ https://signalvnoise.com/posts/2577-loading-spinner-animation-using-css-and-webk
|
|
|
7
7
|
https://www.andreaverlicchi.eu/blog/css-3-only-spinning-loading-animation/
|
|
8
8
|
*/
|
|
9
9
|
/* ========== MARKDOWN ========== */
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Loading — provides a spinner/loading indicator used across the UI.
|
|
12
|
+
*
|
|
13
|
+
* This component renders a CSS spinner; use `ToggleLoading` to control visibility programmatically.
|
|
14
|
+
*/
|
|
15
|
+
/** Loading.propTypes — No props (component renders a CSS spinner).
|
|
16
|
+
* @param {any} [props] - No props are accepted by Loading.
|
|
17
|
+
*/
|
|
18
|
+
Loading.propTypes = { /** no props */};
|
|
11
19
|
export function Loading(props) {
|
|
12
20
|
return (_jsx(_Fragment, { children: _jsx("div", { id: "loadingSpinner", className: "loading", children: _jsxs("div", { className: "spinner", children: [_jsx("div", { className: "bar1" }), _jsx("div", { className: "bar2" }), _jsx("div", { className: "bar3" }), _jsx("div", { className: "bar4" }), _jsx("div", { className: "bar5" }), _jsx("div", { className: "bar6" }), _jsx("div", { className: "bar7" }), _jsx("div", { className: "bar8" }), _jsx("div", { className: "bar9" }), _jsx("div", { className: "bar10" }), _jsx("div", { className: "bar11" }), _jsx("div", { className: "bar12" })] }) }) }));
|
|
13
21
|
}
|
|
14
22
|
ToggleLoading.propTypes = {
|
|
23
|
+
/** When true shows the global loading spinner; false hides it; omitted toggles the current state. */
|
|
15
24
|
show: PropTypes.bool,
|
|
16
25
|
};
|
|
17
26
|
export function ToggleLoading(props) {
|
|
@@ -5,7 +5,13 @@ import { SmartImage } from "./smartimage";
|
|
|
5
5
|
import { usePixelatedConfig } from "../config/config.client";
|
|
6
6
|
import "./markdown.css";
|
|
7
7
|
/* ========== MARKDOWN ========== */
|
|
8
|
+
/**
|
|
9
|
+
* Markdown — Renders a simplified markdown string into HTML (supports headings, lists, links, images, inline code).
|
|
10
|
+
*
|
|
11
|
+
* @param {string} [props.markdowndata] - Markdown input string to be parsed and rendered as HTML.
|
|
12
|
+
*/
|
|
8
13
|
Markdown.propTypes = {
|
|
14
|
+
/** Markdown input (string) to render */
|
|
9
15
|
markdowndata: PropTypes.string.isRequired,
|
|
10
16
|
};
|
|
11
17
|
export function Markdown(props) {
|
|
@@ -36,8 +36,16 @@ function generateMenuItems({ menuData, state = "hide" }) {
|
|
|
36
36
|
}
|
|
37
37
|
return myItems;
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* MenuAccordion — Accordion-style navigational menu that supports nested menu groups and individual items.
|
|
41
|
+
*
|
|
42
|
+
* @param {arrayOf} [props.menuItems] - Array (or object) of menu items; items should include { name, path?, target?, hidden?, routes? }.
|
|
43
|
+
* @param {boolean} [props.showHidden] - When true, items marked as `hidden` will be shown.
|
|
44
|
+
*/
|
|
39
45
|
MenuAccordion.propTypes = {
|
|
46
|
+
/** Array of menu items (can contain nested `routes`) */
|
|
40
47
|
menuItems: PropTypes.arrayOf(menuItemShape).isRequired,
|
|
48
|
+
/** Show items marked `hidden` */
|
|
41
49
|
showHidden: PropTypes.bool,
|
|
42
50
|
};
|
|
43
51
|
export function MenuAccordion(props) {
|
|
@@ -152,11 +160,19 @@ export function MenuAccordion(props) {
|
|
|
152
160
|
return (_jsx("div", { className: "accordionMenuWrapper accordionUp", suppressHydrationWarning: true, children: _jsx("div", { className: "accordionMenu", id: "accordionMenu", children: _jsx(MenuAccordionGroup, { menuItems: menuItems, state: undefined }, "accordionRoot") }) }));
|
|
153
161
|
}
|
|
154
162
|
/* ========== MENU GROUP ========== */
|
|
163
|
+
/**
|
|
164
|
+
* MenuAccordionGroup — Renders a group of menu items (may be a single item with `routes` or an array of items).
|
|
165
|
+
*
|
|
166
|
+
* @param {oneOfType} [props.menuItems] - A menu item object or an array of menu items (used for nested groups).
|
|
167
|
+
* @param {string} [props.state] - Optional visibility state ('hide' or 'show').
|
|
168
|
+
*/
|
|
155
169
|
MenuAccordionGroup.propTypes = {
|
|
170
|
+
/** Menu item or array of menu items (routes) */
|
|
156
171
|
menuItems: PropTypes.oneOfType([
|
|
157
172
|
menuItemShape,
|
|
158
173
|
PropTypes.arrayOf(menuItemShape)
|
|
159
174
|
]).isRequired,
|
|
175
|
+
/** Visibility state 'hide' | 'show' */
|
|
160
176
|
state: PropTypes.string,
|
|
161
177
|
};
|
|
162
178
|
export function MenuAccordionGroup(props) {
|
|
@@ -164,9 +180,19 @@ export function MenuAccordionGroup(props) {
|
|
|
164
180
|
return (_jsx("ul", { className: (props.state === "hide" ? "menuHide" : "menuShow"), children: generateMenuItems({ menuData: myMenuItems, state: props.state ?? "hide" }) }, "menu-group-" + props.menuItems.name));
|
|
165
181
|
}
|
|
166
182
|
/* ========== MENU ITEM ========== */
|
|
183
|
+
/**
|
|
184
|
+
* MenuAccordionItem — Single menu entry used by the accordion.
|
|
185
|
+
*
|
|
186
|
+
* @param {string} [props.name] - Display text for the menu item.
|
|
187
|
+
* @param {string} [props.href] - Destination href (empty string for expand/collapse toggles).
|
|
188
|
+
* @param {string} [props.target] - Optional link target (e.g., '_self' or '_blank').
|
|
189
|
+
*/
|
|
167
190
|
MenuAccordionItem.propTypes = {
|
|
191
|
+
/** Display text for the menu item */
|
|
168
192
|
name: PropTypes.string.isRequired,
|
|
193
|
+
/** Link href (or empty string for toggle items) */
|
|
169
194
|
href: PropTypes.string.isRequired,
|
|
195
|
+
/** Optional link target attribute */
|
|
170
196
|
target: PropTypes.string,
|
|
171
197
|
};
|
|
172
198
|
export function MenuAccordionItem(props) {
|
|
@@ -178,7 +204,10 @@ export function MenuAccordionItem(props) {
|
|
|
178
204
|
/*
|
|
179
205
|
https://www.unclebigbay.com/blog/building-the-world-simplest-hamburger-with-html-and-css
|
|
180
206
|
*/
|
|
181
|
-
MenuAccordionButton
|
|
207
|
+
/** MenuAccordionButton — Mobile menu toggle button.
|
|
208
|
+
* @param {any} [props] - No props are accepted by MenuAccordionButton.
|
|
209
|
+
*/
|
|
210
|
+
MenuAccordionButton.propTypes = { /** no props */};
|
|
182
211
|
export function MenuAccordionButton(props) {
|
|
183
212
|
function slideMobilePanel() {
|
|
184
213
|
if (typeof window !== 'undefined' && window.moveMenu) {
|
|
@@ -4,12 +4,24 @@ import { useEffect, useRef } from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { SmartImage } from './smartimage';
|
|
6
6
|
import './menu-expando.css';
|
|
7
|
+
/**
|
|
8
|
+
* MenuExpando — collapsible navigation menu with optional nested sections for mobile and compact navigation.
|
|
9
|
+
*
|
|
10
|
+
* @param {oneOfType} [props.menuItems] - Either an object map of name->href or an array of items that may include nested `routes`.
|
|
11
|
+
* @param {string} [props.name] - Name of a menu item when using the array format.
|
|
12
|
+
* @param {string} [props.path] - Href/path for a menu item when using the array format.
|
|
13
|
+
* @param {array} [props.routes] - Optional nested route array to create expandable submenus.
|
|
14
|
+
*/
|
|
7
15
|
MenuExpando.propTypes = {
|
|
16
|
+
/** Menu items can be provided as { name: href } or as an array of items with optional nested routes. */
|
|
8
17
|
menuItems: PropTypes.oneOfType([
|
|
9
18
|
PropTypes.objectOf(PropTypes.string),
|
|
10
19
|
PropTypes.arrayOf(PropTypes.shape({
|
|
20
|
+
/** Menu item display name */
|
|
11
21
|
name: PropTypes.string.isRequired,
|
|
22
|
+
/** Href/path for the menu item */
|
|
12
23
|
path: PropTypes.string.isRequired,
|
|
24
|
+
/** Optional nested routes (array of route objects) */
|
|
13
25
|
routes: PropTypes.array,
|
|
14
26
|
}))
|
|
15
27
|
]).isRequired
|
|
@@ -124,14 +136,25 @@ export function MenuExpando(props) {
|
|
|
124
136
|
}
|
|
125
137
|
return (_jsx("div", { className: "menuExpando", id: "menuExpando", children: _jsxs("details", { className: "menu-expando-wrapper", id: "menu-expando-wrapper", ref: detailsRef, children: [_jsx("summary", {}), _jsx("ul", { ref: ulRef, children: generateMenuItems() })] }) }));
|
|
126
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* MenuExpandoItem — simple menu item renderer for `MenuExpando`.
|
|
141
|
+
*
|
|
142
|
+
* @param {string} [props.name] - Display name for the menu entry.
|
|
143
|
+
* @param {string} [props.href] - Destination href for the menu entry.
|
|
144
|
+
*/
|
|
127
145
|
MenuExpandoItem.propTypes = {
|
|
146
|
+
/** Display text for the menu item. */
|
|
128
147
|
name: PropTypes.string.isRequired,
|
|
148
|
+
/** Href or path for the menu item. */
|
|
129
149
|
href: PropTypes.string.isRequired
|
|
130
150
|
};
|
|
131
151
|
export function MenuExpandoItem(props) {
|
|
132
152
|
return (_jsx("li", { children: _jsx("a", { href: props.href, children: props.name }) }));
|
|
133
153
|
}
|
|
134
|
-
MenuExpandoButton.propTypes
|
|
154
|
+
/** MenuExpandoButton.propTypes — No props (menu expando toggle).
|
|
155
|
+
* @param {any} [props] - No props are accepted by MenuExpandoButton.
|
|
156
|
+
*/
|
|
157
|
+
MenuExpandoButton.propTypes = { /** no props */};
|
|
135
158
|
export function MenuExpandoButton(props) {
|
|
136
159
|
function handleMenuExpandoButtonClick(event) {
|
|
137
160
|
event.preventDefault();
|
|
@@ -10,7 +10,13 @@ const menuItemShape = PropTypes.shape({
|
|
|
10
10
|
hidden: PropTypes.bool,
|
|
11
11
|
routes: PropTypes.array,
|
|
12
12
|
});
|
|
13
|
+
/**
|
|
14
|
+
* MenuSimple — renders a simple flat navigation menu from an array of items.
|
|
15
|
+
*
|
|
16
|
+
* @param {arrayOf} [props.menuItems] - Array of menu item objects ({ name, path, target, hidden, routes }).
|
|
17
|
+
*/
|
|
13
18
|
MenuSimple.propTypes = {
|
|
19
|
+
/** Array of menu items to render (flat list). */
|
|
14
20
|
menuItems: PropTypes.arrayOf(menuItemShape).isRequired,
|
|
15
21
|
};
|
|
16
22
|
export function MenuSimple(props) {
|
|
@@ -20,6 +26,7 @@ export function MenuSimple(props) {
|
|
|
20
26
|
const myItem = props.menuItems[itemKey];
|
|
21
27
|
if (!myItem)
|
|
22
28
|
continue; // Skip null/undefined items
|
|
29
|
+
// if (myItem.hidden) continue; // Skip nested routes
|
|
23
30
|
if (myItem.routes)
|
|
24
31
|
continue; // Skip nested routes
|
|
25
32
|
myItems.push(_jsx(MenuSimpleItem, { name: myItem.name, path: myItem.path || '', target: myItem.target || undefined, hidden: myItem.hidden || undefined }, itemKey));
|
|
@@ -43,11 +50,25 @@ export function MenuSimple(props) {
|
|
|
43
50
|
return (_jsx("div", { className: "menu-wrapper", children: _jsx("div", { className: "menu", id: "menu", children: _jsx("ul", { children: generateMenuItems() }) }) }));
|
|
44
51
|
}
|
|
45
52
|
/* ========== MENU ITEM ========== */
|
|
53
|
+
/**
|
|
54
|
+
* MenuSimpleItem — Single entry for the flat `MenuSimple` menu.
|
|
55
|
+
*
|
|
56
|
+
* @param {string} [props.name] - Display text for the item.
|
|
57
|
+
* @param {string} [props.path] - Destination href or path for the item.
|
|
58
|
+
* @param {string} [props.target] - Optional link target (e.g., '_self' or '_blank').
|
|
59
|
+
* @param {boolean} [props.hidden] - When true, the item is treated as hidden (applies CSS to hide it).
|
|
60
|
+
* @param {array} [props.routes] - Optional nested routes (not used by `MenuSimpleItem` but accepted for compatibility).
|
|
61
|
+
*/
|
|
46
62
|
MenuSimpleItem.propTypes = {
|
|
63
|
+
/** Display text for the item */
|
|
47
64
|
name: PropTypes.string.isRequired,
|
|
65
|
+
/** Destination href or path */
|
|
48
66
|
path: PropTypes.string.isRequired,
|
|
67
|
+
/** Optional link target */
|
|
49
68
|
target: PropTypes.string,
|
|
69
|
+
/** When true, the item is hidden */
|
|
50
70
|
hidden: PropTypes.bool,
|
|
71
|
+
/** Optional nested routes (ignored by this renderer) */
|
|
51
72
|
routes: PropTypes.array,
|
|
52
73
|
};
|
|
53
74
|
export function MenuSimpleItem(props) {
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import PropTypes from "prop-types";
|
|
2
|
+
/**
|
|
3
|
+
* setClientMetadata — updates document head metadata (title, description, keywords, og:title, og:description).
|
|
4
|
+
*
|
|
5
|
+
* @param {string} [props.title] - Document title to set.
|
|
6
|
+
* @param {string} [props.description] - Meta description content to set.
|
|
7
|
+
* @param {string} [props.keywords] - Comma-separated keywords string to set in the meta keywords tag.
|
|
8
|
+
*/
|
|
2
9
|
setClientMetadata.propTypes = {
|
|
10
|
+
/** Title to set as document.title and og:title. */
|
|
3
11
|
title: PropTypes.string.isRequired,
|
|
12
|
+
/** Meta description text applied to several description tags. */
|
|
4
13
|
description: PropTypes.string.isRequired,
|
|
14
|
+
/** Comma-separated keywords string applied to meta[name='keywords']. */
|
|
5
15
|
keywords: PropTypes.string.isRequired,
|
|
6
16
|
};
|
|
7
17
|
export function setClientMetadata(props) {
|
|
@@ -9,15 +9,37 @@ import './microinteractions.css';
|
|
|
9
9
|
* @param props - Configuration props for enabling/disabling interactions
|
|
10
10
|
* @returns A cleanup function if scrollfadeElements is used
|
|
11
11
|
*/
|
|
12
|
+
/**
|
|
13
|
+
* MicroInteractions — enables or disables lightweight UI micro-interactions by toggling body classes and initializing scroll-fade behavior.
|
|
14
|
+
*
|
|
15
|
+
* @param {boolean} [props.buttonring] - Enable pulsing ring animations on buttons.
|
|
16
|
+
* @param {boolean} [props.cartpulse] - Enable cart pulse animation for add-to-cart actions.
|
|
17
|
+
* @param {boolean} [props.formglow] - Enable focus-glow styles for form controls.
|
|
18
|
+
* @param {boolean} [props.grayscalehover] - Enable grayscale-to-color hover effects on images.
|
|
19
|
+
* @param {boolean} [props.imgscale] - Enable subtle image scaling on hover.
|
|
20
|
+
* @param {boolean} [props.imgtwist] - Enable small rotation animation on hover for images.
|
|
21
|
+
* @param {boolean} [props.imghue] - Enable hue-shift effects on hover for images.
|
|
22
|
+
* @param {boolean} [props.simplemenubutton] - Enable simplified menu button microinteractions.
|
|
23
|
+
* @param {string} [props.scrollfadeElements] - CSS selector for elements to apply scroll-fade animations to.
|
|
24
|
+
*/
|
|
12
25
|
MicroInteractions.propTypes = {
|
|
26
|
+
/** Enable ring animation on buttons. */
|
|
13
27
|
buttonring: PropTypes.bool,
|
|
28
|
+
/** Enable pulse animation on cart icon or similar. */
|
|
14
29
|
cartpulse: PropTypes.bool,
|
|
30
|
+
/** Enable glow effects on focused form elements. */
|
|
15
31
|
formglow: PropTypes.bool,
|
|
32
|
+
/** Enable grayscale hover-to-color transitions on elements. */
|
|
16
33
|
grayscalehover: PropTypes.bool,
|
|
34
|
+
/** Enable scale-up animation on image hover. */
|
|
17
35
|
imgscale: PropTypes.bool,
|
|
36
|
+
/** Enable slight twist/rotation on image hover. */
|
|
18
37
|
imgtwist: PropTypes.bool,
|
|
38
|
+
/** Enable hue-shift color changes on hover. */
|
|
19
39
|
imghue: PropTypes.bool,
|
|
40
|
+
/** Toggle simplified menu button interactions. */
|
|
20
41
|
simplemenubutton: PropTypes.bool,
|
|
42
|
+
/** Selector for elements that should receive the scroll-fade animation. */
|
|
21
43
|
scrollfadeElements: PropTypes.string,
|
|
22
44
|
};
|
|
23
45
|
export function MicroInteractions(props) {
|
|
@@ -6,10 +6,22 @@ import './modal.css';
|
|
|
6
6
|
/*
|
|
7
7
|
https://www.w3schools.com/howto/howto_css_modals.asp
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* Modal — accessible modal overlay component that can use either DOM events or a React close callback.
|
|
11
|
+
*
|
|
12
|
+
* @param {node} [props.modalContent] - Content to render inside the modal dialog (usually React nodes).
|
|
13
|
+
* @param {string} [props.modalID] - Optional suffix used to form DOM ids for compatibility with legacy event-based controls.
|
|
14
|
+
* @param {boolean} [props.isOpen] - Whether the modal is currently open and visible.
|
|
15
|
+
* @param {function} [props.handleCloseEvent] - Optional callback to close the modal (used by React-driven consumers).
|
|
16
|
+
*/
|
|
9
17
|
Modal.propTypes = {
|
|
18
|
+
/** Content rendered inside the modal dialog. */
|
|
10
19
|
modalContent: PropTypes.node.isRequired,
|
|
20
|
+
/** Optional id suffix for the modal; used for legacy DOM-style open/close helpers. */
|
|
11
21
|
modalID: PropTypes.string,
|
|
22
|
+
/** Flag indicating whether the modal is visible. */
|
|
12
23
|
isOpen: PropTypes.bool,
|
|
24
|
+
/** Optional close callback invoked by escape key, overlay click, or controls. */
|
|
13
25
|
handleCloseEvent: PropTypes.func,
|
|
14
26
|
};
|
|
15
27
|
export function Modal({ modalContent, modalID, isOpen = false, handleCloseEvent }) {
|
|
@@ -6,7 +6,15 @@ import "../../css/pixelated.grid.scss";
|
|
|
6
6
|
import "./nerdjoke.css";
|
|
7
7
|
const debug = false;
|
|
8
8
|
const TIME_LIMIT = 15;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* NerdJoke — fetches and displays short Q/A 'nerd' jokes on a timer with controls to pause/advance.
|
|
11
|
+
*
|
|
12
|
+
* Props are primarily internal to the fetching implementation; the component exposes control buttons to pause or fetch the next joke.
|
|
13
|
+
*/
|
|
14
|
+
/** NerdJoke.propTypes — No props (fetches/show jokes internally).
|
|
15
|
+
* @param {any} [props] - No props are accepted by NerdJoke.
|
|
16
|
+
*/
|
|
17
|
+
NerdJoke.propTypes = { /** no props */};
|
|
10
18
|
export function NerdJoke(props) {
|
|
11
19
|
const [joke, setJoke] = useState({ question: "", answer: "" });
|
|
12
20
|
const timerIntervalRef = useRef(null);
|
|
@@ -98,7 +106,9 @@ export function NerdJoke(props) {
|
|
|
98
106
|
return (_jsx("div", { className: "nerdJoke", children: _jsxs("div", { className: "row-12col", children: [_jsx("div", { className: "grid-s1-e5", children: _jsx("div", { className: "left", children: _jsx(JokeButton, { clickFunction: pauseTimer, buttonText: "Pause || / Play >" }) }) }), _jsx("div", { className: "grid-s9-e13", children: _jsx("div", { className: "right", children: _jsx(JokeButton, { clickFunction: loadJoke, buttonText: "Next Joke ->" }) }) }), _jsx("div", { className: "jokeTimer grid-s1-e13", children: _jsxs("div", { className: "row-12col", children: [_jsx("div", { className: "grid-s1-e11", children: _jsx("svg", { className: "jokeTimerSvg", xmlns: "http://www.w3.org/2000/svg", children: _jsx("rect", { id: "jokeTimerPathElapsed" }) }) }), _jsx("div", { className: "grid-s11-e13 center", id: "jokeTimerLabel", children: formatTimeLeft(timeLeftRef.current) })] }) }), _jsxs("div", { className: "jokeText grid-s1-e13", children: [_jsxs("div", { children: [_jsx("span", { className: "label", children: "Q: " }), _jsxs("span", { className: "question", children: [" ", joke.question, " "] })] }), _jsxs("div", { children: [_jsx("span", { className: "label", children: "A: " }), _jsxs("span", { className: "answer", children: [" ", joke.answer, " "] })] })] })] }) }));
|
|
99
107
|
}
|
|
100
108
|
JokeButton.propTypes = {
|
|
109
|
+
/** Click handler invoked when the button is pressed (e.g., pause or fetch next). */
|
|
101
110
|
clickFunction: PropTypes.func.isRequired,
|
|
111
|
+
/** Label text to render inside the button. */
|
|
102
112
|
buttonText: PropTypes.string.isRequired,
|
|
103
113
|
};
|
|
104
114
|
function JokeButton(props) {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { NextResponse } from "next/server";
|
|
2
|
+
/**
|
|
3
|
+
* STANDARD_PROXY_MATCHER
|
|
4
|
+
*
|
|
5
|
+
* A statically analyzable matcher array for Next.js middleware.
|
|
6
|
+
* Excludes static assets, images, API routes, and favicons from proxy processing.
|
|
7
|
+
*/
|
|
8
|
+
export const STANDARD_PROXY_MATCHER = ["/((?!_next/image|_next/static|api|favicon.ico).*)"];
|
|
2
9
|
/**
|
|
3
10
|
* handlePixelatedProxy
|
|
4
11
|
*
|
|
@@ -8,13 +15,6 @@ import { NextResponse } from "next/server";
|
|
|
8
15
|
* TODO: Future enhancement - Accept an options object to allow per-site CSP overrides,
|
|
9
16
|
* enabling/disabling specific permissions (e.g., camera access), or setting custom rate limits.
|
|
10
17
|
*/
|
|
11
|
-
/**
|
|
12
|
-
* STANDARD_PROXY_MATCHER
|
|
13
|
-
*
|
|
14
|
-
* A statically analyzable matcher array for Next.js middleware.
|
|
15
|
-
* Excludes static assets, images, API routes, and favicons from proxy processing.
|
|
16
|
-
*/
|
|
17
|
-
export const STANDARD_PROXY_MATCHER = ["/((?!_next/image|_next/static|api|favicon.ico).*)"];
|
|
18
18
|
export function handlePixelatedProxy(req) {
|
|
19
19
|
const path = req.nextUrl.pathname + (req.nextUrl.search || "");
|
|
20
20
|
const origin = req.nextUrl?.origin ?? new URL(req.url).origin;
|
|
@@ -55,10 +55,20 @@ export function mapSchemaRecipeToDisplay(schemaRecipe) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
/* ========== RECIPE BOOK ========== */
|
|
58
|
+
/**
|
|
59
|
+
* RecipeBook — renders a browsable collection of recipes grouped by category with deep-linking support.
|
|
60
|
+
*
|
|
61
|
+
* @param {shape} [props.recipeData] - Object containing recipe items in schema.org/Recipe format.
|
|
62
|
+
* @param {array} [props.items] - Array of recipe items (used internally by recipeData.items).
|
|
63
|
+
* @param {array} [props.recipeCategories] - Array of category names used to group and render recipes.
|
|
64
|
+
*/
|
|
58
65
|
RecipeBook.propTypes = {
|
|
66
|
+
/** Object containing recipe items (schema.org/Recipe objects). */
|
|
59
67
|
recipeData: PropTypes.shape({
|
|
68
|
+
/** Array of recipe items used to render the book. */
|
|
60
69
|
items: PropTypes.array.isRequired
|
|
61
70
|
}).isRequired,
|
|
71
|
+
/** Categories used to group recipes in the book (array of strings). */
|
|
62
72
|
recipeCategories: PropTypes.array.isRequired
|
|
63
73
|
};
|
|
64
74
|
export function RecipeBook(props) {
|
|
@@ -129,10 +139,22 @@ export function RecipeBook(props) {
|
|
|
129
139
|
return (_jsxs("div", { id: "recipes", children: [_jsx(BackToTop, {}), _jsx(RecipePickList, { recipeData: props.recipeData, recipeCategories: props.recipeCategories, handleRecipePickListChange: onRecipePickListChange }), outputElems] }));
|
|
130
140
|
}
|
|
131
141
|
/* ========== RECIPE CATEGORY ========== */
|
|
142
|
+
/**
|
|
143
|
+
* RecipeCategory — renders a category heading for a group of recipes.
|
|
144
|
+
*
|
|
145
|
+
* @param {string} [props.id] - DOM id for the category heading element.
|
|
146
|
+
* @param {string} [props.className] - CSS class names for the heading element.
|
|
147
|
+
* @param {string} [props.category] - Category name displayed to users.
|
|
148
|
+
* @param {string} [props.showOnly] - Optional filter key used to hide/show categories via deep link or selection.
|
|
149
|
+
*/
|
|
132
150
|
RecipeCategory.propTypes = {
|
|
151
|
+
/** DOM id for the category heading. */
|
|
133
152
|
id: PropTypes.string.isRequired,
|
|
153
|
+
/** CSS class names to apply to the heading. */
|
|
134
154
|
className: PropTypes.string.isRequired,
|
|
155
|
+
/** Category display name. */
|
|
135
156
|
category: PropTypes.string.isRequired,
|
|
157
|
+
/** Filter token used to show only a specific recipe or category. */
|
|
136
158
|
showOnly: PropTypes.string.isRequired
|
|
137
159
|
};
|
|
138
160
|
export function RecipeCategory(props) {
|
|
@@ -142,9 +164,19 @@ export function RecipeCategory(props) {
|
|
|
142
164
|
return (_jsx("h2", { id: props.id, className: props.className, style: isHidden, children: props.category }));
|
|
143
165
|
}
|
|
144
166
|
/* ========== RECIPE ========== */
|
|
167
|
+
/**
|
|
168
|
+
* RecipeBookItem — displays a single recipe including image, ingredients and instructions.
|
|
169
|
+
*
|
|
170
|
+
* @param {object} [props.recipeData] - Normalized recipe data used for rendering (name, photo, ingredients, instructions, etc.).
|
|
171
|
+
* @param {string} [props.id] - DOM id for deep-linking to this recipe.
|
|
172
|
+
* @param {string} [props.showOnly] - Filter token used to hide/show the item for deep-linking.
|
|
173
|
+
*/
|
|
145
174
|
RecipeBookItem.propTypes = {
|
|
175
|
+
/** Normalized recipe data object used to render the recipe view. */
|
|
146
176
|
recipeData: PropTypes.object.isRequired,
|
|
177
|
+
/** DOM id used for deep-linking. */
|
|
147
178
|
id: PropTypes.string.isRequired,
|
|
179
|
+
/** Filter token used when deep-linking or scoping displayed recipes. */
|
|
148
180
|
showOnly: PropTypes.string.isRequired
|
|
149
181
|
};
|
|
150
182
|
export function RecipeBookItem(props) {
|
|
@@ -160,9 +192,19 @@ export function RecipeBookItem(props) {
|
|
|
160
192
|
return (_jsxs("article", { id: props.id, className: "h-recipe", style: isHidden, children: [_jsx("h3", { className: "p-name", children: _jsx("a", { id: props.id, href: `#${props.id}`, onClick: () => { return false; }, children: recipe.name }) }), recipeImage, _jsx("p", { className: "p-summary", children: recipe.summary }), _jsx("p", { children: "\u00A0" }), _jsxs("p", { className: "p-author", children: ["Author: ", recipe.author] }), _jsxs("p", { className: "p-published", children: ["Published: ", recipe.published] }), _jsxs("p", { className: "dt-duration", children: ["Duration: ", recipe.duration] }), _jsxs("p", { className: "p-yield", children: ["Yield: ", recipe.yield] }), _jsx("h4", { className: "e-ingredients", children: "Ingredients" }), _jsx("ul", { children: ingredients }), _jsx("h4", { className: "e-instructions", children: "Instructions" }), _jsx("ol", { children: instructions })] }));
|
|
161
193
|
}
|
|
162
194
|
/* ========== RECIPE PICK LIST ========== */
|
|
195
|
+
/**
|
|
196
|
+
* RecipePickList — renders a select control for picking recipes by category and recipe name.
|
|
197
|
+
*
|
|
198
|
+
* @param {object} [props.recipeData] - Object containing recipe items accessible by category.
|
|
199
|
+
* @param {array} [props.recipeCategories] - Categories used to organize recipes in the select list.
|
|
200
|
+
* @param {function} [props.handleRecipePickListChange] - Callback invoked when the selected recipe changes (receives selected id).
|
|
201
|
+
*/
|
|
163
202
|
RecipePickList.propTypes = {
|
|
203
|
+
/** Recipe data object containing items used to build the pick list. */
|
|
164
204
|
recipeData: PropTypes.object.isRequired,
|
|
205
|
+
/** Array of category names for grouping recipes in the select. */
|
|
165
206
|
recipeCategories: PropTypes.array.isRequired,
|
|
207
|
+
/** Change handler called with the selected recipe identifier when the pick list changes. */
|
|
166
208
|
handleRecipePickListChange: PropTypes.func.isRequired
|
|
167
209
|
};
|
|
168
210
|
export function RecipePickList(props) {
|
|
@@ -203,7 +245,10 @@ export function RecipePickList(props) {
|
|
|
203
245
|
return (_jsx("form", { children: _jsx("select", { id: "recipe-list", name: "recipe-list", onChange: recipeListChanged, children: recipeOptions }) }));
|
|
204
246
|
}
|
|
205
247
|
/* ========== RECIPE BACK TO TOP ========== */
|
|
206
|
-
BackToTop.propTypes
|
|
248
|
+
/** BackToTop.propTypes — No props (scroll-to-top control).
|
|
249
|
+
* @param {any} [props] - No props are accepted by BackToTop.
|
|
250
|
+
*/
|
|
251
|
+
BackToTop.propTypes = { /** no props */};
|
|
207
252
|
export function BackToTop() {
|
|
208
253
|
function scrollToTop() {
|
|
209
254
|
window.scroll({
|