@depict-ai/react-ui 2.0.3 → 2.0.4

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 (47) hide show
  1. package/ES10/index.cjs +1 -1
  2. package/ES10/index.d.ts +1 -1
  3. package/ES10/index.js +1 -1
  4. package/dist/main.js +293 -0
  5. package/dist/module.js +285 -0
  6. package/dist/styles/components/PLP/Buttons.scss +124 -0
  7. package/dist/styles/components/PLP/MorphingSign.scss +31 -0
  8. package/dist/styles/components/PLP/PLPResults.scss +20 -0
  9. package/dist/styles/components/PLP/ProductListingPage.scss +142 -0
  10. package/dist/styles/components/PLP/ScrollStatus.scss +24 -0
  11. package/dist/styles/components/PLP/SelectedFilters.scss +74 -0
  12. package/dist/styles/components/PLP/SlidableItems.scss +99 -0
  13. package/dist/styles/components/PLP/SortAndFilter/FloatingButtons.scss +75 -0
  14. package/dist/styles/components/PLP/SortAndFilter/SortAndFilter.scss +728 -0
  15. package/dist/styles/components/PLP/SortAndFilter/SortAndFilterModal.scss +160 -0
  16. package/dist/styles/components/PLP/SortAndFilter/WhiteSortAndFilter.scss +148 -0
  17. package/dist/styles/components/PLP/Toast.scss +54 -0
  18. package/dist/styles/components/PLP/index.scss +45 -0
  19. package/dist/styles/components/category/BreadCrumbs.scss +23 -0
  20. package/dist/styles/components/category/CategoryTitle.scss +28 -0
  21. package/dist/styles/components/category/QuickLinks.scss +71 -0
  22. package/dist/styles/components/category/index.scss +23 -0
  23. package/dist/styles/components/search/Autocomplete.scss +117 -0
  24. package/dist/styles/components/search/CategorySuggestions.scss +74 -0
  25. package/dist/styles/components/search/InstantCard.scss +117 -0
  26. package/dist/styles/components/search/InstantResults.scss +10 -0
  27. package/dist/styles/components/search/PreviousSearches.scss +77 -0
  28. package/dist/styles/components/search/QueryInput.scss +167 -0
  29. package/dist/styles/components/search/SearchModal.scss +95 -0
  30. package/dist/styles/components/search/SearchRecommendations.scss +25 -0
  31. package/dist/styles/components/search/ShowingResultsFor.scss +10 -0
  32. package/dist/styles/components/search/index.scss +40 -0
  33. package/dist/styles/default.css +1 -0
  34. package/dist/styles/helpers/custom_input.scss +162 -0
  35. package/dist/styles/helpers/supports-hover.scss +5 -0
  36. package/dist/styles/helpers/utils.scss +82 -0
  37. package/dist/styles/variables.scss +47 -0
  38. package/latest/index.cjs +1 -1
  39. package/latest/index.d.ts +1 -1
  40. package/latest/index.js +1 -1
  41. package/package.json +2 -2
  42. package/server/ES10/index.cjs +1 -1
  43. package/server/ES10/index.d.ts +1 -1
  44. package/server/ES10/index.js +1 -1
  45. package/server/latest/index.cjs +1 -1
  46. package/server/latest/index.d.ts +1 -1
  47. package/server/latest/index.js +1 -1
