@crystallize/design-system 1.24.46 → 2.0.2

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 (171) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/{chunk-6DIAYHKQ.mjs → chunk-D4B2KPZR.mjs} +5384 -4415
  3. package/dist/index.css +156 -208
  4. package/dist/index.d.ts +57 -204
  5. package/dist/index.js +8927 -8258
  6. package/dist/index.mjs +137 -307
  7. package/dist/{parser-babel-B7AMC4UT.mjs → parser-babel-D5SPHKKD.mjs} +2424 -2411
  8. package/dist/{parser-html-URMUOK6U.mjs → parser-html-RZQPYQ4H.mjs} +3 -3
  9. package/dist/{parser-postcss-AN2EJ77H.mjs → parser-postcss-D5TI5WMI.mjs} +6 -6
  10. package/dist/{rich-text-editor-EVN3N57G.css → rich-text-editor-4ZROYBHM.css} +98 -147
  11. package/dist/{rich-text-editor-QGMRYDKQ.mjs → rich-text-editor-QIDU7APE.mjs} +667 -873
  12. package/dist/{standalone-AR2ENVE7.mjs → standalone-COC5HE24.mjs} +8 -6
  13. package/package.json +26 -27
  14. package/src/action-menu/action-menu.tsx +1 -2
  15. package/src/dialog/config.tsx +6 -10
  16. package/src/dialog/dialog.tsx +2 -2
  17. package/src/dropdown-menu/dropdown-menu-root.tsx +3 -4
  18. package/src/iconography/Icon.stories.tsx +0 -1
  19. package/src/iconography/actions.tsx +1 -5
  20. package/src/iconography/add.tsx +1 -5
  21. package/src/iconography/advance.tsx +1 -5
  22. package/src/iconography/app.tsx +1 -5
  23. package/src/iconography/archive.tsx +1 -5
  24. package/src/iconography/arrow.tsx +1 -5
  25. package/src/iconography/atom.tsx +1 -5
  26. package/src/iconography/battery.tsx +1 -5
  27. package/src/iconography/bell.tsx +1 -5
  28. package/src/iconography/billing-payments.tsx +1 -5
  29. package/src/iconography/bin.tsx +1 -5
  30. package/src/iconography/boolean.tsx +17 -0
  31. package/src/iconography/cancel.tsx +1 -5
  32. package/src/iconography/caret.tsx +2 -6
  33. package/src/iconography/cart.tsx +1 -5
  34. package/src/iconography/catalogue.tsx +1 -4
  35. package/src/iconography/check-with-circle.tsx +1 -4
  36. package/src/iconography/check.tsx +1 -4
  37. package/src/iconography/checkbox.tsx +24 -0
  38. package/src/iconography/chevron.tsx +1 -3
  39. package/src/iconography/choice.tsx +1 -5
  40. package/src/iconography/chunk.tsx +1 -5
  41. package/src/iconography/clock.tsx +1 -5
  42. package/src/iconography/cloud-with-key-hole.tsx +1 -5
  43. package/src/iconography/cloud.tsx +1 -5
  44. package/src/iconography/compact.tsx +1 -5
  45. package/src/iconography/copy-with-cloud.tsx +2 -13
  46. package/src/iconography/copy.tsx +1 -5
  47. package/src/iconography/coupon.tsx +1 -5
  48. package/src/iconography/crystal.tsx +2 -14
  49. package/src/iconography/customers.tsx +1 -5
  50. package/src/iconography/dashboard.tsx +1 -5
  51. package/src/iconography/date-infinity.tsx +1 -5
  52. package/src/iconography/date.tsx +1 -5
  53. package/src/iconography/discovery.tsx +1 -5
  54. package/src/iconography/document-shortcut.tsx +1 -5
  55. package/src/iconography/document.tsx +1 -5
  56. package/src/iconography/dots.tsx +1 -5
  57. package/src/iconography/download.tsx +1 -5
  58. package/src/iconography/drag-handle.tsx +1 -5
  59. package/src/iconography/dynamic-value.tsx +1 -5
  60. package/src/iconography/edit.tsx +1 -5
  61. package/src/iconography/error-white.tsx +1 -4
  62. package/src/iconography/error.tsx +1 -4
  63. package/src/iconography/expanded.tsx +1 -5
  64. package/src/iconography/eye-closed.tsx +1 -5
  65. package/src/iconography/eye-open.tsx +1 -5
  66. package/src/iconography/file-upload.tsx +1 -5
  67. package/src/iconography/filename.tsx +1 -5
  68. package/src/iconography/fixed-property-table.tsx +1 -5
  69. package/src/iconography/fixed-value.tsx +1 -5
  70. package/src/iconography/flow.tsx +9 -21
  71. package/src/iconography/folder-shortcut.tsx +1 -5
  72. package/src/iconography/folder.tsx +1 -5
  73. package/src/iconography/frontends.tsx +1 -5
  74. package/src/iconography/fulfilment.tsx +1 -5
  75. package/src/iconography/glasses.tsx +2 -13
  76. package/src/iconography/graphQL.tsx +2 -13
  77. package/src/iconography/grid-relation.tsx +1 -5
  78. package/src/iconography/grid.tsx +1 -5
  79. package/src/iconography/hand-mirror.tsx +1 -4
  80. package/src/iconography/hooks.tsx +1 -5
  81. package/src/iconography/image.tsx +1 -5
  82. package/src/iconography/index.ts +18 -1
  83. package/src/iconography/info.tsx +1 -4
  84. package/src/iconography/items.tsx +1 -5
  85. package/src/iconography/key.tsx +1 -5
  86. package/src/iconography/language.tsx +2 -6
  87. package/src/iconography/lifebouy.tsx +2 -6
  88. package/src/iconography/limitations.tsx +1 -5
  89. package/src/iconography/location.tsx +2 -6
  90. package/src/iconography/lock-closed.tsx +1 -5
  91. package/src/iconography/lock-open.tsx +2 -6
  92. package/src/iconography/magnifier.tsx +22 -37
  93. package/src/iconography/meta-preset.tsx +36 -0
  94. package/src/iconography/min-quantity.tsx +2 -6
  95. package/src/iconography/min-value.tsx +2 -6
  96. package/src/iconography/multilingual.tsx +2 -6
  97. package/src/iconography/multiple-choice.tsx +2 -6
  98. package/src/iconography/mushroom.tsx +2 -6
  99. package/src/iconography/nail-polish.tsx +3 -14
  100. package/src/iconography/number.tsx +16 -0
  101. package/src/iconography/numeric.tsx +2 -6
  102. package/src/iconography/operation-log.tsx +33 -0
  103. package/src/iconography/order.tsx +2 -6
  104. package/src/iconography/organization.tsx +2 -6
  105. package/src/iconography/paragraph-collection.tsx +2 -6
  106. package/src/iconography/particle.tsx +3 -15
  107. package/src/iconography/paths.tsx +2 -5
  108. package/src/iconography/people.tsx +2 -6
  109. package/src/iconography/percentage.tsx +3 -8
  110. package/src/iconography/piece.tsx +4 -8
  111. package/src/iconography/pin.tsx +2 -6
  112. package/src/iconography/pipeline-dashed.tsx +2 -6
  113. package/src/iconography/plans-and-pricing.tsx +2 -6
  114. package/src/iconography/plug.tsx +2 -6
  115. package/src/iconography/price-list.tsx +2 -6
  116. package/src/iconography/price-tag.tsx +2 -6
  117. package/src/iconography/product-shortcut.tsx +2 -6
  118. package/src/iconography/product.tsx +2 -6
  119. package/src/iconography/promotion.tsx +2 -6
  120. package/src/iconography/property-table.tsx +2 -6
  121. package/src/iconography/relation.tsx +2 -6
  122. package/src/iconography/remove.tsx +2 -6
  123. package/src/iconography/renew.tsx +2 -6
  124. package/src/iconography/restricted-catalogue.tsx +2 -5
  125. package/src/iconography/rich-text.tsx +2 -6
  126. package/src/iconography/rocket.tsx +2 -6
  127. package/src/iconography/search.tsx +2 -6
  128. package/src/iconography/select.tsx +20 -0
  129. package/src/iconography/selection.tsx +2 -6
  130. package/src/iconography/settings.tsx +2 -6
  131. package/src/iconography/shapes.tsx +2 -6
  132. package/src/iconography/singleline.tsx +2 -6
  133. package/src/iconography/special-price.tsx +2 -6
  134. package/src/iconography/split.tsx +2 -6
  135. package/src/iconography/stock-location.tsx +2 -6
  136. package/src/iconography/string.tsx +16 -0
  137. package/src/iconography/subscription-contracts.tsx +43 -49
  138. package/src/iconography/subscription-plans.tsx +2 -6
  139. package/src/iconography/subscription.tsx +2 -6
  140. package/src/iconography/switch.tsx +2 -6
  141. package/src/iconography/target.tsx +2 -6
  142. package/src/iconography/topics-branch.tsx +2 -6
  143. package/src/iconography/topics-leaf.tsx +2 -6
  144. package/src/iconography/topics.tsx +2 -6
  145. package/src/iconography/transition-in-disabled.tsx +2 -6
  146. package/src/iconography/transition-in.tsx +2 -6
  147. package/src/iconography/transition-out-disabled.tsx +13 -19
  148. package/src/iconography/transition-out.tsx +2 -6
  149. package/src/iconography/unpublish.tsx +2 -6
  150. package/src/iconography/usage-meter.tsx +4 -8
  151. package/src/iconography/usage.tsx +2 -6
  152. package/src/iconography/user-card.tsx +2 -6
  153. package/src/iconography/user.tsx +2 -6
  154. package/src/iconography/users.tsx +2 -6
  155. package/src/iconography/variant.tsx +2 -6
  156. package/src/iconography/video.tsx +2 -6
  157. package/src/iconography/wand.tsx +2 -6
  158. package/src/iconography/warning.tsx +2 -5
  159. package/src/iconography/x-for-y.tsx +2 -6
  160. package/src/label/label.tsx +1 -1
  161. package/src/popover/popover.tsx +5 -6
  162. package/src/rich-text-editor/tests/rich-text-editor-basic-rendering.test.tsx +8 -6
  163. package/src/rich-text-editor/tests/rich-text-editor-code.test.tsx +1 -1
  164. package/src/rich-text-editor/tests/rich-text-editor-onchange.test.tsx +4 -18
  165. package/src/rich-text-editor/tests/rich-text-editor-quote.test.tsx +2 -1
  166. package/src/rich-text-editor/tests/rich-text-editor-typing.test.tsx +6 -4
  167. package/src/rich-text-editor/tests/utils.ts +3 -1
  168. package/src/select/select-root.tsx +2 -2
  169. package/src/spinner/index.tsx +3 -3
  170. package/src/tag/tag.tsx +2 -2
  171. package/src/tooltip/tooltip.tsx +1 -1
