@semcore/radio 17.0.0-prerelease.31 → 17.0.0-prerelease.36

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.
@@ -17,16 +17,6 @@ SRadio[disabled] {
17
17
  pointer-events: none;
18
18
  }
19
19
 
20
- SText[size='m'] {
21
- font-size: var(--intergalactic-fs-200, 14px);
22
- line-height: var(--intergalactic-lh-200, 142%);
23
- }
24
-
25
- SText[size='l'] {
26
- font-size: var(--intergalactic-fs-300, 16px);
27
- line-height: var(--intergalactic-lh-300, 150%);
28
- }
29
-
30
20
  SValue {
31
21
  position: relative;
32
22
  flex-shrink: 0;
@@ -0,0 +1,9 @@
1
+ import type { Intergalactic } from '@semcore/core';
2
+ import { inputProps } from '@semcore/core/lib/utils/inputProps';
3
+ import React from 'react';
4
+ import type { IntergalacticRadioGroupComponent, RadioComponent } from './Radio.type';
5
+ declare const RadioGroup: IntergalacticRadioGroupComponent;
6
+ declare const Radio: RadioComponent;
7
+ export declare const wrapRadioGroup: <PropsExtending extends {}>(wrapper: (props: Intergalactic.InternalTypings.UntypeRefAndTag<Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticRadioGroupComponent>> & PropsExtending) => React.ReactNode) => IntergalacticRadioGroupComponent<PropsExtending>;
8
+ export { inputProps, RadioGroup };
9
+ export default Radio;
@@ -0,0 +1,69 @@
1
+ import type { Box, BoxProps, Flex } from '@semcore/base-components';
2
+ import type { PropGetterFn, Intergalactic } from '@semcore/core';
3
+ import type { Text, TextProps } from '@semcore/typography';
4
+ import type React from 'react';
5
+ export type RadioSize = 'm' | 'l';
6
+ export type RadioState = 'normal' | 'invalid';
7
+ export type RadioValue = string | number | boolean;
8
+ export type RadioProps = BoxProps & {
9
+ /** Radio item value **/
10
+ value?: RadioValue;
11
+ /** Radio item checked flag **/
12
+ checked?: boolean;
13
+ /**
14
+ * The value displaying the state of the component
15
+ * @default normal
16
+ */
17
+ state?: RadioState;
18
+ /**
19
+ * Radio button size
20
+ * @default m
21
+ **/
22
+ size?: RadioSize;
23
+ /** The theme of the radio button that you can send your color to */
24
+ theme?: string;
25
+ /** Radio item text **/
26
+ label?: string;
27
+ /** Blocks access and changes to the radio item **/
28
+ disabled?: boolean;
29
+ };
30
+ export type RadioGroupProps<T extends RadioValue = RadioValue> = {
31
+ /** Radio group name */
32
+ name?: string;
33
+ /** Active default value */
34
+ defaultValue?: T;
35
+ /** Active value */
36
+ value?: T;
37
+ /** Called when the selected element is changed */
38
+ onChange?: ((value: T, e?: React.SyntheticEvent<HTMLInputElement>) => void) | React.Dispatch<React.SetStateAction<T>>;
39
+ /** Radio button size */
40
+ size?: RadioSize;
41
+ /** The theme of the radio button that you can send your color to */
42
+ theme?: string;
43
+ /** Blocks access and changes to the form field */
44
+ disabled?: boolean;
45
+ };
46
+ export type RadioValueProps = BoxProps & {
47
+ /** List of elements that can be put on a hidden input */
48
+ includeInputProps?: string[];
49
+ };
50
+ export type RadioCtx = {
51
+ getValueProps: PropGetterFn;
52
+ getTextProps: PropGetterFn;
53
+ };
54
+ export type IntergalacticRadioGroupComponent<PropsExtending = {}> = (<Value extends RadioValue, Tag extends Intergalactic.Tag = typeof Flex>(props: Intergalactic.InternalTypings.ComponentProps<Tag, typeof Flex, RadioGroupProps<Value>> & PropsExtending) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', typeof Flex, RadioGroupProps>;
55
+ export type RadioValueControlProps = {};
56
+ export type RadioValueMarkProps = {};
57
+ export type RadioTextProps = TextProps;
58
+ export type RadioValueControlComponent = Intergalactic.Component<'input', RadioValueControlProps>;
59
+ export type RadioValueRadioMarkComponent = Intergalactic.Component<typeof Box, RadioValueMarkProps>;
60
+ export type RadioValueComponent = Intergalactic.Component<'input', RadioValueProps> & {
61
+ Control: RadioValueControlComponent;
62
+ RadioMark: RadioValueRadioMarkComponent;
63
+ };
64
+ export type RadioTextComponent = typeof Text;
65
+ export type RadioRootComponent = Intergalactic.Component<'label', RadioProps, RadioCtx>;
66
+ export type RadioComponent = RadioRootComponent & {
67
+ Value: RadioValueComponent;
68
+ Text: RadioTextComponent;
69
+ };
@@ -1,98 +1,2 @@
1
- import type { Box, BoxProps, Flex } from '@semcore/base-components';
2
- import type { PropGetterFn, Intergalactic } from '@semcore/core';
3
- import type { Text } from '@semcore/typography';
4
- import type React from 'react';
5
-
6
- export type RadioSize = 'm' | 'l';
7
- export type RadioState = 'normal' | 'invalid';
8
- export type RadioValue = string | number | boolean;
9
-
10
- export type RadioProps = BoxProps & {
11
- /** Radio item value **/
12
- value?: RadioValue;
13
-
14
- /** Radio item checked flag **/
15
- checked?: boolean;
16
-
17
- /**
18
- * The value displaying the state of the component
19
- * @default normal
20
- */
21
- state?: RadioState;
22
- /**
23
- * Radio button size
24
- * @default m
25
- **/
26
- size?: RadioSize;
27
- /** The theme of the radio button that you can send your color to */
28
- theme?: string;
29
- /** Radio item text **/
30
- label?: string;
31
- /** Blocks access and changes to the radio item **/
32
- disabled?: boolean;
33
- };
34
-
35
- export type RadioGroupProps<T extends RadioValue = RadioValue> = {
36
- /** Radio group name */
37
- name?: string;
38
- /** Active default value */
39
- defaultValue?: T;
40
- /** Active value */
41
- value?: T;
42
- /** Called when the selected element is changed */
43
- onChange?:
44
- | ((value: T, e?: React.SyntheticEvent<HTMLInputElement>) => void)
45
- | React.Dispatch<React.SetStateAction<T>>;
46
- /** Radio button size */
47
- size?: RadioSize;
48
- /** The theme of the radio button that you can send your color to */
49
- theme?: string;
50
- /** Blocks access and changes to the form field */
51
- disabled?: boolean;
52
- };
53
-
54
- export type RadioValueProps = BoxProps & {
55
- /** List of elements that can be put on a hidden input */
56
- includeInputProps?: string[];
57
- };
58
-
59
- export type RadioCtx = {
60
- getValueProps: PropGetterFn;
61
- getTextProps: PropGetterFn;
62
- };
63
-
64
- type IntergalacticRadioGroupComponent<PropsExtending = {}> = (<
65
- Value extends RadioValue,
66
- Tag extends Intergalactic.Tag = typeof Flex,
67
- >(
68
- props: Intergalactic.InternalTypings.ComponentProps<Tag, typeof Flex, RadioGroupProps<Value>> &
69
- PropsExtending,
70
- ) => Intergalactic.InternalTypings.ComponentRenderingResults) &
71
- Intergalactic.InternalTypings.ComponentAdditive<'div', typeof Flex, RadioGroupProps>;
72
-
73
- export type RadioValueControlProps = {};
74
- export type RadioValueMarkProps = {};
75
-
76
- declare const RadioGroup: IntergalacticRadioGroupComponent;
77
-
78
- export { RadioGroup };
79
-
80
- declare const Radio: Intergalactic.Component<'label', RadioProps, RadioCtx> & {
81
- Value: Intergalactic.Component<'input', RadioValueProps> & {
82
- Control: Intergalactic.Component<'input', RadioValueControlProps>;
83
- RadioMark: Intergalactic.Component<typeof Box, RadioValueMarkProps>;
84
- };
85
- Text: typeof Text;
86
- };
87
-
88
- declare const wrapRadioGroup: <PropsExtending extends {}>(
89
- wrapper: (
90
- props: Intergalactic.InternalTypings.UntypeRefAndTag<
91
- Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticRadioGroupComponent>
92
- > &
93
- PropsExtending,
94
- ) => React.ReactNode,
95
- ) => IntergalacticRadioGroupComponent<PropsExtending>;
96
- export { wrapRadioGroup };
97
-
98
- 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": "17.0.0-prerelease.31",
4
+ "version": "17.0.0-prerelease.36",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/typography": "^17.0.0-prerelease.31"
17
+ "@semcore/typography": "^17.0.0-prerelease.36"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@semcore/base-components": "^17.0.0 || ^17.0.0-0"
@@ -25,11 +25,11 @@
25
25
  "directory": "semcore/radio"
26
26
  },
27
27
  "devDependencies": {
28
+ "@semcore/base-components": "17.0.0-prerelease.36",
28
29
  "@semcore/testing-utils": "1.0.0",
29
- "@semcore/core": "17.0.0-prerelease.31",
30
- "@semcore/base-components": "17.0.0-prerelease.31"
30
+ "@semcore/core": "17.0.0-prerelease.36"
31
31
  },
32
32
  "scripts": {
33
- "build": "pnpm semcore-builder --source=js && pnpm vite build"
33
+ "build": "pnpm semcore-builder && pnpm vite build"
34
34
  }
35
35
  }
@@ -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 type { Box, BoxProps, Flex } from '@semcore/base-components';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\nimport type { Text } from '@semcore/typography';\nimport type React from 'react';\n\nexport type RadioSize = 'm' | 'l';\nexport type RadioState = 'normal' | 'invalid';\nexport type RadioValue = string | number | boolean;\n\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\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\nexport type RadioValueProps = BoxProps & {\n /** List of elements that can be put on a hidden input */\n includeInputProps?: string[];\n};\n\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) &\nIntergalactic.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":"","ignoreList":[]}
@@ -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 type { Box, BoxProps, Flex } from '@semcore/base-components';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\nimport type { Text } from '@semcore/typography';\nimport type React from 'react';\n\nexport type RadioSize = 'm' | 'l';\nexport type RadioState = 'normal' | 'invalid';\nexport type RadioValue = string | number | boolean;\n\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\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\nexport type RadioValueProps = BoxProps & {\n /** List of elements that can be put on a hidden input */\n includeInputProps?: string[];\n};\n\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) &\nIntergalactic.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":"","ignoreList":[]}