@crystallize/design-system 1.23.3 → 1.23.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.
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-NT4RM5NK.mjs → chunk-XAHDYFIZ.mjs} +2 -4
- package/dist/index.css +20 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -6
- package/dist/index.mjs +16 -7
- package/dist/{rich-text-editor-7QQ3AZED.mjs → rich-text-editor-3M2LH5IE.mjs} +1 -1
- package/package.json +1 -1
- package/src/iconography/caret.tsx +2 -2
- package/src/switch/switch.css +1 -1
- package/src/tag/tag.css +10 -0
- package/src/tag/tag.tsx +13 -3
package/CHANGELOG.md
CHANGED
|
@@ -712,13 +712,11 @@ var Caret = forwardRef13((delegated, ref) => {
|
|
|
712
712
|
ref,
|
|
713
713
|
width: "8",
|
|
714
714
|
height: "8",
|
|
715
|
-
viewBox: "0 0
|
|
715
|
+
viewBox: "0 0 8 8",
|
|
716
716
|
fill: "none",
|
|
717
717
|
...delegated,
|
|
718
718
|
children: /* @__PURE__ */ jsx19("path", {
|
|
719
|
-
d: "
|
|
720
|
-
stroke: "#5B5178",
|
|
721
|
-
strokeWidth: 2.4
|
|
719
|
+
d: "M4.36763 6.81306C4.21367 7.07973 3.82877 7.07973 3.67481 6.81306L0.921902 2.04489C0.767942 1.77822 0.960391 1.44489 1.26831 1.44489L6.77412 1.44489C7.08204 1.44489 7.27449 1.77822 7.12053 2.04489L4.36763 6.81306Z"
|
|
722
720
|
})
|
|
723
721
|
});
|
|
724
722
|
});
|
package/dist/index.css
CHANGED
|
@@ -1763,6 +1763,26 @@
|
|
|
1763
1763
|
white-space: nowrap;
|
|
1764
1764
|
border-width: 0;
|
|
1765
1765
|
}
|
|
1766
|
+
.c-tag__remove-button--hover {
|
|
1767
|
+
opacity: 0;
|
|
1768
|
+
transition-property:
|
|
1769
|
+
color,
|
|
1770
|
+
background-color,
|
|
1771
|
+
border-color,
|
|
1772
|
+
text-decoration-color,
|
|
1773
|
+
fill,
|
|
1774
|
+
stroke,
|
|
1775
|
+
opacity,
|
|
1776
|
+
box-shadow,
|
|
1777
|
+
transform,
|
|
1778
|
+
filter,
|
|
1779
|
+
backdrop-filter;
|
|
1780
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1781
|
+
transition-duration: 150ms;
|
|
1782
|
+
}
|
|
1783
|
+
.c-tag:hover .c-tag__remove-button--hover {
|
|
1784
|
+
opacity: 1;
|
|
1785
|
+
}
|
|
1766
1786
|
.c-tag-default {
|
|
1767
1787
|
--tw-border-opacity: 1;
|
|
1768
1788
|
border-color: rgb(var(--c-color-gray-200-700) / var(--tw-border-opacity));
|
|
@@ -3421,8 +3441,6 @@
|
|
|
3421
3441
|
/* src/switch/switch.css */
|
|
3422
3442
|
.c-switch-root {
|
|
3423
3443
|
position: relative;
|
|
3424
|
-
height: 1.5rem;
|
|
3425
|
-
width: 2.75rem;
|
|
3426
3444
|
border-radius: 9999px;
|
|
3427
3445
|
border-width: 1px;
|
|
3428
3446
|
border-style: solid;
|
package/dist/index.d.ts
CHANGED
|
@@ -322,8 +322,9 @@ declare const tagStyles: (props?: ({
|
|
|
322
322
|
type TagProps = React.ComponentProps<'div'> & TagStylesProps & {
|
|
323
323
|
prepend?: React.ReactNode;
|
|
324
324
|
onRemove?: () => void;
|
|
325
|
+
showRemoveOnHover?: boolean;
|
|
325
326
|
};
|
|
326
|
-
declare function Tag({ children, className, variant, size, prepend, onRemove, ...delegated }: TagProps): JSX.Element;
|
|
327
|
+
declare function Tag({ children, className, variant, size, prepend, onRemove, showRemoveOnHover, ...delegated }: TagProps): JSX.Element;
|
|
327
328
|
|
|
328
329
|
declare const CODE_ALL_NAME_OPTIONS: {
|
|
329
330
|
readonly javascript: "js";
|
package/dist/index.js
CHANGED
|
@@ -910,13 +910,11 @@ var init_caret = __esm({
|
|
|
910
910
|
ref,
|
|
911
911
|
width: "8",
|
|
912
912
|
height: "8",
|
|
913
|
-
viewBox: "0 0
|
|
913
|
+
viewBox: "0 0 8 8",
|
|
914
914
|
fill: "none",
|
|
915
915
|
...delegated,
|
|
916
916
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", {
|
|
917
|
-
d: "
|
|
918
|
-
stroke: "#5B5178",
|
|
919
|
-
strokeWidth: 2.4
|
|
917
|
+
d: "M4.36763 6.81306C4.21367 7.07973 3.82877 7.07973 3.67481 6.81306L0.921902 2.04489C0.767942 1.77822 0.960391 1.44489 1.26831 1.44489L6.77412 1.44489C7.08204 1.44489 7.27449 1.77822 7.12053 2.04489L4.36763 6.81306Z"
|
|
920
918
|
})
|
|
921
919
|
});
|
|
922
920
|
});
|
|
@@ -39705,7 +39703,16 @@ var tagStyles = (0, import_class_variance_authority19.cva)("c-tag", {
|
|
|
39705
39703
|
size: "xs"
|
|
39706
39704
|
}
|
|
39707
39705
|
});
|
|
39708
|
-
function Tag({
|
|
39706
|
+
function Tag({
|
|
39707
|
+
children,
|
|
39708
|
+
className,
|
|
39709
|
+
variant,
|
|
39710
|
+
size,
|
|
39711
|
+
prepend,
|
|
39712
|
+
onRemove,
|
|
39713
|
+
showRemoveOnHover,
|
|
39714
|
+
...delegated
|
|
39715
|
+
}) {
|
|
39709
39716
|
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", {
|
|
39710
39717
|
className: tagStyles({ className, variant, size }),
|
|
39711
39718
|
...delegated,
|
|
@@ -39717,7 +39724,7 @@ function Tag({ children, className, variant, size, prepend, onRemove, ...delegat
|
|
|
39717
39724
|
children,
|
|
39718
39725
|
onRemove && /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("button", {
|
|
39719
39726
|
type: "button",
|
|
39720
|
-
className: "c-tag__remove-button",
|
|
39727
|
+
className: (0, import_class_variance_authority19.cx)("c-tag__remove-button", showRemoveOnHover ? "c-tag__remove-button--hover" : ""),
|
|
39721
39728
|
onClick: (e) => {
|
|
39722
39729
|
e.stopPropagation();
|
|
39723
39730
|
onRemove();
|
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-XAHDYFIZ.mjs";
|
|
21
21
|
import "./chunk-NIH5ZMPE.mjs";
|
|
22
22
|
|
|
23
23
|
// src/card/card.tsx
|
|
@@ -312,7 +312,7 @@ function StackIcon({ type, children, size = 18 }) {
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
// src/tag/tag.tsx
|
|
315
|
-
import { cva as cva5 } from "class-variance-authority";
|
|
315
|
+
import { cva as cva5, cx as cx4 } from "class-variance-authority";
|
|
316
316
|
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
317
317
|
var tagStyles = cva5("c-tag", {
|
|
318
318
|
variants: {
|
|
@@ -333,7 +333,16 @@ var tagStyles = cva5("c-tag", {
|
|
|
333
333
|
size: "xs"
|
|
334
334
|
}
|
|
335
335
|
});
|
|
336
|
-
function Tag({
|
|
336
|
+
function Tag({
|
|
337
|
+
children,
|
|
338
|
+
className,
|
|
339
|
+
variant,
|
|
340
|
+
size,
|
|
341
|
+
prepend,
|
|
342
|
+
onRemove,
|
|
343
|
+
showRemoveOnHover,
|
|
344
|
+
...delegated
|
|
345
|
+
}) {
|
|
337
346
|
return /* @__PURE__ */ jsxs6("div", {
|
|
338
347
|
className: tagStyles({ className, variant, size }),
|
|
339
348
|
...delegated,
|
|
@@ -345,7 +354,7 @@ function Tag({ children, className, variant, size, prepend, onRemove, ...delegat
|
|
|
345
354
|
children,
|
|
346
355
|
onRemove && /* @__PURE__ */ jsxs6("button", {
|
|
347
356
|
type: "button",
|
|
348
|
-
className: "c-tag__remove-button",
|
|
357
|
+
className: cx4("c-tag__remove-button", showRemoveOnHover ? "c-tag__remove-button--hover" : ""),
|
|
349
358
|
onClick: (e) => {
|
|
350
359
|
e.stopPropagation();
|
|
351
360
|
onRemove();
|
|
@@ -368,7 +377,7 @@ function Tag({ children, className, variant, size, prepend, onRemove, ...delegat
|
|
|
368
377
|
// src/rich-text-editor/index.tsx
|
|
369
378
|
import { lazy, Suspense } from "react";
|
|
370
379
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
371
|
-
var LazyRichTextEditor = lazy(() => import("./rich-text-editor-
|
|
380
|
+
var LazyRichTextEditor = lazy(() => import("./rich-text-editor-3M2LH5IE.mjs"));
|
|
372
381
|
var RichTextEditor = (props) => {
|
|
373
382
|
return /* @__PURE__ */ jsx12(Suspense, {
|
|
374
383
|
fallback: null,
|
|
@@ -382,7 +391,7 @@ var RichTextEditor = (props) => {
|
|
|
382
391
|
import { Toaster } from "sonner";
|
|
383
392
|
|
|
384
393
|
// src/toast/toast.tsx
|
|
385
|
-
import { cva as cva6, cx as
|
|
394
|
+
import { cva as cva6, cx as cx5 } from "class-variance-authority";
|
|
386
395
|
import { toast as sonnerToast } from "sonner";
|
|
387
396
|
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
388
397
|
var toastStyles = cva6("c-toast", {
|
|
@@ -411,7 +420,7 @@ var toast = ({ title, message, type = "success", timeout = 6e3 }) => {
|
|
|
411
420
|
sonnerToast.custom(
|
|
412
421
|
(id) => /* @__PURE__ */ jsxs7("div", {
|
|
413
422
|
"data-testid": `toast-${type}`,
|
|
414
|
-
className:
|
|
423
|
+
className: cx5(toastStyles({ type }), withMessage ? "c-toast-with-message" : "c-toast-title-only"),
|
|
415
424
|
children: [
|
|
416
425
|
/* @__PURE__ */ jsx13("div", {
|
|
417
426
|
children: /* @__PURE__ */ jsx13(ToastIcon, {
|
package/package.json
CHANGED
|
@@ -6,8 +6,8 @@ type CaretRef = SVGSVGElement;
|
|
|
6
6
|
|
|
7
7
|
export const Caret = forwardRef<CaretRef, CaretProps>((delegated, ref) => {
|
|
8
8
|
return (
|
|
9
|
-
<svg ref={ref} width="8" height="8" viewBox="0 0
|
|
10
|
-
<path d="
|
|
9
|
+
<svg ref={ref} width="8" height="8" viewBox="0 0 8 8" fill="none" {...delegated}>
|
|
10
|
+
<path d="M4.36763 6.81306C4.21367 7.07973 3.82877 7.07973 3.67481 6.81306L0.921902 2.04489C0.767942 1.77822 0.960391 1.44489 1.26831 1.44489L6.77412 1.44489C7.08204 1.44489 7.27449 1.77822 7.12053 2.04489L4.36763 6.81306Z" />
|
|
11
11
|
</svg>
|
|
12
12
|
);
|
|
13
13
|
});
|
package/src/switch/switch.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.c-switch-root {
|
|
2
|
-
@apply relative
|
|
2
|
+
@apply relative rounded-full border border-solid border-purple-200-700 bg-purple-50-900 pl-0.5 transition-all hover:border-purple-300-600 focus:outline-none enabled:cursor-pointer disabled:opacity-40 data-[state=checked]:border-green-400-500 data-[state=checked]:bg-cyan-100-800;
|
|
3
3
|
|
|
4
4
|
&-sm {
|
|
5
5
|
@apply h-6 w-11;
|
package/src/tag/tag.css
CHANGED
package/src/tag/tag.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cva, VariantProps } from 'class-variance-authority';
|
|
1
|
+
import { cva, VariantProps, cx } from 'class-variance-authority';
|
|
2
2
|
|
|
3
3
|
import { Icon } from '../iconography';
|
|
4
4
|
import './tag.css';
|
|
@@ -28,9 +28,19 @@ export type TagProps = React.ComponentProps<'div'> &
|
|
|
28
28
|
TagStylesProps & {
|
|
29
29
|
prepend?: React.ReactNode;
|
|
30
30
|
onRemove?: () => void;
|
|
31
|
+
showRemoveOnHover?: boolean;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
|
-
export function Tag({
|
|
34
|
+
export function Tag({
|
|
35
|
+
children,
|
|
36
|
+
className,
|
|
37
|
+
variant,
|
|
38
|
+
size,
|
|
39
|
+
prepend,
|
|
40
|
+
onRemove,
|
|
41
|
+
showRemoveOnHover,
|
|
42
|
+
...delegated
|
|
43
|
+
}: TagProps) {
|
|
34
44
|
return (
|
|
35
45
|
<div className={tagStyles({ className, variant, size })} {...delegated}>
|
|
36
46
|
{!prepend ? null : <span className="c-tag__prepend">{prepend}</span>}
|
|
@@ -38,7 +48,7 @@ export function Tag({ children, className, variant, size, prepend, onRemove, ...
|
|
|
38
48
|
{onRemove && (
|
|
39
49
|
<button
|
|
40
50
|
type="button"
|
|
41
|
-
className=
|
|
51
|
+
className={cx('c-tag__remove-button', showRemoveOnHover ? 'c-tag__remove-button--hover' : '')}
|
|
42
52
|
onClick={e => {
|
|
43
53
|
e.stopPropagation();
|
|
44
54
|
onRemove();
|