@semcore/radio 6.43.4 → 6.44.0-prerelease.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,149 +1,2 @@
1
- import React from 'react';
2
- import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';
3
- import { Box, BoxProps, Flex } from '@semcore/flex-box';
4
- import { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
5
- import { Text } from '@semcore/typography';
6
-
7
- export type RadioSize = 'm' | 'l';
8
- export type RadioState = 'normal' | 'invalid';
9
- export type RadioValue = string | number | boolean;
10
-
11
- /** @deprecated */
12
- export interface IRadioProps extends RadioProps, UnknownProperties {}
13
- export type RadioProps = BoxProps & {
14
- /** Radio item value **/
15
- value?: RadioValue;
16
-
17
- /** Radio item checked flag **/
18
- checked?: boolean;
19
-
20
- /**
21
- * The value displaying the state of the component
22
- * @default normal
23
- */
24
- state?: RadioState;
25
- /**
26
- * Radio button size
27
- * @default m
28
- **/
29
- size?: RadioSize;
30
- /** The theme of the radio button that you can send your color to */
31
- theme?: string;
32
- /** Radio item text **/
33
- label?: string;
34
- /** Blocks access and changes to the radio item **/
35
- disabled?: boolean;
36
- };
37
-
38
- /** @deprecated */
39
- export interface IRadioGroupProps extends RadioGroupProps, UnknownProperties {
40
- /**
41
- * HTML tag name for the displayed item
42
- */
43
- tag?: React.ElementType | string;
44
- }
45
- export type RadioGroupProps<T extends RadioValue = RadioValue> = {
46
- /** Radio group name */
47
- name?: string;
48
- /** Active default value */
49
- defaultValue?: T;
50
- /** Active value */
51
- value?: T;
52
- /** Called when the selected element is changed */
53
- onChange?:
54
- | ((value: T, e?: React.SyntheticEvent<HTMLInputElement>) => void)
55
- | React.Dispatch<React.SetStateAction<T>>;
56
- /** Radio button size */
57
- size?: RadioSize;
58
- /** The theme of the radio button that you can send your color to */
59
- theme?: string;
60
- /** Blocks access and changes to the form field */
61
- disabled?: boolean;
62
- };
63
-
64
- /** @deprecated */
65
- export interface IRadioValueProps extends RadioValueProps, UnknownProperties {}
66
- export type RadioValueProps = BoxProps &
67
- KeyboardFocusProps & {
68
- /** List of elements that can be put on a hidden input */
69
- includeInputProps?: string[];
70
- /**
71
- * @deprecated set `state` on root Radio instead
72
- * The value displaying the state of the component
73
- * @default normal
74
- */
75
- state?: RadioState;
76
- /**
77
- * @deprecated
78
- * The theme of the radio button that you can send your color to
79
- */
80
- theme?: string;
81
- /**
82
- * @deprecated set `size` on root RadioGroup instead
83
- * Radio button size
84
- */
85
- size?: RadioSize;
86
- /**
87
- * @deprecated set `value` on root Radio instead
88
- * The element value is required for RadioGroup
89
- */
90
- value?: RadioValue;
91
- /**
92
- * @deprecated set `defaultValue` on root RadioGroup instead
93
- * Default value if `value` property is not provided
94
- */
95
- defaultValue?: RadioValue;
96
- /**
97
- * @deprecated set `onChange` on root RadioGroup instead
98
- * Called when the value changes
99
- */
100
- onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;
101
- /**
102
- * @deprecated set `disabled` on root Radio instead
103
- * Blocks access and changes to the form field
104
- */
105
- disabled?: boolean;
106
- };
107
-
108
- /** @deprecated */
109
- export interface IRadioCtx extends RadioCtx, UnknownProperties {}
110
- export type RadioCtx = {
111
- getValueProps: PropGetterFn;
112
- getTextProps: PropGetterFn;
113
- };
114
-
115
- type IntergalacticRadioGroupComponent<PropsExtending = {}> = (<
116
- Value extends RadioValue,
117
- Tag extends Intergalactic.Tag = typeof Flex,
118
- >(
119
- props: Intergalactic.InternalTypings.ComponentProps<Tag, typeof Flex, RadioGroupProps<Value>> &
120
- PropsExtending,
121
- ) => Intergalactic.InternalTypings.ComponentRenderingResults) &
122
- Intergalactic.InternalTypings.ComponentAdditive<'div', typeof Flex, RadioGroupProps>;
123
-
124
- export type RadioValueControlProps = {};
125
- export type RadioValueMarkProps = {};
126
-
127
- declare const RadioGroup: IntergalacticRadioGroupComponent;
128
-
129
- export { RadioGroup };
130
-
131
- declare const Radio: Intergalactic.Component<'label', RadioProps, RadioCtx> & {
132
- Value: Intergalactic.Component<'input', RadioValueProps> & {
133
- Control: Intergalactic.Component<'input', RadioValueControlProps>;
134
- RadioMark: Intergalactic.Component<typeof Box, RadioValueMarkProps>;
135
- };
136
- Text: typeof Text;
137
- };
138
-
139
- declare const wrapRadioGroup: <PropsExtending extends {}>(
140
- wrapper: (
141
- props: Intergalactic.InternalTypings.UntypeRefAndTag<
142
- Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticRadioGroupComponent>
143
- > &
144
- PropsExtending,
145
- ) => React.ReactNode,
146
- ) => IntergalacticRadioGroupComponent<PropsExtending>;
147
- export { wrapRadioGroup };
148
-
149
- export default Radio;
1
+ export { default, wrapRadioGroup, RadioGroup } from './Radio';
2
+ export * from './Radio.type';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/radio",
3
3
  "description": "Semrush Radio Component",
4
- "version": "6.43.4",
4
+ "version": "6.44.0-prerelease.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,12 +14,12 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/utils": "4.48.5",
18
- "@semcore/flex-box": "5.41.4",
19
- "@semcore/typography": "5.53.2"
17
+ "@semcore/utils": "4.49.0-prerelease.0",
18
+ "@semcore/flex-box": "5.42.0-prerelease.0",
19
+ "@semcore/typography": "5.54.0-prerelease.0"
20
20
  },
