-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component Improvements & Docs Overhaul #184
Conversation
🦋 Changeset detectedLatest commit: 83b2a5b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
hi @huntabyte - just wanted to pop in and ask if you have seen my comments on the wip calendar here: since maybe you intend for this patch to get merged and #171 to get closed |
Hey @ollema, I believe most of the issues were addressed, will take a look at the builder attrs, its likely because the attributes are For the styling on the As for the |
New Components
Improvements
Docs Overhaul & Redesign ✨
The docs have 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!
Select Component
multiple
behavior (closes Select's "multiple" typing is incorrect as it doesn't allow true #188 & Weird Select behavior #121)onChange
from firing on init / multiple times (closes Prevent Select onValueChange from firing on init #73)items
array to be used for type inferenceFloating Components
arrowSize
prop fromRoot
components in favor of passing it directly to theArrow
componentsIndicator Components (Checkbox & Radio)
Indicator
components for checkbox/radio items to a similar API / underlying elementMisc Improvements
data-
attributes to all components for easier global stylingasChild
prop to all components that we render an element for to allow for more flexibility in element structure & scoped stylesMajor 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
propThe
positioning
prop is confusing and has been something I've wanted to change since I rapidly released this project. It's applied to theRoot
component which is not intuitive considering it's not actually positioning theRoot
component but theContent
component, so I've decided to remove it in favor of individual props on theContent
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 triggeralign
- 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 totrue
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:Components Impacted:
Context Menu
,Dropdown Menu
,Link Preview
,Popover
,Select
&Tooltip
Move
arrowSize
propCurrently, the
arrowSize
prop is applied to theRoot
component of several floating components. Similar to thepositioning
prop, this is not intuitive and I've decided to move it to theArrow
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: