Skip to content

Commit

Permalink
chore: attribution and docs nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
HBS999 committed Nov 9, 2024
1 parent 546f78f commit ea8a123
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion apps/docs/src/routes/docs/core/components/rating-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { Root, Label, ... } from "@kobalte/core/rating-group";

## Features

- Precise ratings with half-value increments.
- Syncs with form reset events.
- Group and rating labeling support for assistive technology.
- Can be controlled or uncontrolled.
Expand Down Expand Up @@ -141,7 +142,7 @@ transition: fill 200ms cubic-bezier(0.2, 0, 0, 1);
fill: hsl(200 98% 39%);
}

````
```

</TabsSnippets.Content>
{/* <!-- prettier-ignore-end --> */}
Expand Down
9 changes: 0 additions & 9 deletions packages/core/src/rating-group/rating-group-root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,6 @@ export function RatingGroupRoot<T extends ValidComponent = "div">(
}

setValue(newValue);

// Sync all radio input checked state in the group with the selected value.
// This is necessary because checked state might be out of sync
// (ex: when using controlled radio-group).
if (ref)
for (const el of ref.querySelectorAll("[role='radio']")) {
const radio = el as HTMLInputElement;
radio.checked = Number(radio.value) === value();
}
},
allowHalf: () => local.allowHalf,
orientation: () => local.orientation!,
Expand Down
8 changes: 8 additions & 0 deletions packages/core/src/rating-group/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* Portions of this file are based on code from zag.
* MIT License, Copyright 2021 Chakra UI.
*
* Credits to the Chakra UI team:
* https://github.com/chakra-ui/zag/blob/87ebdd171d5e28fffe2cec7d0b0d5f5a68601963/packages/utilities/dom-event/src/get-event-point.ts
*/

type PointType = "page" | "client";
type AnyPointerEvent = MouseEvent | TouchEvent | PointerEvent;
type Point = {
Expand Down

0 comments on commit ea8a123

Please sign in to comment.