Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubhdeep12 committed Oct 30, 2024
1 parent cf8da30 commit ea44978
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions apps/docs/src/examples/checkbox-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ export function HTMLFormExample() {
e.stopPropagation();

const formData = new FormData(formRef);
const subscriptions = Array.from(formData.getAll('subscriptions'));
const subscriptions = Array.from(formData.getAll("subscriptions"));

const result = {
...Object.fromEntries(formData),
subscriptions,
};

alert(JSON.stringify(result, null, 2));
};

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/routes/docs/core/components/checkbox-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,13 @@ function HTMLFormExample() {
e.stopPropagation();

const formData = new FormData(formRef);
const subscriptions = Array.from(formData.getAll('subscriptions'));
const subscriptions = Array.from(formData.getAll("subscriptions"));

const result = {
...Object.fromEntries(formData),
subscriptions,
};

alert(JSON.stringify(result, null, 2));
};

Expand Down
19 changes: 12 additions & 7 deletions packages/core/src/checkbox-group/checkbox-group-item-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { type Component, type ValidComponent, splitProps } from "solid-js";

import { mergeRefs } from "@kobalte/utils";
import {
Checkbox,
type CheckboxInputCommonProps,
Expand All @@ -17,19 +18,21 @@ import {
import { useFormControlContext } from "../form-control";
import type { ElementOf, PolymorphicProps } from "../polymorphic";
import { useCheckboxGroupContext } from "./checkbox-group-context";
import { mergeRefs } from "@kobalte/utils";

export interface CheckboxGroupItemInputOptions extends CheckboxInputOptions {}

export interface CheckboxGroupItemInputCommonProps<T extends HTMLElement = HTMLInputElement>
extends CheckboxInputCommonProps {}
export interface CheckboxGroupItemInputCommonProps<
T extends HTMLElement = HTMLInputElement,
> extends CheckboxInputCommonProps {}

export interface CheckboxGroupItemInputRenderProps
extends CheckboxInputRenderProps,
CheckboxGroupItemInputCommonProps {}

export type CheckboxGroupItemInputProps<T extends ValidComponent | HTMLElement = HTMLInputElement> =
CheckboxGroupItemInputOptions & Partial<CheckboxGroupItemInputCommonProps<ElementOf<T>>>;
export type CheckboxGroupItemInputProps<
T extends ValidComponent | HTMLElement = HTMLInputElement,
> = CheckboxGroupItemInputOptions &
Partial<CheckboxGroupItemInputCommonProps<ElementOf<T>>>;

/**
* The native html input that is visually hidden in the checkbox.
Expand All @@ -54,9 +57,11 @@ export function CheckboxGroupItemInput<T extends ValidComponent = "input">(

return (
<Checkbox.Input<
Component<Omit<CheckboxGroupItemInputRenderProps, keyof CheckboxInputRenderProps>>
Component<
Omit<CheckboxGroupItemInputRenderProps, keyof CheckboxInputRenderProps>
>
>
ref={mergeRefs(el => (ref = el), local.ref)}
ref={mergeRefs((el) => (ref = el), local.ref)}
as="input"
aria-describedby={ariaDescribedBy() || undefined}
{...formControlContext.dataset()}
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/checkbox-group/checkbox-group-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ import { useCheckboxGroupContext } from "./checkbox-group-context";

interface CheckboxGroupItemState extends CheckboxRootState {}

export interface CheckboxGroupItemOptions
extends CheckboxRootOptions {}
export interface CheckboxGroupItemOptions extends CheckboxRootOptions {}

export interface CheckboxGroupItemCommonProps<
T extends HTMLElement = HTMLElement,
Expand Down Expand Up @@ -74,7 +73,7 @@ export function CheckboxGroupItem<T extends ValidComponent = "div">(
"name",
"required",
"readOnly",
"ref"
"ref",
]);

const isChecked = () => {
Expand Down

0 comments on commit ea44978

Please sign in to comment.