@crystallize/design-system 1.23.2 → 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/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  showError,
18
18
  showInfo,
19
19
  showWarning
20
- } from "./chunk-VYFBR7S4.mjs";
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({ children, className, variant, size, prepend, onRemove, ...delegated }) {
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-PXZQZRPK.mjs"));
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 cx4 } from "class-variance-authority";
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: cx4(toastStyles({ type }), withMessage ? "c-toast-with-message" : "c-toast-title-only"),
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, {
@@ -6,7 +6,7 @@ import {
6
6
  Icon,
7
7
  IconButton,
8
8
  InputWithLabel
9
- } from "./chunk-VYFBR7S4.mjs";
9
+ } from "./chunk-XAHDYFIZ.mjs";
10
10
  import "./chunk-NIH5ZMPE.mjs";
11
11
 
12
12
  // src/rich-text-editor/rich-text-editor.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystallize/design-system",
3
- "version": "1.23.2",
3
+ "version": "1.23.4",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -0,0 +1,44 @@
1
+ import React, { forwardRef, SVGProps } from 'react';
2
+
3
+ type BatteryProps = SVGProps<SVGSVGElement>;
4
+
5
+ type BatteryRef = SVGSVGElement;
6
+
7
+ export const Battery = forwardRef<BatteryRef, BatteryProps>((delegated, ref) => {
8
+ return (
9
+ <svg ref={ref} width="22" height="22" viewBox="0 0 22 22" fill="currentColor" {...delegated}>
10
+ <path
11
+ fill="#BFF6F8"
12
+ d="M10.064 2.638a1.426 1.426 0 0 1 1.948-.522l6.176 3.565c.682.394.916 1.266.522 1.948l-6.774 11.733a1.426 1.426 0 0 1-1.948.522L3.812 16.32a1.426 1.426 0 0 1-.522-1.948l6.774-11.733Z"
13
+ />
14
+ <path
15
+ fill="#528693"
16
+ fillRule="evenodd"
17
+ d="m17.831 6.299-6.175-3.566a.713.713 0 0 0-.974.261L3.908 14.727a.713.713 0 0 0 .26.974l6.176 3.566c.341.197.777.08.974-.261l6.774-11.733a.713.713 0 0 0-.26-.974Zm-5.819-4.183a1.426 1.426 0 0 0-1.948.522L3.29 14.37a1.426 1.426 0 0 0 .522 1.948l6.176 3.565c.682.394 1.554.16 1.948-.522L18.71 7.63a1.426 1.426 0 0 0-.522-1.948l-6.175-3.565Z"
18
+ clipRule="evenodd"
19
+ />
20
+ <path
21
+ fill="#fff"
22
+ d="m13.95 8.997-1.882-1.086a.143.143 0 0 0-.155.008L9.326 9.801a.143.143 0 0 0 .012.24l.9.518a.143.143 0 0 1 .038.215L8.007 13.53c-.095.116.03.282.168.221l5.264-2.316a.143.143 0 0 0 .014-.254l-1.1-.635a.143.143 0 0 1-.007-.243l1.61-1.063a.143.143 0 0 0-.007-.243Z"
23
+ />
24
+ <path
25
+ fill="#528693"
26
+ fillRule="evenodd"
27
+ d="M11.702 7.63a.5.5 0 0 1 .543-.028l1.882 1.086a.5.5 0 0 1 .025.85l-1.322.872.8.462a.5.5 0 0 1-.048.89l-5.264 2.315-.144-.326.144.326c-.482.212-.92-.368-.587-.774l2.109-2.561-.68-.393a.5.5 0 0 1-.045-.836l2.587-1.882Zm.307.66L9.801 9.895l.614.354a.5.5 0 0 1 .136.75l-1.698 2.063 4.056-1.785-.735-.424a.5.5 0 0 1-.025-.848l.196.297-.196-.297 1.322-.873-1.462-.844Z"
28
+ clipRule="evenodd"
29
+ />
30
+ <path
31
+ fill="#fff"
32
+ d="M13.605 2.212a.713.713 0 0 1 .974-.261l2.47 1.426a.713.713 0 0 1 .26.974l-.712 1.235-3.705-2.14.713-1.234Z"
33
+ />
34
+ <path
35
+ fill="#528693"
36
+ fillRule="evenodd"
37
+ d="m16.692 3.994-2.47-1.426-.356.618 2.47 1.426.356-.618ZM14.58 1.951a.713.713 0 0 0-.974.26l-.713 1.236 3.705 2.139.713-1.235a.713.713 0 0 0-.261-.974l-2.47-1.426Z"
38
+ clipRule="evenodd"
39
+ />
40
+ </svg>
41
+ );
42
+ });
43
+
44
+ Battery.displayName = 'BatteryIcon';
@@ -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 17 15" fill="none" {...delegated}>
10
- <path d="M15.463 1.2L8.5 12.685 1.537 1.2h13.925zM1.353.896s0 0 0 0h0z" stroke="#5B5178" strokeWidth={2.4} />
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
  });
@@ -3,6 +3,7 @@ import { App } from './app';
3
3
  import { Archive } from './archive';
4
4
  import { Arrow } from './arrow';
5
5
  import { Atom } from './atom';
6
+ import { Battery } from './battery';
6
7
  import { Bell } from './bell';
7
8
  import { BillingPayments } from './billing-payments';
8
9
  import { Bin } from './bin';
@@ -104,6 +105,7 @@ export const Icon = {
104
105
  Add,
105
106
  Archive,
106
107
  App,
108
+ Battery,
107
109
  BillingPayments,
108
110
  Bin,
109
111
  Bell,
@@ -1,5 +1,5 @@
1
1
  .c-switch-root {
2
- @apply relative h-6 w-11 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;
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
@@ -14,6 +14,16 @@
14
14
  &__remove-button-text {
15
15
  @apply sr-only;
16
16
  }
17
+
18
+ &__remove-button--hover {
19
+ @apply opacity-0 transition;
20
+ }
21
+
22
+ &:hover {
23
+ .c-tag__remove-button--hover {
24
+ @apply opacity-100;
25
+ }
26
+ }
17
27
  }
18
28
 
19
29
  .c-tag-default {
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({ children, className, variant, size, prepend, onRemove, ...delegated }: TagProps) {
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="c-tag__remove-button"
51
+ className={cx('c-tag__remove-button', showRemoveOnHover ? 'c-tag__remove-button--hover' : '')}
42
52
  onClick={e => {
43
53
  e.stopPropagation();
44
54
  onRemove();