@orangesk/orange-design-system 2.0.0-beta.34 → 2.0.0-beta.35

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 (198) hide show
  1. package/README.md +3 -3
  2. package/build/components/BodyBanner/style.css +1 -1
  3. package/build/components/BodyBanner/style.css.map +1 -1
  4. package/build/components/Megamenu/style.css +1 -1
  5. package/build/components/Megamenu/style.css.map +1 -1
  6. package/build/components/Table/style.css +1 -1
  7. package/build/components/Table/style.css.map +1 -1
  8. package/build/components/index.js +1 -1
  9. package/build/components/index.js.map +1 -1
  10. package/build/components/tsconfig.tsbuildinfo +1 -1
  11. package/build/components/types/index.d.ts +11 -1
  12. package/build/components/types/src/components/Forms/TextInput/TextInput.d.ts +3 -0
  13. package/build/components/types/src/components/Icon/index.d.ts +1 -0
  14. package/build/components/types/src/components/Megamenu/Megamenu.static.d.ts +2 -0
  15. package/build/components/types/src/components/Megamenu/constants.d.ts +3 -0
  16. package/build/components/types/src/components/index.d.ts +2 -2
  17. package/build/lib/components.css +1 -1
  18. package/build/lib/components.css.map +1 -1
  19. package/build/lib/footer.js.map +1 -1
  20. package/build/lib/megamenu.css +1 -1
  21. package/build/lib/megamenu.css.map +1 -1
  22. package/build/lib/megamenu.js +1 -1
  23. package/build/lib/megamenu.js.map +1 -1
  24. package/build/lib/scripts.js +1 -1
  25. package/build/lib/scripts.js.map +1 -1
  26. package/build/lib/style.css +1 -1
  27. package/build/lib/style.css.map +1 -1
  28. package/build/lib/tsconfig.tsbuildinfo +1 -1
  29. package/build/search-index.json +4 -4
  30. package/package.json +13 -12
  31. package/src/components/Accordion/tests/{Accordion.static.test.js → Accordion.static.test.jsx} +23 -23
  32. package/src/components/Accordion/tests/{Accordion.unit.test.js → Accordion.unit.test.jsx} +1 -1
  33. package/src/components/Alert/tests/{Alert.conformance.test.js → Alert.conformance.test.jsx} +1 -1
  34. package/src/components/Alert/tests/{Alert.test.js → Alert.test.jsx} +1 -1
  35. package/src/components/AnchorNavigation/tests/{AnchorNavigation.conformance.test.js → AnchorNavigation.conformance.test.jsx} +1 -1
  36. package/src/components/Bar/tests/{Bar.conformance.test.js → Bar.conformance.test.jsx} +1 -1
  37. package/src/components/BlockAction/tests/{BlockAction.conformance.test.js → BlockAction.conformance.test.jsx} +1 -1
  38. package/src/components/BlockAction/tests/{BlockActionControl.unit.test.js → BlockActionControl.unit.test.jsx} +2 -2
  39. package/src/components/BodyBanner/styles/mixins.scss +1 -5
  40. package/src/components/BodyBanner/tests/{BodyBanner.conformance.test.js → BodyBanner.conformance.test.jsx} +1 -1
  41. package/src/components/Breadcrumbs/tests/{Breadcrumbs.conformance.test.js → Breadcrumbs.conformance.test.jsx} +1 -1
  42. package/src/components/Button/tests/{Button.conformance.test.js → Button.conformance.test.jsx} +1 -1
  43. package/src/components/Button/tests/{Button.test.js → Button.test.jsx} +1 -1
  44. package/src/components/Buttons/tests/{Buttons.conformance.test.js → Buttons.conformance.test.jsx} +1 -1
  45. package/src/components/Card/tests/{Card.conformance.test.js → Card.conformance.test.jsx} +1 -1
  46. package/src/components/Carousel/tests/{Carousel.conformance.test.js → Carousel.conformance.test.jsx} +1 -1
  47. package/src/components/Carousel/tests/{Carousel.static.test.js → Carousel.static.test.jsx} +49 -42
  48. package/src/components/CarouselHero/tests/{CarouselHero.conformance.test.js → CarouselHero.conformance.test.jsx} +25 -9
  49. package/src/components/CarouselHero/tests/{CarouselHeroItem.conformance.test.js → CarouselHeroItem.conformance.test.jsx} +1 -1
  50. package/src/components/CarouselPromotions/tests/{CarouselPromotions.conformance.test.js → CarouselPromotions.conformance.test.jsx} +12 -3
  51. package/src/components/CarouselPromotions/tests/{CarouselPromotions.unit.test.js → CarouselPromotions.unit.test.jsx} +2 -3
  52. package/src/components/CartTable/tests/{CartTable.conformance.test.js → CartTable.conformance.test.jsx} +1 -1
  53. package/src/components/Container/tests/{Container.conformance.test.js → Container.conformance.test.jsx} +2 -6
  54. package/src/components/Container/tests/{Container.unit.test.js → Container.unit.test.jsx} +2 -2
  55. package/src/components/Controls/tests/{Controls.test.js → Controls.test.jsx} +12 -12
  56. package/src/components/Cover/tests/{Cover.conformance.test.js → Cover.conformance.test.jsx} +1 -1
  57. package/src/components/Divider/tests/{Divider.conformance.test.js → Divider.conformance.test.jsx} +1 -1
  58. package/src/components/Dropdown/tests/{Dropdown.conformance.test.js → Dropdown.conformance.test.jsx} +1 -1
  59. package/src/components/Expander/tests/{Expander.conformance.test.js → Expander.conformance.test.jsx} +1 -1
  60. package/src/components/FeatureAccordion/tests/{FeatureAccordion.conformance.test.js → FeatureAccordion.conformance.test.jsx} +1 -1
  61. package/src/components/Footer/tests/{Footer.conformance.test.js → Footer.conformance.test.jsx} +1 -5
  62. package/src/components/Forms/Autocomplete/Autocomplete.static.ts +36 -0
  63. package/src/components/Forms/Autocomplete/styles/style.scss +42 -0
  64. package/src/components/Forms/Field/tests/{Autocomplete.Field.conformance.test.js → Autocomplete.Field.conformance.test.jsx} +1 -1
  65. package/src/components/Forms/Field/tests/{Checkbox.Field.conformance.test.js → Checkbox.Field.conformance.test.jsx} +1 -1
  66. package/src/components/Forms/Field/tests/{File.Field.conformance.test.js → File.Field.conformance.test.jsx} +2 -2
  67. package/src/components/Forms/Field/tests/{Group.Field.conformance.test.js → Group.Field.conformance.test.jsx} +1 -1
  68. package/src/components/Forms/Field/tests/{Radio.Field.conformance.test.js → Radio.Field.conformance.test.jsx} +1 -1
  69. package/src/components/Forms/Field/tests/{Rangeslider.Field.test.js → Rangeslider.Field.test.jsx} +1 -1
  70. package/src/components/Forms/Field/tests/{Select.Field.conformance.test.js → Select.Field.conformance.test.jsx} +1 -1
  71. package/src/components/Forms/Field/tests/{Text.Field.conformance.test.js → Text.Field.conformance.test.jsx} +1 -1
  72. package/src/components/Forms/Field/tests/{Textarea.Field.conformance.test.js → Textarea.Field.conformance.test.jsx} +1 -1
  73. package/src/components/Forms/TextInput/TextInput.tsx +30 -3
  74. package/src/components/Forms/TextInput/styles/style.scss +62 -0
  75. package/src/components/Grid/tests/{GridCol.unit.test.js → GridCol.unit.test.jsx} +1 -1
  76. package/src/components/Hero/tests/{Hero.conformance.test.js → Hero.conformance.test.jsx} +1 -1
  77. package/src/components/Icon/index.ts +1 -0
  78. package/src/components/Icon/tests/{Icon.conformance.test.js → Icon.conformance.test.jsx} +1 -1
  79. package/src/components/Icon/tests/{Icon.unit.test.js → Icon.unit.test.jsx} +1 -1
  80. package/src/components/Icon/tests/{Pictogram.unit.test.js → Pictogram.unit.test.jsx} +2 -20
  81. package/src/components/IconList/tests/{IconList.conformance.test.js → IconList.conformance.test.jsx} +2 -2
  82. package/src/components/IconList/tests/{IconList.unit.test.js → IconList.unit.test.jsx} +1 -1
  83. package/src/components/IconList/tests/{Item.unit.test.js → Item.unit.test.jsx} +1 -1
  84. package/src/components/Image/tests/{Image.conformance.test.js → Image.conformance.test.jsx} +1 -1
  85. package/src/components/Image/tests/{Image.unit.test.js → Image.unit.test.jsx} +12 -3
  86. package/src/components/Link/tests/{Link.conformance.test.js → Link.conformance.test.jsx} +2 -2
  87. package/src/components/Link/tests/{Link.unit.test.js → Link.unit.test.jsx} +5 -5
  88. package/src/components/List/tests/{List.conformance.test.js → List.conformance.test.jsx} +1 -1
  89. package/src/components/Loader/tests/{Loader.conformance.test.js → Loader.conformance.test.jsx} +1 -1
  90. package/src/components/Megamenu/Megamenu.static.ts +59 -8
  91. package/src/components/Megamenu/MegamenuSearchContent.tsx +22 -14
  92. package/src/components/Megamenu/constants.ts +3 -0
  93. package/src/components/Megamenu/styles/mixins.scss +33 -2
  94. package/src/components/Megamenu/styles/style.scss +4 -0
  95. package/src/components/Modal/tests/{Modal.conformance.test.js → Modal.conformance.test.jsx} +2 -2
  96. package/src/components/Pagination/tests/{Item.unit.test.js → Item.unit.test.jsx} +1 -1
  97. package/src/components/Pagination/tests/{Pagination.conformance.test.js → Pagination.conformance.test.jsx} +1 -1
  98. package/src/components/Pagination/tests/{Separator.unit.test.js → Separator.unit.test.jsx} +1 -1
  99. package/src/components/Pill/tests/{Pill.conformance.test.js → Pill.conformance.test.jsx} +1 -1
  100. package/src/components/Progress/tests/{Progress.conformance.test.js → Progress.conformance.test.jsx} +1 -1
  101. package/src/components/PromoBanner/tests/{PromoBanner.conformance.test.js → PromoBanner.conformance.test.jsx} +7 -7
  102. package/src/components/PromoBanner/tests/{PromoBanner.unit.test.js → PromoBanner.unit.test.jsx} +1 -1
  103. package/src/components/PromotionCard/tests/{PromotionCard.conformance.test.js → PromotionCard.conformance.test.jsx} +4 -4
  104. package/src/components/PromotionCard/tests/{PromotionCard.unit.test.js → PromotionCard.unit.test.jsx} +1 -1
  105. package/src/components/Section/tests/{Section.conformance.test.js → Section.conformance.test.jsx} +4 -4
  106. package/src/components/Section/tests/{Section.unit.test.js → Section.unit.test.jsx} +1 -1
  107. package/src/components/Skeleton/tests/{Skeleton.conformance.test.js → Skeleton.conformance.test.jsx} +1 -1
  108. package/src/components/SkipLink/tests/{SkipLink.unit.test.js → SkipLink.unit.test.jsx} +2 -2
  109. package/src/components/SocialButton/tests/{SocialButton.unit.test.js → SocialButton.unit.test.jsx} +2 -2
  110. package/src/components/Stepbar/tests/{Stepbar.conformance.test.js → Stepbar.conformance.test.jsx} +1 -1
  111. package/src/components/Sticker/tests/{Sticker.conformance.test.js → Sticker.conformance.test.jsx} +1 -1
  112. package/src/components/Table/styles/mixins.scss +0 -4
  113. package/src/components/Table/styles/style.scss +0 -4
  114. package/src/components/Table/tests/{Table.conformance.test.js → Table.conformance.test.jsx} +1 -1
  115. package/src/components/Tabs/tests/{Tabs.unit.test.js → Tabs.unit.test.jsx} +1 -1
  116. package/src/components/Tag/tests/{Tag.conformance.test.js → Tag.conformance.test.jsx} +1 -1
  117. package/src/components/Tag/tests/{Tag.unit.test.js → Tag.unit.test.jsx} +4 -4
  118. package/src/components/Tag/tests/{TagButton.conformance.test.js → TagButton.conformance.test.jsx} +1 -1
  119. package/src/components/Tag/tests/{TagButton.unit.test.js → TagButton.unit.test.jsx} +3 -2
  120. package/src/components/Testimonial/tests/{Testimonial.conformance.test.js → Testimonial.conformance.test.jsx} +1 -1
  121. package/src/components/Tile/tests/{Tile.conformance.test.js → Tile.conformance.test.jsx} +1 -1
  122. package/src/components/Tile/tests/{Tile.unit.test.js → Tile.unit.test.jsx} +2 -2
  123. package/src/components/Tooltip/tests/{Tooltip.conformance.test.js → Tooltip.conformance.test.jsx} +1 -1
  124. package/src/components/Tooltip/tests/{Tooltip.unit.test.js → Tooltip.unit.test.jsx} +9 -5
  125. package/src/components/index.ts +3 -1
  126. /package/src/components/AnchorNavigation/tests/{AnchorNavigation.unit.test.js → AnchorNavigation.unit.test.jsx} +0 -0
  127. /package/src/components/Bar/tests/{Bar.unit.test.js → Bar.unit.test.jsx} +0 -0
  128. /package/src/components/Bar/tests/{BarBreak.unit.test.js → BarBreak.unit.test.jsx} +0 -0
  129. /package/src/components/Bar/tests/{BarItem.unit.test.js → BarItem.unit.test.jsx} +0 -0
  130. /package/src/components/BlockAction/tests/{BlockAction.unit.test.js → BlockAction.unit.test.jsx} +0 -0
  131. /package/src/components/BlockAction/tests/{BlockActionIndicator.unit.test.js → BlockActionIndicator.unit.test.jsx} +0 -0
  132. /package/src/components/BlockAction/tests/{CloneElementWithClassName.unit.test.js → CloneElementWithClassName.unit.test.jsx} +0 -0
  133. /package/src/components/BodyBanner/tests/{BodyBanner.unit.test.js → BodyBanner.unit.test.jsx} +0 -0
  134. /package/src/components/Breadcrumbs/tests/{BreadcrumbItem.unit.test.js → BreadcrumbItem.unit.test.jsx} +0 -0
  135. /package/src/components/Breadcrumbs/tests/{Breadcrumbs.integration.test.js → Breadcrumbs.integration.test.jsx} +0 -0
  136. /package/src/components/Breadcrumbs/tests/{Breadcrumbs.unit.test.js → Breadcrumbs.unit.test.jsx} +0 -0
  137. /package/src/components/Button/tests/{IconButton.unit.test.js → IconButton.unit.test.jsx} +0 -0
  138. /package/src/components/Buttons/tests/{Buttons.unit.test.js → Buttons.unit.test.jsx} +0 -0
  139. /package/src/components/Card/tests/{Card.unit.test.js → Card.unit.test.jsx} +0 -0
  140. /package/src/components/Card/tests/{CardProductHeader.unit.test.js → CardProductHeader.unit.test.jsx} +0 -0
  141. /package/src/components/Card/tests/{CardSection.unit.test.js → CardSection.unit.test.jsx} +0 -0
  142. /package/src/components/Carousel/tests/{Carousel.unit.test.js → Carousel.unit.test.jsx} +0 -0
  143. /package/src/components/Carousel/tests/{CarouselItem.unit.test.js → CarouselItem.unit.test.jsx} +0 -0
  144. /package/src/components/CarouselHero/tests/{CarouselHero.unit.test.js → CarouselHero.unit.test.jsx} +0 -0
  145. /package/src/components/CarouselHero/tests/{CarouselHeroItem.unit.test.js → CarouselHeroItem.unit.test.jsx} +0 -0
  146. /package/src/components/CarouselPromotions/tests/{CarouselPromotionsItem.unit.test.js → CarouselPromotionsItem.unit.test.jsx} +0 -0
  147. /package/src/components/Cover/tests/{Cover.unit.test.js → Cover.unit.test.jsx} +0 -0
  148. /package/src/components/Divider/tests/{Divider.unit.test.js → Divider.unit.test.jsx} +0 -0
  149. /package/src/components/Dropdown/tests/{Dropdown.unit.test.js → Dropdown.unit.test.jsx} +0 -0
  150. /package/src/components/Expander/tests/{Expander.unit.test.js → Expander.unit.test.jsx} +0 -0
  151. /package/src/components/FeatureAccordion/tests/{FeatureAccordion.unit.test.js → FeatureAccordion.unit.test.jsx} +0 -0
  152. /package/src/components/Footer/tests/{Footer.unit.test.js → Footer.unit.test.jsx} +0 -0
  153. /package/src/components/Forms/Checkbox/tests/{Checkbox.unit.test.js → Checkbox.unit.test.jsx} +0 -0
  154. /package/src/components/Forms/DatePicker/tests/{DatePicker.unit.test.js → DatePicker.unit.test.jsx} +0 -0
  155. /package/src/components/Forms/Field/tests/{Field.unit.test.js → Field.unit.test.jsx} +0 -0
  156. /package/src/components/Forms/Field/tests/{Label.unit.test.js → Label.unit.test.jsx} +0 -0
  157. /package/src/components/Forms/Field/tests/{Messages.unit.test.js → Messages.unit.test.jsx} +0 -0
  158. /package/src/components/Forms/Field/tests/{Tooltip.unit.test.js → Tooltip.unit.test.jsx} +0 -0
  159. /package/src/components/Forms/Fieldset/tests/{Fieldset.unit.test.js → Fieldset.unit.test.jsx} +0 -0
  160. /package/src/components/Forms/Group/tests/{Group.unit.test.js → Group.unit.test.jsx} +0 -0
  161. /package/src/components/Forms/Group/tests/{Item.unit.test.js → Item.unit.test.jsx} +0 -0
  162. /package/src/components/Forms/Hint/tests/{Hint.unit.test.js → Hint.unit.test.jsx} +0 -0
  163. /package/src/components/Forms/InputStepper/tests/{InputStepper.unit.test.js → InputStepper.unit.test.jsx} +0 -0
  164. /package/src/components/Forms/Label/tests/{Label.unit.test.js → Label.unit.test.jsx} +0 -0
  165. /package/src/components/Forms/Message/tests/{Message.unit.test.js → Message.unit.test.jsx} +0 -0
  166. /package/src/components/Forms/Radio/tests/{Radio.unit.test.js → Radio.unit.test.jsx} +0 -0
  167. /package/src/components/Forms/Select/tests/{Select.unit.test.js → Select.unit.test.jsx} +0 -0
  168. /package/src/components/Forms/TextArea/tests/{TextArea.unit.test.js → TextArea.unit.test.jsx} +0 -0
  169. /package/src/components/Forms/TextInput/tests/{TextInput.unit.test.js → TextInput.unit.test.jsx} +0 -0
  170. /package/src/components/Gauge/tests/{Gauge.conformance.test.js → Gauge.conformance.test.jsx} +0 -0
  171. /package/src/components/Gauge/tests/{Gauge.unit.test.js → Gauge.unit.test.jsx} +0 -0
  172. /package/src/components/Grid/tests/{Grid.unit.test.js → Grid.unit.test.jsx} +0 -0
  173. /package/src/components/Hero/tests/{Hero.unit.test.js → Hero.unit.test.jsx} +0 -0
  174. /package/src/components/List/tests/{ClickableControl.unit.test.js → ClickableControl.unit.test.jsx} +0 -0
  175. /package/src/components/List/tests/{List.unit.test.js → List.unit.test.jsx} +0 -0
  176. /package/src/components/List/tests/{ListItem.unit.test.js → ListItem.unit.test.jsx} +0 -0
  177. /package/src/components/Loader/tests/{Loader.unit.test.js → Loader.unit.test.jsx} +0 -0
  178. /package/src/components/Modal/tests/{Modal.unit.test.js → Modal.unit.test.jsx} +0 -0
  179. /package/src/components/Modal/tests/{ModalBody.unit.test.js → ModalBody.unit.test.jsx} +0 -0
  180. /package/src/components/Modal/tests/{ModalCloseButton.unit.test.js → ModalCloseButton.unit.test.jsx} +0 -0
  181. /package/src/components/Modal/tests/{ModalProductHeader.unit.test.js → ModalProductHeader.unit.test.jsx} +0 -0
  182. /package/src/components/Modal/tests/{ModalTitle.unit.test.js → ModalTitle.unit.test.jsx} +0 -0
  183. /package/src/components/Pagination/tests/{Pagination.unit.test.js → Pagination.unit.test.jsx} +0 -0
  184. /package/src/components/Pill/tests/{Pill.unit.test.js → Pill.unit.test.jsx} +0 -0
  185. /package/src/components/Progress/tests/{Progress.unit.test.js → Progress.unit.test.jsx} +0 -0
  186. /package/src/components/Skeleton/tests/{Skeleton.unit.test.js → Skeleton.unit.test.jsx} +0 -0
  187. /package/src/components/Stepbar/tests/{Stepbar.unit.test.js → Stepbar.unit.test.jsx} +0 -0
  188. /package/src/components/Sticker/tests/{Sticker.unit.test.js → Sticker.unit.test.jsx} +0 -0
  189. /package/src/components/Table/tests/{Cell.unit.test.js → Cell.unit.test.jsx} +0 -0
  190. /package/src/components/Table/tests/{Footer.unit.test.js → Footer.unit.test.jsx} +0 -0
  191. /package/src/components/Table/tests/{Header.unit.test.js → Header.unit.test.jsx} +0 -0
  192. /package/src/components/Table/tests/{Row.unit.test.js → Row.unit.test.jsx} +0 -0
  193. /package/src/components/Table/tests/{Rows.unit.test.js → Rows.unit.test.jsx} +0 -0
  194. /package/src/components/Table/tests/{Table.unit.test.js → Table.unit.test.jsx} +0 -0
  195. /package/src/components/Tabs/tests/{Tab.unit.test.js → Tab.unit.test.jsx} +0 -0
  196. /package/src/components/Tabs/tests/{TabPanel.unit.test.js → TabPanel.unit.test.jsx} +0 -0
  197. /package/src/components/Testimonial/tests/{Testimonial.unit.test.js → Testimonial.unit.test.jsx} +0 -0
  198. /package/src/components/Tooltip/tests/{InfoTooltip.unit.test.js → InfoTooltip.unit.test.jsx} +0 -0
