@asantemedia-org/leybold-design-system 1.0.3 → 1.0.5

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/README.md CHANGED
@@ -58,6 +58,34 @@ npm run build
58
58
  npm run build:npm
59
59
  ```
60
60
 
61
+ ### Publishing to npm
62
+
63
+ Publishing requires an npm access token with publish permissions for the `@asantemedia-org` organization.
64
+
65
+ #### Setup Access Token
66
+
67
+ 1. Generate an access token at [npmjs.com](https://www.npmjs.com) → Access Tokens
68
+ 2. Configure the token:
69
+
70
+ ```bash
71
+ npm config set //registry.npmjs.org/:_authToken YOUR_ACCESS_TOKEN
72
+ ```
73
+
74
+ #### Publish
75
+
76
+ ```bash
77
+ npm run build:npm
78
+ npm run publish:npm
79
+ ```
80
+
81
+ Or to bump version and publish in one step:
82
+
83
+ ```bash
84
+ npm run build:npm
85
+ npm version patch # or minor/major
86
+ npm publish --access public
87
+ ```
88
+
61
89
  ### Project Structure
62
90
 
63
91
  ```
@@ -127,9 +155,9 @@ The design system follows the Atomic Design methodology:
127
155
  6. **Templates** - Complete page layouts
128
156
 
129
157
  Each component should include:
158
+
130
159
  - Component implementation
131
160
  - Storybook stories with different variants
132
161
  - Documentation
133
162
  - TypeScript types
134
163
  - SCSS modules for styling
135
-
package/dist/index.esm.js CHANGED
@@ -1771,5 +1771,5 @@ const SearchTriggerButton = ({
1771
1771
  }, label));
1772
1772
  };
1773
1773
 
1774
- export { AlgoliaDynamicSearchLeybold, AppliedFilterTag, AppliedFilters, Button, ContentCardHorizontal, FederatedInstantResultsLayout, FederatedResultsView, FederatedSearchExperience, FilterAccordion, FilterItem, FilterSearch, FiltersPanel, ModalCloseButton, Pagination, PaginationButton, PaginationEllipsis, PaginationItem, ProductCardHorizontal, QrFormLeybold, ResultsColumn, ResultsCount, ResultsList, SearchBar, SearchIcon, SearchInput, SearchModal, SearchSubmitButton, SearchTriggerButton, SeeAllLinkButton };
1774
+ export { AlgoliaDynamicSearchLeybold as AlgoliaDynamicSearch, AlgoliaDynamicSearchLeybold, AppliedFilterTag, AppliedFilters, Button, ContentCardHorizontal, FederatedInstantResultsLayout, FederatedResultsView, FederatedSearchExperience, FilterAccordion, FilterItem, FilterSearch, FiltersPanel, ModalCloseButton, Pagination, PaginationButton, PaginationEllipsis, PaginationItem, ProductCardHorizontal, QrFormLeybold as QrForm, QrFormLeybold, ResultsColumn, ResultsCount, ResultsList, SearchBar, SearchIcon, SearchInput, SearchModal, SearchSubmitButton, SearchTriggerButton, SeeAllLinkButton };
1775
1775
  //# sourceMappingURL=index.esm.js.map
package/dist/index.js CHANGED
@@ -1,7 +1,5 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var edwardsvacuumDesignSystem = require('@asantemedia-org/edwardsvacuum-design-system');
1
+ import React, { useMemo, useState, useCallback, useRef, useEffect } from 'react';
2
+ import { ProductDetailsCard, AlgoliaDynamicSearchRaw, QrForm } from '@asantemedia-org/edwardsvacuum-design-system';
5
3
 
