generator-chisel 2.3.2 → 2.4.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.
Files changed (117) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/lib/commands/create/creators/app/chisel-starter-theme/.editorconfig +16 -0
  3. package/lib/commands/create/creators/app/chisel-starter-theme/.gitignore.chisel-tpl +0 -1
  4. package/lib/commands/create/creators/app/chisel-starter-theme/.husky/pre-commit +92 -0
  5. package/lib/commands/create/creators/app/chisel-starter-theme/.nvmrc +1 -1
  6. package/lib/commands/create/creators/app/chisel-starter-theme/.vscode/extensions.json +10 -0
  7. package/lib/commands/create/creators/app/chisel-starter-theme/.vscode/settings.json +19 -0
  8. package/lib/commands/create/creators/app/chisel-starter-theme/README.md +67 -10
  9. package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons-source/search.svg +3 -0
  10. package/lib/commands/create/creators/app/chisel-starter-theme/composer.json +3 -3
  11. package/lib/commands/create/creators/app/chisel-starter-theme/{inc/WP/AjaxEndpoints.php → core/Ajax/LoadMoreEndpoint.php} +8 -51
  12. package/lib/commands/create/creators/app/chisel-starter-theme/core/Controllers/AjaxController.php +225 -0
  13. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/AcfHelpers.php +4 -0
  14. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/AjaxHelpers.php +4 -0
  15. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/AssetsHelpers.php +4 -0
  16. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/BlocksHelpers.php +5 -0
  17. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/CacheHelpers.php +5 -1
  18. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/CommentsHelpers.php +4 -0
  19. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/DataHelpers.php +4 -0
  20. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/GravityFormsHelpers.php +4 -0
  21. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/ImageHelpers.php +4 -0
  22. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/ThemeHelpers.php +10 -2
  23. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/WoocommerceHelpers.php +4 -0
  24. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Helpers/YoastHelpers.php +4 -0
  25. package/lib/commands/create/creators/app/chisel-starter-theme/core/Interfaces/AjaxEndpointInterface.php +15 -0
  26. package/lib/commands/create/creators/app/chisel-starter-theme/{inc/Plugins → core/Plugins/GravityForms}/GravityForms.php +12 -24
  27. package/lib/commands/create/creators/app/chisel-starter-theme/{inc/Plugins → core/Plugins/Woocommerce}/Woocommerce.php +23 -14
  28. package/lib/commands/create/creators/app/chisel-starter-theme/core/Plugins/Yoast/Yoast.php +37 -0
  29. package/lib/commands/create/creators/app/chisel-starter-theme/{inc/WP → core/Timber}/Cache.php +5 -17
  30. package/lib/commands/create/creators/app/chisel-starter-theme/{inc/WP → core/Timber}/ChiselImage.php +1 -1
  31. package/lib/commands/create/creators/app/chisel-starter-theme/{inc/WP → core/Timber}/ChiselPost.php +1 -1
  32. package/lib/commands/create/creators/app/chisel-starter-theme/{inc/WP → core/Timber}/ChiselProduct.php +1 -1
  33. package/lib/commands/create/creators/app/chisel-starter-theme/{inc/WP → core/Timber}/ChiselProductCategory.php +1 -1
  34. package/lib/commands/create/creators/app/chisel-starter-theme/{inc/WP → core/Timber}/ChiselTerm.php +1 -1
  35. package/lib/commands/create/creators/app/chisel-starter-theme/{inc/WP → core/Timber}/Components.php +1 -1
  36. package/lib/commands/create/creators/app/chisel-starter-theme/core/Traits/Hooks.php +29 -0
  37. package/lib/commands/create/creators/app/chisel-starter-theme/core/Traits/HooksSingleton.php +54 -0
  38. package/lib/commands/create/creators/app/chisel-starter-theme/core/Traits/Rest.php +51 -0
  39. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Traits/Singleton.php +10 -8
  40. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/WP/Acf.php +22 -55
  41. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/WP/AcfBlocks.php +7 -20
  42. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/WP/Assets.php +3 -15
  43. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/WP/Blocks.php +7 -19
  44. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/WP/Comments.php +44 -49
  45. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/WP/CustomPostTypes.php +8 -35
  46. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/WP/CustomTaxonomies.php +12 -36
  47. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/WP/Sidebars.php +3 -15
  48. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/WP/Site.php +52 -18
  49. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/WP/Theme.php +4 -15
  50. package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/WP/Twig.php +12 -31
  51. package/lib/commands/create/creators/app/chisel-starter-theme/custom/app/Timber/ChiselPost.php +14 -0
  52. package/lib/commands/create/creators/app/chisel-starter-theme/custom/app/WP/Acf.php +66 -0
  53. package/lib/commands/create/creators/app/chisel-starter-theme/custom/app/WP/Ajax.php +45 -0
  54. package/lib/commands/create/creators/app/chisel-starter-theme/custom/app/WP/Assets.php +37 -0
  55. package/lib/commands/create/creators/app/chisel-starter-theme/custom/app/WP/CustomPostTypes.php +76 -0
  56. package/lib/commands/create/creators/app/chisel-starter-theme/custom/app/WP/Site.php +42 -0
  57. package/lib/commands/create/creators/app/chisel-starter-theme/custom/app/WP/Twig.php +52 -0
  58. package/lib/commands/create/creators/app/chisel-starter-theme/custom/functions.php +8 -0
  59. package/lib/commands/create/creators/app/chisel-starter-theme/custom/views/README.md +7 -0
  60. package/lib/commands/create/creators/app/chisel-starter-theme/functions.php +31 -9
  61. package/lib/commands/create/creators/app/chisel-starter-theme/package.chisel-tpl.json +11 -6
  62. package/lib/commands/create/creators/app/chisel-starter-theme/phpcs.xml +10 -0
  63. package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/block.json +1 -1
  64. package/lib/commands/create/creators/app/chisel-starter-theme/src/design/settings/_index.scss +2 -2
  65. package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_breakpoints.scss +1 -0
  66. package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/mods/core.js +11 -2
  67. package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/modules/main-nav.js +14 -2
  68. package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/modules/slider.js +45 -4
  69. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_buttons.scss +11 -2
  70. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_search-form.scss +17 -0
  71. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_slider.scss +3 -3
  72. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-base.scss +117 -0
  73. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-collapse.scss.disabled +66 -0
  74. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-elastic.scss.disabled +56 -0
  75. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-emphatic.scss.disabled +59 -0
  76. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-settings.scss +22 -0
  77. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-slider.scss +59 -0
  78. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-spin.scss.disabled +60 -0
  79. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-spring.scss.disabled +98 -0
  80. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-squeeze.scss.disabled +47 -0
  81. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-stand.scss.disabled +59 -0
  82. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-three-d.scss.disabled +139 -0
  83. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/main-nav-toggle/_mnt-vortex.scss.disabled +61 -0
  84. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/gravity-forms.scss +17 -1
  85. package/lib/commands/create/creators/app/chisel-starter-theme/style.chisel-tpl.css +1 -1
  86. package/lib/commands/create/creators/app/chisel-starter-theme/theme.json +1 -1
  87. package/lib/commands/create/creators/app/chisel-starter-theme/twig_cs.php +4 -2
  88. package/lib/commands/create/creators/app/chisel-starter-theme/views/base.twig +1 -2
  89. package/lib/commands/create/creators/app/chisel-starter-theme/views/components/footer.twig +19 -11
  90. package/lib/commands/create/creators/app/chisel-starter-theme/views/components/header.twig +6 -2
  91. package/lib/commands/create/creators/app/chisel-starter-theme/views/components/logo.twig +6 -2
  92. package/lib/commands/create/creators/app/chisel-starter-theme/views/components/main-nav.twig +1 -1
  93. package/lib/commands/create/creators/app/chisel-starter-theme/views/components/post-item.twig +38 -20
  94. package/lib/commands/create/creators/app/chisel-starter-theme/views/components/search-form.twig +8 -0
  95. package/lib/commands/create/creators/app/chisel-starter-theme/views/index.twig +19 -10
  96. package/lib/commands/create/creators/app/chisel-starter-theme/views/search.twig +5 -6
  97. package/lib/commands/create/creators/app/chisel-starter-theme/views/single.twig +43 -31
  98. package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/content-product.twig +1 -1
  99. package/lib/commands/create/creators/app/index.js +87 -9
  100. package/lib/commands/create/creators/app/template/.gitignore.chisel-tpl +1 -0
  101. package/lib/commands/create/creators/wp/index.js +10 -2
  102. package/lib/commands/create/packages-versions.js +2 -2
  103. package/lib/commands/create/priorities.js +3 -0
  104. package/package.json +2 -2
  105. package/lib/commands/create/creators/app/chisel-starter-theme/inc/Controllers/AjaxController.php +0 -156
  106. package/lib/commands/create/creators/app/chisel-starter-theme/inc/Interfaces/HooksInterface.php +0 -26
  107. package/lib/commands/create/creators/app/chisel-starter-theme/inc/Interfaces/InstanceInterface.php +0 -16
  108. package/lib/commands/create/creators/app/chisel-starter-theme/inc/Plugins/Yoast.php +0 -46
  109. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_main-nav-toggle.scss +0 -804
  110. /package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Enums/AcfOptionsPageType.php +0 -0
  111. /package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Enums/BlocksType.php +0 -0
  112. /package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Factories/RegisterAcfOptionsPage.php +0 -0
  113. /package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Factories/RegisterBlocks.php +0 -0
  114. /package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Factories/RegisterCustomPostType.php +0 -0
  115. /package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Factories/RegisterCustomTaxonomy.php +0 -0
  116. /package/lib/commands/create/creators/app/chisel-starter-theme/{inc → core}/Traits/PageBlocks.php +0 -0
  117. /package/lib/commands/create/creators/app/chisel-starter-theme/{src/scripts/blog.js → custom/app/Ajax/.gitkeep} +0 -0
