@crystallize/design-system 1.23.1 → 1.23.3

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-NT4RM5NK.mjs";
21
21
  import "./chunk-NIH5ZMPE.mjs";
22
22
 
23
23
  // src/card/card.tsx
@@ -368,7 +368,7 @@ function Tag({ children, className, variant, size, prepend, onRemove, ...delegat
368
368
  // src/rich-text-editor/index.tsx
369
369
  import { lazy, Suspense } from "react";
370
370
  import { jsx as jsx12 } from "react/jsx-runtime";
371
- var LazyRichTextEditor = lazy(() => import("./rich-text-editor-PXZQZRPK.mjs"));
371
+ var LazyRichTextEditor = lazy(() => import("./rich-text-editor-7QQ3AZED.mjs"));
372
372
  var RichTextEditor = (props) => {
373
373
  return /* @__PURE__ */ jsx12(Suspense, {
374
374
  fallback: null,
@@ -455,12 +455,24 @@ var toast = ({ title, message, type = "success", timeout = 6e3 }) => {
455
455
  toast.dismiss = sonnerToast.dismiss;
456
456
 
457
457
  // src/switch/switch.tsx
458
+ import { cva as cva7 } from "class-variance-authority";
458
459
  import * as RadixSwitch from "@radix-ui/react-switch";
459
460
  import { jsx as jsx14 } from "react/jsx-runtime";
460
- function Switch(props) {
461
+ var switchStyles = cva7(["c-switch-root"], {
462
+ variants: {
463
+ size: {
464
+ xs: "c-switch-root-xs",
465
+ sm: "c-switch-root-sm"
466
+ }
467
+ },
468
+ defaultVariants: {
469
+ size: "sm"
470
+ }
471
+ });
472
+ function Switch({ size, ...props }) {
461
473
  return /* @__PURE__ */ jsx14(RadixSwitch.Root, {
462
474
  ...props,
463
- className: "c-switch-root",
475
+ className: switchStyles({ size }),
464
476
  children: /* @__PURE__ */ jsx14(RadixSwitch.Thumb, {
465
477
  className: "c-switch-thumb"
466
478
  })
@@ -6,7 +6,7 @@ import {
6
6
  Icon,
7
7
  IconButton,
8
8
  InputWithLabel
9
- } from "./chunk-VYFBR7S4.mjs";
9
+ } from "./chunk-NT4RM5NK.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.1",
3
+ "version": "1.23.3",
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';
@@ -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,13 +1,34 @@
1
1
  .c-switch-root {
2
- /* @apply radix-state-checked:border-[#528693] radix-state-checked:bg-neptune h-4 w-7 rounded-full border border-solid border-[#52869399] bg-[#9095a84d] p-0 focus:outline-none focus:ring-1 focus:ring-[#528693] focus:ring-offset-1 disabled:opacity-40; */
3
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;
3
+
4
+ &-sm {
5
+ @apply h-6 w-11;
6
+
7
+ .c-switch-thumb {
8
+ @apply h-4 w-4;
9
+
10
+ &[data-state='checked']  {
11
+ transform: translateX(20px);
12
+ }
13
+ }
14
+ }
15
+
16
+ &-xs {
17
+ @apply h-5 w-9;
18
+
19
+ .c-switch-thumb {
20
+ @apply h-3.5 w-3.5;
21
+
22
+ &[data-state='checked']  {
23
+ transform: translateX(16px);
24
+ }
25
+ }
26
+ }
4
27
  }
5
28
 
6
29
  .c-switch-thumb {
7
- /* @apply block h-4 w-4 translate-x-[1px] transform-gpu rounded-full bg-purple-200-700 transition-all data-[state=checked]:translate-x-12 data-[state=checked]:bg-green-400-500; */
8
- @apply block h-4 w-4 origin-center translate-x-1 rounded-full bg-purple-400-500 transition-all;
30
+ @apply block origin-center translate-x-1 rounded-full bg-purple-400-500 transition-all;
9
31
  &[data-state='checked']  {
10
- transform: translateX(20px);
11
32
  @apply bg-green-500-400;
12
33
  }
13
34
  }
@@ -1,11 +1,25 @@
1
1
  import type { ComponentProps } from 'react';
2
+ import { cva, VariantProps } from 'class-variance-authority';
2
3
  import * as RadixSwitch from '@radix-ui/react-switch';
3
4
 
4
- export type SwitchProps = ComponentProps<typeof RadixSwitch.Root>;
5
+ type SwitchStylesProps = VariantProps<typeof switchStyles>;
6
+ const switchStyles = cva(['c-switch-root'], {
7
+ variants: {
8
+ size: {
9
+ xs: 'c-switch-root-xs',
10
+ sm: 'c-switch-root-sm',
11
+ },
12
+ },
13
+ defaultVariants: {
14
+ size: 'sm',
15
+ },
16
+ });
5
17
 
6
- export function Switch(props: SwitchProps) {
18
+ export type SwitchProps = ComponentProps<typeof RadixSwitch.Root> & SwitchStylesProps;
19
+
20
+ export function Switch({ size, ...props }: SwitchProps) {
7
21
  return (
8
- <RadixSwitch.Root {...props} className="c-switch-root">
22
+ <RadixSwitch.Root {...props} className={switchStyles({ size })}>
9
23
  <RadixSwitch.Thumb className="c-switch-thumb" />
10
24
  </RadixSwitch.Root>
11
25
  );