@depict-ai/react-ui 0.0.55 → 0.0.57

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 (29) hide show
  1. package/dist/index.d.ts +129 -20
  2. package/dist/main.js +188 -83
  3. package/dist/module.js +180 -79
  4. package/dist/styles/components/PLP/Buttons.scss +3 -3
  5. package/dist/styles/components/PLP/MorphingSign.scss +2 -3
  6. package/dist/styles/components/PLP/ScrollStatus.scss +1 -1
  7. package/dist/styles/components/PLP/SlidableItems.scss +1 -1
  8. package/dist/styles/components/PLP/SortAndFilter/SortAndFilter.scss +35 -21
  9. package/dist/styles/components/PLP/SortAndFilter/SortAndFilterModal.scss +2 -4
  10. package/dist/styles/components/PLP/SortAndFilter/WhiteSortAndFilter.scss +2 -2
  11. package/dist/styles/components/PLP/index.scss +0 -2
  12. package/dist/styles/components/category/index.scss +3 -3
  13. package/dist/styles/components/search/Autocomplete.scss +97 -18
  14. package/dist/styles/components/search/CategorySuggestions.scss +8 -0
  15. package/dist/styles/components/search/InstantCard.scss +5 -0
  16. package/dist/styles/components/search/InstantResults.scss +2 -0
  17. package/dist/styles/components/search/PreviousSearches.scss +15 -3
  18. package/dist/styles/components/search/QueryInput.scss +19 -7
  19. package/dist/styles/components/search/SearchModal.scss +0 -1
  20. package/dist/styles/components/search/index.scss +3 -3
  21. package/dist/styles/default.css +1 -1
  22. package/dist/styles/helpers/custom_input.scss +38 -6
  23. package/dist/styles/helpers/supports-hover.scss +2 -0
  24. package/dist/styles/helpers/utils.scss +9 -1
  25. package/dist/styles/variables.scss +4 -2
  26. package/dist-server/index.d.ts +12 -2
  27. package/dist-server/main.js +25 -4
  28. package/dist-server/module.js +22 -4
  29. package/package.json +7 -4
@@ -1,7 +1,9 @@
1
1
  @use "sass:string";
2
2
  @use "sass:color";
3
3
  @use "supports-hover";
4
+ @use "sass:map";
4
5
  @use "./utils";
6
+ @use "../components/PLP/Buttons";
5
7
 
6
8
  // https://selleo.com/til/posts/rc5qli22jp-pass-hex-color-to-fill-svg-in-background-url-scss
