@crystallize/design-system 1.24.13 → 1.24.15
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.
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-62NPPXVQ.mjs → chunk-J5RWIXT3.mjs} +483 -355
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +986 -840
- package/dist/index.mjs +2 -2
- package/dist/{rich-text-editor-VSCYKBXX.mjs → rich-text-editor-N3CKGEBD.mjs} +6 -2
- package/package.json +1 -1
- package/src/iconography/index.ts +4 -0
- package/src/iconography/price-list.tsx +12 -9
- package/src/iconography/promotion.tsx +66 -0
- package/src/iconography/special-price.tsx +48 -0
- package/src/popover/popover.css +1 -1
- package/src/rich-text-editor/model/parse-initial-state.ts +18 -11
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
showError,
|
|
18
18
|
showInfo,
|
|
19
19
|
showWarning
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-J5RWIXT3.mjs";
|
|
21
21
|
import "./chunk-NIH5ZMPE.mjs";
|
|
22
22
|
|
|
23
23
|
// src/card/card.tsx
|
|
@@ -480,7 +480,7 @@ function Tag({
|
|
|
480
480
|
// src/rich-text-editor/index.tsx
|
|
481
481
|
import { lazy, Suspense } from "react";
|
|
482
482
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
483
|
-
var LazyRichTextEditor = lazy(() => import("./rich-text-editor-
|
|
483
|
+
var LazyRichTextEditor = lazy(() => import("./rich-text-editor-N3CKGEBD.mjs"));
|
|
484
484
|
var RichTextEditor = (props) => {
|
|
485
485
|
return /* @__PURE__ */ jsx15(Suspense, {
|
|
486
486
|
fallback: null,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
Icon,
|
|
7
7
|
IconButton,
|
|
8
8
|
InputWithLabel
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-J5RWIXT3.mjs";
|
|
10
10
|
import "./chunk-NIH5ZMPE.mjs";
|
|
11
11
|
|
|
12
12
|
// src/rich-text-editor/rich-text-editor.tsx
|
|
@@ -159,7 +159,10 @@ import { $createTableCellNode, $createTableNode, $createTableRowNode } from "@le
|
|
|
159
159
|
// src/rich-text-editor/model/parse-initial-state.ts
|
|
160
160
|
function parseInitialState({ richText }) {
|
|
161
161
|
let richTextArray = Array.isArray(richText) ? richText : [richText];
|
|
162
|
-
|
|
162
|
+
const ensureRootBlockElements = (richTextArray2) => richTextArray2.flatMap((rootNode) => {
|
|
163
|
+
if (Array.isArray(rootNode)) {
|
|
164
|
+
return ensureRootBlockElements(rootNode);
|
|
165
|
+
}
|
|
163
166
|
if (!rootNode?.kind || rootNode.kind === "inline") {
|
|
164
167
|
return {
|
|
165
168
|
type: "paragraph",
|
|
@@ -169,6 +172,7 @@ function parseInitialState({ richText }) {
|
|
|
169
172
|
}
|
|
170
173
|
return rootNode;
|
|
171
174
|
});
|
|
175
|
+
richTextArray = ensureRootBlockElements(richTextArray);
|
|
172
176
|
return richTextArray;
|
|
173
177
|
}
|
|
174
178
|
|
package/package.json
CHANGED
package/src/iconography/index.ts
CHANGED
|
@@ -76,6 +76,7 @@ import { PriceList } from './price-list';
|
|
|
76
76
|
import { PriceTag } from './price-tag';
|
|
77
77
|
import { Product } from './product';
|
|
78
78
|
import { ProductShortcut } from './product-shortcut';
|
|
79
|
+
import { Promotion } from './promotion';
|
|
79
80
|
import { PropertyTable } from './property-table';
|
|
80
81
|
import { Relation } from './relation';
|
|
81
82
|
import { Renew } from './renew';
|
|
@@ -87,6 +88,7 @@ import { Selection } from './selection';
|
|
|
87
88
|
import { Settings } from './settings';
|
|
88
89
|
import { Shapes } from './shapes';
|
|
89
90
|
import { SingleLine } from './singleline';
|
|
91
|
+
import { SpecialPrice } from './special-price';
|
|
90
92
|
import { Split } from './split';
|
|
91
93
|
import { StockLocation } from './stock-location';
|
|
92
94
|
import { Subscription } from './subscription';
|
|
@@ -164,6 +166,7 @@ export const Icon = {
|
|
|
164
166
|
PriceTag,
|
|
165
167
|
Product,
|
|
166
168
|
ProductShortcut,
|
|
169
|
+
Promotion,
|
|
167
170
|
PipelineDashed,
|
|
168
171
|
RestrictedCatalogue,
|
|
169
172
|
Renew,
|
|
@@ -171,6 +174,7 @@ export const Icon = {
|
|
|
171
174
|
Search,
|
|
172
175
|
Settings,
|
|
173
176
|
Shapes,
|
|
177
|
+
SpecialPrice,
|
|
174
178
|
Split,
|
|
175
179
|
StockLocation,
|
|
176
180
|
SubscriptionContracts,
|
|
@@ -6,39 +6,42 @@ type PriceListRef = SVGSVGElement;
|
|
|
6
6
|
|
|
7
7
|
export const PriceList = forwardRef<PriceListRef, PriceListProps>((delegated, ref) => {
|
|
8
8
|
return (
|
|
9
|
-
<svg ref={ref} width="
|
|
9
|
+
<svg ref={ref} width="22" height="22" viewBox="0 0 22 22" fill="currentColor" {...delegated}>
|
|
10
10
|
<path
|
|
11
11
|
fill="#BFF6F8"
|
|
12
|
-
d="
|
|
12
|
+
d="M3.094 5.635c0-.943.764-1.707 1.707-1.707h12.398c.943 0 1.707.764 1.707 1.707v13.66c0 .942-.764 1.706-1.707 1.706H4.801a1.707 1.707 0 0 1-1.707-1.707V5.634Z"
|
|
13
13
|
/>
|
|
14
14
|
<path
|
|
15
15
|
fill="#528693"
|
|
16
16
|
fillRule="evenodd"
|
|
17
|
-
d="
|
|
17
|
+
d="M4.801 3.416H17.2c1.225 0 2.219.994 2.219 2.219v13.66a2.219 2.219 0 0 1-2.22 2.219H4.802a2.219 2.219 0 0 1-2.219-2.22V5.636c0-1.225.994-2.219 2.219-2.219Zm0 .512c-.943 0-1.707.764-1.707 1.707v13.66c0 .942.764 1.707 1.707 1.707H17.2c.942 0 1.707-.765 1.707-1.707V5.635c0-.943-.765-1.707-1.707-1.707H4.8Z"
|
|
18
18
|
clipRule="evenodd"
|
|
19
19
|
/>
|
|
20
20
|
<path
|
|
21
21
|
fill="#fff"
|
|
22
|
-
d="M7.
|
|
22
|
+
d="M7.92 4.205c0-.943.764-1.707 1.707-1.707h2.745c.943 0 1.707.764 1.707 1.707v.812a.341.341 0 0 1-.341.341H8.26a.341.341 0 0 1-.341-.34v-.813Z"
|
|
23
23
|
/>
|
|
24
24
|
<path
|
|
25
25
|
fill="#528693"
|
|
26
26
|
fillRule="evenodd"
|
|
27
|
-
d="
|
|
27
|
+
d="M9.625 1.986h2.746c1.225 0 2.219.994 2.219 2.22v.811a.853.853 0 0 1-.854.854H8.26a.853.853 0 0 1-.854-.854v-.812c0-1.225.994-2.219 2.22-2.219Zm0 .512c-.942 0-1.707.765-1.707 1.707v.812c0 .189.153.342.342.342h5.476a.341.341 0 0 0 .342-.342v-.812c0-.942-.765-1.707-1.707-1.707H9.625Z"
|
|
28
28
|
clipRule="evenodd"
|
|
29
29
|
/>
|
|
30
|
-
<path fill="#fff" d="M11
|
|
30
|
+
<path fill="#fff" d="M11 .997a.98.98 0 0 0-.98.98h1.96a.98.98 0 0 0-.98-.98Z" />
|
|
31
31
|
<path
|
|
32
32
|
fill="#528693"
|
|
33
33
|
fillRule="evenodd"
|
|
34
|
-
d="M9.
|
|
34
|
+
d="M9.506 2.49v-.512a1.492 1.492 0 0 1 2.984 0v.512H9.506Zm2.472-.512a.98.98 0 1 0-1.96 0h1.96Z"
|
|
35
35
|
clipRule="evenodd"
|
|
36
36
|
/>
|
|
37
|
-
<path
|
|
37
|
+
<path
|
|
38
|
+
fill="#fff"
|
|
39
|
+
d="M11 16.155c-.654 0-1.18-.533-1.18-1.18a.676.676 0 0 0-.675-.675.676.676 0 0 0-.674.674c0 1.14.755 2.105 1.787 2.422v.553c0 .37.304.674.675.674a.676.676 0 0 0 .674-.674v-.52A2.53 2.53 0 0 0 11 12.445c-.654.001-1.18-.532-1.18-1.18 0-.654.533-1.18 1.18-1.18.648 0 1.18.533 1.18 1.18 0 .372.304.675.675.675.37 0 .675-.303.675-.674a2.533 2.533 0 0 0-1.923-2.456v-.64a.676.676 0 0 0-.674-.675.677.677 0 0 0-.675.675v.674a2.53 2.53 0 0 0 .742 4.95c.654.001 1.18.534 1.18 1.181 0 .655-.526 1.18-1.18 1.18Z"
|
|
40
|
+
/>
|
|
38
41
|
<path
|
|
39
42
|
fill="#528693"
|
|
40
43
|
fillRule="evenodd"
|
|
41
|
-
d="
|
|
44
|
+
d="M10.332 14.974a.67.67 0 0 0 1.337 0 .67.67 0 0 0-.669-.668c-.358 0-.703-.063-1.022-.177.218.216.354.515.354.845ZM9.322 13.8a1.189 1.189 0 0 0-1.363 1.174c0 1.234.736 2.296 1.787 2.774v.2c0 .654.533 1.187 1.187 1.187s1.187-.533 1.187-1.187v-.146a3.038 3.038 0 0 0 1.922-2.828 3.04 3.04 0 0 0-1.363-2.537 1.189 1.189 0 0 0 1.363-1.174c0-1.283-.8-2.382-1.922-2.827v-.268c0-.654-.533-1.187-1.187-1.187s-1.187.533-1.187 1.187v.322a3.048 3.048 0 0 0-1.787 2.774A3.04 3.04 0 0 0 9.322 13.8Zm.937-4.957a2.53 2.53 0 0 0 .742 4.95c.654 0 1.18.533 1.18 1.18 0 .655-.526 1.181-1.18 1.181-.655 0-1.18-.533-1.18-1.18a.677.677 0 0 0-.675-.675.677.677 0 0 0-.675.675c0 1.14.756 2.104 1.787 2.421v.553c0 .371.304.675.675.675a.676.676 0 0 0 .675-.675v-.52A2.53 2.53 0 0 0 11 12.445c-.655 0-1.18-.533-1.18-1.18 0-.654.532-1.18 1.18-1.18.647 0 1.18.533 1.18 1.18 0 .371.303.675.674.675a.676.676 0 0 0 .675-.675 2.533 2.533 0 0 0-1.922-2.455v-.641a.676.676 0 0 0-.675-.674.676.676 0 0 0-.675.674v.675Zm1.764 3.266a1.183 1.183 0 0 1-.354-.845.674.674 0 0 0-.669-.668.67.67 0 0 0 0 1.336c.36 0 .704.063 1.023.177Z"
|
|
42
45
|
clipRule="evenodd"
|
|
43
46
|
/>
|
|
44
47
|
</svg>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { forwardRef, SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
type PromotionProps = SVGProps<SVGSVGElement>;
|
|
4
|
+
|
|
5
|
+
type PromotionRef = SVGSVGElement;
|
|
6
|
+
|
|
7
|
+
export const Promotion = forwardRef<PromotionRef, PromotionProps>((delegated, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg ref={ref} width="22" height="23" viewBox="0 0 22 23" fill="currentColor" {...delegated}>
|
|
10
|
+
<path
|
|
11
|
+
d="M3.60278 7.73474C3.68172 6.83379 4.43614 6.14258 5.34055 6.14258H16.7978C17.7095 6.14258 18.4674 6.84455 18.5371 7.75352L19.4852 20.1059C19.5629 21.119 18.7619 21.9838 17.7459 21.9838H4.25823C3.23472 21.9838 2.43112 21.1067 2.52046 20.0871L3.60278 7.73474Z"
|
|
12
|
+
fill="#BFF6F8"
|
|
13
|
+
/>
|
|
14
|
+
<path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
d="M5.33852 5.61914H16.7958C17.981 5.61914 18.9662 6.5317 19.0569 7.71336L20.0049 20.0658C20.106 21.3827 19.0647 22.5071 17.7438 22.5071H4.25621C2.92565 22.5071 1.88097 21.3668 1.99711 20.0414L3.07942 7.68896C3.18205 6.51771 4.16279 5.61914 5.33852 5.61914ZM5.33852 6.14247C4.43412 6.14247 3.67969 6.83368 3.60075 7.73463L2.51844 20.087C2.4291 21.1066 3.2327 21.9837 4.25621 21.9837H17.7438C18.7599 21.9837 19.5609 21.1189 19.4831 20.1058L18.5351 7.75341C18.4654 6.84444 17.7075 6.14247 16.7958 6.14247H5.33852Z"
|
|
18
|
+
fill="#528693"
|
|
19
|
+
/>
|
|
20
|
+
<path
|
|
21
|
+
fillRule="evenodd"
|
|
22
|
+
clipRule="evenodd"
|
|
23
|
+
d="M10.9916 3.1396C11.9858 3.1396 12.8016 3.95541 12.8016 4.94959V7.48368C12.8016 7.8472 13.0962 8.14186 13.4598 8.14186C13.8233 8.14186 14.1179 7.8472 14.1179 7.48368V4.94959C14.1179 3.22878 12.7124 1.82324 10.9916 1.82324C9.27078 1.82324 7.86523 3.22878 7.86523 4.94959V7.48368C7.86523 7.8472 8.1599 8.14186 8.52341 8.14186C8.88693 8.14186 9.18159 7.8472 9.18159 7.48368V4.94959C9.18159 3.95541 9.99741 3.1396 10.9916 3.1396Z"
|
|
24
|
+
fill="white"
|
|
25
|
+
/>
|
|
26
|
+
<path
|
|
27
|
+
fillRule="evenodd"
|
|
28
|
+
clipRule="evenodd"
|
|
29
|
+
d="M12.2762 4.94949C12.2762 4.24433 11.6947 3.66282 10.9895 3.66282C10.2844 3.66282 9.70286 4.24433 9.70286 4.94949V7.48358C9.70286 8.13612 9.17389 8.66509 8.52135 8.66509C7.86881 8.66509 7.33984 8.13612 7.33984 7.48358V4.94949C7.33984 2.93965 8.97969 1.2998 10.9895 1.2998C12.9994 1.2998 14.6392 2.93965 14.6392 4.94949V7.48358C14.6392 8.13612 14.1102 8.66509 13.4577 8.66509C12.8052 8.66509 12.2762 8.13612 12.2762 7.48358V4.94949ZM12.7995 4.94949C12.7995 3.95531 11.9837 3.13949 10.9895 3.13949C9.99535 3.13949 9.17953 3.95531 9.17953 4.94949V7.48358C9.17953 7.84709 8.88486 8.14176 8.52135 8.14176C8.15784 8.14176 7.86317 7.84709 7.86317 7.48358V4.94949C7.86317 3.22868 9.26871 1.82313 10.9895 1.82313C12.7103 1.82313 14.1159 3.22868 14.1159 4.94949V7.48358C14.1159 7.84709 13.8212 8.14176 13.4577 8.14176C13.0942 8.14176 12.7995 7.84709 12.7995 7.48358V4.94949Z"
|
|
30
|
+
fill="#528693"
|
|
31
|
+
/>
|
|
32
|
+
<path
|
|
33
|
+
d="M7.49405 18.1396C7.28915 17.9347 7.28915 17.6025 7.49405 17.3976L13.7415 11.1501C13.9464 10.9452 14.2786 10.9452 14.4835 11.1501V11.1501C14.6884 11.355 14.6884 11.6872 14.4835 11.8921L8.23605 18.1396C8.03115 18.3445 7.69895 18.3445 7.49405 18.1396V18.1396Z"
|
|
34
|
+
fill="white"
|
|
35
|
+
/>
|
|
36
|
+
<path
|
|
37
|
+
fillRule="evenodd"
|
|
38
|
+
clipRule="evenodd"
|
|
39
|
+
d="M7.15156 17.0545L13.399 10.8071C13.7933 10.4127 14.4327 10.4127 14.8271 10.8071C15.2215 11.2014 15.2215 11.8408 14.8271 12.2352L8.57969 18.4826C8.18533 18.877 7.54593 18.877 7.15156 18.4826C6.7572 18.0883 6.7572 17.4489 7.15156 17.0545ZM7.49463 17.3976C7.28973 17.6025 7.28973 17.9347 7.49463 18.1396C7.69953 18.3445 8.03173 18.3445 8.23663 18.1396L14.484 11.8921C14.6889 11.6872 14.6889 11.355 14.484 11.1501C14.2791 10.9452 13.9469 10.9452 13.742 11.1501L7.49463 17.3976Z"
|
|
40
|
+
fill="#528693"
|
|
41
|
+
/>
|
|
42
|
+
<path
|
|
43
|
+
d="M10.7594 12.0233C10.7594 13.0274 9.94538 13.8414 8.94123 13.8414C7.93707 13.8414 7.12305 13.0274 7.12305 12.0233C7.12305 11.0191 7.93707 10.2051 8.94123 10.2051C9.94538 10.2051 10.7594 11.0191 10.7594 12.0233Z"
|
|
44
|
+
fill="white"
|
|
45
|
+
/>
|
|
46
|
+
<path
|
|
47
|
+
fillRule="evenodd"
|
|
48
|
+
clipRule="evenodd"
|
|
49
|
+
d="M8.94123 13.3563C9.67743 13.3563 10.2742 12.7595 10.2742 12.0233C10.2742 11.2871 9.67743 10.6902 8.94123 10.6902C8.20502 10.6902 7.60821 11.2871 7.60821 12.0233C7.60821 12.7595 8.20502 13.3563 8.94123 13.3563ZM8.94123 13.8414C9.94538 13.8414 10.7594 13.0274 10.7594 12.0233C10.7594 11.0191 9.94538 10.2051 8.94123 10.2051C7.93707 10.2051 7.12305 11.0191 7.12305 12.0233C7.12305 13.0274 7.93707 13.8414 8.94123 13.8414Z"
|
|
50
|
+
fill="#528693"
|
|
51
|
+
/>
|
|
52
|
+
<path
|
|
53
|
+
d="M14.8532 17.2606C14.8532 18.2647 14.0391 19.0787 13.035 19.0787C12.0308 19.0787 11.2168 18.2647 11.2168 17.2606C11.2168 16.2564 12.0308 15.4424 13.035 15.4424C14.0391 15.4424 14.8532 16.2564 14.8532 17.2606Z"
|
|
54
|
+
fill="white"
|
|
55
|
+
/>
|
|
56
|
+
<path
|
|
57
|
+
fillRule="evenodd"
|
|
58
|
+
clipRule="evenodd"
|
|
59
|
+
d="M13.035 18.5936C13.7712 18.5936 14.368 17.9968 14.368 17.2606C14.368 16.5244 13.7712 15.9275 13.035 15.9275C12.2988 15.9275 11.702 16.5244 11.702 17.2606C11.702 17.9968 12.2988 18.5936 13.035 18.5936ZM13.035 19.0787C14.0391 19.0787 14.8532 18.2647 14.8532 17.2606C14.8532 16.2564 14.0391 15.4424 13.035 15.4424C12.0308 15.4424 11.2168 16.2564 11.2168 17.2606C11.2168 18.2647 12.0308 19.0787 13.035 19.0787Z"
|
|
60
|
+
fill="#528693"
|
|
61
|
+
/>
|
|
62
|
+
</svg>
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
Promotion.displayName = 'PromotionIcon';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { forwardRef, SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
type SpecialPriceProps = SVGProps<SVGSVGElement>;
|
|
4
|
+
|
|
5
|
+
type SpecialPriceRef = SVGSVGElement;
|
|
6
|
+
|
|
7
|
+
export const SpecialPrice = forwardRef<SpecialPriceRef, SpecialPriceProps>((delegated, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg ref={ref} width="23" height="22" viewBox="0 0 23 22" fill="none" {...delegated}>
|
|
10
|
+
<path
|
|
11
|
+
fill="#BFF6F8"
|
|
12
|
+
d="M10.568 1.418c.542-.42 1.3-.42 1.843 0l1.324 1.025c.276.214.618.325.968.315l1.673-.052c.686-.021 1.3.425 1.492 1.084l.468 1.607c.097.336.309.627.598.824l1.384.941c.567.386.802 1.108.57 1.754l-.567 1.575a1.506 1.506 0 0 0 0 1.018l.567 1.575a1.505 1.505 0 0 1-.57 1.754l-1.384.942c-.29.196-.5.487-.598.823l-.468 1.607a1.505 1.505 0 0 1-1.492 1.084l-1.673-.052c-.35-.01-.692.1-.968.315l-1.324 1.025c-.542.42-1.3.42-1.843 0l-1.324-1.025a1.505 1.505 0 0 0-.968-.315l-1.673.052a1.505 1.505 0 0 1-1.491-1.084l-.468-1.607a1.505 1.505 0 0 0-.599-.824l-1.384-.941a1.505 1.505 0 0 1-.57-1.753l.567-1.576a1.505 1.505 0 0 0 0-1.018L2.09 8.916a1.505 1.505 0 0 1 .57-1.754l1.384-.941c.29-.197.5-.488.599-.824l.468-1.607a1.505 1.505 0 0 1 1.49-1.084l1.674.052c.35.01.692-.1.968-.315l1.324-1.025Z"
|
|
13
|
+
/>
|
|
14
|
+
<path
|
|
15
|
+
fill="#528693"
|
|
16
|
+
fillRule="evenodd"
|
|
17
|
+
d="M13.393 2.884 12.07 1.859a.947.947 0 0 0-1.16 0L9.585 2.884a2.063 2.063 0 0 1-1.327.431l-1.673-.051a.947.947 0 0 0-.939.681L5.18 5.553c-.134.46-.424.86-.82 1.129l-1.384.942a.947.947 0 0 0-.359 1.103l.567 1.575c.162.451.162.945 0 1.396l-.567 1.575a.947.947 0 0 0 .359 1.104l1.384.941c.396.27.686.669.82 1.13l.468 1.607c.12.414.507.695.939.681l1.673-.051c.48-.015.948.137 1.327.43l1.323 1.026a.947.947 0 0 0 1.16 0l1.324-1.025a2.063 2.063 0 0 1 1.327-.431l1.673.051a.947.947 0 0 0 .939-.681l.468-1.608c.134-.46.424-.86.82-1.129l1.384-.941a.947.947 0 0 0 .359-1.104l-.566-1.575a2.063 2.063 0 0 1 0-1.396l.566-1.575a.947.947 0 0 0-.359-1.103l-1.384-.942a2.063 2.063 0 0 1-.82-1.13l-.468-1.607a.947.947 0 0 0-.939-.681l-1.673.051a2.063 2.063 0 0 1-1.327-.431Zm-.982-1.466c-.542-.42-1.3-.42-1.843 0L9.244 2.443a1.505 1.505 0 0 1-.968.315l-1.673-.052A1.505 1.505 0 0 0 5.112 3.79l-.468 1.607c-.098.336-.31.627-.599.824l-1.384.941a1.505 1.505 0 0 0-.57 1.754l.567 1.575c.118.329.118.689 0 1.018l-.567 1.575a1.505 1.505 0 0 0 .57 1.754l1.384.942c.29.196.5.487.599.823l.468 1.607a1.505 1.505 0 0 0 1.49 1.084l1.674-.052c.35-.01.692.1.968.315l1.324 1.025c.542.42 1.3.42 1.843 0l1.324-1.025c.276-.214.618-.325.968-.315l1.673.052c.686.021 1.3-.425 1.492-1.084l.468-1.607c.097-.336.309-.627.598-.824l1.384-.941a1.505 1.505 0 0 0 .57-1.753l-.567-1.576a1.506 1.506 0 0 1 0-1.018l.567-1.575a1.505 1.505 0 0 0-.57-1.754l-1.384-.941a1.505 1.505 0 0 1-.598-.824l-.468-1.607a1.505 1.505 0 0 0-1.492-1.084l-1.673.052c-.35.01-.692-.1-.968-.315L12.41 1.418Z"
|
|
18
|
+
clipRule="evenodd"
|
|
19
|
+
/>
|
|
20
|
+
<path
|
|
21
|
+
fill="#fff"
|
|
22
|
+
d="M7.471 15.02a.603.603 0 0 1 0-.853l7.184-7.183a.603.603 0 0 1 .853.853L8.324 15.02a.603.603 0 0 1-.853 0Z"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
fill="#528693"
|
|
26
|
+
fillRule="evenodd"
|
|
27
|
+
d="m7.076 13.773 7.184-7.184a1.161 1.161 0 1 1 1.642 1.642L8.72 15.415a1.161 1.161 0 0 1-1.643-1.642Zm.395.394a.603.603 0 0 0 .853.853l7.184-7.183a.603.603 0 1 0-.853-.853L7.47 14.167Z"
|
|
28
|
+
clipRule="evenodd"
|
|
29
|
+
/>
|
|
30
|
+
<path fill="#fff" d="M11.226 7.989a2.09 2.09 0 1 1-4.182 0 2.09 2.09 0 0 1 4.182 0Z" />
|
|
31
|
+
<path
|
|
32
|
+
fill="#528693"
|
|
33
|
+
fillRule="evenodd"
|
|
34
|
+
d="M9.135 9.521a1.533 1.533 0 1 0 0-3.065 1.533 1.533 0 0 0 0 3.065Zm0 .558a2.09 2.09 0 1 0 0-4.181 2.09 2.09 0 0 0 0 4.181Z"
|
|
35
|
+
clipRule="evenodd"
|
|
36
|
+
/>
|
|
37
|
+
<path fill="#fff" d="M15.934 14.011a2.09 2.09 0 1 1-4.181 0 2.09 2.09 0 0 1 4.18 0Z" />
|
|
38
|
+
<path
|
|
39
|
+
fill="#528693"
|
|
40
|
+
fillRule="evenodd"
|
|
41
|
+
d="M13.843 15.544a1.533 1.533 0 1 0 0-3.066 1.533 1.533 0 0 0 0 3.066Zm0 .558a2.09 2.09 0 1 0 0-4.182 2.09 2.09 0 0 0 0 4.182Z"
|
|
42
|
+
clipRule="evenodd"
|
|
43
|
+
/>
|
|
44
|
+
</svg>
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
SpecialPrice.displayName = 'SpecialPriceIcon';
|
package/src/popover/popover.css
CHANGED
|
@@ -3,18 +3,25 @@ import type { CrystallizeRichText, CrystallizeRichTextNode } from '../types/crys
|
|
|
3
3
|
export function parseInitialState({ richText }: { richText: CrystallizeRichText }): CrystallizeRichTextNode[] {
|
|
4
4
|
let richTextArray = Array.isArray(richText) ? richText : [richText];
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
const ensureRootBlockElements = (richTextArray: CrystallizeRichText): CrystallizeRichText =>
|
|
7
|
+
richTextArray.flatMap(rootNode => {
|
|
8
|
+
if (Array.isArray(rootNode)) {
|
|
9
|
+
return ensureRootBlockElements(rootNode);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (!rootNode?.kind || rootNode.kind === 'inline') {
|
|
13
|
+
return {
|
|
14
|
+
type: 'paragraph',
|
|
15
|
+
kind: 'block',
|
|
16
|
+
children: [rootNode],
|
|
17
|
+
};
|
|
18
|
+
}
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
return rootNode;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Ensure all root items are block elements
|
|
24
|
+
richTextArray = ensureRootBlockElements(richTextArray);
|
|
18
25
|
|
|
19
26
|
return richTextArray;
|
|
20
27
|
}
|