@@ -6,24 +6,40 @@ require_once get_template_directory() . '/vendor/autoload.php';
6
6
 
7
7
  spl_autoload_register(
8
8
  function ( $class_name ) {
9
- $base_directory = get_template_directory() . '/inc/';
9
+ $base_directories = array(
10
+ get_template_directory() . '/core/',
11
+ get_template_directory() . '/custom/app/',
12
+ );
10
13
 
11
14
  $namespace_prefix_length = strlen( CHISEL_NAMESPACE );
12
15
 
13
16
  if ( strncmp( CHISEL_NAMESPACE, $class_name, $namespace_prefix_length ) !== 0 ) {
14
- return;
17
+ return;
15
18
  }
16
19
 
17
20
  $relative_class_name = substr( $class_name, $namespace_prefix_length );
21
+ $relative_path = str_replace( '\\', '/', $relative_class_name ) . '.php';
18
22
 
19
- $class_filename = $base_directory . str_replace( '\\', '/', $relative_class_name ) . '.php';
23
+ foreach ( $base_directories as $base_directory ) {
24
+ if ( strpos( $base_directory, 'custom/app' ) !== false ) {
25
+ $relative_path = preg_replace( '/\/Custom\//', '/', $relative_path, 1 );
26
+ }
20
27
 
21
- if ( file_exists( $class_filename ) ) {
22
- require $class_filename;
28
+ $class_filename = $base_directory . $relative_path;
29
+
30
+ if ( file_exists( $class_filename ) ) {
31
+ require $class_filename;
32
+ return;
33
+ }
23
34
  }
24
35
  }
25
36
  );
26
37
 
38
+ // Icons module. Also requires packacke.json and scss configuration.
39
+ if ( ! defined( 'CHISEL_USE_ICONS_MODULE' ) ) {
40
+ define( 'CHISEL_USE_ICONS_MODULE', false );
41
+ }
42
+
27
43
  Timber\Timber::init();
28
44
 
29
45
  \Chisel\Controllers\AjaxController::get_instance();
@@ -31,7 +47,6 @@ Timber\Timber::init();
31
47
  \Chisel\WP\Acf::get_instance();
32
48
  \Chisel\WP\AcfBlocks::get_instance();
33
49
  \Chisel\WP\Assets::get_instance();
34
- \Chisel\WP\Cache::get_instance();
35
50
  \Chisel\WP\Comments::get_instance();
36
51
  \Chisel\WP\Site::get_instance();
37
52
  \Chisel\WP\Sidebars::get_instance();
@@ -39,6 +54,13 @@ Timber\Timber::init();
39
54
  \Chisel\WP\CustomPostTypes::get_instance();
40
55
  \Chisel\WP\CustomTaxonomies::get_instance();
41
56
  \Chisel\WP\Twig::get_instance();
42
- \Chisel\Plugins\GravityForms::get_instance();
43
- \Chisel\Plugins\Woocommerce::get_instance();
44
- \Chisel\Plugins\Yoast::get_instance();
57
+ \Chisel\Plugins\GravityForms\GravityForms::get_instance();
58
+ \Chisel\Plugins\Woocommerce\Woocommerce::get_instance();
59
+ \Chisel\Plugins\Yoast\Yoast::get_instance();
60
+ \Chisel\Timber\Cache::get_instance();
61
+
62
+ $custom_functions_php = get_template_directory() . '/custom/functions.php';
63
+
64
+ if ( is_file( $custom_functions_php ) ) {
65
+ require_once $custom_functions_php;
66
+ }
@@ -10,28 +10,33 @@
10
10
  "devcontainer:up": "npm run --silent devcontainer -- up --workspace-folder ../../..",
11
11
  "devcontainer:enter": "/usr/bin/env bash ../../../.devcontainer/exec bash",
12
12
  "devcontainer:start": "/usr/bin/env bash ../../../.devcontainer/exec npm run --silent start",
13
- "//icons-module": "Add --use-icons-module to start and build-scripts jobs to enable icons module. Also requires scss and wp-config configuration.",
13
+ "//icons-module": "Add --use-icons-module to start and build-scripts jobs to enable icons module. Also requires scss and functions.php configuration.",
14
14
  "start": "chisel-scripts start --experimental-modules",
15
15
  "dev": "npm run --silent start",
16
16
  "build-scripts": "chisel-scripts build --experimental-modules",
17
- "build": "npm run build-scripts && npm run lint && npm run phpcs && npm run twigcs",
17
+ "build": "npm run build-scripts && npm run lint && npm run phpcs && npm run twigcs && npm run check-update",
18
18
  "add-page": "chisel-scripts add-page",
19
19
  "create-block": "chisel-scripts create-block --category=chisel-blocks --namespace=chisel",
20
20
  "create-dynamic-block": "npm run create-block --variant=dynamic",
21
21
  "wp": "chisel-scripts wp",
22
22
  "composer": "chisel-scripts composer",
23
23
  "wp-config": "chisel-scripts wp-config",
24
- "phpcs": "cross-env vendor/bin/phpcs --extensions=php",
25
- "twigcs": "cross-env vendor/bin/twigcs --config=twig_cs.php"
24
+ "phpcs": "cross-env vendor/bin/phpcs --extensions=php --exclude=Generic.PHP.Syntax",
25
+ "twigcs": "cross-env vendor/bin/twigcs --config=twig_cs.php",
26
+ "check-update": "chisel-scripts check-chisel-update",
27
+ "update-chisel": "chisel-scripts chisel-update",
28
+ "update": "npm run check-update && npm run update-chisel",
29
+ "prepare": "chisel-scripts husky-init || node -e \"\""
26
30
  },