21
21
  "peerDependencies": {
22
- "@semcore/core": "^2.17.5",
22
+ "@semcore/core": "^2.40.0-prerelease.0",
23
23
  "react": "16.8 - 18",
24
24
  "react-dom": "16.8 - 18"
25
25
  },
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=index.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps, Flex } from '@semcore/flex-box';\nimport { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { Text } from '@semcore/typography';\n\nexport type RadioSize = 'm' | 'l';\nexport type RadioState = 'normal' | 'invalid';\nexport type RadioValue = string | number | boolean;\n\n/** @deprecated */\nexport interface IRadioProps extends RadioProps, UnknownProperties {}\nexport type RadioProps = BoxProps & {\n /** Radio item value **/\n value?: RadioValue;\n\n /** Radio item checked flag **/\n checked?: boolean;\n\n /**\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * Radio button size\n * @default m\n **/\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Radio item text **/\n label?: string;\n /** Blocks access and changes to the radio item **/\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioGroupProps extends RadioGroupProps, UnknownProperties {\n /**\n * HTML tag name for the displayed item\n */\n tag?: React.ElementType | string;\n}\nexport type RadioGroupProps<T extends RadioValue = RadioValue> = {\n /** Radio group name */\n name?: string;\n /** Active default value */\n defaultValue?: T;\n /** Active value */\n value?: T;\n /** Called when the selected element is changed */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLInputElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Radio button size */\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Blocks access and changes to the form field */\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioValueProps extends RadioValueProps, UnknownProperties {}\nexport type RadioValueProps = BoxProps &\n KeyboardFocusProps & {\n /** List of elements that can be put on a hidden input */\n includeInputProps?: string[];\n /**\n * @deprecated set `state` on root Radio instead\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * @deprecated\n * The theme of the radio button that you can send your color to\n */\n theme?: string;\n /**\n * @deprecated set `size` on root RadioGroup instead\n * Radio button size\n */\n size?: RadioSize;\n /**\n * @deprecated set `value` on root Radio instead\n * The element value is required for RadioGroup\n */\n value?: RadioValue;\n /**\n * @deprecated set `defaultValue` on root RadioGroup instead\n * Default value if `value` property is not provided\n */\n defaultValue?: RadioValue;\n /**\n * @deprecated set `onChange` on root RadioGroup instead\n * Called when the value changes\n */\n onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n /**\n * @deprecated set `disabled` on root Radio instead\n * Blocks access and changes to the form field\n */\n disabled?: boolean;\n };\n\n/** @deprecated */\nexport interface IRadioCtx extends RadioCtx, UnknownProperties {}\nexport type RadioCtx = {\n getValueProps: PropGetterFn;\n getTextProps: PropGetterFn;\n};\n\ntype IntergalacticRadioGroupComponent<PropsExtending = {}> = (<\n Value extends RadioValue,\n Tag extends Intergalactic.Tag = typeof Flex,\n>(\n props: Intergalactic.InternalTypings.ComponentProps<Tag, typeof Flex, RadioGroupProps<Value>> &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div', typeof Flex, RadioGroupProps>;\n\nexport type RadioValueControlProps = {};\nexport type RadioValueMarkProps = {};\n\ndeclare const RadioGroup: IntergalacticRadioGroupComponent;\n\nexport { RadioGroup };\n\ndeclare const Radio: Intergalactic.Component<'label', RadioProps, RadioCtx> & {\n Value: Intergalactic.Component<'input', RadioValueProps> & {\n Control: Intergalactic.Component<'input', RadioValueControlProps>;\n RadioMark: Intergalactic.Component<typeof Box, RadioValueMarkProps>;\n };\n Text: typeof Text;\n};\n\ndeclare const wrapRadioGroup: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticRadioGroupComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticRadioGroupComponent<PropsExtending>;\nexport { wrapRadioGroup };\n\nexport default Radio;\n"],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps, Flex } from '@semcore/flex-box';\nimport { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { Text } from '@semcore/typography';\n\nexport type RadioSize = 'm' | 'l';\nexport type RadioState = 'normal' | 'invalid';\nexport type RadioValue = string | number | boolean;\n\n/** @deprecated */\nexport interface IRadioProps extends RadioProps, UnknownProperties {}\nexport type RadioProps = BoxProps & {\n /** Radio item value **/\n value?: RadioValue;\n\n /** Radio item checked flag **/\n checked?: boolean;\n\n /**\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * Radio button size\n * @default m\n **/\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Radio item text **/\n label?: string;\n /** Blocks access and changes to the radio item **/\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioGroupProps extends RadioGroupProps, UnknownProperties {\n /**\n * HTML tag name for the displayed item\n */\n tag?: React.ElementType | string;\n}\nexport type RadioGroupProps<T extends RadioValue = RadioValue> = {\n /** Radio group name */\n name?: string;\n /** Active default value */\n defaultValue?: T;\n /** Active value */\n value?: T;\n /** Called when the selected element is changed */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLInputElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Radio button size */\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Blocks access and changes to the form field */\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioValueProps extends RadioValueProps, UnknownProperties {}\nexport type RadioValueProps = BoxProps &\n KeyboardFocusProps & {\n /** List of elements that can be put on a hidden input */\n includeInputProps?: string[];\n /**\n * @deprecated set `state` on root Radio instead\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * @deprecated\n * The theme of the radio button that you can send your color to\n */\n theme?: string;\n /**\n * @deprecated set `size` on root RadioGroup instead\n * Radio button size\n */\n size?: RadioSize;\n /**\n * @deprecated set `value` on root Radio instead\n * The element value is required for RadioGroup\n */\n value?: RadioValue;\n /**\n * @deprecated set `defaultValue` on root RadioGroup instead\n * Default value if `value` property is not provided\n */\n defaultValue?: RadioValue;\n /**\n * @deprecated set `onChange` on root RadioGroup instead\n * Called when the value changes\n */\n onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n /**\n * @deprecated set `disabled` on root Radio instead\n * Blocks access and changes to the form field\n */\n disabled?: boolean;\n };\n\n/** @deprecated */\nexport interface IRadioCtx extends RadioCtx, UnknownProperties {}\nexport type RadioCtx = {\n getValueProps: PropGetterFn;\n getTextProps: PropGetterFn;\n};\n\ntype IntergalacticRadioGroupComponent<PropsExtending = {}> = (<\n Value extends RadioValue,\n Tag extends Intergalactic.Tag = typeof Flex,\n>(\n props: Intergalactic.InternalTypings.ComponentProps<Tag, typeof Flex, RadioGroupProps<Value>> &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div', typeof Flex, RadioGroupProps>;\n\nexport type RadioValueControlProps = {};\nexport type RadioValueMarkProps = {};\n\ndeclare const RadioGroup: IntergalacticRadioGroupComponent;\n\nexport { RadioGroup };\n\ndeclare const Radio: Intergalactic.Component<'label', RadioProps, RadioCtx> & {\n Value: Intergalactic.Component<'input', RadioValueProps> & {\n Control: Intergalactic.Component<'input', RadioValueControlProps>;\n RadioMark: Intergalactic.Component<typeof Box, RadioValueMarkProps>;\n };\n Text: typeof Text;\n};\n\ndeclare const wrapRadioGroup: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticRadioGroupComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticRadioGroupComponent<PropsExtending>;\nexport { wrapRadioGroup };\n\nexport default Radio;\n"],"mappings":""}