@depict-ai/react-ui 0.0.76 → 0.0.78

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 (42) hide show
  1. package/README.md +3 -0
  2. package/dist/index.d.ts +3 -3
  3. package/dist/main.js +1 -1
  4. package/dist/module.js +1 -1
  5. package/dist/styles/index.scss +1 -54
  6. package/dist/styles/plain-css-fallback-styling.css +1 -0
  7. package/dist-server/index.d.ts +1 -1
  8. package/dist-server/main.js +1 -1
  9. package/dist-server/module.js +1 -1
  10. package/package.json +18 -11
  11. package/dist/styles/components/PLP/Buttons.scss +0 -152
  12. package/dist/styles/components/PLP/MorphingSign.scss +0 -32
  13. package/dist/styles/components/PLP/PLPResults.scss +0 -26
  14. package/dist/styles/components/PLP/ProductListingPage.scss +0 -165
  15. package/dist/styles/components/PLP/ScrollStatus.scss +0 -28
  16. package/dist/styles/components/PLP/SelectedFilters.scss +0 -81
  17. package/dist/styles/components/PLP/SlidableItems.scss +0 -118
  18. package/dist/styles/components/PLP/SortAndFilter/FloatingButtons.scss +0 -76
  19. package/dist/styles/components/PLP/SortAndFilter/SortAndFilter.scss +0 -802
  20. package/dist/styles/components/PLP/SortAndFilter/SortAndFilterModal.scss +0 -157
  21. package/dist/styles/components/PLP/Toast.scss +0 -61
  22. package/dist/styles/components/PLP/index.scss +0 -15
  23. package/dist/styles/components/category/BreadCrumbs.scss +0 -25
  24. package/dist/styles/components/category/CategoryTitle.scss +0 -33
  25. package/dist/styles/components/category/QuickLinks.scss +0 -57
  26. package/dist/styles/components/category/index.scss +0 -7
  27. package/dist/styles/components/search/Autocomplete.scss +0 -182
  28. package/dist/styles/components/search/CategorySuggestions.scss +0 -53
  29. package/dist/styles/components/search/InstantCard.scss +0 -119
  30. package/dist/styles/components/search/InstantResults.scss +0 -12
  31. package/dist/styles/components/search/PreviousSearches.scss +0 -83
  32. package/dist/styles/components/search/SearchField.scss +0 -141
  33. package/dist/styles/components/search/SearchModal.scss +0 -86
  34. package/dist/styles/components/search/SearchRecommendations.scss +0 -28
  35. package/dist/styles/components/search/ShowingResultsFor.scss +0 -7
  36. package/dist/styles/components/search/index.scss +0 -12
  37. package/dist/styles/default.css +0 -1
  38. package/dist/styles/helpers/custom_input.scss +0 -194
  39. package/dist/styles/helpers/supports-hover.scss +0 -7
  40. package/dist/styles/helpers/utils.scss +0 -96
  41. package/dist/styles/package.json +0 -30
  42. package/dist/styles/variables.scss +0 -295