@@ -0,0 +1,74 @@
1
+ @use "../../helpers/supports-hover";
2
+ @use "../../helpers/utils";
3
+ @use "../../variables";
4
+
5
+ @mixin CategorySuggestions(
6
+ $card-background: white,
7
+ $hovered-card-background: false,
8
+ $card-border: false,
9
+ $card-border-radius: variables.$border-radius,
10
+ $title-font-weight: 420,
11
+ $parent-title-font-weight: 400,
12
+ $thin: true
13
+ ) {
14
+ .category-suggestions {
15
+ display: flex;
16
+
17
+ .sliding {
18
+ padding-bottom: 2px;
19
+ margin-bottom: -2px;
20
+ }
21
+
22
+ .title {
23
+ font-weight: $title-font-weight;
24
+ }
25
+ .category-suggestion {
26
+ background: $card-background;
27
+ transition: background 100ms ease-in-out;
28
+
29
+ &:focus {
30
+ @if $hovered-card-background {
31
+ background: $hovered-card-background;
32
+ } @else {
33
+ @include utils.highlight-background($normal-background: $card-background);
34
+ }
35
+ }
36
+ @include supports-hover.supports-hover() {
37
+ &:hover {
38
+ @if $hovered-card-background {
39
+ background: $hovered-card-background;
40
+ } @else {
41
+ @include utils.highlight-background($normal-background: $card-background);
42
+ }
43
+ }
44
+ }
45
+ border-radius: $card-border-radius;
46
+ @if $card-border {
47
+ border: $card-border;
48
+ }
49
+ padding: 10px 20px;
50
+ color: black;
51
+ display: flex;
52
+ height: 100%;
53
+ align-items: center;
54
+ @if $thin {
55
+ justify-content: space-between;
56
+ @include utils.flex-gap(10px, "row nowrap");
57
+ } @else {
58
+ justify-content: center;
59
+ flex-direction: column;
60
+ @include utils.flex-gap(10px, "column nowrap");
61
+ }
62
+
63
+ .parent-title {
64
+ font-weight: $parent-title-font-weight;
65
+ }
66
+
67
+ & > * {
68
+ white-space: nowrap;
69
+ font-size: 0.85em;
70
+ }
71
+ }
72
+ @content;
73
+ }
74
+ }
@@ -0,0 +1,117 @@
1
+ @use "../../helpers/utils";
2
+ @use "../../variables";
3
+
4
+ @mixin InstantCard(
5
+ $instant-card-sales_price_color: variables.$instant-card-sales_price_color,
6
+ $instant-card-show-price: variables.$instant-card-show-price,
7
+ $instant-card-show-tagline: variables.$instant-card-show-tagline
8
+ ) {
9
+ .instant-results {
10
+ .instant-card {
11
+ $card-gap: 1.5vw;
12
+ &:hover,
13
+ &:focus {
14
+ box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15), -4px -4px 4px rgba(255, 255, 255, 0.3);
15
+ z-index: 2;
16
+ }
17
+ overflow: hidden;
18
+ flex: 1 1 100%;
19
+ display: flex;
20
+ background: white;
21
+ padding-left: 20px;
22
+ padding-top: 5px;
23
+ padding-bottom: 5px;
24
+ padding-right: 20px;
25
+ border-radius: variables.$border-radius;
26
+ @include utils.flex-gap($card-gap, "row nowrap");
27
+
28
+ .img-part {
29
+ flex: 0 0 100px;
30
+ }
31
+
32
+ .right-part {
33
+ flex-grow: 1;
34
+ display: flex;
35
+ justify-content: space-between;
36
+ @include utils.flex-gap($card-gap, "row nowrap");
37
+
38
+ .title-brand-tagline {
39
+ display: flex;
40
+ justify-content: center;
41
+ align-items: center;
42
+ @media (min-width: 601px) {
43
+ @include utils.flex-gap($card-gap, "row nowrap");
44
+ }
45
+
46
+ @media (max-width: 600px) {
47
+ @include utils.flex-gap($card-gap, "column nowrap");
48
+ flex-direction: column;
49
+ align-items: flex-start;
50
+ }
51
+
52
+ .title {
53
+ text-overflow: ellipsis;
54
+ white-space: pre-line;
55
+ overflow-wrap: anywhere;
56
+ display: -webkit-box;
57
+ -webkit-box-orient: vertical;
58
+ -webkit-line-clamp: 2;
59
+ overflow: hidden;
60
+ word-break: break-word;
61
+ }
62
+
63
+ @if $instant-card-show-tagline {
64
+ .tagline {
65
+ font-size: 0.9em;
66
+ color: #868689;
67
+ }
68
+ } @else {
69
+ .tagline {
70
+ display: none;
71
+ }
72
+ }
73
+ }
74
+
75
+ .price-container {
76
+ @if $instant-card-show-price {
77
+ display: flex;
78
+
79
+ justify-content: center;
80
+ align-items: center;
81
+ @media (min-width: 601px) {
82
+ @include utils.flex-gap($card-gap, "row nowrap");
83
+ }
84
+
85
+ .price {
86
+ &:not(.orig) {
87
+ font-weight: 700;
88
+ color: #0f0f0f;
89
+ }
90
+ &.orig {
91
+ text-decoration: line-through;
92
+ color: #868689;
93
+ }
94
+ &.sales-price {
95
+ color: $instant-card-sales_price_color;
96
+ }
97
+ }
98
+ @media (max-width: 600px) {
99
+ @include utils.flex-gap($card-gap, "column nowrap");
100
+ flex-direction: column;
101
+
102
+ .price:not(.orig) {
103
+ order: 0;
104
+ }
105
+
106
+ .price.orig {
107
+ order: 1;
108
+ }
109
+ }
110
+ } @else {
111
+ display: none;
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
117
+ }
@@ -0,0 +1,10 @@
1
+ @use "../../helpers/utils";
2
+
3
+ @mixin InstantResults($gap: 5px) {
4
+ .instant-results {
5
+ display: flex;
6
+ flex-direction: column;
7
+ @include utils.flex-gap($gap, "column nowrap");
8
+ @content;
9
+ }
10
+ }
@@ -0,0 +1,77 @@
1
+ @use "../../variables";
2
+ @use "../../helpers/utils";
3
+ @use "../PLP/Buttons";
4
+
5
+ @mixin PreviousSearches($icon-color: variables.$brand-black, $item-color: variables.$brand-black) {
6
+ .previous-searches {
7
+ display: flex;
8
+ flex-direction: column;
9
+ @include utils.flex-gap(15px, "column nowrap");
10
+
11
+ .list {
12
+ display: flex;
13
+ flex-direction: column;
14
+ @include utils.flex-gap(5px, "column nowrap");
15
+ .item {
16
+ color: $item-color;
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: space-between;
20
+ padding-top: 10px;
21
+ padding-bottom: 10px;
22
+ padding-left: 20px;
23
+ padding-right: 20px;
24
+ border-radius: variables.$border-radius;
25
+ overflow-wrap: anywhere;
26
+ .left {
27
+ @include utils.flex-gap(10px, "row nowrap");
28
+ display: flex;
29
+ align-items: center;
30
+ svg {
31
+ min-width: 12px;
32
+ path {
33
+ fill: $icon-color;
34
+ }
35
+ }
36
+ }
37
+ .delete {
38
+ height: 100%;
39
+ padding: 0 10px;
40
+ background: transparent;
41
+ cursor: pointer;
42
+ display: flex;
43
+ justify-content: center;
44
+ align-items: center;
45
+
46
+ &:focus {
47
+ outline: none;
48
+ }
49
+
50
+ svg {
51
+ transition-duration: 150ms;
52
+ width: 13px;
53
+ height: 13px;
54
+ path {
55
+ fill: variables.$brand-dark-grey;
56
+ }
57
+ }
58
+ &:hover svg {
59
+ transform: scale(1.2);
60
+ path {
61
+ fill: #000;
62
+ }
63
+ }
64
+ &:focus-visible {
65
+ filter: Buttons.$secondary-button-focus-visible-filter;
66
+ svg {
67
+ transform: scale(1.2);
68
+ path {
69
+ fill: #000;
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,167 @@
1
+ @use "../../variables";
2
+ @use "../../helpers/supports-hover";
3
+ @use "../PLP/Buttons";
4
+
5
+ @mixin QueryInput(
6
+ $border-radius: calc(#{variables.$border-radius} * 2.5),
7
+ $input-font-size: initial,
8
+ $input-font-weight: initial,
9
+ $input-placeholder-color: initial,
10
+ $submit-background: false,
11
+ $submit-icon-size: 1,
12
+ $back-color: variables.$brand-dark-grey,
13
+ $back-background: #fff,
14
+ $clear-color: variables.$brand-dark-grey,
15
+ $hovered-clear-color: variables.$brand-black,
16
+ $query-text-color: variables.$brand-dark-grey,
17
+ $query-background-color: #fff,
18
+ $query-border: none,
19
+ $hovered-back-color: variables.$brand-black,
20
+ $hovered-submit-color: false,
21
+ $focused-query-text-color: #000,
22
+ $box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05)
23
+ ) {
24
+ .query-input {
25
+ input,
26
+ button {
27
+ margin: 0; // safari has some default margin
28
+ }
29
+ display: flex;
30
+ z-index: calc(#{variables.$search-page-base-z-index} + 5); // make shadow go above contents
31
+ box-shadow: $box-shadow;
32
+
33
+ .query {
34
+ border-radius: $border-radius 0 0 $border-radius;
35
+ border: $query-border;
36
+ flex-grow: 1;
37
+ padding-left: 20px;
38
+ padding-top: 14px;
39
+ padding-bottom: 14px;
40
+ padding-right: 55px;
41
+ width: 100%;
42
+ color: $query-text-color;
43
+ background-color: $query-background-color;
44
+
45
+ &::placeholder {
46
+ color: $input-placeholder-color;
47
+ }
48
+ &:focus {
49
+ outline: none;
50
+ color: $focused-query-text-color;
51
+ }
52
+ @include supports-hover.supports-hover() {
53
+ &:hover {
54
+ outline: none;
55
+ color: $focused-query-text-color;
56
+ }
57
+ }
58
+ font-size: $input-font-size;
59
+ font-weight: $input-font-weight;
60
+ &.has-adjacent-back-button {
61
+ border-bottom-left-radius: 0;
62
+ border-top-left-radius: 0;
63
+ padding-left: 0;
64
+ }
65
+ }
66
+
67
+ .field {
68
+ position: relative;
69
+ flex-grow: 1;
70
+ display: flex;
71
+ }
72
+
73
+ .back {
74
+ background: $back-background;
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ border: none;
79
+ padding-left: 10px;
80
+ padding-top: 14px;
81
+ padding-bottom: 14px;
82
+ padding-right: 15px;
83
+ border-bottom-left-radius: $border-radius;
84
+ border-top-left-radius: $border-radius;
85
+ cursor: pointer;
86
+ svg path {
87
+ fill: $back-color;
88
+ }
89
+ &:focus {
90
+ outline: none;
91
+ }
92
+ &:focus-visible {
93
+ filter: Buttons.$secondary-button-focus-visible-filter;
94
+ svg path {
95
+ fill: $hovered-back-color;
96
+ }
97
+ }
98
+ @include supports-hover.supports-hover() {
99
+ &:hover {
100
+ svg path {
101
+ fill: $hovered-back-color;
102
+ }
103
+ }
104
+ }
105
+ }
106
+
107
+ .clear,
108
+ .submit {
109
+ cursor: pointer;
110
+ }
111
+
112
+ .clear {
113
+ position: absolute;
114
+ right: 30px;
115
+ top: 50%;
116
+ transform: translateY(-50%) scale(0.8);
117
+ background: transparent;
118
+ border: none;
119
+ padding: 0;
120
+ svg path {
121
+ fill: $clear-color;
122
+ }
123
+
124
+ &:focus {
125
+ outline: none;
126
+ }
127
+ &:focus-visible {
128
+ filter: Buttons.$secondary-button-focus-visible-filter;
129
+ svg path {
130
+ fill: $hovered-clear-color;
131
+ }
132
+ }
133
+ @include supports-hover.supports-hover() {
134
+ &:hover {
135
+ svg path {
136
+ fill: $hovered-clear-color;
137
+ }
138
+ }
139
+ }
140
+ }
141
+
142
+ .submit {
143
+ border: none;
144
+ padding: 0;
145
+ min-width: 50px;
146
+ border-radius: 0 $border-radius $border-radius 0;
147
+ svg {
148
+ transform: scale($submit-icon-size);
149
+ }
150
+
151
+ @if ($submit-background) {
152
+ background: $submit-background;
153
+ }
154
+
155
+ @include supports-hover.supports-hover() {
156
+ &:hover {
157
+ svg path {
158
+ @if $hovered-submit-color {
159
+ fill: $hovered-submit-color;
160
+ }
161
+ }
162
+ }
163
+ }
164
+ }
165
+ @content;
166
+ }
167
+ }
@@ -0,0 +1,95 @@
1
+ @use "../../helpers/utils";
2
+ @use "../../variables";
3
+ @use "../../helpers/supports-hover";
4
+
5
+ @mixin SearchModal(
6
+ $background: variables.$brand-lighter-grey,
7
+ $border-radius: calc(#{variables.$border-radius} * 2.5),
8
+ $discover-more-text-transform: uppercase,
9
+ $top-snapping: true,
10
+ $max-width: 800px
11
+ ) {
12
+ .depict-search-modal-backdrop {
13
+ @include utils.modal-backdrop($z-index: variables.$base-z-index);
14
+ }
15
+
16
+ .depict-search-modal {
17
+ // Center horizontally by default, align_field can override
18
+ display: flex;
19
+ justify-content: center;
20
+
21
+ button {
22
+ // disable ugly default borders
23
+ border: none;
24
+ }
25
+
26
+ .query-input {
27
+ z-index: calc(#{variables.$base-z-index} + 5); // make shadow go above contents
28
+ }
29
+
30
+ .body {
31
+ display: flex;
32
+ flex-direction: column;
33
+ background: $background;
34
+ width: 80vw;
35
+ max-width: $max-width;
36
+ z-index: calc(#{variables.$base-z-index} + 1);
37
+ position: absolute;
38
+ border-radius: $border-radius;
39
+ @media (hover: hover) and (pointer: fine) {
40
+ @media (max-height: 790px) {
41
+ @if $top-snapping {
42
+ max-height: 100% !important;
43
+ top: 0 !important;
44
+ position: fixed;
45
+ }
46
+ @media (max-width: 600px) {
47
+ left: 30px !important;
48
+ width: calc(100% - 30px) !important;
49
+ }
50
+ }
51
+ }
52
+ @media not all and (hover: hover) and (pointer: fine) {
53
+ @if $top-snapping {
54
+ @media (max-height: 1000px) {
55
+ max-height: 100% !important;
56
+ top: 0 !important;
57
+ position: fixed;
58
+ }
59
+ }
60
+ @media (max-height: 1000px) and (max-width: 600px) {
61
+ left: 30px !important;
62
+ width: calc(100% - 30px) !important;
63
+ }
64
+ }
65
+
66
+ .padded > *,
67
+ .query-input {
68
+ // workaround https://github.com/philipwalton/flexbugs#flexbug-1 in MobileSafari 12-14.2 (range is only what I tested)
69
+ flex-shrink: 0;
70
+ }
71
+ .padded {
72
+ padding-top: 20px;
73
+ padding-left: max(1vw, 10px);
74
+ padding-right: max(1vw, 10px);
75
+ @include utils.flex-gap(20px, "column nowrap");
76
+ display: flex;
77
+ flex-direction: column;
78
+ overflow: auto;
79
+ }
80
+
81
+ .discover-more {
82
+ display: flex;
83
+ justify-content: center;
84
+
85
+ button {
86
+ padding: 12px 18px;
87
+ margin: 20px 0;
88
+ @if $discover-more-text-transform {
89
+ text-transform: $discover-more-text-transform;
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
@@ -0,0 +1,25 @@
1
+ @use "../../variables";
2
+ @use "../../helpers/utils";
3
+ @use "../../helpers/supports-hover";
4
+
5
+ @mixin SearchRecommendations($border-top: 2px solid variables.$brand-light-grey) {
6
+ .listing-page {
7
+ .search-recs {
8
+ border-top: $border-top;
9
+ display: flex;
10
+ flex-direction: column;
11
+ .search-recs-title {
12
+ line-height: 1;
13
+ font-weight: 600;
14
+ font-size: 24px;
15
+ margin-top: 0;
16
+ margin-bottom: 20px;
17
+ }
18
+ .load-more-container {
19
+ display: flex;
20
+ justify-content: center;
21
+ margin-top: 30px;
22
+ }
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,10 @@
1
+ @mixin ShowingResultsFor($results-for-font-size: 1.5em, $mobile-centered: false) {
2
+ .results-for {
3
+ font-size: $results-for-font-size;
4
+ overflow-wrap: anywhere;
5
+ @if $mobile-centered {
6
+ // To center in the one row view, add flex-grow: 1;
7
+ text-align: center;
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,40 @@
1
+ @use "sass:meta";
2
+
3
+ // Component style mixins
4
+ @use "Autocomplete";
5
+ @use "CategorySuggestions";
6
+ @use "InstantResults";
7
+ @use "InstantCard";
8
+ @use "QueryInput";
9
+ @use "ShowingResultsFor";
10
+ @use "SearchRecommendations";
11
+ @use "SearchModal";
12
+ @use "../PLP/ProductListingPage";
13
+
14
+ @forward "Autocomplete";
15
+ @forward "CategorySuggestions";
16
+ @forward "InstantResults";
17
+ @forward "InstantCard";
18
+ @forward "QueryInput";
19
+ @forward "SearchRecommendations";
20
+ @forward "ShowingResultsFor";
21
+ @forward "SearchModal";
22
+ @forward "../PLP/ProductListingPage";
23
+
24
+ // Load all mixins with default values. If only minor theming is needed styles in variables.scss can be
25
+ // reassigned: https://sass-lang.com/documentation/at-rules/use#reassigning-variables
26
+ // The variables are forwarded from PLP/index.scss
27
+ // If more control is needed use these mixins separately and pass custom params
28
+ @mixin all-components() {
29
+ .depict.search {
30
+ @include Autocomplete.Autocomplete();
31
+ @include CategorySuggestions.CategorySuggestions();
32
+ @include InstantResults.InstantResults();
33
+ @include InstantCard.InstantCard();
34
+ @include QueryInput.QueryInput();
35
+ @include SearchModal.SearchModal();
36
+ @include ProductListingPage.SearchPage();
37
+ @include SearchRecommendations.SearchRecommendations();
38
+ @include ShowingResultsFor.ShowingResultsFor();
39
+ }
40
+ }