Skip to content

Releases: huntabyte/bits-ui

v0.11.4

07 Dec 02:16
d3c1f4b
Compare
Choose a tag to compare

Patch Changes

  • Fix: bugs with reactive slot props & multiple value bindings (#221)

v0.11.3

06 Dec 02:31
3c2c5b5
Compare
Choose a tag to compare

Patch Changes

  • fix: generic type inference for Select component (#217)

v0.11.2

06 Dec 00:49
552a3db
Compare
Choose a tag to compare

Patch Changes

  • fix: exported SelectProps type (#214)

v0.11.1

06 Dec 00:07
946d16b
Compare
Choose a tag to compare

Patch Changes

  • feat: readonly startValue prop (#212)

v0.11.0

05 Dec 22:56
cfd703c
Compare
Choose a tag to compare

Minor Changes

  • breaking: rename Date to Day in Calendar components (#210)

v0.10.3

05 Dec 04:33
77c7997
Compare
Choose a tag to compare

Patch Changes

  • Calendar & Range Calendar: add initialFocus prop to autofocus dates on mount (#207)

v0.10.2

05 Dec 01:48
970c5ff
Compare
Choose a tag to compare

Patch Changes

  • fix: calendar data-selected attribute (#205)

v0.10.1

04 Dec 16:48
a8f18d1
Compare
Choose a tag to compare

Patch Changes

  • fix: Update Builder type to support all Melt UI builders (#201)

v0.10.0

04 Dec 04:43
e5113a9
Compare
Choose a tag to compare

PR Reference: #184

New Components

  • Calendar - Presents a calendar view tailored for selecting dates.
  • Range Calendar - Presents a calendar view tailored for selecting date ranges.
  • Date Picker - Facilitates the selection of dates through an input and calendar-based interface.
  • Date Range Picker - Facilitates the selection of date ranges through an input and calendar-based interface.
  • Date Field - Enables users to input specific dates within a designated field.
  • Date Range Field - Enables users to input specific date ranges within a designated field.

Improvements

Docs Overhaul & Redesign ✨

bits-ui.com has been completely redesigned by the incredible Pavel Stianko / Bitworks, who refuses to be paid for this work as he wants to contribute to the Svelte community just as I do. I'm incredibly grateful for his work and I hope you all enjoy the new docs!

  • API references for all components
  • At least 1 example for each component (more to come)

Select Component

  • fix numerous bugs with multiple behavior (closes #188 & #121)
  • prevent onChange from firing on init / multiple times (closes #73)
  • add the ability to pass in a custom items array to be used for type inference

Floating Components

  • improve positioning behavior (closes #161)
  • Remove arrowSize prop from Root components in favor of passing it directly to the Arrow components

Indicator Components (Checkbox & Radio)

  • Standardize the Indicator components for checkbox/radio items to a similar API / underlying element

Misc Improvements

  • Apply data- attributes to all components for easier global styling
  • Add asChild prop to all components that we render an element for to allow for more flexibility in element structure & scoped styles
  • Export individual prop types from the library for cleaner imports

Major Breaking Changes

As you're all probably aware, anything pre-1.0 is subject to breaking changes, but this release will introduce a few more than usual, so I wanted to call them out here and provide some guidance on how to migrate.

Replace positioning prop

The positioning prop is confusing and has been something I've wanted to change since I rapidly released this project. It's applied to the Root component which is not intuitive considering it's not actually positioning the Root component but the Content component, so I've decided to remove it in favor of individual props on the Content components of your floating components (see "Components Impacted" below).

The props you can now use to adjust the positioning of your floating content components are:

  • side - the preferred side of the trigger the content should be positioned against ("top", "right", "bottom", "left")
  • sideOffset - the offset in pixels from the preferred side. This is useful when you want to position your content a little further away from the trigger
  • align - the preferred alignment of the content relative to the trigger ("start", "center", "end")
  • alignOffset - the offset in pixels from the preferred alignment.
  • avoidCollisions - whether or not the content should avoid collisions with the viewport, which defaults to true and is what causes the content to flip sides when it's too close to the edge of the viewport.
  • collisionBoundary - The boundary element to check for collisions against. Defaults to the viewport.
  • collisionPadding - The amount of padding to apply to the collision boundary, which determines how close the content can get to the edge of the boundary before it flips sides.
  • fitViewport - Whether or not the content should be forced to fit within the viewport.
  • sameWidth - Whether or not the content should be forced to be the same width as the trigger.
  • strategy - The positioning strategy to use for the floating element.
  • overlap - Whether or not the floating element can overlap the trigger.

These props are applied to the Content components.

For example, if you wanted to position a Popover component to the right of the trigger, you would now do something like this:

<script lang="ts">
	import { Popover } from "bits-ui";
</script>

<Popover.Root>
	<Popover.Trigger>Open</Popover.Trigger>
	<Popover.Content side="right" align="start">
		Content Here
	</Popover.Content>
</Popover.Root>

Components Impacted: Context Menu, Dropdown Menu, Link Preview, Popover, Select & Tooltip

Move arrowSize prop

Currently, the arrowSize prop is applied to the Root component of several floating components. Similar to the positioning prop, this is not intuitive and I've decided to move it to the Arrow component of the floating components.

For example, if you wanted to change the size of the arrow on a Tooltip component, you would now do something like this:

<script lang="ts">
	import { Tooltip } from "bits-ui";
</script>

<Tooltip.Root>
	<Tooltip.Trigger>Open</Tooltip.Trigger>
	<Tooltip.Content>
		<Tooltip.Arrow size={8} />
	</Tooltip.Content>
</Tooltip.Root>

v0.10.0-next.0

04 Dec 02:55
0370d25
Compare
Choose a tag to compare
v0.10.0-next.0 Pre-release
Pre-release

Minor Changes

  • remove arrowSize prop from menu Root components in favor of passing it as a prop to the Arrow components (#184)

  • New component: Date Range Picker (#184)

  • feat: Calendar (#184)

  • Breaking change: separate floating positioning props into individual props and move them to content components (#184)

  • New components: Range Calendar, Date Field, Date Range Field (#184)