7
9
  @function escape-url-hex-color($hex_color) {
@@ -28,8 +30,12 @@
28
30
  $hovered-checkbox-checked-background-color,
29
31
  $hovered-checkbox-border,
30
32
  $hovered-radio-border,
31
- $width-and-height
33
+ $input-row-height-goal,
34
+ $largest-border-on-custom-input
32
35
  ) {
36
+ $width-and-height: calc(
37
+ #{$input-row-height-goal} - calc(#{$largest-border-on-custom-input} * 2)
38
+ ); // border is on both sides
33
39
  /* Customize the label (the container) */
34
40
  .input-row {
35
41
  position: relative;
@@ -62,7 +68,17 @@
62
68
  padding: calc(#{$width-and-height} / 2);
63
69
  background-color: $checkbox-background-color;
64
70
  border-radius: $checkbox-border-radius;
65
- border: $checkbox-border;
71
+ &:not(.color) {
72
+ border: $checkbox-border;
73
+ }
74
+ &.color {
75
+ padding: calc(#{$input-row-height-goal} / 2); // doesn't have border so needs more size
76
+ &.outline {
77
+ $border-width: 0.5px;
78
+ padding: calc(calc(#{$input-row-height-goal} - calc(#{$border-width} * 2)) / 2);
79
+ border: $border-width solid #868689;
80
+ }
81
+ }
66
82
  }
67
83
  /* When the checkbox is checked, add a blue background */
68
84
  &:checked ~ .custom-indicator {
@@ -83,9 +99,22 @@
83
99
  width: 12px;
84
100
  height: 10px;
85
101
  }
102
+ &.color:after {
103
+ // Force this to be white for color checkboxes
104
+ background-image: url('data:image/svg+xml;utf8,<svg fill="#{escape-url-hex-color(#fff)}" width="12" height="10" viewBox="0 0 12 10" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.0001L10.6 0.600098L4 7.2001L1.4 4.6001L0 6.0001L4 10.0001L12 2.0001Z" /></svg>');
105
+ }
106
+ &.color.check-dark:after {
107
+ background-image: url('data:image/svg+xml;utf8,<svg fill="#{escape-url-hex-color(#000)}" width="12" height="10" viewBox="0 0 12 10" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.0001L10.6 0.600098L4 7.2001L1.4 4.6001L0 6.0001L4 10.0001L12 2.0001Z" /></svg>');
108
+ }
109
+ &.color.check-multi:after {
110
+ background-image: url('data:image/svg+xml;utf8,<svg fill="#{escape-url-hex-color(#fff)}" width="12" height="10" viewBox="0 0 12 10" xmlns="http://www.w3.org/2000/svg"><path style="stroke:black;stroke-width:1px" d="M12 2.0001L10.6 0.600098L4 7.2001L1.4 4.6001L0 6.0001L4 10.0001L12 2.0001Z" /></svg>');
111
+ }
86
112
  }
87
113
  &:focus-visible ~ .custom-indicator {
88
114
  background-color: $hovered-checkbox-bg;
115
+ &.color {
116
+ filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
117
+ }
89
118
  }
90
119
  &:checked:focus-visible ~ .custom-indicator {
91
120
  background-color: $hovered-checkbox-checked-background-color;
@@ -95,10 +124,12 @@
95
124
  &:hover input[type="checkbox"] {
96
125
  & ~ .custom-indicator {
97
126
  background-color: $hovered-checkbox-bg;
98
- border: $hovered-checkbox-border;
99
- $hovered-border-width: get_border_width($hovered-checkbox-border);
100
- $border-width: get_border_width($checkbox-border);
101
- padding: calc(calc(#{$width-and-height} / 2) - calc(#{$hovered-border-width} - #{$border-width}));
127
+ &:not(.color) {
128
+ border: $hovered-checkbox-border;
129
+ $hovered-border-width: get_border_width($hovered-checkbox-border);
130
+ $border-width: get_border_width($checkbox-border);
131
+ padding: calc(calc(#{$width-and-height} / 2) - calc(#{$hovered-border-width} - #{$border-width}));
132
+ }
102
133
  }
103
134
  &:checked ~ .custom-indicator {
104
135
  background-color: $hovered-checkbox-checked-background-color;
@@ -149,6 +180,7 @@
149
180
  padding: calc(calc(#{$width-and-height} / 2) - calc(#{$hovered-border-width} - #{$border-width}));
150
181
  }
151
182
  }
183
+
152
184
  @content;
153
185
  }
154
186
  }
@@ -1,3 +1,5 @@
1
+ /// Wraps @content in a media query that targets devices that support `:hover` in a non-fallback way.
2
+
1
3
  @mixin supports-hover {
2
4
  @media not all and (hover: none) {
3
5
  @content;
@@ -1,6 +1,9 @@
1
1
  @use "sass:math";
2
2
  @use "sass:color";
3
3
 
4
+ /// This mixin is used for the SortAndFilterModal and the SearchModal to color the backdrop behind the modal
5
+ /// @param {Color} $background [rgba(0, 0, 0, 0.4)] - The background color of the backdrop, keep in mind it should be a transparent color
6
+ /// @param {Number} $z-index - The z-index of the backdrop
4
7
  @mixin modal-backdrop($background: rgba(0, 0, 0, 0.4), $z-index) {
5
8
  position: fixed;
6
9
  background: $background;
@@ -12,6 +15,11 @@
12
15
  touch-action: none;
13
16
  }
14
17
 
18
+ /// This mixin sets the background property to the provided color but darkens it by the provided amounts if it is brighter or darker than 50%
19
+ /// The purpose is to really easily create i.e. hover effects
20
+ /// @param {Color} $normal-background - The color to darken or lighten
21
+ /// @param {Percentage} $darken-factor [10%] - The amount to darken the color by
22
+ /// @param {Percentage} $lighten-factor [10%] - The amount to lighten the color by
15
23
  @mixin highlight-background($normal-background, $darken-factor: 10%, $lighten-factor: 10%) {
16
24
  @if color.lightness($normal-background) >= 50% {
17
25
  background: color.adjust($normal-background, $lightness: -$darken-factor);
@@ -20,8 +28,8 @@
20
28
  }
21
29
  }
22
30
 
23
- // can't use flex gap due to poor compatibility
24
31
  // source of below: https://gist.github.com/mashirozx/c0691c3b8ed3f1f63722883649d41c18
32
+ /// We can't (or couldn't) use flex gap due to poor compatibility, this mixin is used instead of it and generates margins. We recommend reading the source code and applying thinking to the margin situation that will result.
25
33
  @mixin _flex-gap($gap, $row: true, $use_nth_child: true) {
26
34
  $margin: math.div($gap, 2);
27
35
  $transform: -$margin;
@@ -15,6 +15,9 @@ $base-z-index: 5000;
15
15
  /// The z-index of the search page
16
16
  $search-page-base-z-index: 1;
17
17
  /// The border radius to use. This is used in many places and not often exactly this value. Sometimes a multiple is used and if it's 0 then everything will be square
18
+ ///
19
+ /// Does re-assigning this variable with, for example, `PLP.$border-radius: 0` or `variables.$border-radius: 0` give an error in your IDE?
20
+ /// Please upvote the Jetbrains issue (and maybe also comment why this is an issue for you) to get it fixed in WebStorm: https://youtrack.jetbrains.com/issue/WEB-46500
18
21
  $border-radius: 4px;
19
22
 
20
23
  /// Makes the PLP.all-components mixin use WhiteSortAndFilter instead of SortAndFilter
@@ -33,9 +36,8 @@ $g-instant-card: (
33
36
  );
34
37
 
35
38
  /// Configure the styling - right now only works for three variables.
36
- /// We'll probably change how to customise styling to using maps instead in the future.
39
+ /// This is subject to change.
37
40
  ///
38
- /// Sorry for the confusion
39
41
  /// @param {String} $instant-card-sales-price-color [null]
40
42
  /// Determines the color of the sales price in the Instant Card component
41
43
  /// @param {Boolean} $instant-card-show-price [null]
@@ -1,11 +1,21 @@
1
- export const version = "0.0.55";
1
+ type OpenModal = () => void;
2
+ interface UseSearchModalReturn {
3
+ open: OpenModal;
4
+ }
5
+ export const version = "0.0.57";
2
6
  export function DepictProvider(props: any): any;
3
7
  export function DepictSearchField(): any;
4
8
  export function DepictSearchPage(): any;
5
9
  export function DepictCategoryPage(): any;
6
- export function DepictSearchHeader(): import("react").DetailedReactHTMLElement<{
10
+ export function BreadCrumbs(): any;
11
+ export function QuickLinks(): any;
12
+ export function DepictAligner(): import("react").DetailedReactHTMLElement<{
7
13
  className: string;
14
+ style: {
15
+ height: string;
16
+ };
8
17
  }, HTMLElement>;
9
18
  export function ImagePlaceHolder(): any;
10
19
  export function TextPlaceholder(): any;
11
20
  export function openModal(): void;
21
+ export function useDepictSearchModal(): UseSearchModalReturn;
@@ -9,14 +9,17 @@ $parcel$export(module.exports, "DepictProvider", () => $41e7e5d85b5e0d49$export$
9
9
  $parcel$export(module.exports, "DepictSearchField", () => $41e7e5d85b5e0d49$export$4c0fa313cf50c4ad);
10
10
  $parcel$export(module.exports, "DepictSearchPage", () => $41e7e5d85b5e0d49$export$210723f5a54a7028);
11
11
  $parcel$export(module.exports, "DepictCategoryPage", () => $41e7e5d85b5e0d49$export$d87c61cecb2edf0d);
12
- $parcel$export(module.exports, "DepictSearchHeader", () => $41e7e5d85b5e0d49$export$cbcd1ecdb41b1d0a);
12
+ $parcel$export(module.exports, "BreadCrumbs", () => $41e7e5d85b5e0d49$export$5646050d516e06bc);
13
+ $parcel$export(module.exports, "QuickLinks", () => $41e7e5d85b5e0d49$export$466cdc317043f6cb);
14
+ $parcel$export(module.exports, "DepictAligner", () => $41e7e5d85b5e0d49$export$3f4580d6398c5027);
13
15
  $parcel$export(module.exports, "ImagePlaceHolder", () => $41e7e5d85b5e0d49$export$ecf150517ad2aa0);
14
16
  $parcel$export(module.exports, "TextPlaceholder", () => $41e7e5d85b5e0d49$export$89c6019e4baa40b1);
15
17
  $parcel$export(module.exports, "openModal", () => $41e7e5d85b5e0d49$export$a7f6cffb6b8ba11c);
18
+ $parcel$export(module.exports, "useDepictSearchModal", () => $41e7e5d85b5e0d49$export$cc1e9aaf280afdcb);
16
19
  $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
17
20
 
18
21
 
19
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.55";
22
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.57";
20
23
 
21
24
 
22
25
  function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
@@ -37,9 +40,22 @@ function $41e7e5d85b5e0d49$export$d87c61cecb2edf0d() {
37
40
  children: []
38
41
  });
39
42
  }
40
- function $41e7e5d85b5e0d49$export$cbcd1ecdb41b1d0a() {
43
+ function $41e7e5d85b5e0d49$export$5646050d516e06bc() {
44
+ return (0, $5efvh$reactjsxruntime.jsx)("div", {
45
+ children: []
46
+ });
47
+ }
48
+ function $41e7e5d85b5e0d49$export$466cdc317043f6cb() {
49
+ return (0, $5efvh$reactjsxruntime.jsx)("div", {
50
+ children: []
51
+ });
52
+ }
53
+ function $41e7e5d85b5e0d49$export$3f4580d6398c5027() {
41
54
  return (0, $5efvh$react.createElement)("div", {
42
- className: "depict aligner"
55
+ className: "depict aligner",
56
+ style: {
57
+ height: "100%"
58
+ }
43
59
  });
44
60
  }
45
61
  function $41e7e5d85b5e0d49$export$ecf150517ad2aa0() {
@@ -53,5 +69,10 @@ function $41e7e5d85b5e0d49$export$89c6019e4baa40b1() {
53
69
  });
54
70
  }
55
71
  function $41e7e5d85b5e0d49$export$a7f6cffb6b8ba11c() {}
72
+ function $41e7e5d85b5e0d49$export$cc1e9aaf280afdcb() {
73
+ return {
74
+ open: ()=>{}
75
+ };
76
+ }
56
77
 
57
78
 
@@ -3,7 +3,7 @@ import {jsx as $1RlIW$jsx} from "react/jsx-runtime";
3
3
 
4
4
 
5
5
 
6
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.55";
6
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.57";
7
7
 
8
8
 
9
9
  function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
@@ -24,9 +24,22 @@ function $2b1fdeb83610500f$export$d87c61cecb2edf0d() {
24
24
  children: []
25
25
  });
26
26
  }
27
- function $2b1fdeb83610500f$export$cbcd1ecdb41b1d0a() {
27
+ function $2b1fdeb83610500f$export$5646050d516e06bc() {
28
+ return (0, $1RlIW$jsx)("div", {
29
+ children: []
30
+ });
31
+ }
32
+ function $2b1fdeb83610500f$export$466cdc317043f6cb() {
33
+ return (0, $1RlIW$jsx)("div", {
34
+ children: []
35
+ });
36
+ }
37
+ function $2b1fdeb83610500f$export$3f4580d6398c5027() {
28
38
  return (0, $1RlIW$createElement)("div", {
29
- className: "depict aligner"
39
+ className: "depict aligner",
40
+ style: {
41
+ height: "100%"
42
+ }
30
43
  });
31
44
  }
32
45
  function $2b1fdeb83610500f$export$ecf150517ad2aa0() {
@@ -40,6 +53,11 @@ function $2b1fdeb83610500f$export$89c6019e4baa40b1() {
40
53
  });
41
54
  }
42
55
  function $2b1fdeb83610500f$export$a7f6cffb6b8ba11c() {}
56
+ function $2b1fdeb83610500f$export$cc1e9aaf280afdcb() {
57
+ return {
58
+ open: ()=>{}
59
+ };
60
+ }
43
61
 
44
62
 
45
- export {$2b1fdeb83610500f$export$9fac37a9c21c2f3b as DepictProvider, $2b1fdeb83610500f$export$4c0fa313cf50c4ad as DepictSearchField, $2b1fdeb83610500f$export$210723f5a54a7028 as DepictSearchPage, $2b1fdeb83610500f$export$d87c61cecb2edf0d as DepictCategoryPage, $2b1fdeb83610500f$export$cbcd1ecdb41b1d0a as DepictSearchHeader, $2b1fdeb83610500f$export$ecf150517ad2aa0 as ImagePlaceHolder, $2b1fdeb83610500f$export$89c6019e4baa40b1 as TextPlaceholder, $2b1fdeb83610500f$export$a7f6cffb6b8ba11c as openModal, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version};
63
+ export {$2b1fdeb83610500f$export$9fac37a9c21c2f3b as DepictProvider, $2b1fdeb83610500f$export$4c0fa313cf50c4ad as DepictSearchField, $2b1fdeb83610500f$export$210723f5a54a7028 as DepictSearchPage, $2b1fdeb83610500f$export$d87c61cecb2edf0d as DepictCategoryPage, $2b1fdeb83610500f$export$5646050d516e06bc as BreadCrumbs, $2b1fdeb83610500f$export$466cdc317043f6cb as QuickLinks, $2b1fdeb83610500f$export$3f4580d6398c5027 as DepictAligner, $2b1fdeb83610500f$export$ecf150517ad2aa0 as ImagePlaceHolder, $2b1fdeb83610500f$export$89c6019e4baa40b1 as TextPlaceholder, $2b1fdeb83610500f$export$a7f6cffb6b8ba11c as openModal, $2b1fdeb83610500f$export$cc1e9aaf280afdcb as useDepictSearchModal, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/react-ui",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -90,8 +90,8 @@
90
90
  "/locales"
91
91
  ],
92
92
  "dependencies": {
93
- "@depict-ai/ui": "^0.0.32",
94
- "@depict-ai/utilishared": "^0.0.30",
93
+ "@depict-ai/ui": "^0.0.34",
94
+ "@depict-ai/utilishared": "^0.0.32",
95
95
  "solid-js": "^1.6.2"
96
96
  },
97
97
  "peerDependencies": {
@@ -109,17 +109,20 @@
109
109
  "@parcel/babel-preset-env": "latest",
110
110
  "@parcel/resolver-default": "^2.8.0",
111
111
  "@parcel/transformer-sass": "latest",
112
+ "@types/jest": "^29.2.6",
112
113
  "@types/node": "^18.11.11",
113
114
  "@types/react": "^18.0.26",
114
115
  "@types/react-dom": "^18.0.10",
115
116
  "babel-preset-solid": "latest",
116
117
  "jest": "^29.3.1",
118
+ "jest-environment-jsdom": "^29.3.1",
117
119
  "jest-haste-map": "^29.3.1",
118
120
  "jest-resolve": "^29.3.1",
119
121
  "next": "^13.1.1",
120
122
  "parcel": "latest",
121
123
  "react": "^18.2.0",
122
124
  "react-dom": "^18.2.0",
123
- "react-router": "^6.6.1"
125
+ "react-router": "^6.6.1",
126
+ "ts-jest": "^29.0.5"
124
127
  }
125
128
  }