6
4
  function _extends() {
7
5
  return _extends = Object.assign ? Object.assign.bind() : function (n) {
@@ -277,7 +275,7 @@ const Pagination = ({
277
275
  className,
278
276
  ariaLabel = "Pagination"
279
277
  }) => {
280
- const pageNumbers = React.useMemo(() => generatePageNumbers(currentPage, totalPages, maxVisiblePages), [currentPage, totalPages, maxVisiblePages]);
278
+ const pageNumbers = useMemo(() => generatePageNumbers(currentPage, totalPages, maxVisiblePages), [currentPage, totalPages, maxVisiblePages]);
281
279
  const handlePageChange = page => {
282
280
  if (page >= 1 && page <= totalPages && page !== currentPage) {
283
281
  onPageChange(page);
@@ -349,15 +347,15 @@ const Image = ({
349
347
  srcSet,
350
348
  sizes
351
349
  }) => {
352
- const [isLoading, setIsLoading] = React.useState(true);
353
- const [hasError, setHasError] = React.useState(false);
354
- const [currentSrc, setCurrentSrc] = React.useState(src);
355
- const handleLoad = React.useCallback(() => {
350
+ const [isLoading, setIsLoading] = useState(true);
351
+ const [hasError, setHasError] = useState(false);
352
+ const [currentSrc, setCurrentSrc] = useState(src);
353
+ const handleLoad = useCallback(() => {
356
354
  setIsLoading(false);
357
355
  setHasError(false);
358
356
  onLoad?.();
359
357
  }, [onLoad]);
360
- const handleError = React.useCallback(() => {
358
+ const handleError = useCallback(() => {
361
359
  setIsLoading(false);
362
360
  setHasError(true);
363
361
 
@@ -536,7 +534,7 @@ const ProductCardDetails = ({
536
534
  };
537
535
  return /*#__PURE__*/React.createElement("div", {
538
536
  className: styles$b.productDetails
539
- }, /*#__PURE__*/React.createElement(edwardsvacuumDesignSystem.ProductDetailsCard, {
537
+ }, /*#__PURE__*/React.createElement(ProductDetailsCard, {
540
538
  className: `${className}`,
541
539
  title: title,
542
540
  imageUrl: imageUrl,
@@ -615,7 +613,7 @@ const AlgoliaDynamicSearchLeybold = props => {
615
613
  ProductCard: ProductCardAdapter,
616
614
  ProductDetailsCard: ProductCardDetailsAdapter
617
615
  };
618
- return /*#__PURE__*/React.createElement(edwardsvacuumDesignSystem.AlgoliaDynamicSearchRaw, _extends({}, props, {
616
+ return /*#__PURE__*/React.createElement(AlgoliaDynamicSearchRaw, _extends({}, props, {
619
617
  innerComponents: innerComponents
620
618
  }));
621
619
  };
@@ -666,7 +664,7 @@ const QrFormButtonAdapter = ({
666
664
  const QrFormLeybold = props => {
667
665
  return /*#__PURE__*/React.createElement("div", {
668
666
  className: "qr-journey-form-wrapper"
669
- }, /*#__PURE__*/React.createElement(edwardsvacuumDesignSystem.QrForm, _extends({}, props, {
667
+ }, /*#__PURE__*/React.createElement(QrForm, _extends({}, props, {
670
668
  ButtonComponent: QrFormButtonAdapter
671
669
  })));
672
670
  };
@@ -712,9 +710,9 @@ const SearchModal = ({
712
710
  children,
713
711
  className = ''
714
712
  }) => {
715
- const modalRef = React.useRef(null);
716
- const previouslyFocusedElement = React.useRef(null);
717
- React.useEffect(() => {
713
+ const modalRef = useRef(null);
714
+ const previouslyFocusedElement = useRef(null);
715
+ useEffect(() => {
718
716
  if (isOpen) {
719
717
  // Store the previously focused element
720
718
  previouslyFocusedElement.current = document.activeElement;
@@ -739,7 +737,7 @@ const SearchModal = ({
739
737
  document.body.style.overflow = '';
740
738
  };
741
739
  }, [isOpen]);
742
- React.useEffect(() => {
740
+ useEffect(() => {
743
741
  const handleEscape = event => {
744
742
  if (event.key === 'Escape' && isOpen) {
745
743
  onClose();
@@ -750,7 +748,7 @@ const SearchModal = ({
750
748
  }, [isOpen, onClose]);
751
749
 
752
750
  // Focus trap implementation
753
- React.useEffect(() => {
751
+ useEffect(() => {
754
752
  if (!isOpen || !modalRef.current) return;
755
753
  const modal = modalRef.current;
756
754
  const focusableElements = modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
@@ -1167,10 +1165,10 @@ const FilterAccordion = ({
1167
1165
  onValueToggle,
1168
1166
  className
1169
1167
  }) => {
1170
- const [searchQuery, setSearchQuery] = React.useState("");
1168
+ const [searchQuery, setSearchQuery] = useState("");
1171
1169
 
1172
1170
  // Filter facet values based on search query
1173
- const filteredValues = React.useMemo(() => {
1171
+ const filteredValues = useMemo(() => {
1174
1172
  if (!searchQuery.trim()) {
1175
1173
  return facet.values;
1176
1174
  }
@@ -1293,7 +1291,7 @@ const AppliedFilters = ({
1293
1291
  className
1294
1292
  }) => {
1295
1293
  // Extract all refined (selected) filters
1296
- const appliedFilters = React.useMemo(() => {
1294
+ const appliedFilters = useMemo(() => {
1297
1295
  const filters = [];
1298
1296
  facets.forEach(facet => {
1299
1297
  facet.values.forEach(value => {
@@ -1358,7 +1356,7 @@ const FiltersPanel = ({
1358
1356
  className
1359
1357
  }) => {
1360
1358
  // Track which accordions are expanded
1361
- const [expandedAccordions, setExpandedAccordions] = React.useState(() => {
1359
+ const [expandedAccordions, setExpandedAccordions] = useState(() => {
1362
1360
  // Initialize with default expanded facets
1363
1361
  const expanded = new Set();
1364
1362
  facets.forEach(facet => {
@@ -1368,7 +1366,7 @@ const FiltersPanel = ({
1368
1366
  });
1369
1367
  return expanded;
1370
1368
  });
1371
- const handleAccordionToggle = React.useCallback(facetId => {
1369
+ const handleAccordionToggle = useCallback(facetId => {
1372
1370
  setExpandedAccordions(prev => {
1373
1371
  const next = new Set(prev);
1374
1372
  if (next.has(facetId)) {
@@ -1379,13 +1377,13 @@ const FiltersPanel = ({
1379
1377
  return next;
1380
1378
  });
1381
1379
  }, []);
1382
- const handleValueToggle = React.useCallback((attribute, value) => {
1380
+ const handleValueToggle = useCallback((attribute, value) => {
1383
1381
  onFacetToggle(attribute, value);
1384
1382
  }, [onFacetToggle]);
1385
- const handleRemoveFilter = React.useCallback((attribute, value) => {
1383
+ const handleRemoveFilter = useCallback((attribute, value) => {
1386
1384
  onFacetToggle(attribute, value);
1387
1385
  }, [onFacetToggle]);
1388
- const handleClearAll = React.useCallback(() => {
1386
+ const handleClearAll = useCallback(() => {
1389
1387
  // Remove all refined facets
1390
1388
  facets.forEach(facet => {
1391
1389
  facet.values.forEach(value => {
@@ -1773,14 +1771,8 @@ const SearchTriggerButton = ({
1773
1771
  }, label));
1774
1772
  };
1775
1773
 
1776
- exports.AlgoliaDynamicSearchLeybold = AlgoliaDynamicSearchLeybold;
1777
- exports.AppliedFilterTag = AppliedFilterTag;
1778
- exports.AppliedFilters = AppliedFilters;
1779
- exports.Button = Button;
1780
- exports.ContentCardHorizontal = ContentCardHorizontal;
1781
- exports.FederatedInstantResultsLayout = FederatedInstantResultsLayout;
1782
- exports.FederatedResultsView = FederatedResultsView;
1783
- exports.FederatedSearchExperience = FederatedSearchExperience;
1774
+ export { AlgoliaDynamicSearchLeybold as AlgoliaDynamicSearch, AlgoliaDynamicSearchLeybold, AppliedFilterTag, AppliedFilters, Button, ContentCardHorizontal, FederatedInstantResultsLayout, FederatedResultsView, FederatedSearchExperience, FilterAccordion, FilterItem, FilterSearch, FiltersPanel, ModalCloseButton, Pagination, PaginationButton, PaginationEllipsis, PaginationItem, ProductCardHorizontal, QrFormLeybold as QrForm, QrFormLeybold, ResultsColumn, ResultsCount, ResultsList, SearchBar, SearchIcon, SearchInput, SearchModal, SearchSubmitButton, SearchTriggerButton, SeeAllLinkButton };
1775
+ archExperience;
1784
1776
  exports.FilterAccordion = FilterAccordion;
1785
1777
  exports.FilterItem = FilterItem;
1786
1778
  exports.FilterSearch = FilterSearch;
@@ -1791,6 +1783,7 @@ exports.PaginationButton = PaginationButton;
1791
1783
  exports.PaginationEllipsis = PaginationEllipsis;
1792
1784
  exports.PaginationItem = PaginationItem;
1793
1785
  exports.ProductCardHorizontal = ProductCardHorizontal;
1786
+ exports.QrForm = QrFormLeybold;
1794
1787
  exports.QrFormLeybold = QrFormLeybold;
1795
1788
  exports.ResultsColumn = ResultsColumn;
1796
1789
  exports.ResultsCount = ResultsCount;