{
}}
>
{filteredData.map(({ description, data }) => {
+ const open = isOpen.includes(description);
return (
-
-
-
-
- {description}
-
-
-
+
+
+
{
tableProps={{ style: { width: '100%' } }}
compact
/>
-
-
+
+
);
})}
diff --git a/stories/components/radio.stories.tsx b/stories/components/radio.stories.tsx
index 37634b61..0a0cf21b 100644
--- a/stories/components/radio.stories.tsx
+++ b/stories/components/radio.stories.tsx
@@ -1,14 +1,11 @@
-import {
- RadioGroup as BlueprintjsRadioGroup,
- type RadioGroupProps as BlueprintjsRadioGroupProps,
-} from '@blueprintjs/core';
+import { RadioGroup, type RadioGroupProps } from '@blueprintjs/core';
import styled from '@emotion/styled';
import { useState } from 'react';
import {
- RadioGroup,
- type RadioGroupProps,
- type RadioOption,
+ RadioButton,
+ RadioButtonGroup,
+ type RadioButtonGroupProps,
} from '../../src/components/index.js';
export default {
@@ -29,22 +26,17 @@ const ExampleGroup = styled.div`
gap: 20px;
`;
export function ControlBlueprint(
- props: Omit<
- BlueprintjsRadioGroupProps,
- 'onChange' | 'selectedValue' | 'children'
- >,
+ props: Omit,
) {
- const [option, setOption] = useState(options[2]);
+ const [option, setOption] = useState(options[2].value);
return (
- {
const value = event.currentTarget.value;
- setOption(
- (option) => options.find((o) => o.value === value) || option,
- );
+ setOption(value);
}}
- selectedValue={option.value}
+ selectedValue={option}
options={options}
{...props}
/>
@@ -56,29 +48,57 @@ ControlBlueprint.args = {
disabled: false,
inline: false,
};
-export function ControlButton(
- props: Omit,
+
+export function ControlRadioButton(
+ props: Omit,
) {
- const [option, setOption] = useState(options[2] as RadioOption);
+ const [option, setOption] = useState(options[2].value);
return (
- {
+ const value = event.currentTarget.value;
+ setOption(value);
+ }}
{...props}
/>
);
}
-ControlButton.args = {
- variant: 'default',
+ControlRadioButton.args = {
+ large: false,
disabled: false,
};
-ControlButton.argTypes = {
- variant: {
- options: ['default', 'small'],
- control: { type: 'radio' },
- },
+export function RadioButtonWithChildren(
+ props: Omit,
+) {
+ const [option, setOption] = useState(options[2].value);
+ return (
+
+ {
+ const value = event.currentTarget.value;
+ setOption(value);
+ }}
+ {...props}
+ >
+ {options.map(({ value, label, disabled }) => (
+
+ ))}
+
+
+ );
+}
+RadioButtonWithChildren.args = {
+ large: false,
+ disabled: false,
};