The Open Standard for Generative UI
Refactor styling (#56)
subham51affed04805
diff --git a/js/packages/react-ui/package.json b/js/packages/react-ui/package.jsonindex 233609914..e0c716aff 100644--- a/js/packages/react-ui/package.json+++ b/js/packages/react-ui/package.json@@ -2,7 +2,7 @@"type": "module","name": "@crayonai/react-ui","license": "MIT",- "version": "0.5.5",+ "version": "0.5.6","description": "Component library for Generative UI SDK","main": "dist/index.js","types": "dist/index.d.ts",diff --git a/js/packages/react-ui/src/components/Calendar/utils/calendarBaseStyle.scss b/js/packages/react-ui/src/components/Calendar/utils/calendarBaseStyle.scssindex f58f72e33..0430d67c8 100644--- a/js/packages/react-ui/src/components/Calendar/utils/calendarBaseStyle.scss+++ b/js/packages/react-ui/src/components/Calendar/utils/calendarBaseStyle.scss@@ -14,6 +14,7 @@align-items: center;justify-content: center;border-radius: cssUtils.$rounded-xl;+ border: 1px solid cssUtils.$stroke-default;}.crayon-calendar-nav {diff --git a/js/packages/react-ui/src/components/CheckBoxItem/CheckBoxItem.tsx b/js/packages/react-ui/src/components/CheckBoxItem/CheckBoxItem.tsxindex 49a014bf2..d2c90f45e 100644--- a/js/packages/react-ui/src/components/CheckBoxItem/CheckBoxItem.tsx+++ b/js/packages/react-ui/src/components/CheckBoxItem/CheckBoxItem.tsx@@ -2,7 +2,6 @@ import * as Checkbox from "@radix-ui/react-checkbox";import clsx from "clsx";import { Check } from "lucide-react";import { CSSProperties, forwardRef, ReactNode, useId } from "react";-import { Label } from "../Label";export interface CheckBoxItemProps {label?: ReactNode;@@ -36,14 +35,9 @@ const CheckBoxItem = forwardRef<HTMLButtonElement, CheckBoxItemProps>((props, re</Checkbox.Indicator></Checkbox.Root>{label && (- <Label- htmlFor={id}- className="crayon-checkbox-item-label"- disabled={disabled}- required={required}- >+ <label htmlFor={id} className="crayon-checkbox-item-label">{label}- </Label>+ </label>)}</div>);diff --git a/js/packages/react-ui/src/components/CheckBoxItem/checkBoxItem.scss b/js/packages/react-ui/src/components/CheckBoxItem/checkBoxItem.scssindex 5a58ccea4..ea12fb0b6 100644--- a/js/packages/react-ui/src/components/CheckBoxItem/checkBoxItem.scss+++ b/js/packages/react-ui/src/components/CheckBoxItem/checkBoxItem.scss@@ -43,6 +43,8 @@.crayon-checkbox-item-label {flex: 1;+ @include cssUtils.typography(primary, default);+ color: cssUtils.$primary-text;&:disabled {color: cssUtils.$disabled-text;}diff --git a/js/packages/react-ui/src/components/RadioItem/RadioItem.tsx b/js/packages/react-ui/src/components/RadioItem/RadioItem.tsxindex e26fddf1c..9c7ebe85c 100644--- a/js/packages/react-ui/src/components/RadioItem/RadioItem.tsx+++ b/js/packages/react-ui/src/components/RadioItem/RadioItem.tsx@@ -1,7 +1,6 @@import * as Radio from "@radix-ui/react-radio-group";import clsx from "clsx";import { CSSProperties, forwardRef, ReactNode, useId } from "react";-import { Label } from "../Label";export interface RadioItemProps {label?: ReactNode;@@ -51,14 +50,9 @@ const RadioItem = forwardRef<HTMLButtonElement, RadioItemProps>((props, ref) =></svg></Radio.Item>{label && (- <Label- htmlFor={id}- className="crayon-radio-item-label"- disabled={disabled}- required={required}- >+ <label htmlFor={id} className="crayon-radio-item-label">{label}- </Label>+ </label>)}</div>);diff --git a/js/packages/react-ui/src/components/RadioItem/radioItem.scss b/js/packages/react-ui/src/components/RadioItem/radioItem.scssindex 7cbc47a8b..fe7d2431f 100644--- a/js/packages/react-ui/src/components/RadioItem/radioItem.scss+++ b/js/packages/react-ui/src/components/RadioItem/radioItem.scss@@ -81,3 +81,11 @@fill: cssUtils.$stroke-default;}}+.crayon-radio-item-label {+ flex: 1;+ @include cssUtils.typography(primary, default);+ color: cssUtils.$primary-text;+ &:disabled {+ color: cssUtils.$disabled-text;+ }+}diff --git a/js/packages/react-ui/src/components/SwitchItem/SwitchItem.tsx b/js/packages/react-ui/src/components/SwitchItem/SwitchItem.tsxindex 9c1937d07..383aa5b27 100644--- a/js/packages/react-ui/src/components/SwitchItem/SwitchItem.tsx+++ b/js/packages/react-ui/src/components/SwitchItem/SwitchItem.tsx@@ -1,7 +1,6 @@import * as Switch from "@radix-ui/react-switch";import clsx from "clsx";import { CSSProperties, forwardRef, ReactNode, useId } from "react";-import { Label } from "../Label";interface SwitchItemProps {label?: ReactNode;@@ -33,14 +32,9 @@ const SwitchItem = forwardRef<HTMLButtonElement, SwitchItemProps>((props, ref) =<Switch.Thumb className="crayon-switch-item-thumb" /></Switch.Root>{label && (- <Label- htmlFor={id}- className="crayon-switch-item-label"- disabled={disabled}- required={required}- >+ <label htmlFor={id} className="crayon-switch-item-label">{label}- </Label>+ </label>)}</div>);diff --git a/js/packages/react-ui/src/components/SwitchItem/switchItem.scss b/js/packages/react-ui/src/components/SwitchItem/switchItem.scssindex ab5d7b7c7..e17ce63ca 100644--- a/js/packages/react-ui/src/components/SwitchItem/switchItem.scss+++ b/js/packages/react-ui/src/components/SwitchItem/switchItem.scss@@ -61,3 +61,12 @@border-color: cssUtils.$stroke-interactive-el;}}++.crayon-switch-item-label {+ flex: 1;+ @include cssUtils.typography(primary, default);+ color: cssUtils.$primary-text;+ &:disabled {+ color: cssUtils.$disabled-text;+ }+}