@@ -1,12 +1,8 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
3
  import { stroke } from './variables';
4
4
 
5
- type TransitionInDisabledProps = SVGProps<SVGSVGElement>;
6
-
7
- type TransitionInDisabledRef = SVGSVGElement;
8
-
9
- export const TransitionInDisabled = forwardRef<TransitionInDisabledRef, TransitionInDisabledProps>((delegated, ref) => {
5
+ export const TransitionInDisabled = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
10
6
  return (
11
7
  <svg ref={ref} width="22" height="22" viewBox="0 0 22 22" fill="none" {...delegated}>
12
8
  <rect width="7" height="1" x="12.95" y="18.77" fill={stroke} rx=".5" transform="rotate(-135 12.95 18.77)" />
@@ -1,12 +1,8 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
3
  import { fill, stroke } from './variables';
4
4
 
5
- type TransitionInProps = SVGProps<SVGSVGElement>;
6
-
7
- type TransitionInRef = SVGSVGElement;
8
-
9
- export const TransitionIn = forwardRef<TransitionInRef, TransitionInProps>((delegated, ref) => {
5
+ export const TransitionIn = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
10
6
  return (
11
7
  <svg ref={ref} width="22" height="22" viewBox="0 0 22 22" fill="none" {...delegated}>
12
8
  <path
@@ -1,24 +1,18 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
3
  import { stroke } from './variables';
4
4
 
5
- type TransitionOutDisabledProps = SVGProps<SVGSVGElement>;
6
-
7
- type TransitionOutDisabledRef = SVGSVGElement;
8
-
9
- export const TransitionOutDisabled = forwardRef<TransitionOutDisabledRef, TransitionOutDisabledProps>(
10
- (delegated, ref) => {
11
- return (
12
- <svg ref={ref} width="22" height="22" viewBox="0 0 22 22" fill="none" {...delegated}>
13
- <path
14
- fill={stroke}
15
- d="M2.475 18.428h1.06a.3.3 0 0 0 0-.6h-1.06c-.27 0-.401-.176-.401-.296v-.944a.3.3 0 0 0-.601 0v.944c0 .54.497.896 1.002.896Zm0-4.968h1.06a.3.3 0 0 0 0-.6h-1.06c-.505 0-1.002.357-1.002.896v.944a.3.3 0 0 0 .6 0v-.944c0-.12.133-.296.402-.296Zm3.18 4.968h2.122a.3.3 0 1 0 0-.6H5.656a.3.3 0 0 0 0 .6Zm0-4.968h2.122a.3.3 0 1 0 0-.6H5.656a.3.3 0 0 0 0 .6Zm4.243 4.968h2.12a.3.3 0 0 0 0-.6h-2.12a.3.3 0 1 0 0 .6Zm0-4.968h2.12a.3.3 0 0 0 0-.6h-2.12a.3.3 0 1 0 0 .6Zm4.241 4.968h2.121a.3.3 0 1 0 0-.6H14.14a.3.3 0 0 0 0 .6Zm0-4.968h2.121a.3.3 0 1 0 0-.6H14.14a.3.3 0 0 0 0 .6Zm4.242 4.968h1.06c.506 0 1.002-.357 1.002-.896v-.944a.3.3 0 1 0-.6 0v.944c0 .12-.132.296-.401.296h-1.06a.3.3 0 1 0 0 .6Zm0-4.968h1.06c.27 0 .402.177.402.296v.944a.3.3 0 0 0 .6 0v-.944c0-.538-.496-.895-1.001-.895h-1.06a.3.3 0 1 0 0 .6Z"
16
- />
17
- <rect width="7" height="1" x="8.707" y="4" fill={stroke} rx=".5" transform="rotate(45 8.707 4)" />
18
- <rect width="7" height="1" x="13.657" y="4.707" fill={stroke} rx=".5" transform="rotate(135 13.657 4.707)" />
19
- </svg>
20
- );
21
- },
22
- );
5
+ export const TransitionOutDisabled = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
6
+ return (
7
+ <svg ref={ref} width="22" height="22" viewBox="0 0 22 22" fill="none" {...delegated}>
8
+ <path
9
+ fill={stroke}
10
+ d="M2.475 18.428h1.06a.3.3 0 0 0 0-.6h-1.06c-.27 0-.401-.176-.401-.296v-.944a.3.3 0 0 0-.601 0v.944c0 .54.497.896 1.002.896Zm0-4.968h1.06a.3.3 0 0 0 0-.6h-1.06c-.505 0-1.002.357-1.002.896v.944a.3.3 0 0 0 .6 0v-.944c0-.12.133-.296.402-.296Zm3.18 4.968h2.122a.3.3 0 1 0 0-.6H5.656a.3.3 0 0 0 0 .6Zm0-4.968h2.122a.3.3 0 1 0 0-.6H5.656a.3.3 0 0 0 0 .6Zm4.243 4.968h2.12a.3.3 0 0 0 0-.6h-2.12a.3.3 0 1 0 0 .6Zm0-4.968h2.12a.3.3 0 0 0 0-.6h-2.12a.3.3 0 1 0 0 .6Zm4.241 4.968h2.121a.3.3 0 1 0 0-.6H14.14a.3.3 0 0 0 0 .6Zm0-4.968h2.121a.3.3 0 1 0 0-.6H14.14a.3.3 0 0 0 0 .6Zm4.242 4.968h1.06c.506 0 1.002-.357 1.002-.896v-.944a.3.3 0 1 0-.6 0v.944c0 .12-.132.296-.401.296h-1.06a.3.3 0 1 0 0 .6Zm0-4.968h1.06c.27 0 .402.177.402.296v.944a.3.3 0 0 0 .6 0v-.944c0-.538-.496-.895-1.001-.895h-1.06a.3.3 0 1 0 0 .6Z"
11
+ />
12
+ <rect width="7" height="1" x="8.707" y="4" fill={stroke} rx=".5" transform="rotate(45 8.707 4)" />
13
+ <rect width="7" height="1" x="13.657" y="4.707" fill={stroke} rx=".5" transform="rotate(135 13.657 4.707)" />
14
+ </svg>
15
+ );
16
+ });
23
17
 
24
18
  TransitionOutDisabled.displayName = 'TransitionOutDisabledIcon';
@@ -1,12 +1,8 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
3
  import { fill, stroke } from './variables';
4
4
 
5
- type TransitionOutProps = SVGProps<SVGSVGElement>;
6
-
7
- type TransitionOutRef = SVGSVGElement;
8
-
9
- export const TransitionOut = forwardRef<TransitionOutRef, TransitionOutProps>((delegated, ref) => {
5
+ export const TransitionOut = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
10
6
  return (
11
7
  <svg ref={ref} width="22" height="22" viewBox="0 0 22 22" fill="none" {...delegated}>
12
8
  <path
@@ -1,12 +1,8 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
3
  import { fill, stroke } from './variables';
4
4
 
5
- type UnpublishProps = SVGProps<SVGSVGElement>;
6
-
7
- type UnpublishRef = SVGSVGElement;
8
-
9
- export const Unpublish = forwardRef<UnpublishRef, UnpublishProps>((delegated, ref) => {
5
+ export const Unpublish = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
10
6
  return (
11
7
  <svg ref={ref} width="22" height="22" viewBox="0 0 22 22" fill="none" {...delegated}>
12
8
  <path
@@ -1,13 +1,9 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
- type UsageMeterProps = SVGProps<SVGSVGElement>;
4
-
5
- type UsageMeterRef = SVGSVGElement;
6
-
7
- export const UsageMeter = forwardRef<UsageMeterRef, UsageMeterProps>((delegated, ref) => {
3
+ export const UsageMeter = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
8
4
  return (
9
5
  <svg ref={ref} width="17" height="16" viewBox="0 0 17 16" fill="none" {...delegated}>
10
- <g clipPath="url(#a)">
6
+ <g clipPath="url(#usage-meter)">
11
7
  <path
12
8
  d="M15.836 9.0665a1.7036 1.7036 0 0 0 .0053-.3334 6.6839 6.6839 0 0 0-1.1166-3.0268c-.0423-.0635-.0846-.1217-.1217-.18-.0582-.074-.1111-.1534-.1693-.2275a5.5278 5.5278 0 0 0-.3175-.381c-.0053-.0053-.0106-.0158-.0212-.0211a7.2427 7.2427 0 0 0-.6403-.635c-.0741-.0635-.1534-.1165-.2275-.1747a.0053.0053 0 0 0-.0016-.0037.0052.0052 0 0 0-.0037-.0015c-.1535-.1165-.3069-.2329-.471-.3387a.2946.2946 0 0 0-.0423-.0265c-.1376-.09-.2857-.1746-.4286-.2593-.0582-.0317-.1217-.0582-.1799-.09-.1059-.0528-.2117-.1058-.3175-.1534-.1059-.0476-.217-.09-.3228-.1323-.0741-.0264-.1429-.0582-.217-.0846a4.7983 4.7983 0 0 0-.3651-.1112 4.3458 4.3458 0 0 0-.2487-.0688 3.9942 3.9942 0 0 0-.2434-.0529 6.621 6.621 0 0 0-1.5134-.1534 6.9257 6.9257 0 0 0-6.768 6.1224c0 .0476.0053.0846.0053.1323a6.6487 6.6487 0 0 0 .09 2.0478 6.838 6.838 0 0 0 .3439 1.1695c.0794.1958.164.3863.2593.5768a7.523 7.523 0 0 0 .1534.2857l.037.0688.0795.1217.1534.2593c1.7568 0 3.5613-.0053 5.5615-.0106.0741 0 .1482.0053.2223.0053 1.434.0106 2.5664.0212 4.1327-.0106.5133 0 1.0372-.0053 1.5822-.0053.0688-.1111.1482-.2381.2329-.381.0423-.0846.0952-.1799.1481-.2804a6.1283 6.1283 0 0 0 .3122-.7091 6.9592 6.9592 0 0 0 .4181-1.8785c0-.0371-.0053-.0635-.0053-.1006a7.2363 7.2363 0 0 0 .0053-.9577Zm-.7885 1.6986a5.9413 5.9413 0 0 1-.3175 1.0477 5.3569 5.3569 0 0 1-.2275.508c-.0477.0847-.09.1693-.1376.254l-.0476.0741-5.3763.0159H7.1154c-1.1536-.0106-2.309-.0141-3.466-.0106a.0399.0399 0 0 0-.0212.0106c-.0053-.0053-.0053-.0106-.0159-.0265-.0423-.0741-.0952-.1534-.1376-.2434a5.1632 5.1632 0 0 1-.2963-.635 6.1699 6.1699 0 0 1-.4075-1.688v-.0265a6.5296 6.5296 0 0 1-.0053-.9102c.03-.1036.0494-.21.0583-.3174a6.203 6.203 0 0 1 2.323-4.1434c.0317-.0265.0635-.0476.0952-.074.0847-.0636.1747-.127.2646-.1906a6.2837 6.2837 0 0 1 3.5771-1.0583 6.1823 6.1823 0 0 1 3.8365 1.4234c.0688.0583.1376.1165.2063.18a6.244 6.244 0 0 1 1.7675 2.7569c.0052.0159.0052.0265.0105.0423.0477.1482.0847.3017.1165.4498.0154.0593.0277.1194.037.18.0212.127.0423.254.0582.3862a6.1523 6.1523 0 0 1-.0688 1.995Z"
13
9
  fill="#528693"
@@ -30,7 +26,7 @@ export const UsageMeter = forwardRef<UsageMeterRef, UsageMeterProps>((delegated,
30
26
  />
31
27
  </g>
32
28
  <defs>
33
- <clipPath id="a">
29
+ <clipPath id="usage-meter">
34
30
  <path fill="#fff" transform="translate(.984)" d="M0 0h16v16H0z" />
35
31
  </clipPath>
36
32
  </defs>
@@ -1,10 +1,6 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
- type UsageProps = SVGProps<SVGSVGElement>;
4
-
5
- type UsageRef = SVGSVGElement;
6
-
7
- export const Usage = forwardRef<UsageRef, UsageProps>((delegated, ref) => {
3
+ export const Usage = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
8
4
  return (
9
5
  <svg ref={ref} width="23" height="23" viewBox="0 0 23 23" fill="none" {...delegated}>
10
6
  <path
@@ -1,10 +1,6 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
- type UserCardProps = SVGProps<SVGSVGElement>;
4
-
5
- type UserCardRef = SVGSVGElement;
6
-
7
- export const UserCard = forwardRef<UserCardRef, UserCardProps>((delegated, ref) => {
3
+ export const UserCard = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
8
4
  return (
9
5
  <svg ref={ref} width="17" height="16" viewBox="0 0 17 16" fill="none" {...delegated}>
10
6
  <rect x="2.184" y="4.2" width="13.6" height="8.6" rx=".8" fill="#BFF6F8" stroke="#528693" strokeWidth=".4" />
@@ -1,12 +1,8 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
3
  import { fill, stroke } from './variables';
4
4
 
5
- type UserProps = SVGProps<SVGSVGElement>;
6
-
7
- type UserRef = SVGSVGElement;
8
-
9
- export const User = forwardRef<UserRef, UserProps>((delegated, ref) => {
5
+ export const User = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
10
6
  return (
11
7
  <svg ref={ref} width="23" height="22" viewBox="0 0 23 22" fill="none" {...delegated}>
12
8
  <path
@@ -1,12 +1,8 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
3
  import { fill, stroke } from './variables';
4
4
 
5
- type UsersProps = SVGProps<SVGSVGElement>;
6
-
7
- type UsersRef = SVGSVGElement;
8
-
9
- export const Users = forwardRef<UsersRef, UsersProps>((delegated, ref) => {
5
+ export const Users = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
10
6
  return (
11
7
  <svg ref={ref} width="24" height="24" viewBox="0 0 24 24" fill="none" {...delegated}>
12
8
  <path
@@ -1,12 +1,8 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
3
  import { fill, stroke } from './variables';
4
4
 
5
- type VariantProps = SVGProps<SVGSVGElement>;
6
-
7
- type VariantRef = SVGSVGElement;
8
-
9
- export const Variant = forwardRef<VariantRef, VariantProps>((delegated, ref) => {
5
+ export const Variant = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
10
6
  return (
11
7
  <svg ref={ref} width="22" height="22" viewBox="0 0 22 22" fill="none" {...delegated}>
12
8
  <path
@@ -1,10 +1,6 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
- type VideoProps = SVGProps<SVGSVGElement>;
4
-
5
- type VideoRef = SVGSVGElement;
6
-
7
- export const Video = forwardRef<VideoRef, VideoProps>((delegated, ref) => {
3
+ export const Video = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
8
4
  return (
9
5
  <svg ref={ref} width="22" height="22" viewBox="0 0 22 22" fill="none" {...delegated}>
10
6
  <path
@@ -1,10 +1,6 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
- type WandProps = SVGProps<SVGSVGElement>;
4
-
5
- type WandRef = SVGSVGElement;
6
-
7
- export const Wand = forwardRef<WandRef, WandProps>((delegated, ref) => {
3
+ export const Wand = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
8
4
  return (
9
5
  <svg ref={ref} width="19" height="19" viewBox="0 0 19 19" fill="none" {...delegated}>
10
6
  <g clipPath="url(#wand)">
@@ -1,13 +1,10 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
3
  import { stroke } from './variables';
4
4
 
5
5
  const fill = 'var(--c-icon-fill, #FFDE99)';
6
6
 
7
- type WarningProps = SVGProps<SVGSVGElement>;
8
- type WarningRef = SVGSVGElement;
9
-
10
- export const Warning = forwardRef<WarningRef, WarningProps>((delegated, ref) => {
7
+ export const Warning = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
11
8
  return (
12
9
  <svg ref={ref} width="22" height="22" fill="none" viewBox="0 0 22 22" {...delegated}>
13
10
  <path
@@ -1,12 +1,8 @@
1
- import { forwardRef, SVGProps } from 'react';
1
+ import { forwardRef, type SVGProps } from 'react';
2
2
 
3
3
  import { fill, stroke } from './variables';
4
4
 
5
- type XForYProps = SVGProps<SVGSVGElement>;
6
-
7
- type XForYRef = SVGSVGElement;
8
-
9
- export const XForY = forwardRef<XForYRef, XForYProps>((delegated, ref) => {
5
+ export const XForY = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((delegated, ref) => {
10
6
  return (
11
7
  <svg ref={ref} width="22" height="22" viewBox="0 0 22 22" fill="none" {...delegated}>
12
8
  <path
@@ -1,4 +1,4 @@
1
- import { forwardRef, LabelHTMLAttributes } from 'react';
1
+ import { forwardRef, type LabelHTMLAttributes } from 'react';
2
2
  import { cx } from 'class-variance-authority';
3
3
 
4
4
  import './label.css';
@@ -1,4 +1,3 @@
1
- import type { ReactNode } from 'react';
2
1
  import { cx } from 'class-variance-authority';
3
2
  import * as PopoverPrimitive from '@radix-ui/react-popover';
4
3
 
@@ -6,12 +5,12 @@ import { PopoverClose } from './popover-close';
6
5
  import './popover.css';
7
6
 
8
7
  type PopoverProps = Pick<PopoverPrimitive.PopoverProps, 'open' | 'onOpenChange'> &
9
- Pick<PopoverPrimitive.PortalProps, 'container'> &
10
- PopoverPrimitive.PopperContentProps & {
11
- children: ReactNode;
12
- closeButton?: boolean | JSX.Element;
8
+ Pick<PopoverPrimitive.PopoverPortalProps, 'container'> &
9
+ Omit<PopoverPrimitive.PopoverContentProps, 'content'> & {
10
+ children: React.ReactNode;
11
+ closeButton?: boolean | React.JSX.Element;
13
12
  hasArrow?: boolean;
14
- content: ReactNode;
13
+ content: React.ReactNode;
15
14
  onOpenAutoFocus?: (e: Event) => void;
16
15
  };
17
16
 
@@ -10,7 +10,8 @@ const emptyParagraph: CrystallizeRichText = [{ kind: 'block', type: 'paragraph',
10
10
  describe('RichTextEditor basic rendering', () => {
11
11
  it('shows placeholder when no initial data is passed', async () => {
12
12
  const onChange = vi.fn();
13
- await render(<RichTextEditor placeholder="Get your content in here" />);
13
+ render(<RichTextEditor placeholder="Get your content in here" />);
14
+
14
15
  await sleep(1);
15
16
 
16
17
  expect(screen.getByText('Get your content in here')).toBeInTheDocument();
@@ -20,7 +21,8 @@ describe('RichTextEditor basic rendering', () => {
20
21
 
21
22
  it('should not trigger onChange on mount when no initialData is passed', async () => {
22
23
  const onChange = vi.fn();
23
- await render(<RichTextEditor onChange={onChange} />);
24
+ render(<RichTextEditor onChange={onChange} />);
25
+
24
26
  await sleep(1);
25
27
 
26
28
  expect(onChange).not.toHaveBeenCalled();
@@ -28,7 +30,8 @@ describe('RichTextEditor basic rendering', () => {
28
30
 
29
31
  it('should not trigger onChange on mount when initialData is passed', async () => {
30
32
  const onChange = vi.fn();
31
- await render(<RichTextEditor initialData={emptyParagraph} onChange={onChange} />);
33
+ render(<RichTextEditor initialData={emptyParagraph} onChange={onChange} />);
34
+
32
35
  await sleep(1);
33
36
 
34
37
  expect(onChange).not.toHaveBeenCalled();
@@ -36,9 +39,8 @@ describe('RichTextEditor basic rendering', () => {
36
39
 
37
40
  it('should trigger onChange on mount if triggerOnChangeOnAutoFocus and autoFocus is passed', async () => {
38
41
  const onChange = vi.fn();
39
- await render(
40
- <RichTextEditor initialData={emptyParagraph} onChange={onChange} triggerOnChangeOnAutoFocus autoFocus />,
41
- );
42
+ render(<RichTextEditor initialData={emptyParagraph} onChange={onChange} triggerOnChangeOnAutoFocus autoFocus />);
43
+
42
44
  await sleep(1);
43
45
 
44
46
  expect(onChange).toHaveBeenCalledTimes(1);
@@ -5,6 +5,7 @@ import { RichTextEditor } from '../rich-text-editor';
5
5
 
6
6
  describe('RichTextEditor code node', () => {
7
7
  it('can add a code block to an existing paragraph text', async () => {
8
+ const user = userEvent.setup();
8
9
  const onChange = vi.fn();
9
10
 
10
11
  render(
@@ -20,7 +21,6 @@ describe('RichTextEditor code node', () => {
20
21
  />,
21
22
  );
22
23
 
23
- const user = userEvent.setup();
24
24
  await user.click(screen.getByTestId('toggle-block-format'));
25
25
  await user.click(screen.getByTestId('toggle-block-format-code'));
26
26
 
@@ -5,33 +5,19 @@ import { RichTextEditor } from '../rich-text-editor';
5
5
 
6
6
  describe('RichTextEditor onChange behaves like expected', () => {
7
7
  it('will fire exactly 1 onChange if a single character was entered', async () => {
8
+ const user = userEvent.setup();
8
9
  const onChange = vi.fn();
9
10
 
10
11
  render(
11
- <RichTextEditor
12
- initialData={[
13
- {
14
- type: 'paragraph',
15
- kind: 'block',
16
- textContent: 'Hi',
17
- },
18
- ]}
19
- onChange={onChange}
20
- />,
12
+ <RichTextEditor initialData={[{ type: 'paragraph', kind: 'block', textContent: 'Hi' }]} onChange={onChange} />,
21
13
  );
22
14
 
23
15
  expect(onChange).toHaveBeenCalledTimes(0);
24
16
 
25
- const user = userEvent.setup();
17
+ await user.click(screen.getByRole('textbox'));
26
18
  await user.type(screen.getByRole('textbox'), '!');
27
19
 
28
20
  expect(onChange).toHaveBeenCalledTimes(1);
29
- expect(onChange).toHaveBeenCalledWith([
30
- {
31
- type: 'paragraph',
32
- kind: 'block',
33
- textContent: 'Hi!',
34
- },
35
- ]);
21
+ expect(onChange).toHaveBeenCalledWith([{ type: 'paragraph', kind: 'block', textContent: 'Hi!' }]);
36
22
  });
37
23
  });
@@ -1,7 +1,8 @@
1
1
  import { render, screen } from '@testing-library/react';
2
2
  import userEvent from '@testing-library/user-event';
3
3
 
4
- import { CrystallizeRichText, RichTextEditor } from '../rich-text-editor';
4
+ import { RichTextEditor } from '../rich-text-editor';
5
+ import type { CrystallizeRichText } from '../types/crystallize-rich-text-types';
5
6
 
6
7
  describe('RichTextEditor code node', () => {
7
8
  it('can replace an existing paragraph to a quote with clicking a dropdown item', async () => {
@@ -29,8 +29,10 @@ describe('RichTextEditor typing', () => {
29
29
  // });
30
30
 
31
31
  it('can change a simple text, keeping the textContent on paragraph', async () => {
32
+ const user = userEvent.setup();
32
33
  const onChange = vi.fn();
33
34
  const initialText = 'rabbit';
35
+
34
36
  render(
35
37
  <RichTextEditor
36
38
  initialData={[{ kind: 'block', type: 'paragraph', textContent: initialText }]}
@@ -38,10 +40,9 @@ describe('RichTextEditor typing', () => {
38
40
  />,
39
41
  );
40
42
 
41
- const user = userEvent.setup();
42
-
43
43
  const addedText = faker.lorem.paragraph();
44
44
 
45
+ await user.click(screen.getByRole('textbox'));
45
46
  await user.type(screen.getByRole('textbox'), addedText);
46
47
 
47
48
  const endText = initialText + addedText;
@@ -51,8 +52,10 @@ describe('RichTextEditor typing', () => {
51
52
  });
52
53
 
53
54
  it('can type a text with line breaks', async () => {
55
+ const user = userEvent.setup();
54
56
  const onChange = vi.fn();
55
57
  const initialText = 'rabbit';
58
+
56
59
  render(
57
60
  <RichTextEditor
58
61
  initialData={[{ kind: 'block', type: 'paragraph', textContent: initialText }]}
@@ -60,10 +63,9 @@ describe('RichTextEditor typing', () => {
60
63
  />,
61
64
  );
62
65
 
63
- const user = userEvent.setup();
64
-
65
66
  const addedText = faker.lorem.paragraphs();
66
67
 
68
+ await user.click(screen.getByRole('textbox'));
67
69
  await user.type(screen.getByRole('textbox'), addedText);
68
70
 
69
71
  const endText = initialText + addedText;
@@ -1,4 +1,6 @@
1
- export const sleep = (t: number) => new Promise(r => setTimeout(r, t));
1
+ import { act } from '@testing-library/react';
2
+
3
+ export const sleep = async (t: number) => act(async () => new Promise(r => setTimeout(r, t)));
2
4
 
3
5
  export async function selectTextInElement({
4
6
  element,
@@ -1,4 +1,4 @@
1
- import { ComponentProps, forwardRef } from 'react';
1
+ import { forwardRef } from 'react';
2
2
  import { cva, VariantProps } from 'class-variance-authority';
3
3
  import * as SelectPrimitives from '@radix-ui/react-select';
4
4
 
@@ -19,7 +19,7 @@ const selectTriggerStyles = cva('c-select-trigger', {
19
19
  });
20
20
 
21
21
  export type SelectRef = HTMLButtonElement;
22
- export type SelectProps = ComponentProps<typeof SelectPrimitives.Root> &
22
+ export type SelectProps = React.ComponentProps<typeof SelectPrimitives.Root> &
23
23
  VariantProps<typeof selectTriggerStyles> & {
24
24
  triggerClassName?: string;
25
25
  disabled?: boolean;
@@ -1,12 +1,12 @@
1
- import { ComponentPropsWithRef, forwardRef, ReactNode } from 'react';
1
+ import { forwardRef } from 'react';
2
2
  import { cx } from 'class-variance-authority';
3
3
 
4
4
  import './spinner.css';
5
5
 
6
6
  const realSize = 40;
7
7
 
8
- type SpinnerProps = ComponentPropsWithRef<'div'> & {
9
- children?: ReactNode;
8
+ type SpinnerProps = React.ComponentPropsWithRef<'div'> & {
9
+ children?: React.ReactNode;
10
10
  className?: string;
11
11
  color?: string;
12
12
  size?: number;
package/src/tag/tag.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { cva, VariantProps, cx } from 'class-variance-authority';
1
+ import { cva, type VariantProps, cx } from 'class-variance-authority';
2
2
 
3
3
  import { Icon } from '../iconography';
4
4
  import './tag.css';
@@ -24,7 +24,7 @@ const tagStyles = cva('c-tag', {
24
24
  },
25
25
  });
26
26
 
27
- export type TagProps = React.ComponentProps<'div'> &
27
+ export type TagProps = React.ComponentPropsWithRef<'div'> &
28
28
  TagStylesProps & {
29
29
  prepend?: React.ReactNode;
30
30
  onRemove?: () => void;
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import { cva, VariantProps } from 'class-variance-authority';
2
+ import { cva, type VariantProps } from 'class-variance-authority';
3
3
  import * as RadixTooltip from '@radix-ui/react-tooltip';
4
4
 
5
5
  type TooltipStylesProps = VariantProps<typeof tooltipStyles>;