@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,119 +0,0 @@
1
- @use "../../helpers/utils";
2
- @use "../../variables";
3
-
4
- /// Mixin that styles the idividual product cards in the InstantResults in the SearchModal
5
-
6
- @mixin InstantCard() {
7
- .instant-results {
8
- .instant-card {
9
- $card-gap: 1.5vw;
10
- &:hover,
11
- &:focus {
12
- box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15), -4px -4px 4px rgba(255, 255, 255, 0.3);
13
- z-index: 2;
14
- }
15
- overflow: hidden;
16
- flex: 1 1 100%;
17
- display: flex;
18
- background: white;
19
- padding-left: 20px;
20
- padding-top: 5px;
21
- padding-bottom: 5px;
22
- padding-right: 20px;
23
- border-radius: variables.$border-radius;
24
- @include utils.flex-gap($card-gap, "row nowrap");
25
-
26
- .img-part {
27
- flex: 0 0 100px;
28
- }
29
-
30
- .right-part {
31
- flex-grow: 1;
32
- display: flex;
33
- justify-content: space-between;
34
- @include utils.flex-gap($card-gap, "row nowrap");
35
-
36
- .title-brand-tagline {
37
- display: flex;
38
- justify-content: center;
39
- align-items: center;
40
- @media (min-width: 601px) {
41
- @include utils.flex-gap($card-gap, "row nowrap");
42
- }
43
-
44
- @media (max-width: 600px) {
45
- @include utils.flex-gap($card-gap, "column nowrap");
46
- flex-direction: column;
47
- align-items: flex-start;
48
- }
49
-
50
- .title {
51
- text-overflow: ellipsis;
52
- white-space: pre-line;
53
- overflow-wrap: anywhere;
54
- display: -webkit-box;
55
- -webkit-box-orient: vertical;
56
- -webkit-line-clamp: 2;
57
- overflow: hidden;
58
- word-break: break-word;
59
- }
60
-
61
- @if variables.get-merged(variables.$instant-card-defaults, variables.$instant-card, "show-tagline") {
62
- .tagline {
63
- font-size: 0.9em;
64
- color: #868689;
65
- }
66
- } @else {
67
- .tagline {
68
- display: none;
69
- }
70
- }
71
- }
72
-
73
- .price-container {
74
- @if variables.get-merged(variables.$instant-card-defaults, variables.$instant-card, "show-price") {
75
- display: flex;
76
-
77
- justify-content: center;
78
- align-items: center;
79
- @media (min-width: 601px) {
80
- @include utils.flex-gap($card-gap, "row nowrap");
81
- }
82
-
83
- .price {
84
- &:not(.orig) {
85
- font-weight: 700;
86
- color: #0f0f0f;
87
- }
88
- &.orig {
89
- text-decoration: line-through;
90
- color: #868689;
91
- }
92
- &.sales-price {
93
- color: variables.get-merged(
94
- variables.$instant-card-defaults,
95
- variables.$instant-card,
96
- "sales-price-color"
97
- );
98
- }
99
- }
100
- @media (max-width: 600px) {
101
- @include utils.flex-gap($card-gap, "column nowrap");
102
- flex-direction: column;
103
-
104
- .price:not(.orig) {
105
- order: 0;
106
- }
107
-
108
- .price.orig {
109
- order: 1;
110
- }
111
- }
112
- } @else {
113
- display: none;
114
- }
115
- }
116
- }
117
- }
118
- }
119
- }
@@ -1,12 +0,0 @@
1
- @use "../../helpers/utils";
2
- @use "../../variables";
3
-
4
- /// Mixin that styles the container of the InstantResults in the SearchModal
5
- @mixin InstantResults() {
6
- .instant-results {
7
- display: flex;
8
- flex-direction: column;
9
- @include utils.flex-gap(variables.get-gap("between-instant-results"), "column nowrap");
10
- @content;
11
- }
12
- }
@@ -1,83 +0,0 @@
1
- @use "../../variables";
2
- @use "../../helpers/utils";
3
- @use "../PLP/Buttons";
4
- @use "sass:map";
5
-
6
- /// PreviousSearches is the component that shows the previous searches of the user in its own section, with a heading that says "Your previous searches" (key of the string is `previous_searches_text_` in the locales).
7
- /// The component is only shown if the user has previous searches and the search field is empty.
8
- ///
9
- /// PreviousSearches is a sub-component of Autocomplete so you probably don't want to use it on its own.
10
-
11
- @mixin PreviousSearches() {
12
- .previous-searches {
13
- display: flex;
14
- flex-direction: column;
15
- @include utils.flex-gap(15px, "column nowrap");
16
- $icon-color: variables.get-text-icon-color("neutral", "default");
17
-
18
- .list {
19
- display: flex;
20
- flex-direction: column;
21
- @include utils.flex-gap(map.get(variables.get-gap("autocomplete"), "between-items-in-row-mode"), "column nowrap");
22
- .item {
23
- display: flex;
24
- align-items: center;
25
- justify-content: space-between;
26
- padding-top: 10px;
27
- padding-bottom: 10px;
28
- padding-left: 20px;
29
- padding-right: 20px;
30
- border-radius: variables.$border-radius;
31
- overflow-wrap: anywhere;
32
- .left {
33
- @include utils.flex-gap(10px, "row nowrap");
34
- display: flex;
35
- align-items: center;
36
- svg {
37
- min-width: 12px;
38
- path {
39
- fill: $icon-color;
40
- }
41
- }
42
- }
43
- .delete {
44
- height: 100%;
45
- padding: 0 10px;
46
- background: transparent;
47
- cursor: pointer;
48
- display: flex;
49
- justify-content: center;
50
- align-items: center;
51
-
52
- &:focus {
53
- outline: none;
54
- }
55
-
56
- svg {
57
- transition-duration: 150ms;
58
- width: 13px;
59
- height: 13px;
60
- path {
61
- fill: $icon-color;
62
- }
63
- }
64
- &:hover svg {
65
- transform: scale(1.2);
66
- path {
67
- fill: variables.get-text-icon-color("neutral", "pressed");
68
- }
69
- }
70
- &:focus-visible {
71
- filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
72
- svg {
73
- transform: scale(1.2);
74
- path {
75
- fill: variables.get-text-icon-color("neutral", "pressed");
76
- }
77
- }
78
- }
79
- }
80
- }
81
- }
82
- }
83
- }
@@ -1,160 +0,0 @@
1
- @use "../../variables";
2
- @use "../../helpers/supports-hover";
3
- @use "../PLP/Buttons";
4
- @use "sass:map";
5
-
6
- /// SearchField is the component that shows the search input, sometimes back button, clear button and the search button.
7
-
8
- @mixin SearchField() {
9
- $search-field-background: variables.get-merged(
10
- variables.$search-field-defaults,
11
- variables.$search-field,
12
- "background"
13
- );
14
- $border-radius: variables.get-merged(variables.$search-field-defaults, variables.$search-field, "border-radius");
15
-
16
- .search-field {
17
- input,
18
- button {
19
- margin: 0; // safari has some default margin
20
- }
21
- display: flex;
22
- z-index: calc(#{variables.$search-page-base-z-index} + 5); // make shadow go above contents
23
- box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05);
24
- // For the shadow
25
- border-radius: $border-radius;
26
-
27
- //&:focus-within {
28
- // // something like this could be nice?
29
- // box-shadow: 0px 4px 12px rgba(15, 15, 15, 0.16);
30
- //}
31
-
32
- .query {
33
- font-size: initial;
34
- border-radius: $border-radius 0 0 $border-radius;
35
- flex-grow: 1;
36
- padding-left: 20px;
37
- padding-top: 14px;
38
- padding-bottom: 14px;
39
- padding-right: 55px;
40
- width: 100%;
41
- color: variables.get-text-icon-color("neutral", "default");
42
- background-color: $search-field-background;
43
- border: none;
44
-
45
- &:focus {
46
- outline: none;
47
- color: variables.get-text-icon-color("neutral", "pressed");
48
- }
49
- @include supports-hover.supports-hover() {
50
- &:hover {
51
- outline: none;
52
- color: variables.get-text-icon-color("neutral", "pressed");
53
- }
54
- }
55
- &.has-adjacent-back-button {
56
- border-bottom-left-radius: 0;
57
- border-top-left-radius: 0;
58
- padding-left: 0;
59
- }
60
- }
61
-
62
- .field {
63
- position: relative;
64
- flex-grow: 1;
65
- display: flex;
66
- }
67
-
68
- .back {
69
- background-color: $search-field-background;
70
- display: flex;
71
- align-items: center;
72
- justify-content: center;
73
- border: none;
74
- padding-left: 10px;
75
- padding-top: 14px;
76
- padding-bottom: 14px;
77
- padding-right: 15px;
78
- border-bottom-left-radius: $border-radius;
79
- border-top-left-radius: $border-radius;
80
- cursor: pointer;
81
-
82
- svg path {
83
- fill: variables.get-text-icon-color("neutral", "default");
84
- }
85
- &:focus {
86
- outline: none;
87
- }
88
- &:focus-visible {
89
- filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
90
- svg path {
91
- fill: variables.get-text-icon-color("neutral", "hover");
92
- }
93
- }
94
- @include supports-hover.supports-hover() {
95
- &:hover {
96
- svg path {
97
- fill: variables.get-text-icon-color("neutral", "hover");
98
- }
99
- }
100
- }
101
- }
102
-
103
- .clear,
104
- .submit {
105
- cursor: pointer;
106
- }
107
-
108
- .clear {
109
- position: absolute;
110
- right: 30px;
111
- top: 50%;
112
- transform: translateY(-50%) scale(0.8);
113
- background-color: $search-field-background;
114
- border: none;
115
- padding: 0;
116
- svg path {
117
- fill: variables.get-text-icon-color("neutral", "default");
118
- }
119
-
120
- &:focus {
121
- outline: none;
122
- }
123
- &:focus-visible {
124
- filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
125
- svg path {
126
- fill: variables.get-text-icon-color("neutral", "pressed");
127
- }
128
- }
129
- @include supports-hover.supports-hover() {
130
- &:hover {
131
- svg path {
132
- fill: variables.get-text-icon-color("neutral", "pressed");
133
- }
134
- }
135
- }
136
- }
137
-
138
- .submit {
139
- border: none;
140
- padding: 0;
141
- min-width: 50px;
142
- border-radius: 0 $border-radius $border-radius 0;
143
- }
144
- @content;
145
- }
146
-
147
- .search-field:not(.in-modal) {
148
- $border: 1px solid variables.get-border-color("neutral", "default");
149
- .query {
150
- border-top: $border;
151
- border-bottom: $border;
152
- border-left: $border;
153
- }
154
- .submit {
155
- border-top: $border;
156
- border-bottom: $border;
157
- border-right: $border;
158
- }
159
- }
160
- }
@@ -1,86 +0,0 @@
1
- @use "../../helpers/utils";
2
- @use "../../variables";
3
- @use "../../helpers/supports-hover";
4
-
5
- /// SearchModal is the component that shows the search modal when the user clicks on the search icon/into the search field in the header.
6
- @mixin SearchModal() {
7
- .depict-search-modal-backdrop {
8
- @include utils.modal-backdrop($z-index: variables.$base-z-index);
9
- }
10
-
11
- .depict-search-modal {
12
- // Center horizontally by default, align_field can override
13
- display: flex;
14
- justify-content: center;
15
-
16
- .search-field {
17
- z-index: calc(#{variables.$base-z-index} + 5); // make shadow go above contents
18
- }
19
-
20
- .body {
21
- // this also has position:absolute and width: 80vw set as default styling from the javascript, inside of SearchModal.tsx
22
- display: flex;
23
- flex-direction: column;
24
- background: variables.get-background-color("subtle", "default");
25
- max-width: variables.get-merged(variables.$search-modal-defaults, variables.$search-modal, "max-width");
26
- z-index: calc(#{variables.$base-z-index} + 1);
27
- border-radius: calc(#{variables.$border-radius} * 2.5);
28
- $top-snapping: variables.get-merged(variables.$search-modal-defaults, variables.$search-modal, "top-snapping");
29
-
30
- @media (hover: hover) and (pointer: fine) {
31
- @media (max-height: 790px) {
32
- @if $top-snapping {
33
- max-height: 100%;
34
- top: 0;
35
- position: fixed;
36
- }
37
- @media (max-width: 600px) {
38
- left: 30px;
39
- width: calc(100% - 30px);
40
- }
41
- }
42
- }
43
- @media not all and (hover: hover) and (pointer: fine) {
44
- @if $top-snapping {
45
- @media (max-height: 1000px) {
46
- max-height: 100%;
47
- top: 0;
48
- position: fixed;
49
- }
50
- }
51
- @media (max-height: 1000px) and (max-width: 600px) {
52
- left: 30px;
53
- width: calc(100% - 30px);
54
- }
55
- }
56
-
57
- .padded > *,
58
- .search-field {
59
- // workaround https://github.com/philipwalton/flexbugs#flexbug-1 in MobileSafari 12-14.2 (range is only what I tested)
60
- flex-shrink: 0;
61
- }
62
- .padded {
63
- padding-top: 20px;
64
- padding-left: max(1vw, 10px);
65
- padding-right: max(1vw, 10px);
66
- @include utils.flex-gap(20px, "column nowrap");
67
- display: flex;
68
- flex-direction: column;
69
- overflow: auto;
70
- }
71
-
72
- .discover-more {
73
- display: flex;
74
- justify-content: center;
75
-
76
- button {
77
- padding: 12px 18px;
78
- margin: 20px 0;
79
- @if variables.$uppercase-text-transform != "none" {
80
- text-transform: variables.$uppercase-text-transform;
81
- }
82
- }
83
- }
84
- }
85
- }
86
- }
@@ -1,28 +0,0 @@
1
- @use "../../variables";
2
- @use "../../helpers/utils";
3
- @use "../../helpers/supports-hover";
4
-
5
- /// SearchRecommendations is the component that shows the search recommendations below the SearchResults once the user has reached the end of the results.
6
- /// @param {Border} $border-top [2px solid variables.$brand-light-grey] - The border separating the results and recommendations
7
-
8
- @mixin SearchRecommendations() {
9
- .listing-page {
10
- .search-recs {
11
- border-top: 2px solid variables.get-border-color("subtle", "default");
12
- display: flex;
13
- flex-direction: column;
14
- .search-recs-title {
15
- line-height: 1;
16
- font-weight: 600;
17
- font-size: 24px;
18
- margin-top: 0;
19
- margin-bottom: 20px;
20
- }
21
- .load-more-container {
22
- display: flex;
23
- justify-content: center;
24
- margin-top: 30px;
25
- }
26
- }
27
- }
28
- }
@@ -1,7 +0,0 @@
1
- /// This is the styling for the text that says "Showing __30__ result(s) for __falk__"
2
- @mixin ShowingResultsFor() {
3
- .results-for {
4
- font-size: 1.5em;
5
- overflow-wrap: anywhere;
6
- }
7
- }
@@ -1,12 +0,0 @@
1
- /// Component style mixins for Search styling
2
- /// Don't forget to also include PLP styling
3
-
4
- @forward "Autocomplete";
5
- @forward "CategorySuggestions";
6
- @forward "InstantResults";
7
- @forward "InstantCard";
8
- @forward "SearchField";
9
- @forward "SearchRecommendations";
10
- @forward "ShowingResultsFor";
11
- @forward "SearchModal";
12
- @forward "../PLP/ProductListingPage";
@@ -1,112 +0,0 @@
1
- @use "sass:map";
2
- @use "sass:color";
3
- @use "./utils";
4
-
5
- @function get-possible-inferred-or-merged-something($default-values-map, $user-overrides-map, $type, $state) {
6
- $value-from-merged-map: map.get(map.get(map.deep-merge($default-values-map, $user-overrides-map), $type), $state);
7
- // If the color is specified as override, just return it.
8
- @if map.has-key($user-overrides-map, $type) and map.has-key(map.get($user-overrides-map, $type), $state) {
9
- @return $value-from-merged-map;
10
- }
11
- $infer-defaults-return-value: infer-defaults($user-overrides-map, $type);
12
- $safe-overrides-map: map.get($infer-defaults-return-value, "map");
13
- $changed-direction: map.get($infer-defaults-return-value, "changed-direction");
14
- // If we don't have overrides or don't have a "default" override, don't infer and return from the merged map.
15
- @if (not map.has-key($safe-overrides-map, $type)) or (not map.has-key(map.get($safe-overrides-map, $type), "default"))
16
- {
17
- @return $value-from-merged-map;
18
- }
19
-
20
- // If the color is specified as override NOW, just return it.
21
- @if map.has-key($safe-overrides-map, $type) and map.has-key(map.get($safe-overrides-map, $type), $state) {
22
- @return map.get(map.get($safe-overrides-map, $type), $state);
23
- }
24
-
25
- // We're good to infer
26
- $our-color: map.get(map.get($safe-overrides-map, $type), "default");
27
- $direction-to-go: if(
28
- not $changed-direction,
29
- if(color.lightness($our-color) >= 50%, "darken", "lighten"),
30
- $changed-direction
31
- );
32
-
33
- //"hover": get-merged($base-colors-defaults, $base-colors, 600),
34
- //"pressed": get-merged($base-colors-defaults, $base-colors, 1000),
35
- //"disabled": get-merged($base-colors-defaults, $base-colors, 400),
36
- @if $direction-to-go == "darken" {
37
- @if $state == "hover" {
38
- @return color.adjust($our-color, $lightness: -12%, $saturation: -7%);
39
- } @else if $state == "pressed" {
40
- @return color.adjust($our-color, $lightness: -20%, $saturation: -10%);
41
- } @else if $state == "disabled" {
42
- @return color.adjust($our-color, $lightness: -30%, $saturation: -5%);
43
- }
44
- } @else {
45
- @if $state == "hover" {
46
- @return color.adjust($our-color, $lightness: 10%, $saturation: 5%);
47
- } @else if $state == "pressed" {
48
- @return color.adjust($our-color, $lightness: 20%);
49
- } @else if $state == "disabled" {
50
- @return color.adjust($our-color, $lightness: 30%);
51
- }
52
- }
53
- }
54
-
55
- @function infer-defaults($user-overrides-map, $type) {
56
- @if (not map.has-key($user-overrides-map, "base")) or
57
- (not map.has-key(map.get($user-overrides-map, "base"), "default"))
58
- {
59
- // If no base to fallback this function is useless
60
- @return ("map": $user-overrides-map, "changed-direction": false);
61
- }
62
- // Check if have default
63
- @if (not map.has-key($user-overrides-map, $type)) or (not map.has-key(map.get($user-overrides-map, $type), "default"))
64
- {
65
- $default-color: map.get(map.get($user-overrides-map, "base"), "default");
66
- // it's important to always go in the same direction with our inference but since
67
- // default color is the same for base, neutral and subtle we don't need to preserve the direction somewhere else, it will automatically be consistent
68
- $changed-color: black;
69
- $changed-direction: false;
70
- @if $type == "neutral" {
71
- @if color.lightness($default-color) >= 50% {
72
- $changed-color: color.adjust($default-color, $lightness: -25%, $saturation: -10%);
73
- $changed-direction: "darken";
74
- } @else {
75
- $changed-color: color.adjust($default-color, $lightness: 25%);
76
- $changed-direction: "lighten";
77
- }
78
- } @else if $type == "subtle" {
79
- @if color.lightness($default-color) >= 50% {
80
- // Please never change lightness by more than 50% as the distance won't be the same between neutral and subtle anymore
81
- // If you do, find out the max change possible for a certain color and only change neutral half of that (I think that's like using color.scale but that function doesn't work in the black-direction IIRC?)
82
- $changed-color: color.adjust($default-color, $lightness: -30%, $saturation: -20%);
83
- $changed-direction: "darken";
84
- } @else {
85
- $changed-color: color.adjust(
86
- $default-color,
87
- $lightness: 30%,
88
- $saturation:
89
- if((color.saturation($default-color)) < 30% and (color.saturation($default-color) > 2%), 20%, -20%)
90
- );
91
- $changed-direction: "lighten";
92
- }
93
- } @else if $type == "inverse" {
94
- // Invert color and ensure saturation is same as input color
95
- $changed-color: color.change(color.invert($default-color), $saturation: color.saturation($default-color));
96
- } @else {
97
- @debug "Unknown type: #{$type}";
98
- }
99
- // Merge in default
100
- $modified-map: map.deep-merge(
101
- $user-overrides-map,
102
- (
103
- $type: (
104
- "default": $changed-color,
105
- ),
106
- )
107
- );
108
- @return ("map": $modified-map, "changed-direction": $changed-direction);
109
- }
110
-
111
- @return ("map": $user-overrides-map, "changed-direction": false);
112
- }