@depict-ai/react-ui 0.0.77 → 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 +1 -1
  3. package/dist/main.js +1 -1
  4. package/dist/module.js +1 -1
  5. package/dist/styles/index.scss +1 -57
  6. package/dist/styles/{default.css → plain-css-fallback-styling.css} +1 -1
  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 -27
  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 -816
  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 -160
  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/helpers/color_inference.scss +0 -112
  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 -110
  41. package/dist/styles/package.json +0 -31
  42. package/dist/styles/variables.scss +0 -312
@@ -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,110 +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
- /// Like highlight-background mixin but returns color value
38
- @function highlight-color(
39
- $normal-background,
40
- $darken-factor: 10%,
41
- $lighten-factor: 10%,
42
- $saturation-factor: $darken-factor
43
- ) {
44
- @if color.lightness($normal-background) >= 50% {
45
- @return color.adjust($normal-background, $lightness: -$darken-factor, $saturation: -$saturation-factor);
46
- } @else {
47
- @return color.adjust($normal-background, $lightness: $lighten-factor);
48
- }
49
- }
50
-
51
- // source of below: https://gist.github.com/mashirozx/c0691c3b8ed3f1f63722883649d41c18
52
- /// 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.
53
- @mixin _flex-gap($gap, $row: true, $use_nth_child: true) {
54
- $margin: math.div($gap, 2);
55
- $transform: -$margin;
56
-
57
- @if $use_nth_child {
58
- > * {
59
- @if $row {
60
- // modified to be worse by Daniel (probable broke row-reverse and order property) due to him being opinionated on avoiding negative margins when possible
61
- &:not(:first-child) {
62
- margin-left: $margin;
63
- }
64
- &:not(:last-child) {
65
- margin-right: $margin;
66
- }
67
- } @else {
68
- &:not(:first-child) {
69
- margin-top: $margin;
70
- }
71
- &:not(:last-child) {
72
- margin-bottom: $margin;
73
- }
74
- }
75
- }
76
- } @else {
77
- @if $row {
78
- margin-left: $transform;
79
- margin-right: $transform;
80
- } @else {
81
- margin-top: $transform;
82
- margin-bottom: $transform;
83
- }
84
- > * {
85
- @if $row {
86
- margin-left: $margin;
87
- margin-right: $margin;
88
- } @else {
89
- margin-top: $margin;
90
- margin-bottom: $margin;
91
- }
92
- }
93
- }
94
- }
95
-
96
- @mixin flex-gap($gap, $flex-flow: "row nowrap") {
97
- @if $flex-flow== "row nowrap" or $flex-flow== "row-reverse nowrap" {
98
- @include _flex-gap($gap, true);
99
- } @else if $flex-flow== "column nowrap" or $flex-flow== "column-reverse nowrap" {
100
- @include _flex-gap($gap, false);
101
- } @else if $flex-flow== "row wrap" or $flex-flow== "row-reverse wrap" {
102
- @include _flex-gap($gap, true, false);
103
- @include _flex-gap($gap, false, false);
104
- } @else if $flex-flow== "column wrap" or $flex-flow== "column-reverse wrap" {
105
- @include _flex-gap($gap, true, false);
106
- @include _flex-gap($gap, false, false);
107
- } @else {
108
- @error "The second paramater $flex-flow is set to be '#{$flex-flow}', which is illegal.";
109
- }
110
- }
@@ -1,31 +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
- "sass": "index.scss",
14
- "version": "0.0.17",
15
- "description": "Depict PLP UI SCSS Styling",
16
- "author": "Daniel Troger <daniel@depict.ai>",
17
- "contributors": [
18
- "Fabian Hedin <fabian@depict.ai>",
19
- "Sverre Westerlund <sverre@depict.ai>",
20
- "Joakim Olsson <joakim.olsson@depict.ai>",
21
- "Arnaud Cortisse <arnaud@depict.ai>",
22
- "Carl Riis <carl@depict.ai>"
23
- ],
24
- "license": "MIT",
25
- "devDependencies": {
26
- "sassdoc": "^2.7.4"
27
- },
28
- "publishConfig": {
29
- "access": "public"
30
- }
31
- }
@@ -1,312 +0,0 @@
1
- @use "sass:map";
2
- @use "sass:color";
3
- @use "./helpers/utils";
4
- @use "helpers/color_inference";
5
-
6
- /// Deep merged two maps and gives you the value of a key in the merged map.
7
- /// @param {Map} $map - The base map, whose keys will be overridden by the keys in $map2.
8
- /// @param {Map} $map2 - The map whose keys will override the keys in $map.
9
- /// @param {String} $key - The key whose value you want to get from the merged map.
10
- @function get-merged($map, $map2, $key) {
11
- @return map.get(map.deep-merge($map, $map2), $key);
12
- }
13
-
14
- /// 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).
15
- $page-background-color: white !default;
16
-
17
- /// The colors to be used across the UI
18
- /// 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.
19
- /// That is because different things in the UI need to have different colours from the palette, depending on the palette.
20
- /// See the maps below for text and icon colours, border colors and background colors.
21
- $base-colors: () !default;
22
- $base-colors-defaults: (
23
- 1000: #000,
24
- 800: #0f0f0f,
25
- 600: #333335,
26
- 500: #868689,
27
- 400: #cbcbcc,
28
- 300: #e4e4e5,
29
- 200: #f3f3f5,
30
- 100: #fafafc,
31
- 0: #fff,
32
- );
33
-
34
- $text-icon-colors: () !default;
35
- $text-icon-colors-defaults: (
36
- "base": (
37
- "default": get-merged($base-colors-defaults, $base-colors, 800),
38
- "hover": get-merged($base-colors-defaults, $base-colors, 600),
39
- "pressed": get-merged($base-colors-defaults, $base-colors, 1000),
40
- "disabled": get-merged($base-colors-defaults, $base-colors, 400),
41
- ),
42
- "neutral": (
43
- "default": get-merged($base-colors-defaults, $base-colors, 600),
44
- "hover": get-merged($base-colors-defaults, $base-colors, 800),
45
- "pressed": get-merged($base-colors-defaults, $base-colors, 1000),
46
- "disabled": get-merged($base-colors-defaults, $base-colors, 400),
47
- ),
48
- "subtle": (
49
- "default": get-merged($base-colors-defaults, $base-colors, 500),
50
- "hover": get-merged($base-colors-defaults, $base-colors, 600),
51
- "pressed": get-merged($base-colors-defaults, $base-colors, 800),
52
- "disabled": get-merged($base-colors-defaults, $base-colors, 400),
53
- ),
54
- "inverse": (
55
- "default": get-merged($base-colors-defaults, $base-colors, 0),
56
- "hover": get-merged($base-colors-defaults, $base-colors, 200),
57
- "pressed": get-merged($base-colors-defaults, $base-colors, 300),
58
- "disabled": get-merged($base-colors-defaults, $base-colors, 500),
59
- ),
60
- );
61
-
62
- $border-colors: () !default;
63
- $border-colors-defaults: (
64
- "base": (
65
- "default": get-merged($base-colors-defaults, $base-colors, 800),
66
- "hover": get-merged($base-colors-defaults, $base-colors, 600),
67
- "pressed": get-merged($base-colors-defaults, $base-colors, 1000),
68
- "disabled": get-merged($base-colors-defaults, $base-colors, 400),
69
- ),
70
- "neutral": (
71
- "default": get-merged($base-colors-defaults, $base-colors, 400),
72
- "hover": get-merged($base-colors-defaults, $base-colors, 500),
73
- "pressed": get-merged($base-colors-defaults, $base-colors, 700),
74
- "disabled": get-merged($base-colors-defaults, $base-colors, 300),
75
- ),
76
- "subtle": (
77
- "default": get-merged($base-colors-defaults, $base-colors, 300),
78
- "hover": get-merged($base-colors-defaults, $base-colors, 400),
79
- "pressed": get-merged($base-colors-defaults, $base-colors, 500),
80
- "disabled": get-merged($base-colors-defaults, $base-colors, 200),
81
- ),
82
- "inverse": (
83
- "default": get-merged($base-colors-defaults, $base-colors, 0),
84
- "hover": get-merged($base-colors-defaults, $base-colors, 400),
85
- "pressed": get-merged($base-colors-defaults, $base-colors, 300),
86
- "disabled": get-merged($base-colors-defaults, $base-colors, 500),
87
- ),
88
- );
89
-
90
- $background-colors: () !default;
91
- $background-colors-defaults: (
92
- "base": (
93
- "default": get-merged($base-colors-defaults, $base-colors, 0),
94
- "hover": get-merged($base-colors-defaults, $base-colors, 200),
95
- "pressed": get-merged($base-colors-defaults, $base-colors, 300),
96
- "disabled": get-merged($base-colors-defaults, $base-colors, 100),
97
- ),
98
- "neutral": (
99
- "default": get-merged($base-colors-defaults, $base-colors, 300),
100
- "hover": get-merged($base-colors-defaults, $base-colors, 400),
101
- "pressed": get-merged($base-colors-defaults, $base-colors, 200),
102
- "disabled": get-merged($base-colors-defaults, $base-colors, 100),
103
- ),
104
- "subtle": (
105
- "default": get-merged($base-colors-defaults, $base-colors, 200),
106
- "hover": get-merged($base-colors-defaults, $base-colors, 300),
107
- "pressed": get-merged($base-colors-defaults, $base-colors, 400),
108
- "disabled": get-merged($base-colors-defaults, $base-colors, 100),
109
- ),
110
- "inverse": (
111
- "default": get-merged($base-colors-defaults, $base-colors, 800),
112
- "hover": get-merged($base-colors-defaults, $base-colors, 600),
113
- "pressed": get-merged($base-colors-defaults, $base-colors, 1000),
114
- "disabled": get-merged($base-colors-defaults, $base-colors, 400),
115
- ),
116
- );
117
-
118
- /// 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.
119
- /// @prop {Number} font-weights.300 [300] - The font weight to use for "light" (300) text
120
- /// @prop {Number} font-weights.400 [400] - The font weight to use for "regular" (400) text
121
- /// @prop {Number} font-weights.500 [500] - The font weight to use for "medium" (500) text
122
- /// @prop {Number} font-weights.600 [600] - The font weight to use for "semibold" (600) text
123
- /// @prop {Number} font-weights.700 [700] - The font weight to use for "bold" (700) text
124
- $font-weights: () !default;
125
- $font-weights-defaults: (
126
- 300: 300,
127
- 400: 400,
128
- 500: 500,
129
- 600: 600,
130
- 700: 700,
131
- );
132
-
133
- /// The base z-index of the modal
134
- $base-z-index: 5000 !default;
135
- /// The z-index of the search page
136
- $search-page-base-z-index: 1 !default;
137
- /// 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
138
- $border-radius: 4px !default;
139
-
140
- // The color of the progress bar below the toast that shows when it will auto-close
141
- $toast-progress-bar-color: map.get(
142
- get-merged($text-icon-colors-defaults, $text-icon-colors, "base"),
143
- "default"
144
- ) !default;
145
-
146
- /// 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`
147
- $uppercase-text-transform: uppercase !default;
148
-
149
- /// Configuration for the filters on the right
150
- /// @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.
151
- /// @prop {Number with size unit} filters-configuration.input-row-height-goal [20px] - 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. If this is an odd number, the filled-in part of checked radio buttons look off-center in google chrome on macOS on 1440p screens.
152
- $filters-configuration: () !default;
153
- $filters-configuration-defaults: (
154
- "spacing-between-input-rows": 10px,
155
- "input-row-height-goal": 20px,
156
- );
157
-
158
- /// Configuration for the search modal.
159
- /// @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.
160
- /// @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
161
- $search-modal: () !default;
162
- $search-modal-defaults: (
163
- "max-width": 800px,
164
- "top-snapping": true,
165
- );
166
-
167
- /// Configuration for the buttons that show up when scrolling up after not being too close to the top on mobile
168
- /// @prop {Number with size unit} floating-buttons.bottom-distance [12px] - The distance from the bottom of the buttons to the bottom of the screen.
169
- /// @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.
170
- /// @prop {"left" | "right"} floating-buttons.position ["left"] - The side of the screen the buttons should be aligned to. Can be "left" or "right".
171
- $floating-buttons: () !default;
172
- $floating-buttons-defaults: (
173
- "bottom-distance": 12px,
174
- "side-distance": 12px,
175
- "position": "left",
176
- );
177
-
178
- /// Configuration for the search field, that is inside the search modal or on the search page.
179
- /// @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
180
- /// @prop {Number with size unit} search-field.border-radius [variables.$border-radius * 2.5] - Border radius of the outer edges of the whole SearchField
181
- $search-field: () !default;
182
- $search-field-defaults: (
183
- "background": map.get(get-merged($background-colors-defaults, $background-colors, "base"), "default"),
184
- "border-radius": calc(#{$border-radius} * 2.5),
185
- );
186
-
187
- /// 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.
188
- /// @prop {Number with size unit} gaps.between-instant-results [5px] - The gap between the individual instant results in the modal
189
- /// @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.
190
- /// @prop {Number with size unit} gaps.autocomplete.between-category-and-other [20px] - The vertical gap between the category and query suggestion sections
191
- /// @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
192
- /// @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.
193
- /// @prop {Number with size unit} gaps.listing-page.spacing-to-filters [12px] - The spacing between the filters and content.
194
- /// @prop {Number with size unit} gaps.listing-page.desktop-item-gap [20px] - The vertical gap between the different items on desktop.
195
- /// @prop {Number with size unit} gaps.listing-page.mobile-item-gap [16px] - The vertical gap between the different items on mobile.
196
- /// @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.
197
- /// @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.
198
- /// @prop {Boolean} gaps.listing-page.search.spacing-above-search-field [true] - Whether to add equal spacing above the search field as below.
199
- /// @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.
200
- $gaps: () !default;
201
- $gaps-defaults: (
202
- "between-instant-results": 5px,
203
- "autocomplete": (
204
- "between-items-in-row-mode": 5px,
205
- "between-category-and-other": 20px,
206
- "between-compact-suggestions": 5px,
207
- ),
208
- "listing-page": (
209
- "spacing-to-filters": 12px,
210
- "desktop-item-gap": 20px,
211
- "mobile-item-gap": 16px,
212
- "above-and-below-selected-filters": (
213
- "mobile": 10px,
214
- "desktop": 0,
215
- ),
216
- "search": (
217
- "spacing-above-search-field": true,
218
- "gap-to-recs-factor": 3,
219
- ),
220
- ),
221
- );
222
-
223
- /// Styling overrides for the InstantCard component - the component which shows 4 search results in the SearchModal.
224
- /// @prop {Color} instant-card.sales-price-color [#ff2e3e] - The color of the sales price
225
- /// @prop {Boolean} instant-card.show-price [true] - Whether to show the price
226
- /// @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)
227
- $instant-card: () !default;
228
- $instant-card-defaults: (
229
- "sales-price-color": #ff2e3e,
230
- "show-price": true,
231
- "show-tagline": true,
232
- );
233
-
234
- /// See [documentation of Autocomplete mixin](https://scss-docs.depict.ai/#mixin-Autocomplete) for explanation of this map.
235
- /// It allows customizing the highlighting in the query suggestions
236
- $autocomplete-entries-without-highlight: () !default;
237
- /// See [documentation of Autocomplete mixin](https://scss-docs.depict.ai/#mixin-Autocomplete) for explanation of this map.
238
- /// It allows customizing the highlighting in the query suggestions
239
- $autocomplete-entries-with-highlight: () !default;
240
-
241
- /// Styling overrides for our primary buttons (`button.major`, styled by the PrimaryButton mixin)
242
- /// @prop {Color} primary-button.background [variables.get-background-color("inverse", "default")] - The background color of the primary button
243
- /// @prop {Color} primary-button.hover-background [variables.get-background-color("inverse", "hover")] - The hovered background color of the primary button
244
- /// @prop {Color} primary-button.active-background [variables.get-background-color("inverse", "pressed")] - The active background color of the primary button
245
- /// @prop {Color} primary-button.color [variables.get-text-icon-color("inverse", "default")] - The text color of the primary button
246
- /// @prop {Border} primary-button.border [1px solid transparent] - The border of the primary button
247
- /// @prop {Number with size unit} primary-button.border-radius [variables.$border-radius] - The border radius of the primary button
248
- /// @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
249
- /// @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
250
- /// @prop {Filter} primary-button.focus-visible-filter [drop-shadow(2px 2px 4px rgba(65, 143, 195, 0.8))
251
- /// drop-shadow(-2px -2px 4px rgba(65, 143, 195, 0.8))] - The filter to apply to the primary button when focused with keyboard navigation.
252
- $primary-button: () !default;
253
- /// Styling overrides for our secondary buttons (`button.minor`, styled by the SecondaryButton mixin)
254
- /// @prop {Color} secondary-button.background [variables.get-background-color("base", "default")] - The background color of the secondary button
255
- /// @prop {Color} secondary-button.hover-background [variables.get-background-color("base", "hover")] - The hovered background color of the secondary button
256
- /// @prop {Color} secondary-button.active-background [variables.get-background-color("base", "pressed")] - The active background color of the secondary button
257
- /// @prop {Color} secondary-button.color [variables.get-text-icon-color("base", "default")] - The text color of the secondary button
258
- /// @prop {Border} secondary-button.border [variables.get-border("base", "default") 1px solid] - The border of the secondary button
259
- /// @prop {Number with size unit} secondary-button.border-radius [variables.$border-radius] - The border radius of the secondary button
260
- /// @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
261
- /// @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
262
- /// @prop {Filter} secondary-button.focus-visible-filter [drop-shadow(-2px -2px 4px rgba(65, 143, 195, 0.8))
263
- /// drop-shadow(2px 2px 4px rgba(65, 143, 195, 0.8))] - The filter to apply to the secondary button when focused with keyboard navigation.
264
- $secondary-button: () !default;
265
-
266
- /// Makes it easy to get the text color
267
- /// @param {"base" | "neutral" | "subtle" | "inverse"} $type - What type of color
268
- /// @param {"default" | "hover" | "pressed" | "disabled"} $state ["base"] - The state
269
- @function get-text-icon-color($type, $state) {
270
- @return color_inference.get-possible-inferred-or-merged-something(
271
- $text-icon-colors-defaults,
272
- $text-icon-colors,
273
- $type,
274
- $state
275
- );
276
- }
277
-
278
- /// Makes it easy to get the border 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-border-color($type, $state) {
282
- @return color_inference.get-possible-inferred-or-merged-something(
283
- $border-colors-defaults,
284
- $border-colors,
285
- $type,
286
- $state
287
- );
288
- }
289
-
290
- /// Makes it easy to get the background color
291
- /// @param {"base" | "neutral" | "subtle" | "inverse"} $type - What type of color
292
- /// @param {"default" | "hover" | "pressed" | "disabled"} $state ["base"] - The state
293
- @function get-background-color($type, $state) {
294
- @return color_inference.get-possible-inferred-or-merged-something(
295
- $background-colors-defaults,
296
- $background-colors,
297
- $type,
298
- $state
299
- );
300
- }
301
-
302
- /// Makes it easy to get font weight
303
- /// @param {300 | 400 | 500 | 600} $type - What type of font weight to get (light, regular, medium or bold)
304
- @function get-font-weight($type) {
305
- @return get-merged($font-weights-defaults, $font-weights, $type);
306
- }
307
-
308
- /// Makes it easy to get a gap value from the $gaps map
309
- /// @param {String} $name - The name of the property to get
310
- @function get-gap($name) {
311
- @return get-merged($gaps-defaults, $gaps, $name);
312
- }