Skip to content

Commit 3aec177

Browse files
committed
docs(samples): remove button row from input scenarios
1 parent dfe6674 commit 3aec177

File tree

17 files changed

+33
-31
lines changed

17 files changed

+33
-31
lines changed

packages/samples/react/src/components/FormWrap.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,27 @@ import React from 'react';
22

33
import { KolButton, KolForm } from '@public-ui/react';
44

5-
export const FormWrap = <P,>({ RefComponent: Component, ...props }: { RefComponent: any } & Partial<P>) => {
5+
export const FormWrap = <P,>({ RefComponent: Component, showButtons = true, ...props }: { RefComponent: any; showButtons?: boolean } & Partial<P>) => {
66
return (
77
<KolForm className="w-full">
88
<div className="grid gap-4">
99
<Component {...props} />
10-
<div className="flex gap-4">
11-
<KolButton _label="Submit" _icons="codicon codicon-arrow-right" _type="submit" _variant="primary" />
12-
<KolButton
13-
_label="Bunte Icons"
14-
_icons={{
15-
left: { icon: 'codicon codicon-heart-filled', style: { color: '#cc006e' } },
16-
right: { icon: 'codicon codicon-squirrel', style: { color: '#b41b1b' } },
17-
}}
18-
_type="submit"
19-
_variant="secondary"
20-
/>
21-
<KolButton _label="Reset" _type="reset" _variant="tertiary" />
22-
<KolButton _label="Help" _variant="ghost" />
23-
</div>
10+
{showButtons && (
11+
<div className="flex gap-4">
12+
<KolButton _label="Submit" _icons="codicon codicon-arrow-right" _type="submit" _variant="primary" />
13+
<KolButton
14+
_label="Bunte Icons"
15+
_icons={{
16+
left: { icon: 'codicon codicon-heart-filled', style: { color: '#cc006e' } },
17+
right: { icon: 'codicon codicon-squirrel', style: { color: '#b41b1b' } },
18+
}}
19+
_type="submit"
20+
_variant="secondary"
21+
/>
22+
<KolButton _label="Reset" _type="reset" _variant="tertiary" />
23+
<KolButton _label="Help" _variant="ghost" />
24+
</div>
25+
)}
2426
</div>
2527
</KolForm>
2628
);

packages/samples/react/src/components/combobox/basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const ComboboxBasic: FC = () => {
1010
<p>KolCombobox combines a text input with a suggestion list, enabling users to either type in a value or to select on of the suggestions.</p>
1111
</SampleDescription>
1212

13-
<FormWrap RefComponent={ComboboxVariants} />
13+
<FormWrap RefComponent={ComboboxVariants} showButtons={false} />
1414
</>
1515
);
1616
};

packages/samples/react/src/components/input-checkbox/basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export const InputCheckboxBasic: FC = () => (
1111
<p>KolInputCheckbox renders a checkbox. The sample shows KolInputCheckbox in a form context with all variations and states.</p>
1212
</SampleDescription>
1313

14-
<FormWrap RefComponent={InputCheckboxVariants} />
14+
<FormWrap RefComponent={InputCheckboxVariants} showButtons={false} />
1515
</>
1616
);

packages/samples/react/src/components/input-checkbox/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ export const InputCheckboxButton: FC = () => (
1212
<p>This sample shows KolInputCheckbox in the variant &quot;button&quot;.</p>
1313
</SampleDescription>
1414

15-
<FormWrap<Components.KolInputCheckbox> RefComponent={InputCheckboxVariants} _variant="button" />
15+
<FormWrap<Components.KolInputCheckbox> RefComponent={InputCheckboxVariants} _variant="button" showButtons={false} />
1616
</>
1717
);

packages/samples/react/src/components/input-checkbox/switch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ export const InputCheckboxSwitch: FC = () => (
1010
<p>This sample shows KolInputCheckbox in the variant &quot;switch&quot;.</p>
1111
</SampleDescription>
1212

13-
<FormWrap RefComponent={InputCheckboxVariants} _variant="switch" />
13+
<FormWrap RefComponent={InputCheckboxVariants} _variant="switch" showButtons={false} />
1414
</>
1515
);

packages/samples/react/src/components/input-color/basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export const InputColorBasic: FC = () => (
1111
<p>KolInputColor renders a color input. The sample shows KolInputColor in a form context with all variations and states.</p>
1212
</SampleDescription>
1313

14-
<FormWrap RefComponent={InputColorVariants} />
14+
<FormWrap RefComponent={InputColorVariants} showButtons={false} />
1515
</>
1616
);

packages/samples/react/src/components/input-date/basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export const InputDateBasic: FC = () => (
1111
<p>KolInputDate renders all types of fields for date and time input. The sample shows KolInputDate in a form context with all variations and states.</p>
1212
</SampleDescription>
1313

14-
<FormWrap RefComponent={InputDateVariants} />
14+
<FormWrap RefComponent={InputDateVariants} showButtons={false} />
1515
</>
1616
);

packages/samples/react/src/components/input-email/basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export const InputEmailBasic: FC = () => (
1111
<p>KolInputEmail renders an email input field. The sample shows KolInputEmail in a form context with all variations and states.</p>
1212
</SampleDescription>
1313

14-
<FormWrap RefComponent={InputEmailVariants} />
14+
<FormWrap RefComponent={InputEmailVariants} showButtons={false} />
1515
</>
1616
);

packages/samples/react/src/components/input-file/basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export const InputFileBasic: FC = () => (
1111
<p>KolInputFile renders a file input field. The sample shows KolInputFile in a form context with all variations and states.</p>
1212
</SampleDescription>
1313

14-
<FormWrap RefComponent={InputFileVariants} />
14+
<FormWrap RefComponent={InputFileVariants} showButtons={false} />
1515
</>
1616
);

packages/samples/react/src/components/input-number/basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ export const InputNumberBasic: FC = () => (
1414
emphasize validation rules, supporting examples without form validation, and refrains from additional validation through native HTML element validation.
1515
</p>
1616
</SampleDescription>
17-
<FormWrap RefComponent={InputNumberVariants} />
17+
<FormWrap RefComponent={InputNumberVariants} showButtons={false} />
1818
</>
1919
);

0 commit comments

Comments
 (0)