@@ -1,194 +0,0 @@
1
- @use "sass:string";
2
- @use "sass:color";
3
- @use "supports-hover";
4
- @use "sass:map";
5
- @use "utils";
6
- @use "../components/PLP/Buttons";
7
-
8
- // https://selleo.com/til/posts/rc5qli22jp-pass-hex-color-to-fill-svg-in-background-url-scss
9
- @function escape-url-hex-color($hex_color) {
10
- $ie-color-string: color.ie-hex-str($hex_color);
11
- $string: string.quote($ie-color-string);
12
- $color: string.slice($string, 4);
13
- @return "%23" + $color;
14
- }
15
-
16
- @mixin custom_input(
17
- $checkbox-background-color,
18
- $checkbox-checked-background-color,
19
- $checkbox-checkmark-color,
20
- $checkbox-border-radius,
21
- $checkbox-border,
22
- $checkbox-left-offset,
23
- $checkbox-top-offset,
24
- $radio-border,
25
- $radio-background-color,
26
- $radio-selected-dot-color,
27
- $radio-selected-dot-size,
28
- $radio-selected-offset,
29
- $hovered-checkbox-bg,
30
- $hovered-checkbox-checked-background-color,
31
- $hovered-checkbox-border,
32
- $hovered-radio-border,
33
- $input-row-height,
34
- $largest-border-on-custom-input
35
- ) {
36
- $width-and-height: calc(
37
- #{$input-row-height} - calc(#{$largest-border-on-custom-input} * 2)
38
- ); // border is on both sides
39
- /* Customize the label (the container) */
40
- .input-row {
41
- position: relative;
42
- cursor: pointer;
43
-
44
- .custom-indicator {
45
- position: relative;
46
- // space to text
47
- margin-right: 10px;
48
- }
49
-
50
- /* Hide the browser's default radio/checkbox input element */
51
- input {
52
- position: absolute;
53
- opacity: 0;
54
- cursor: pointer;
55
- height: 0;
56
- width: 0;
57
- }
58
- /* Create the custom-indicator (hidden when not checked) */
59
- .custom-indicator:after {
60
- content: "";
61
- position: absolute;
62
- display: none;
63
- }
64
-
65
- /* Create a custom checkbox */
66
- input[type="checkbox"] {
67
- & ~ .custom-indicator {
68
- padding: calc(#{$width-and-height} / 2);
69
- background-color: $checkbox-background-color;
70
- border-radius: $checkbox-border-radius;
71
- &:not(.color) {
72
- border: $checkbox-border;
73
- }
74
- &.color {
75
- padding: calc(#{$input-row-height} / 2); // doesn't have border so needs more size
76
- &.outline {
77
- $border-width: 0.5px;
78
- padding: calc(calc(#{$input-row-height} - calc(#{$border-width} * 2)) / 2);
79
- border: $border-width solid #868689;
80
- }
81
- }
82
- }
83
- /* When the checkbox is checked, add a blue background */
84
- &:checked ~ .custom-indicator {
85
- // background-color: #000;
86
- background-color: $checkbox-checked-background-color;
87
- &:after {
88
- background-image: url('data:image/svg+xml;utf8,<svg fill="#{escape-url-hex-color($checkbox-checkmark-color)}" 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>');
89
- fill: #fff;
90
- color: #fff;
91
- position: absolute;
92
- top: calc(50% + $checkbox-top-offset);
93
- left: calc(50% + $checkbox-left-offset);
94
- transform: translate(-50%, -50%);
95
-
96
- display: block; // Show the custom-indicator when checked
97
-
98
- /* Style the custom-indicator */
99
- width: 12px;
100
- height: 10px;
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
- }
112
- }
113
- &:focus-visible ~ .custom-indicator {
114
- background-color: $hovered-checkbox-bg;
115
- &.color {
116
- filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
117
- }
118
- }
119
- &:checked:focus-visible ~ .custom-indicator {
120
- background-color: $hovered-checkbox-checked-background-color;
121
- }
122
- }
123
- @include supports-hover.supports-hover() {
124
- &:hover input[type="checkbox"] {
125
- & ~ .custom-indicator {
126
- background-color: $hovered-checkbox-bg;
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
- }
133
- }
134
- &:checked ~ .custom-indicator {
135
- background-color: $hovered-checkbox-checked-background-color;
136
- }
137
- }
138
- }
139
-
140
- /* Create a custom radio button */
141
- input[type="radio"] {
142
- ~ .custom-indicator {
143
- padding: calc(#{$width-and-height} / 2);
144
- border-radius: 50%;
145
- border: $radio-border;
146
- background-color: $radio-background-color;
147
- }
148
- &:checked ~ .custom-indicator {
149
- background-color: transparent;
150
- &:after {
151
- display: block; // Show the custom-indicator when checked
152
-
153
- /* Style the custom-indicator */
154
- width: $radio-selected-dot-size;
155
- height: $radio-selected-dot-size;
156
- left: calc(50% + $radio-selected-offset);
157
- top: calc(50% + $radio-selected-offset);
158
- transform: translate(-50%, -50%);
159
-
160
- // width: 8px;
161
- // height: 8px;
162
- // top: 6px;
163
- // left: 6px;
164
- background-color: $radio-selected-dot-color;
165
- border-radius: 50%;
166
- }
167
- }
168
- &:focus-visible ~ .custom-indicator {
169
- @include utils.highlight-background($radio-background-color);
170
- }
171
- &:checked:focus-visible ~ .custom-indicator:after {
172
- @include utils.highlight-background($radio-selected-dot-color, 15%, 25%);
173
- }
174
- }
175
- @include supports-hover.supports-hover() {
176
- &:hover input[type="radio"] ~ .custom-indicator {
177
- border: $hovered-radio-border;
178
- $hovered-border-width: get_border_width($hovered-radio-border);
179
- $border-width: get_border_width($radio-border);
180
- padding: calc(calc(#{$width-and-height} / 2) - calc(#{$hovered-border-width} - #{$border-width}));
181
- }
182
- }
183
-
184
- @content;
185
- }
186
- }
187
-
188
- @function get_border_width($border-declaration) {
189
- @if $border-declaration == "none" or $border-declaration == "unset" {
190
- @return 0px;
191
- } @else {
192
- @return nth($border-declaration, 1);
193
- }
194
- }
@@ -1,7 +0,0 @@
1
- /// Wraps @content in a media query that targets devices that support `:hover` in a non-fallback way.
2
-
3
- @mixin supports-hover {
4
- @media not all and (hover: none) {
5
- @content;
6
- }
7
- }
@@ -1,96 +0,0 @@
1
- @use "sass:math";
2
- @use "sass:color";
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
7
- @mixin modal-backdrop($background: rgba(0, 0, 0, 0.4), $z-index) {
8
- position: fixed;
9
- background: $background;
10
- z-index: $z-index;
11
- left: 0;
12
- right: 0;
13
- bottom: 0;
14
- top: 0;
15
- touch-action: none;
16
- }
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
23
- /// @param {Percentage} $saturation-factor [$darken-factor] - The amount to decrease saturation by when the color is darkened
24
- @mixin highlight-background(
25
- $normal-background,
26
- $darken-factor: 10%,
27
- $lighten-factor: 10%,
28
- $saturation-factor: $darken-factor
29
- ) {
30
- @if color.lightness($normal-background) >= 50% {
31
- background: color.adjust($normal-background, $lightness: -$darken-factor, $saturation: -$saturation-factor);
32
- } @else {
33
- background: color.adjust($normal-background, $lightness: $lighten-factor);
34
- }
35
- }
36
-
37
- // source of below: https://gist.github.com/mashirozx/c0691c3b8ed3f1f63722883649d41c18
38
- /// 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.
39
- @mixin _flex-gap($gap, $row: true, $use_nth_child: true) {
40
- $margin: math.div($gap, 2);
41
- $transform: -$margin;
42
-
43
- @if $use_nth_child {
44
- > * {
45
- @if $row {
46
- // modified to be worse by Daniel (probable broke row-reverse and order property) due to him being opinionated on avoiding negative margins when possible
47
- &:not(:first-child) {
48
- margin-left: $margin;
49
- }
50
- &:not(:last-child) {
51
- margin-right: $margin;
52
- }
53
- } @else {
54
- &:not(:first-child) {
55
- margin-top: $margin;
56
- }
57
- &:not(:last-child) {
58
- margin-bottom: $margin;
59
- }
60
- }
61
- }
62
- } @else {
63
- @if $row {
64
- margin-left: $transform;
65
- margin-right: $transform;
66
- } @else {
67
- margin-top: $transform;
68
- margin-bottom: $transform;
69
- }
70
- > * {
71
- @if $row {
72
- margin-left: $margin;
73
- margin-right: $margin;
74
- } @else {
75
- margin-top: $margin;
76
- margin-bottom: $margin;
77
- }
78
- }
79
- }
80
- }
81
-
82
- @mixin flex-gap($gap, $flex-flow: "row nowrap") {
83
- @if $flex-flow== "row nowrap" or $flex-flow== "row-reverse nowrap" {
84
- @include _flex-gap($gap, true);
85
- } @else if $flex-flow== "column nowrap" or $flex-flow== "column-reverse nowrap" {
86
- @include _flex-gap($gap, false);
87
- } @else if $flex-flow== "row wrap" or $flex-flow== "row-reverse wrap" {
88
- @include _flex-gap($gap, true, false);
89
- @include _flex-gap($gap, false, false);
90
- } @else if $flex-flow== "column wrap" or $flex-flow== "column-reverse wrap" {
91
- @include _flex-gap($gap, true, false);
92
- @include _flex-gap($gap, false, false);
93
- } @else {
94
- @error "The second paramater $flex-flow is set to be '#{$flex-flow}', which is illegal.";
95
- }
96
- }
@@ -1,30 +0,0 @@
1
- {
2
- "name": "@depict-ai/plp-styling",
3
- "packageManager": "yarn@3.2.2",
4
- "scripts": {
5
- "publish": "yarn npm publish"
6
- },
7
- "files": [
8
- "components/",
9
- "helpers/",
10
- "index.scss",
11
- "variables.scss"
12
- ],
13
- "version": "0.0.15",
14
- "description": "Depict PLP UI SCSS Styling",
15
- "author": "Daniel Troger <daniel@depict.ai>",
16
- "contributors": [
17
- "Fabian Hedin <fabian@depict.ai>",
18
- "Sverre Westerlund <sverre@depict.ai>",
19
- "Joakim Olsson <joakim.olsson@depict.ai>",
20
- "Arnaud Cortisse <arnaud@depict.ai>",
21
- "Carl Riis <carl@depict.ai>"
22
- ],
23
- "license": "MIT",
24
- "devDependencies": {
25
- "sassdoc": "^2.7.4"
26
- },
27
- "publishConfig": {
28
- "access": "public"
29
- }
30
- }
@@ -1,295 +0,0 @@
1
- @use "sass:map";
2
- @use "sass:color";
3
-
4
- /// Deep merged two maps and gives you the value of a key in the merged map.
5
- /// @param {Map} $map - The base map, whose keys will be overridden by the keys in $map2.
6
- /// @param {Map} $map2 - The map whose keys will override the keys in $map.
7
- /// @param {String} $key - The key whose value you want to get from the merged map.
8
- @function get-merged($map, $map2, $key) {
9
- @return map.get(map.deep-merge($map, $map2), $key);
10
- }
11
-
12
- /// Set this to the background color of your page. It's needed for example for some things that fade into the background color (that are over another element).
13
- $page-background-color: white !default;
14
-
15
- /// The colors to be used across the UI
16
- /// We're trying to avoid getting colours from this map directly in style declarations, instead there's a layer of abstraction on top of this map.
17
- /// That is because different things in the UI need to have different colours from the palette, depending on the palette.
18
- /// See the maps below for text and icon colours, border colors and background colors.
19
- $base-colors: () !default;
20
- $base-colors-defaults: (
21
- 1000: #000,
22
- 800: #0f0f0f,
23
- 600: #333335,
24
- 500: #868689,
25
- 400: #cbcbcc,
26
- 300: #e4e4e5,
27
- 200: #f3f3f5,
28
- 100: #fafafc,
29
- 0: #fff,
30
- );
31
-
32
- $text-icon-colors: () !default;
33
- $text-icon-colors-defaults: (
34
- "base": (
35
- "default": get-merged($base-colors-defaults, $base-colors, 800),
36
- "hover": get-merged($base-colors-defaults, $base-colors, 600),
37
- "pressed": get-merged($base-colors-defaults, $base-colors, 1000),
38
- "disabled": get-merged($base-colors-defaults, $base-colors, 400),
39
- ),
40
- "neutral": (
41
- "default": get-merged($base-colors-defaults, $base-colors, 600),
42
- "hover": get-merged($base-colors-defaults, $base-colors, 800),
43
- "pressed": get-merged($base-colors-defaults, $base-colors, 1000),
44
- "disabled": get-merged($base-colors-defaults, $base-colors, 400),
45
- ),
46
- "subtle": (
47
- "default": get-merged($base-colors-defaults, $base-colors, 500),
48
- "hover": get-merged($base-colors-defaults, $base-colors, 600),
49
- "pressed": get-merged($base-colors-defaults, $base-colors, 800),
50
- "disabled": get-merged($base-colors-defaults, $base-colors, 400),
51
- ),
52
- "inverse": (
53
- "default": get-merged($base-colors-defaults, $base-colors, 0),
54
- "hover": get-merged($base-colors-defaults, $base-colors, 200),
55
- "pressed": get-merged($base-colors-defaults, $base-colors, 300),
56
- "disabled": get-merged($base-colors-defaults, $base-colors, 500),
57
- ),
58
- );
59
-
60
- $border-colors: () !default;
61
- $border-colors-defaults: (
62
- "base": (
63
- "default": get-merged($base-colors-defaults, $base-colors, 800),
64
- "hover": get-merged($base-colors-defaults, $base-colors, 600),
65
- "pressed": get-merged($base-colors-defaults, $base-colors, 1000),
66
- "disabled": get-merged($base-colors-defaults, $base-colors, 400),
67
- ),
68
- "neutral": (
69
- "default": get-merged($base-colors-defaults, $base-colors, 400),
70
- "hover": get-merged($base-colors-defaults, $base-colors, 500),
71
- "pressed": get-merged($base-colors-defaults, $base-colors, 700),
72
- "disabled": get-merged($base-colors-defaults, $base-colors, 300),
73
- ),
74
- "subtle": (
75
- "default": get-merged($base-colors-defaults, $base-colors, 300),
76
- "hover": get-merged($base-colors-defaults, $base-colors, 400),
77
- "pressed": get-merged($base-colors-defaults, $base-colors, 500),
78
- "disabled": get-merged($base-colors-defaults, $base-colors, 200),
79
- ),
80
- "inverse": (
81
- "default": get-merged($base-colors-defaults, $base-colors, 0),
82
- "hover": get-merged($base-colors-defaults, $base-colors, 400),
83
- "pressed": get-merged($base-colors-defaults, $base-colors, 300),
84
- "disabled": get-merged($base-colors-defaults, $base-colors, 500),
85
- ),
86
- );
87
-
88
- $background-colors: () !default;
89
- $background-colors-defaults: (
90
- "base": (
91
- "default": get-merged($base-colors-defaults, $base-colors, 0),
92
- "hover": get-merged($base-colors-defaults, $base-colors, 200),
93
- "pressed": get-merged($base-colors-defaults, $base-colors, 300),
94
- "disabled": get-merged($base-colors-defaults, $base-colors, 100),
95
- ),
96
- "neutral": (
97
- "default": get-merged($base-colors-defaults, $base-colors, 300),
98
- "hover": get-merged($base-colors-defaults, $base-colors, 400),
99
- "pressed": get-merged($base-colors-defaults, $base-colors, 200),
100
- "disabled": get-merged($base-colors-defaults, $base-colors, 100),
101
- ),
102
- "subtle": (
103
- "default": get-merged($base-colors-defaults, $base-colors, 200),
104
- "hover": get-merged($base-colors-defaults, $base-colors, 300),
105
- "pressed": get-merged($base-colors-defaults, $base-colors, 400),
106
- "disabled": get-merged($base-colors-defaults, $base-colors, 100),
107
- ),
108
- "inverse": (
109
- "default": get-merged($base-colors-defaults, $base-colors, 800),
110
- "hover": get-merged($base-colors-defaults, $base-colors, 600),
111
- "pressed": get-merged($base-colors-defaults, $base-colors, 1000),
112
- "disabled": get-merged($base-colors-defaults, $base-colors, 400),
113
- ),
114
- );
115
-
116
- /// What font weights to use for the different font weights. The main reason to allow customisation for this is to allow for custom fonts that don't have the same font weights as the default font. So for example if your font doesn't have a "light" (300) font weight then you can set it to 400 and it will use the "regular" (400) font weight instead.
117
- /// @prop {Number} font-weights.300 [300] - The font weight to use for "light" (300) text
118
- /// @prop {Number} font-weights.400 [400] - The font weight to use for "regular" (400) text
119
- /// @prop {Number} font-weights.500 [500] - The font weight to use for "medium" (500) text
120
- /// @prop {Number} font-weights.600 [600] - The font weight to use for "semibold" (600) text
121
- /// @prop {Number} font-weights.700 [700] - The font weight to use for "bold" (700) text
122
- $font-weights: () !default;
123
- $font-weights-defaults: (
124
- 300: 300,
125
- 400: 400,
126
- 500: 500,
127
- 600: 600,
128
- 700: 700,
129
- );
130
-
131
- /// The base z-index of the modal
132
- $base-z-index: 5000 !default;
133
- /// The z-index of the search page
134
- $search-page-base-z-index: 1 !default;
135
- /// 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
136
- $border-radius: 4px !default;
137
-
138
- // The color of the progress bar below the toast that shows when it will auto-close
139
- $toast-progress-bar-color: map.get(
140
- get-merged($text-icon-colors-defaults, $text-icon-colors, "base"),
141
- "default"
142
- ) !default;
143
-
144
- /// Sometimes text is all uppercase in the UI. This is the default text transform used to do that that. For example, if you don't want uppercase text, you can set this to `none`
145
- $uppercase-text-transform: uppercase !default;
146
-
147
- /// Configuration for the filters on the right
148
- /// @prop {Number with size unit} filters-configuration.spacing-between-input-rows [10px] - How much space should be between the input rows. Input row being a checkbox/radio button and its label.
149
- /// @prop {Number with size unit} filters-configuration.input-row-height-goal [21px] - How high an "input row" should try to be. Input row being a checkbox/radio button and its label. If this is smaller than the text size, it will be ignored.
150
- $filters-configuration: () !default;
151
- $filters-configuration-defaults: (
152
- "spacing-between-input-rows": 10px,
153
- "input-row-height-goal": 21px,
154
- );
155
-
156
- /// Configuration for the search modal.
157
- /// @prop {Number with size unit} search-modal.max-width [800px] - The max width of the modal. Also used for the max width of SearchField on the search page.
158
- /// @prop {Boolean} search-modal.top-snapping [true] - If the modal should snap to the top at certain screen sizes, only recommended to disable if you take care of this via JS
159
- $search-modal: () !default;
160
- $search-modal-defaults: (
161
- "max-width": 800px,
162
- "top-snapping": true,
163
- );
164
-
165
- /// Configuration for the buttons that show up when scrolling up after not being too close to the top on mobile
166
- /// @prop {Number with size unit} floating-buttons.bottom-distance [12px] - The distance from the bottom of the buttons to the bottom of the screen.
167
- /// @prop {Number with size unit} floating-buttons.side-distance [12px] - The distance from the `$position`-side of the buttons to the `$position`-side of the screen.
168
- /// @prop {"left" | "right"} floating-buttons.position ["left"] - The side of the screen the buttons should be aligned to. Can be "left" or "right".
169
- $floating-buttons: () !default;
170
- $floating-buttons-defaults: (
171
- "bottom-distance": 12px,
172
- "side-distance": 12px,
173
- "position": "left",
174
- );
175
-
176
- /// Configuration for the search field, that is inside the search modal or on the search page.
177
- /// @prop {Color} search-field.background [map.get(get-merged($background-colors-defaults, $background-colors, "base"), "default")] - The background color of the input field, clear button and back button
178
- /// @prop {Number with size unit} search-field.border-radius [variables.$border-radius * 2.5] - Border radius of the outer edges of the whole SearchField
179
- $search-field: () !default;
180
- $search-field-defaults: (
181
- "background": map.get(get-merged($background-colors-defaults, $background-colors, "base"), "default"),
182
- "border-radius": calc(#{$border-radius} * 2.5),
183
- );
184
-
185
- /// Not all gaps can currently be customised using this but some of them do. If this is useful for you and you think we should make it more consistent, please let us know.
186
- /// @prop {Number with size unit} gaps.between-instant-results [5px] - The gap between the individual instant results in the modal
187
- /// @prop {Number with size unit} gaps.autocomplete.between-items-in-row-mode [5px] - The vertical gap between the "list-style items", the individual suggestions that have the full width.
188
- /// @prop {Number with size unit} gaps.autocomplete.between-category-and-other [20px] - The vertical gap between the category and query suggestion sections
189
- /// @prop {Number with size unit} gaps.autocomplete.between-compact-suggestions [5px] - The horizontal gap between the individual query suggestions that show up in "compact" mode (multiple in the same row) when no query has been entered
190
- /// @prop {Map} gaps.listing-page - The product listing page (PLP) overall. Note that for the gaps here not the exact values will always be used but often multiples for different places where it's appropriate.
191
- /// @prop {Number with size unit} gaps.listing-page.spacing-to-filters [12px] - The spacing between the filters and content.
192
- /// @prop {Number with size unit} gaps.listing-page.desktop-item-gap [20px] - The vertical gap between the different items on desktop.
193
- /// @prop {Number with size unit} gaps.listing-page.mobile-item-gap [16px] - The vertical gap between the different items on mobile.
194
- /// @prop {Number with size unit} gaps.listing-page.above-and-below-selected-filters.mobile [10px] - The spacing above and below the selected filters on mobile.
195
- /// @prop {Number with size unit} gaps.listing-page.above-and-below-selected-filters.desktop [0] - The spacing above and below the selected filters on desktop.
196
- /// @prop {Boolean} gaps.listing-page.search.spacing-above-search-field [true] - Whether to add equal spacing above the search field as below.
197
- /// @prop {Number with size unit} gaps.listing-page.search.gaps-to-refactor [3] - he factor to multiply the gaps with to get the spacing above the recommendations.
198
- $gaps: () !default;
199
- $gaps-defaults: (
200
- "between-instant-results": 5px,
201
- "autocomplete": (
202
- "between-items-in-row-mode": 5px,
203
- "between-category-and-other": 20px,
204
- "between-compact-suggestions": 5px,
205
- ),
206
- "listing-page": (
207
- "spacing-to-filters": 12px,
208
- "desktop-item-gap": 20px,
209
- "mobile-item-gap": 16px,
210
- "above-and-below-selected-filters": (
211
- "mobile": 10px,
212
- "desktop": 0,
213
- ),
214
- "search": (
215
- "spacing-above-search-field": true,
216
- "gap-to-recs-factor": 3,
217
- ),
218
- ),
219
- );
220
-
221
- /// Styling overrides for the InstantCard component - the component which shows 4 search results in the SearchModal.
222
- /// @prop {Color} instant-card.sales-price-color [#ff2e3e] - The color of the sales price
223
- /// @prop {Boolean} instant-card.show-price [true] - Whether to show the price
224
- /// @prop {Boolean} instant-card.show-tagline [true] - Whether to show the "tagline" (different for different customers, some show for example the material of the product)
225
- $instant-card: () !default;
226
- $instant-card-defaults: (
227
- "sales-price-color": #ff2e3e,
228
- "show-price": true,
229
- "show-tagline": true,
230
- );
231
-
232
- /// See [documentation of Autocomplete mixin](https://scss-docs.depict.ai/#mixin-Autocomplete) for explanation of this map.
233
- /// It allows customizing the highlighting in the query suggestions
234
- $autocomplete-entries-without-highlight: () !default;
235
- /// See [documentation of Autocomplete mixin](https://scss-docs.depict.ai/#mixin-Autocomplete) for explanation of this map.
236
- /// It allows customizing the highlighting in the query suggestions
237
- $autocomplete-entries-with-highlight: () !default;
238
-
239
- /// Styling overrides for our primary buttons (`button.major`, styled by the PrimaryButton mixin)
240
- /// @prop {Color} primary-button.background [variables.get-background-color("inverse", "default")] - The background color of the primary button
241
- /// @prop {Color} primary-button.hover-background [variables.get-background-color("inverse", "hover")] - The hovered background color of the primary button
242
- /// @prop {Color} primary-button.active-background [variables.get-background-color("inverse", "pressed")] - The active background color of the primary button
243
- /// @prop {Color} primary-button.color [variables.get-text-color("inverse", "default")] - The text color of the primary button
244
- /// @prop {Border} primary-button.border [1px solid transparent] - The border of the primary button
245
- /// @prop {Number with size unit} primary-button.border-radius [variables.$border-radius] - The border radius of the primary button
246
- /// @prop {Filter} primary-button.hover-filter [drop-shadow(-2px -2px 4px rgba(255, 255, 255, 0.25)) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.15))] - The filter to apply to the primary button when hovered
247
- /// @prop {Filter} primary-button.active-filter [drop-shadow(2px 2px 4px rgba(255, 255, 255, 0.25)) drop-shadow(-2px -2px 4px rgba(0, 0, 0, 0.15))] - The filter to apply to the primary button when active
248
- /// @prop {Filter} primary-button.focus-visible-filter [drop-shadow(2px 2px 4px rgba(65, 143, 195, 0.8))
249
- /// drop-shadow(-2px -2px 4px rgba(65, 143, 195, 0.8))] - The filter to apply to the primary button when focused with keyboard navigation.
250
- $primary-button: () !default;
251
- /// Styling overrides for our secondary buttons (`button.minor`, styled by the SecondaryButton mixin)
252
- /// @prop {Color} secondary-button.background [variables.get-background-color("base", "default")] - The background color of the secondary button
253
- /// @prop {Color} secondary-button.hover-background [variables.get-background-color("base", "hover")] - The hovered background color of the secondary button
254
- /// @prop {Color} secondary-button.active-background [variables.get-background-color("base", "pressed")] - The active background color of the secondary button
255
- /// @prop {Color} secondary-button.color [variables.get-text-color("base", "default")] - The text color of the secondary button
256
- /// @prop {Border} secondary-button.border [variables.get-border("base", "default") 1px solid] - The border of the secondary button
257
- /// @prop {Number with size unit} secondary-button.border-radius [variables.$border-radius] - The border radius of the secondary button
258
- /// @prop {Filter} secondary-button.hover-filter [drop-shadow(-2px -2px 4px rgba(255, 255, 255, 0.25)) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.15))] - The filter to apply to the secondary button when hovered
259
- /// @prop {Filter} secondary-button.active-filter [drop-shadow(2px 2px 4px rgba(255, 255, 255, 0.25)) drop-shadow(-2px -2px 4px rgba(0, 0, 0, 0.15))] - The filter to apply to the secondary button when active
260
- /// @prop {Filter} secondary-button.focus-visible-filter [drop-shadow(-2px -2px 4px rgba(65, 143, 195, 0.8))
261
- /// drop-shadow(2px 2px 4px rgba(65, 143, 195, 0.8))] - The filter to apply to the secondary button when focused with keyboard navigation.
262
- $secondary-button: () !default;
263
-
264
- /// Makes it easy to get the text color
265
- /// @param {"base" | "neutral" | "subtle" | "inverse"} $type - What type of color
266
- /// @param {"default" | "hover" | "pressed" | "disabled"} $state ["base"] - The state
267
- @function get-text-color($type, $state) {
268
- @return map.get(get-merged($text-icon-colors-defaults, $text-icon-colors, $type), $state);
269
- }
270
-
271
- /// Makes it easy to get the border color
272
- /// @param {"base" | "neutral" | "subtle" | "inverse"} $type - What type of color
273
- /// @param {"default" | "hover" | "pressed" | "disabled"} $state ["base"] - The state
274
- @function get-border-color($type, $state) {
275
- @return map.get(get-merged($border-colors-defaults, $border-colors, $type), $state);
276
- }
277
-
278
- /// Makes it easy to get the background color
279
- /// @param {"base" | "neutral" | "subtle" | "inverse"} $type - What type of color
280
- /// @param {"default" | "hover" | "pressed" | "disabled"} $state ["base"] - The state
281
- @function get-background-color($type, $state) {
282
- @return map.get(get-merged($background-colors-defaults, $background-colors, $type), $state);
283
- }
284
-
285
- /// Makes it easy to get font weight
286
- /// @param {300 | 400 | 500 | 600} $type - What type of font weight to get (light, regular, medium or bold)
287
- @function get-font-weight($type) {
288
- @return get-merged($font-weights-defaults, $font-weights, $type);
289
- }
290
-
291
- /// Makes it easy to get a gap value from the $gaps map
292
- /// @param {String} $name - The name of the property to get
293
- @function get-gap($name) {
294
- @return get-merged($gaps-defaults, $gaps, $name);
295
- }