@@ -20,14 +20,10 @@
20
20
  * - Tests dark theme context
21
21
  */
22
22
  import { render } from "@testing-library/react";
23
- import { axe, toHaveNoViolations } from "jest-axe";
24
- import "jest-axe/extend-expect";
23
+ import { axe } from "vitest-axe";
25
24
 
26
25
  import { Footer } from "../Footer";
27
26
 
28
- // Extension of expect for axe
29
- expect.extend(toHaveNoViolations);
30
-
31
27
  describe("Footer Conformance Tests", () => {
32
28
  describe("HTML Validity", () => {
33
29
  it("is valid html with default props", () => {
@@ -50,6 +50,42 @@ export default class Autocomplete {
50
50
  }
51
51
  this.config = { ...this.config, ...elementConfig };
52
52
 
53
+ const customInputClassName = this.config.customInputClassName || "";
54
+ const customInputClassTokens = customInputClassName
55
+ .split(/\s+/)
56
+ .filter(Boolean);
57
+
58
+ const hasSearchIcon = customInputClassTokens.includes("input--search-icon");
59
+ const hasSearchIconWithPlaceholder = customInputClassTokens.includes(
60
+ "input--search-icon-with-placeholder",
61
+ );
62
+
63
+ this.config.customInputClassName = customInputClassTokens
64
+ .filter(
65
+ (token) =>
66
+ token !== "input--search-icon" &&
67
+ token !== "input--search-icon-with-placeholder",
68
+ )
69
+ .join(" ");
70
+
71
+ if (hasSearchIcon) {
72
+ this.config.wrapperClassName = [
73
+ this.config.wrapperClassName,
74
+ "autocomplete__wrapper--search-icon",
75
+ ]
76
+ .filter(Boolean)
77
+ .join(" ");
78
+ }
79
+
80
+ if (hasSearchIconWithPlaceholder) {
81
+ this.config.wrapperClassName = [
82
+ this.config.wrapperClassName,
83
+ "autocomplete__wrapper--search-icon-with-placeholder",
84
+ ]
85
+ .filter(Boolean)
86
+ .join(" ");
87
+ }
88
+
53
89
  // Dynamic import to avoid SSR issues
54
90
  const accessibleAutocomplete = (
55
91
  await import("@orangesk/accessible-autocomplete")
@@ -1,8 +1,10 @@
1
1
  @use "./config";
2
2
  @use "./mixins";
3
3
  @use "../../TextInput/styles/mixins" as textMixins;
4
+ @use "../../TextInput/styles/config" as textConfig;
4
5
  @use "../../styles/config" as commonConfig;
5
6
  @use "../../../../styles/tools/generate";
7
+ @use "../../../../styles/tools/convert";
6
8
 
7
9
  @layer components {
8
10
  .autocomplete {
@@ -15,6 +17,46 @@
15
17
 
16
18
  &__wrapper {
17
19
  @include mixins.wrapper();
20
+
21
+ &--search-icon,
22
+ &--search-icon-with-placeholder {
23
+ isolation: isolate;
24
+
25
+ &::before {
26
+ content: "";
27
+ position: absolute;
28
+ top: 50%;
29
+ left: convert.to-rem(8px);
30
+ width: convert.to-rem(20px);
31
+ height: convert.to-rem(20px);
32
+ transform: translateY(-50%);
33
+ background-image: textConfig.$background-image-search-icon;
34
+ background-repeat: no-repeat;
35
+ pointer-events: none;
36
+ z-index: 3;
37
+ }
38
+
39
+ .autocomplete__input {
40
+ background-image: none !important;
41
+ padding-left: convert.to-rem(40px);
42
+ position: relative;
43
+ z-index: 1;
44
+ }
45
+
46
+ .autocomplete__hint {
47
+ padding-left: convert.to-rem(40px);
48
+ }
49
+ }
50
+
51
+ &--search-icon {
52
+ &::before {
53
+ opacity: 0;
54
+ }
55
+
56
+ &:has(.autocomplete__input:not(:focus):placeholder-shown)::before {
57
+ opacity: 1;
58
+ }
59
+ }
18
60
  }
19
61
 
20
62
  &__input {
@@ -1,5 +1,5 @@
1
1
  import { render } from "@testing-library/react";
2
- import { axe } from "jest-axe";
2
+ import { axe } from 'vitest-axe';
3
3
 
4
4
  import { Field } from "../";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { render } from "@testing-library/react";
2
- import { axe } from "jest-axe";
2
+ import { axe } from 'vitest-axe';
3
3
 
4
4
  import { Field } from "../";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { render } from "@testing-library/react";
2
- import { axe } from "jest-axe";
2
+ import { axe } from 'vitest-axe';
3
3
 
4
4
  import { Field } from "..";
5
5
 
@@ -28,7 +28,7 @@ const example = (
28
28
  );
29
29
 
30
30
  beforeAll(() => {
31
- global.DataTransfer = jest.fn(() => ({ files: undefined }));
31
+ global.DataTransfer = vi.fn(() => ({ files: undefined }));
32
32
  });
33
33
 
34
34
  it("is valid html", () => {
@@ -1,5 +1,5 @@
1
1
  import { render } from "@testing-library/react";
2
- import { axe } from "jest-axe";
2
+ import { axe } from 'vitest-axe';
3
3
 
4
4
  import { Button } from "../../../Button";
5
5
  import { Field } from "..";
@@ -1,5 +1,5 @@
1
1
  import { render } from "@testing-library/react";
2
- import { axe } from "jest-axe";
2
+ import { axe } from 'vitest-axe';
3
3
 
4
4
  import { Field } from "../";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { render } from "@testing-library/react";
2
- import { axe } from "jest-axe";
2
+ import { axe } from 'vitest-axe';
3
3
 
4
4
  import { Field } from "../";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { render } from "@testing-library/react";
2
- import { axe } from "jest-axe";
2
+ import { axe } from 'vitest-axe';
3
3
 
4
4
  import { Field } from "../";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { render } from "@testing-library/react";
2
- import { axe } from "jest-axe";
2
+ import { axe } from 'vitest-axe';
3
3
 
4
4
  import { Field } from "../";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { render } from "@testing-library/react";
2
- import { axe } from "jest-axe";
2
+ import { axe } from 'vitest-axe';
3
3
 
4
4
  import { Field } from "../";
5
5
 
@@ -15,8 +15,12 @@ export type TextInputType =
15
15
  | "text"
16
16
  | "url";
17
17
 
18
- export interface TextInputProps
19
- extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
18
+ export type TextInputSearchIcon = "none" | "transient" | "persistent";
19
+
20
+ export interface TextInputProps extends Omit<
21
+ React.InputHTMLAttributes<HTMLInputElement>,
22
+ "size"
23
+ > {
20
24
  /** Input html type. */
21
25
  htmlType?: TextInputType;
22
26
  /** Html id attribute. */
@@ -41,12 +45,15 @@ export interface TextInputProps
41
45
  width?: TextInputWidth;
42
46
  /** Additional CSS classes */
43
47
  className?: string;
48
+ /** Search icon mode. `transient` shows icon only on empty unfocused input, `persistent` keeps it visible with placeholder. */
49
+ searchIcon?: TextInputSearchIcon;
44
50
  }
45
51
 
46
52
  const defaultProps = {
47
53
  htmlType: "text" as TextInputType,
48
54
  size: "default" as TextInputSize,
49
55
  width: "default" as TextInputWidth,
56
+ searchIcon: "none" as TextInputSearchIcon,
50
57
  };
51
58
 
52
59
  const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(
@@ -62,11 +69,15 @@ const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(
62
69
  size = defaultProps.size,
63
70
  htmlType = defaultProps.htmlType,
64
71
  width = defaultProps.width,
72
+ searchIcon = defaultProps.searchIcon,
65
73
  name,
66
74
  ...other
67
75
  },
68
76
  ref,
69
77
  ) => {
78
+ const hasSearchIcon = searchIcon === "transient";
79
+ const hasSearchIconWithPlaceholder = searchIcon === "persistent";
80
+
70
81
  const classes = cx(
71
82
  CLASS_ROOT,
72
83
  {
@@ -80,7 +91,7 @@ const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(
80
91
 
81
92
  const inputName = name || id;
82
93
 
83
- return (
94
+ const inputElement = (
84
95
  <input
85
96
  className={classes}
86
97
  id={id}
@@ -93,6 +104,22 @@ const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(
93
104
  {...other}
94
105
  />
95
106
  );
107
+
108
+ if (hasSearchIcon || hasSearchIconWithPlaceholder) {
109
+ return (
110
+ <span
111
+ className={cx("text-input__wrapper", {
112
+ "text-input__wrapper--search-icon": hasSearchIcon,
113
+ "text-input__wrapper--search-icon-with-placeholder":
114
+ hasSearchIconWithPlaceholder,
115
+ })}
116
+ >
117
+ {inputElement}
118
+ </span>
119
+ );
120
+ }
121
+
122
+ return inputElement;
96
123
  },
97
124
  );
98
125
 
@@ -3,6 +3,68 @@
3
3
  @use "./mixins";
4
4
 
5
5
  @layer components {
6
+ .text-input__wrapper {
7
+ position: relative;
8
+
9
+ &--search-icon,
10
+ &--search-icon-with-placeholder {
11
+ display: inline-block;
12
+
13
+ &:has(> .text-input--3ch) {
14
+ @include mixins.width(3ch);
15
+ }
16
+
17
+ &:has(> .text-input--8ch) {
18
+ @include mixins.width(8ch);
19
+ }
20
+
21
+ &:has(> .text-input--12ch) {
22
+ @include mixins.width(12ch);
23
+ }
24
+
25
+ &:has(> .text-input--fullwidth) {
26
+ @include mixins.width(fullwidth);
27
+ }
28
+
29
+ &:has(
30
+ > .text-input:not(.text-input--3ch):not(.text-input--8ch):not(
31
+ .text-input--12ch
32
+ ):not(.text-input--fullwidth)
33
+ ) {
34
+ @include mixins.width(default);
35
+ }
36
+
37
+ &::before {
38
+ content: "";
39
+ position: absolute;
40
+ top: 50%;
41
+ left: 0.5rem;
42
+ width: 1.25rem;
43
+ height: 1.25rem;
44
+ transform: translateY(-50%);
45
+ background-image: config.$background-image-search-icon;
46
+ background-repeat: no-repeat;
47
+ pointer-events: none;
48
+ z-index: 1;
49
+ }
50
+
51
+ > .text-input {
52
+ background-image: none !important;
53
+ padding-left: 2.5rem;
54
+ }
55
+ }
56
+
57
+ &--search-icon {
58
+ &::before {
59
+ opacity: 0;
60
+ }
61
+
62
+ &:has(> .text-input:not(:focus):placeholder-shown)::before {
63
+ opacity: 1;
64
+ }
65
+ }
66
+ }
67
+
6
68
  .text-input {
7
69
  @include mixins.base();
8
70
  @include mixins.states();
@@ -189,7 +189,7 @@ describe("GridCol complex scenarios", () => {
189
189
  });
190
190
 
191
191
  it("renders with event handlers", () => {
192
- const handleClick = jest.fn();
192
+ const handleClick = vi.fn();
193
193
  const { getByTestId } = render(
194
194
  <GridCol
195
195
  data-testid="test-id"
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { render } from "@testing-library/react";
3
- import { axe } from "jest-axe";
3
+ import { axe } from 'vitest-axe';
4
4
 
5
5
  import { Hero } from "../";
6
6
 
@@ -1,3 +1,4 @@
1
1
  export { SpritePathContext } from "./SpritePathContext";
2
+ export { SpritePathProvider } from "./SpritePathContext";
2
3
  export { Icon } from "./Icon";
3
4
  export { Pictogram } from "./Pictogram";
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { render } from "@testing-library/react";
3
- import { axe } from "jest-axe";
3
+ import { axe } from 'vitest-axe';
4
4
 
5
5
  import { Icon } from "../";
6
6
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @jest-environment jsdom
2
+ * @vitest-environment jsdom
3
3
  */
4
4
 
5
5
  import React from "react";
@@ -1,28 +1,10 @@
1
1
  /**
2
- * @jest-environm it("renders it("light use points to base name, dark use points to name with --dark suffix", () => {
3
- const { container } = render(<Pictogram name="pictogram-skylink" />);
4
- const lightUse = container.querySelector(".icon__use--light");
5
- const darkUse = container.querySelector(".icon__use--dark");
6
-
7
- expect(lightUse?.getAttribute("xlink:href")).toBe(
8
- "/sprite.svg#pictogram-skylink",
9
- );
10
- expect(darkUse?.getAttribute("xlink:href")).toBe(
11
- "/sprite.svg#pictogram-skylink--dark",
12
- );
13
- });nd dark use elements", () => {
14
- const { container } = render(<Pictogram name="pictogram-skylink" />);
15
- const lightUse = container.querySelector(".icon__use--light");
16
- const darkUse = container.querySelector(".icon__use--dark");
17
-
18
- expect(lightUse).toBeInTheDocument();
19
- expect(darkUse).toBeInTheDocument();
20
- });m
2
+ * Unit tests for the Pictogram component.
21
3
  */
22
4
 
23
5
  import React from "react";
24
6
  import { render } from "@testing-library/react";
25
- import { axe } from "jest-axe";
7
+ import { axe } from 'vitest-axe';
26
8
 
27
9
  import { Pictogram } from "../Pictogram";
28
10
 
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  import { render } from "@testing-library/react";
3
- import { axe } from "jest-axe";
3
+ import { axe } from 'vitest-axe';
4
4
 
5
5
  // Mock Tooltip komponent
6
- jest.mock("../../Tooltip", () => ({
6
+ vi.mock("../../Tooltip", () => ({
7
7
  InfoTooltip: ({ children, placement, ...props }) => (
8
8
  <span className="tooltip" data-tooltip-placement={placement} {...props}>
9
9
  <svg className="bold" />
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
3
 
4
4
  // Mock Tooltip komponent
5
- jest.mock('../../Tooltip', () => ({
5
+ vi.mock('../../Tooltip', () => ({
6
6
  InfoTooltip: ({ children, ...props }) => <div data-testid="info-tooltip" {...props}>{children}</div>,
7
7
  }));
8
8
 
@@ -1,7 +1,7 @@
1
1
  import { render } from "@testing-library/react";
2
2
 
3
3
  // Mock Tooltip komponent
4
- jest.mock("../../Tooltip", () => ({
4
+ vi.mock("../../Tooltip", () => ({
5
5
  InfoTooltip: ({ children, placement, className = "", ...props }) => (
6
6
  <span
7
7
  className={`tooltip ${className}`.trim()}
@@ -1,5 +1,5 @@
1
1
  import { render } from "@testing-library/react";
2
- import { axe } from "jest-axe";
2
+ import { axe } from 'vitest-axe';
3
3
 
4
4
  import { Image } from "../";
5
5
 
@@ -2,7 +2,16 @@ import React from "react";
2
2
  import { render, screen } from "@testing-library/react";
3
3
 
4
4
  // Mock breakpoints since SCSS modules don't work in tests
5
- jest.mock("../../../styles/export/breakpoint", () => ({
5
+ vi.mock("../../../styles/export/breakpoint", () => ({
6
+ default: {
7
+ xs: "0px",
8
+ sm: "480px",
9
+ md: "768px",
10
+ lg: "992px",
11
+ xl: "1240px",
12
+ xxl: "1380px",
13
+ xxxl: "1920px",
14
+ },
6
15
  xs: "0px",
7
16
  sm: "480px",
8
17
  md: "768px",
@@ -105,8 +114,8 @@ describe("Image Component", () => {
105
114
 
106
115
  it("renders with correct src attribute for string src", () => {
107
116
  const { container } = render(<Image alt="test" src={singleSource} />);
108
- expect(container.querySelector("img").src).toEqual(
109
- "http://localhost" + singleSource,
117
+ expect(new URL(container.querySelector("img").src).pathname).toEqual(
118
+ singleSource,
110
119
  );
111
120
  });
112
121
 
@@ -19,8 +19,8 @@ Conformance tests for the Link component:
19
19
  - Does not create unnecessary wrapper elements.
20
20
  */
21
21
  import { render, screen } from "@testing-library/react";
22
- import { axe } from "jest-axe";
23
- import "@testing-library/jest-dom";
22
+ import { axe } from 'vitest-axe';
23
+ import "@testing-library/jest-dom/vitest";
24
24
 
25
25
  import { Link } from "../";
26
26
 
@@ -25,14 +25,14 @@ Unit tests for the Link component:
25
25
  - Has correct display name 'Link'.
26
26
  */
27
27
  import { render, screen, fireEvent } from "@testing-library/react";
28
- import "@testing-library/jest-dom";
28
+ import "@testing-library/jest-dom/vitest";
29
29
 
30
30
  import { Link } from "../";
31
31
 
32
32
  // Mock console.warn to test warning messages
33
33
  const originalWarn = console.warn;
34
34
  beforeEach(() => {
35
- console.warn = jest.fn();
35
+ console.warn = vi.fn();
36
36
  });
37
37
 
38
38
  afterEach(() => {
@@ -142,8 +142,8 @@ describe("Link Component", () => {
142
142
  });
143
143
 
144
144
  it("forwards event handlers", () => {
145
- const handleClick = jest.fn();
146
- const handleMouseEnter = jest.fn();
145
+ const handleClick = vi.fn();
146
+ const handleMouseEnter = vi.fn();
147
147
 
148
148
  render(
149
149
  <Link
@@ -242,7 +242,7 @@ describe("Link Component", () => {
242
242
  });
243
243
 
244
244
  it("supports keyboard navigation", () => {
245
- const handleClick = jest.fn();
245
+ const handleClick = vi.fn();
246
246
 
247
247
  render(
248
248
  <Link href="/" onClick={handleClick} data-testid="link">
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
- import { axe } from 'jest-axe';
3
+ import { axe } from 'vitest-axe';
4
4
 
5
5
  import { List, ListItem } from '../';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { render } from "@testing-library/react";
2
- import { axe } from "jest-axe";
2
+ import { axe } from 'vitest-axe';
3
3
 
4
4
  import { Loader } from "../";
5
5
 
@@ -240,6 +240,40 @@ export default class Megamenu {
240
240
  });
241
241
  }
242
242
 
243
+ isInMobilePanel(element: HTMLElement | null) {
244
+ return Boolean(
245
+ element && this.mobilePanels.some((panel) => panel.contains(element)),
246
+ );
247
+ }
248
+
249
+ getFocusRestoreTarget() {
250
+ const lastFocused = this.lastFocusedElement;
251
+ if (
252
+ lastFocused &&
253
+ lastFocused.isConnected &&
254
+ !this.isInMobilePanel(lastFocused)
255
+ ) {
256
+ return lastFocused;
257
+ }
258
+
259
+ const target = this.activeMobileTarget;
260
+ if (target) {
261
+ const matchingTrigger = this.mobileMenuButtons.find(
262
+ (button) =>
263
+ this.getTargetFromElement(button) === target &&
264
+ !this.isInMobilePanel(button),
265
+ );
266
+ if (matchingTrigger) {
267
+ return matchingTrigger;
268
+ }
269
+ }
270
+
271
+ return (
272
+ this.mobileMenuButtons.find((button) => !this.isInMobilePanel(button)) ||
273
+ null
274
+ );
275
+ }
276
+
243
277
  setMobilePanelState(panel: HTMLElement, isOpen: boolean) {
244
278
  panel.classList.toggle(this.config.activeClass, isOpen);
245
279
  panel.setAttribute("aria-hidden", isOpen ? "false" : "true");
@@ -448,14 +482,26 @@ export default class Megamenu {
448
482
  return;
449
483
  }
450
484
 
485
+ // Store the element that opened the menu for focus restoration
486
+ // BEFORE changing panel states, so activeElement is captured correctly.
487
+ this.lastFocusedElement =
488
+ source || (document.activeElement as HTMLElement | null);
489
+
490
+ // Move focus out of any panel about to be hidden to prevent
491
+ // the browser from blocking aria-hidden on a focused descendant.
492
+ const focused = document.activeElement as HTMLElement | null;
493
+ if (
494
+ focused &&
495
+ focused !== panel &&
496
+ this.mobilePanels.some((p) => p !== panel && p.contains(focused))
497
+ ) {
498
+ focused.blur();
499
+ }
500
+
451
501
  // Keep one side panel active at a time.
452
502
  this.mobilePanels.forEach((mobilePanel) => {
453
503
  this.setMobilePanelState(mobilePanel, mobilePanel === panel);
454
504
  });
455
-
456
- // Store the element that opened the menu for focus restoration.
457
- this.lastFocusedElement =
458
- source || (document.activeElement as HTMLElement | null);
459
505
  this.activeMobilePanel = panel;
460
506
  this.activeMobileTarget = target;
461
507
  this.syncMobileButtonState();
@@ -479,6 +525,15 @@ export default class Megamenu {
479
525
  return;
480
526
  }
481
527
 
528
+ // Move focus out of the panel BEFORE setting aria-hidden to prevent
529
+ // the browser from blocking aria-hidden on a focused descendant.
530
+ const restoreTarget = this.getFocusRestoreTarget();
531
+ if (restoreTarget) {
532
+ restoreTarget.focus();
533
+ } else {
534
+ (document.activeElement as HTMLElement | null)?.blur?.();
535
+ }
536
+
482
537
  this.mobilePanels.forEach((panel) => {
483
538
  this.setMobilePanelState(panel, false);
484
539
  });
@@ -487,10 +542,6 @@ export default class Megamenu {
487
542
  this.closeAllAccordions();
488
543
  this.removeFocusTrap();
489
544
 
490
- if (this.isKeyboardUser && this.lastFocusedElement) {
491
- this.lastFocusedElement.focus();
492
- }
493
-
494
545
  this.activeMobilePanel = null;
495
546
  this.activeMobileTarget = null;
496
547
  this.lastFocusedElement = null;