@ssa-ui-kit/core 2.10.1 → 2.11.0

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.
@@ -1,3 +1,3 @@
1
1
  import { RadioProps } from './types';
2
- declare const Radio: ({ id, name, value, isChecked, isDisabled, isRequired, onChange, text, className, }: RadioProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ declare const Radio: ({ id, name, value, isChecked, isDisabled, isRequired, text, colors, className, onChange, }: RadioProps) => import("@emotion/react/jsx-runtime").JSX.Element;
3
3
  export default Radio;
@@ -1,3 +1,5 @@
1
1
  export declare const RadioBase: import("@emotion/styled").StyledComponent<import("../Label/types").LabelProps & {
2
2
  theme?: import("@emotion/react").Theme;
3
+ } & {
4
+ focusShadowColor?: string;
3
5
  }, {}, {}>;
@@ -8,4 +8,10 @@ export interface RadioProps {
8
8
  onChange?: (value: string) => void;
9
9
  text?: string;
10
10
  className?: string;
11
+ colors?: {
12
+ default?: string;
13
+ hovered?: string;
14
+ disabled?: string;
15
+ focusShadow?: string;
16
+ };
11
17
  }
package/dist/index.js CHANGED
@@ -4363,8 +4363,9 @@ const FormHelperText = ({
4363
4363
  const RadioBase = /*#__PURE__*/base_default()(Label_Label, true ? {
4364
4364
  target: "efp6u1p0"
4365
4365
  } : 0)("display:inline-flex;flex-grow:0;align-items:center;cursor:pointer;gap:5px;&:has(input:disabled){cursor:default;}input:focus+svg{filter:drop-shadow(\n ", ({
4366
- theme
4367
- }) => `-4px 4px 10px ${theme.colors.green40}`, "\n );}input{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;}span{font-size:14px;font-weight:100;}" + ( true ? "" : 0));
4366
+ theme,
4367
+ focusShadowColor
4368
+ }) => `-4px 4px 10px ${focusShadowColor || theme.colors.green40}`, "\n );}input{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;}span{font-size:14px;font-weight:100;}" + ( true ? "" : 0));
4368
4369
  ;// ./src/components/Radio/Radio.tsx
4369
4370
 
4370
4371
 
@@ -4378,17 +4379,22 @@ const Radio = ({
4378
4379
  isChecked,
4379
4380
  isDisabled,
4380
4381
  isRequired,
4381
- onChange,
4382
4382
  text,
4383
- className
4383
+ colors,
4384
+ className,
4385
+ onChange
4384
4386
  }) => {
4385
4387
  const theme = (0,react_namespaceObject.useTheme)();
4386
4388
  const autoGenId = (0,external_react_namespaceObject.useId)();
4387
4389
  const [isHovered, setIsHovered] = (0,external_react_namespaceObject.useState)(false);
4388
4390
  const radioId = id || autoGenId;
4391
+ const disabledColor = colors?.disabled || theme.colors.greyFocused40;
4392
+ const hoveredColor = colors?.hovered || theme.colors.green60;
4393
+ const defaultColor = colors?.default || theme.colors.green;
4389
4394
  return (0,jsx_runtime_namespaceObject.jsxs)(RadioBase, {
4390
4395
  htmlFor: radioId,
4391
4396
  className: className,
4397
+ focusShadowColor: colors?.focusShadow,
4392
4398
  onMouseEnter: () => setIsHovered(true),
4393
4399
  onMouseLeave: () => setIsHovered(false),
4394
4400
  children: [(0,jsx_runtime_namespaceObject.jsx)("input", {
@@ -4403,7 +4409,7 @@ const Radio = ({
4403
4409
  }), (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
4404
4410
  name: isChecked ? 'radio-on' : 'circle',
4405
4411
  size: 20,
4406
- color: theme.colors[isDisabled ? 'greyFocused40' : isHovered ? 'green60' : 'green']
4412
+ color: isDisabled ? disabledColor : isHovered ? hoveredColor : defaultColor
4407
4413
  }), text ? (0,jsx_runtime_namespaceObject.jsx)("span", {
4408
4414
  "data-testid": id,
4409
4415
  children: text