27
31
  "dependencies": {
28
32
  "swiper": "^11.1.10",
29
33
  "@wordpress/interactivity": "^6.36.0"
30
34
  },
31
35
  "devDependencies": {
32
- "@wordpress/scripts": "^31.1.0",
36
+ "@wordpress/scripts": "^31.2.0",
33
37
  "chisel-scripts": "*",
34
- "cross-env": "^7.0.3"
38
+ "cross-env": "^7.0.3",
39
+ "husky": "^9.1.7"
35
40
  },
36
41
  "overrides": {
37
42
  "@wordpress/scripts": {
@@ -63,4 +63,14 @@
63
63
  <severity>0</severity>
64
64
  </rule>
65
65
 
66
+ <!-- Disable unused function parameter warning - WordPress hooks often require specific signatures -->
67
+ <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter">
68
+ <severity>0</severity>
69
+ </rule>
70
+
71
+ <!-- Disable Generic.PHP.Syntax - causes internal errors with PHP 8.2+ due to null to trim() deprecation -->
72
+ <rule ref="Generic.PHP.Syntax">
73
+ <severity>0</severity>
74
+ </rule>
75
+
66
76
  </ruleset>
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
3
  "apiVersion": 3,
4
4
  "name": "chisel/accordion",
5
- "version": "0.1.0",
5
+ "version": "1.0.0",
6
6
  "title": "Accordion",
7
7
  "category": "chisel-blocks",
8
8
  "icon": "editor-justify",
@@ -33,9 +33,9 @@ $gaps: (
33
33
  /*
34
34
  * Icons
35
35
  */
36
- $static-icons: ('minus', 'plus', 'arrow-right', 'arrow-left');
36
+ $static-icons: ('minus', 'plus', 'arrow-right', 'arrow-left', 'search');
37
37
  $animated-icons: ('loader');
38
38
  $multicolor-icons: ();
39
39
 
40
- // Icons module. Also requires packacke.json and wp-config configuration.
40
+ // Icons module. Also requires packacke.json and functions.php configuration.
41
41
  $use-icons-module: false;
@@ -1,5 +1,6 @@
1
1
  @use 'sass:meta';
2
2
  @use 'sass:map';
3
+ @use 'sass:list';
3
4
  @use '../settings';
4
5
 
5
6
  $_breakpoints: settings.$breakpoints;
@@ -5,7 +5,11 @@ import { InspectorControls } from '@wordpress/blockEditor';
5
5
  import { PanelBody, ToggleControl } from '@wordpress/components';
6
6
  import { Fragment } from '@wordpress/element';
7
7
 
8
- addFilter('blocks.registerBlockType', 'chisel/add-no-margin-attribute', (settings) => {
8
+ addFilter('blocks.registerBlockType', 'chisel/add-no-margin-attribute', (settings, name) => {
9
+ if (!name.includes('core/') && !name.includes('chisel/')) {
10
+ return settings;
11
+ }
12
+
9
13
  if (typeof settings.attributes !== 'undefined') {
10
14
  settings.attributes = {
11
15
  ...settings.attributes,
@@ -20,7 +24,12 @@ addFilter('blocks.registerBlockType', 'chisel/add-no-margin-attribute', (setting
20
24
 
21
25
  const addNoMarginToggle = createHigherOrderComponent((BlockEdit) => {
22
26
  return (props) => {
23
- const { attributes, setAttributes, isSelected } = props;
27
+ const { attributes, setAttributes, isSelected, name } = props;
28
+
29
+ if (!name.includes('core/') && !name.includes('chisel/')) {
30
+ return <BlockEdit {...props} />;
31
+ }
32
+
24
33
  const { disableBottomMargin = false, className = '' } = attributes;
25
34
 
26
35
  const onToggle = (checked) => {
@@ -1,4 +1,16 @@
1
1
  class MainNav {
2
+ /**
3
+ * Delay before adding the 'open' class after 'active'.
4
+ * This small delay ensures CSS transitions trigger properly.
5
+ */
6
+ static ANIMATION_START_DELAY = 10;
7
+
8
+ /**
9
+ * Duration to wait before cleanup after closing.
10
+ * Should match the CSS transition duration for the nav items.
11
+ */
12
+ static TRANSITION_DURATION = 300;
13
+
2
14
  constructor() {
3
15
  this.initSelectors();
4
16
  this.initElements();
@@ -71,7 +83,7 @@ class MainNav {
71
83
 
72
84
  setTimeout(() => {
73
85
  this.elements.navItems.classList.add(this.classnames.open);
74
- }, 10);
86
+ }, MainNav.ANIMATION_START_DELAY);
75
87
 
76
88
  const coords = this.elements.navToggle.getBoundingClientRect();
77
89
 
@@ -91,7 +103,7 @@ class MainNav {
91
103
  right: 'auto',
92
104
  position: 'relative',
93
105
  });
94
- }, 300);
106
+ }, MainNav.TRANSITION_DURATION);
95
107
  }
96
108
  }
97
109
  }
@@ -20,6 +20,8 @@ class Slider {
20
20
 
21
21
  const swiperInstance = new this.swiper(this.elements.slider, this.params);
22
22
  this.swipers.push(swiperInstance);
23
+
24
+ this.initAccessibility();
23
25
  }
24
26
 
25
27
  /*
@@ -369,6 +371,40 @@ class Slider {
369
371
 
370
372
  this.params.thumbs = moduleParams;
371
373
  }
374
+
375
+ /**
376
+ * Initialize accessibility features for screen readers.
377
+ * Creates an aria-live region that announces slide changes.
378
+ */
379
+ initAccessibility() {
380
+ if (this.swipers.length === 0) {
381
+ return;
382
+ }
383
+
384
+ const mainSwiper = this.swipers[0];
385
+ this.elements.liveRegion = this.createLiveRegion();
386
+
387
+ mainSwiper.on('slideChange', () => {
388
+ const currentSlide = mainSwiper.realIndex + 1;
389
+ const totalSlides = mainSwiper.slides.length;
390
+ this.elements.liveRegion.textContent = __('Slide %1$d of %2$d', 'chisel')
391
+ .replace('%1$d', currentSlide)
392
+ .replace('%2$d', totalSlides);
393
+ });
394
+ }
395
+
396
+ /**
397
+ * Create an aria-live region for announcing slide changes.
398
+ */
399
+ createLiveRegion() {
400
+ const liveRegion = document.createElement('div');
401
+ liveRegion.setAttribute('aria-live', 'polite');
402
+ liveRegion.setAttribute('aria-atomic', 'true');
403
+ liveRegion.className = 'u-sr-only';
404
+ this.elements.sliderContainer.appendChild(liveRegion);
405
+
406
+ return liveRegion;
407
+ }
372
408
  }
373
409
 
374
410
  export default () => {
@@ -392,9 +428,14 @@ export default () => {
392
428
  };
393
429
  };
394
430
 
395
- loadModules().then(({ swiper, swiperModules }) => {
396
- sliders.forEach((slider) => {
397
- new Slider(slider, swiper, swiperModules);
431
+ loadModules()
432
+ .then(({ swiper, swiperModules }) => {
433
+ sliders.forEach((slider) => {
434
+ new Slider(slider, swiper, swiperModules);
435
+ });
436
+ })
437
+ .catch((error) => {
438
+ // eslint-disable-next-line no-console
439
+ console.error('Failed to load Swiper modules:', error);
398
440
  });
399
- });
400
441
  };
@@ -81,7 +81,8 @@ $_static-icons: settings.$static-icons;
81
81
  }
82
82
 
83
83
  @each $icon in $_static-icons {
84
- .c-btn.has-icon-#{$icon} {
84
+ .c-btn.has-icon-#{$icon},
85
+ span.has-icon-#{$icon} {
85
86
  &::after,
86
87
  &::before {
87
88
  @include icon-svg($icon);
@@ -89,7 +90,8 @@ $_static-icons: settings.$static-icons;
89
90
  }
90
91
  }
91
92
 
92
- .c-btn.has-icon {
93
+ .c-btn.has-icon,
94
+ span.has-icon {
93
95
  &::after,
94
96
  &::before {
95
97
  display: block;
@@ -115,4 +117,11 @@ $_static-icons: settings.$static-icons;
115
117
  display: none;
116
118
  }
117
119
  }
120
+
121
+ &.has-icon-only {
122
+ &::after,
123
+ &::before {
124
+ margin: 0;
125
+ }
126
+ }
118
127
  }
@@ -0,0 +1,17 @@
1
+ @use '~design' as *;
2
+
3
+ .c-search-form {
4
+ display: flex;
5
+ gap: get-gap('small');
6
+ align-items: center;
7
+ margin-bottom: get-margin('large');
8
+ }
9
+
10
+ .c-search-form__btn,
11
+ .c-search-form__field {
12
+ margin: 0 !important;
13
+ }
14
+
15
+ .c-search-form__btn {
16
+ flex-shrink: 0;
17
+ }
@@ -114,13 +114,13 @@
114
114
  img {
115
115
  @include object-fit-cover;
116
116
 
117
- border: 2px solid get-color('primary');
118
- opacity: 0.7;
117
+ border: 2px solid get-color('foreground');
118
+ opacity: 0.75;
119
119
  transition: get-transition('normal');
120
120
  }
121
121
 
122
122
  &.swiper-slide-thumb-active img {
123
- border: 2px solid get-color('foreground');
123
+ border: 2px solid get-color('primary');
124
124
  opacity: 1;
125
125
  }
126
126
  }
@@ -0,0 +1,117 @@
1
+ @use '~design' as *;
2
+ @use 'mnt-settings' as *;
3
+
4
+ // Main Nav Toggle - Hamburger Menu Component
5
+ // Based on Hamburgers by Jonathan Suh (https://github.com/jonsuh/hamburgers)
6
+
7
+ // This component has been split into modular subfiles for better organization.
8
+ // Enable additional animation effects by uncommenting the @use statements below.
9
+
10
+ // Available effects:
11
+ // - slider (default) - Sliding bars animation
12
+ // - squeeze - Squeeze bars together
13
+ // - spin - Spinning animation
14
+ // - elastic - Elastic bounce animation
15
+ // - emphatic - Dramatic expansion
16
+ // - collapse - Collapsing bars
17
+ // - vortex - Spinning vortex effect
18
+ // - stand - Stand up animation
19
+ // - spring - Spring bounce effect
20
+ // - 3d - 3D rotation effects (3dx, 3dy, 3dxy)
21
+
22
+ // Required - Base styles and settings
23
+ // 'main-nav-toggle/base';
24
+
25
+ // Default animation effect
26
+ // 'main-nav-toggle/slider';
27
+
28
+ // To enable another effect rename the files with the desired effect by removing .disabled from the file name.
29
+ // For example: _mnt-squeeze.scss.disabled -> _mnt-squeeze.scss
30
+
31
+ // ==================================================
32
+ // Hamburger Base Styles
33
+ // ==================================================
34
+
35
+ .c-main-nav__toggle {
36
+ right: px-rem(16);
37
+ display: inline-block;
38
+ display: block;
39
+ padding: $hamburger-padding-y $hamburger-padding-x;
40
+ margin: 0;
41
+ overflow: visible;
42
+
43
+ // Normalize (<button>)
44
+ font: inherit;
45
+ line-height: 1;
46
+ color: inherit;
47
+ text-transform: none;
48
+ appearance: none;
49
+ cursor: pointer;
50
+ background-color: transparent;
51
+ border: 0;
52
+ transition-timing-function: linear;
53
+ transition-duration: 0.15s;
54
+ transition-property: opacity;
55
+
56
+ @include bp(large) {
57
+ display: none;
58
+ }
59
+
60
+ &:hover {
61
+ opacity: $hamburger-hover-opacity;
62
+ }
63
+
64
+ &.is-active {
65
+ z-index: 999;
66
+
67
+ &:hover {
68
+ opacity: $hamburger-active-hover-opacity;
69
+ }
70
+
71
+ .c-main-nav__toggle-inner,
72
+ .c-main-nav__toggle-inner::before,
73
+ .c-main-nav__toggle-inner::after {
74
+ background-color: $hamburger-active-layer-color;
75
+ }
76
+ }
77
+ }
78
+
79
+ .c-main-nav__toggle-box {
80
+ position: relative;
81
+ display: inline-block;
82
+ width: $hamburger-layer-width;
83
+ height: $hamburger-layer-height * 3 + $hamburger-layer-spacing * 2;
84
+ }
85
+
86
+ .c-main-nav__toggle-inner {
87
+ top: 50%;
88
+ display: block;
89
+ margin-top: calc($hamburger-layer-height / -2);
90
+
91
+ &,
92
+ &::before,
93
+ &::after {
94
+ position: absolute;
95
+ width: $hamburger-layer-width;
96
+ height: $hamburger-layer-height;
97
+ background-color: $hamburger-layer-color;
98
+ border-radius: $hamburger-layer-border-radius;
99
+ transition-timing-function: ease;
100
+ transition-duration: 0.15s;
101
+ transition-property: transform;
102
+ }
103
+
104
+ &::before,
105
+ &::after {
106
+ display: block;
107
+ content: '';
108
+ }
109
+
110
+ &::before {
111
+ top: ($hamburger-layer-spacing + $hamburger-layer-height) * -1;
112
+ }
113
+
114
+ &::after {
115
+ bottom: ($hamburger-layer-spacing + $hamburger-layer-height) * -1;
116
+ }
117
+ }
@@ -0,0 +1,66 @@
1
+ @use 'mnt-settings' as *;
2
+
3
+ // ==================================================
4
+ // Collapse effect
5
+ // ==================================================
6
+ .c-main-nav__toggle--collapse,
7
+ .c-main-nav__toggle--collapse-r {
8
+ .c-main-nav__toggle-inner {
9
+ top: auto;
10
+ bottom: 0;
11
+ transition-delay: 0.13s;
12
+ transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
13
+ transition-duration: 0.13s;
14
+
15
+ &::after {
16
+ top: ($hamburger-layer-spacing * 2 + $hamburger-layer-height * 2) * -1;
17
+ transition:
18
+ top 0.2s 0.2s cubic-bezier(0.3333, 0.6667, 0.6667, 1),
19
+ opacity 0.1s linear;
20
+ }
21
+
22
+ &::before {
23
+ transition:
24
+ top 0.12s 0.2s cubic-bezier(0.3333, 0.6667, 0.6667, 1),
25
+ transform 0.13s cubic-bezier(0.55, 0.055, 0.675, 0.19);
26
+ }
27
+ }
28
+
29
+ &.is-active {
30
+ .c-main-nav__toggle-inner {
31
+ transition-delay: 0.22s;
32
+ transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
33
+ transform: translate3d(0, ($hamburger-layer-spacing + $hamburger-layer-height) * -1, 0)
34
+ rotate(-45deg);
35
+
36
+ &::after {
37
+ top: 0;
38
+ opacity: 0;
39
+ transition:
40
+ top 0.2s cubic-bezier(0.3333, 0, 0.6667, 0.3333),
41
+ opacity 0.1s 0.22s linear;
42
+ }
43
+
44
+ &::before {
45
+ top: 0;
46
+ transition:
47
+ top 0.1s 0.16s cubic-bezier(0.3333, 0, 0.6667, 0.3333),
48
+ transform 0.13s 0.25s cubic-bezier(0.215, 0.61, 0.355, 1);
49
+ transform: rotate(-90deg);
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ .c-main-nav__toggle--collapse-r {
56
+ &.is-active {
57
+ .c-main-nav__toggle-inner {
58
+ transform: translate3d(0, ($hamburger-layer-spacing + $hamburger-layer-height) * -1, 0)
59
+ rotate(45deg);
60
+
61
+ &::before {
62
+ transform: rotate(90deg);
63
+ }
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,56 @@
1
+ @use 'mnt-settings' as *;
2
+
3
+ // ==================================================
4
+ // Elastic effect
5
+ // ==================================================
6
+ .c-main-nav__toggle--elastic,
7
+ .c-main-nav__toggle--elastic-r {
8
+ .c-main-nav__toggle-inner {
9
+ top: calc($hamburger-layer-height / 2);
10
+ transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
11
+ transition-duration: 0.275s;
12
+
13
+ &::before {
14
+ top: $hamburger-layer-height + $hamburger-layer-spacing;
15
+ transition: opacity 0.125s 0.275s ease;
16
+ }
17
+
18
+ &::after {
19
+ top: ($hamburger-layer-height * 2) + ($hamburger-layer-spacing * 2);
20
+ transition: transform 0.275s cubic-bezier(0.68, -0.55, 0.265, 1.55);
21
+ }
22
+ }
23
+
24
+ &.is-active {
25
+ .c-main-nav__toggle-inner {
26
+ $y-offset: $hamburger-layer-spacing + $hamburger-layer-height;
27
+
28
+ transition-delay: 0.075s;
29
+ transform: translate3d(0, $y-offset, 0) rotate(135deg);
30
+
31
+ &::before {
32
+ opacity: 0;
33
+ transition-delay: 0s;
34
+ }
35
+
36
+ &::after {
37
+ transition-delay: 0.075s;
38
+ transform: translate3d(0, $y-offset * -2, 0) rotate(-270deg);
39
+ }
40
+ }
41
+ }
42
+ }
43
+
44
+ .c-main-nav__toggle--elastic-r {
45
+ &.is-active {
46
+ .c-main-nav__toggle-inner {
47
+ $y-offset: $hamburger-layer-spacing + $hamburger-layer-height;
48
+
49
+ transform: translate3d(0, $y-offset, 0) rotate(-135deg);
50
+
51
+ &::after {
52
+ transform: translate3d(0, $y-offset * -2, 0) rotate(270deg);
53
+ }
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,59 @@
1
+ @use 'mnt-settings' as *;
2
+
3
+ // ==================================================
4
+ // Emphatic effect
5
+ // ==================================================
6
+ .c-main-nav__toggle--emphatic {
7
+ overflow: hidden;
8
+
9
+ .c-main-nav__toggle-inner {
10
+ transition: background-color 0.125s 0.175s ease-in;
11
+
12
+ &::before {
13
+ left: 0;
14
+ transition:
15
+ transform 0.125s cubic-bezier(0.6, 0.04, 0.98, 0.335),
16
+ top 0.05s 0.125s linear,
17
+ left 0.125s 0.175s ease-in;
18
+ }
19
+
20
+ &::after {
21
+ top: ($hamburger-layer-height) + ($hamburger-layer-spacing);
22
+ right: 0;
23
+ transition:
24
+ transform 0.125s cubic-bezier(0.6, 0.04, 0.98, 0.335),
25
+ top 0.05s 0.125s linear,
26
+ right 0.125s 0.175s ease-in;
27
+ }
28
+ }
29
+
30
+ &.is-active {
31
+ .c-main-nav__toggle-inner {
32
+ background-color: transparent !important;
33
+ transition-delay: 0s;
34
+ transition-timing-function: ease-out;
35
+
36
+ &::before {
37
+ top: $hamburger-layer-width * -2;
38
+ left: $hamburger-layer-width * -2;
39
+ transition:
40
+ left 0.125s ease-out,
41
+ top 0.05s 0.125s linear,
42
+ transform 0.125s 0.175s cubic-bezier(0.075, 0.82, 0.165, 1);
43
+ transform: translate3d($hamburger-layer-width * 2, $hamburger-layer-width * 2, 0)
44
+ rotate(45deg);
45
+ }
46
+
47
+ &::after {
48
+ top: $hamburger-layer-width * -2;
49
+ right: $hamburger-layer-width * -2;
50
+ transition:
51
+ right 0.125s ease-out,
52
+ top 0.05s 0.125s linear,
53
+ transform 0.125s 0.175s cubic-bezier(0.075, 0.82, 0.165, 1);
54
+ transform: translate3d($hamburger-layer-width * -2, $hamburger-layer-width * 2, 0)
55
+ rotate(-45deg);
56
+ }
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * Hamburgers
3
+ * @description Tasty CSS-animated hamburgers
4
+ * @author Jonathan Suh @jonsuh
5
+ * @site https://jonsuh.com/hamburgers
6
+ * @link https://github.com/jonsuh/hamburgers
7
+ */
8
+
9
+ @use '~design' as *;
10
+
11
+ // Settings
12
+ // ==================================================
13
+ $hamburger-padding-x: get-padding('normal') !default;
14
+ $hamburger-padding-y: get-padding('normal') !default;
15
+ $hamburger-layer-width: px-rem(36) !default;
16
+ $hamburger-layer-height: px-rem(4) !default;
17
+ $hamburger-layer-spacing: px-rem(6) !default;
18
+ $hamburger-layer-color: get-color('primary') !default;
19
+ $hamburger-layer-border-radius: get-border-radius('little') !default;
20
+ $hamburger-hover-opacity: 0.7 !default;
21
+ $hamburger-active-layer-color: $hamburger-layer-color !default;
22
+ $hamburger-active-hover-opacity: $hamburger-hover-opacity !default;