Skip to content

v0.2.0

Compare
Choose a tag to compare
@lpotthast lpotthast released this 05 Sep 07:02
· 343 commits to main since this release

Added

  • Added the Out type. An enum abstracting over Callbacks and WriteSignals. Components can use this type when it is equally likely that a user will provide either of the previously mentioned types. In case of the WriteSignal, the user just wants a new value to be stored. In case of a callback, the user wants fine control over how a new value is handled. The input component is the first one using it, as mentioned in the Changed section.
  • The Select, OptionalSelect and Multiselect components now accept a class prop with which custom classes can be attached to a rendered element.
  • The Kbd component together with KbdShortcut, displaying keyboard keys and shortcuts.
  • The Chip component now accepts custom id, class and style props.
  • You can now use the new --slider-bar-background-image CSS variable to style the bar of a Slider with more control. Defaults to none. --slider-bar-background-color is still the preferred way to style the bar if no image is needed. The image property will overwrite the color.
  • Also added --slider-range-background-color, --slider-range-background-image, --slider-knob-border-width, --slider-knob-border-color, --slider-knob-border-style, --slider-knob-background-color and --slider-knob-halo-background-color.
  • The background color/image of the selection of a Slider can now be styled using --slider-range-background-color, defaulting to var(--brand-color), and --slider-range-background-image, defaulting to none.
  • Initial version of a ColorPicker component.

Changed

  • The DateSelector components on_change prop now takes a Callback instead of a generic function.
  • Buttons of type outlined now use --button-outlined-[color]-... variables for their styling.
  • Buttons of type filled now use --button-filled-[color]-... variables for their styling.
  • Buttons of type outlined and color primary now use a dark text color, contrasting the default bright background.
  • When using an input of type Number, you now have to supply optional min, max and step values which are propagated to the underlying input element.
  • The Input set prop is now optional.
  • The Input set prop is no longer generic. It now expects an Out<String>, which can either be a WriteSignal or a custom Callback.
  • The Slider and RangerSlider set_value props are no longer generic. They now expect an Out<f64>, which can either be a WriteSignal or a custom Callback.
  • The Toggle on_toggle prop is now called set_value and is no longer generic. It now expect an Out<bool>, which can either be a WriteSignal or a custom Callback.
  • The TiptapEditor set_value prop is no longer generic. It now expect an Option<Out<TiptapContent>>, which can either be a WriteSignal or a custom Callback.
  • All components using custom attributes now render them with a "data-" prefix, allowing them to be standard-compliant and distinguishable from well-known / standard attributes. leptonic-theme styling changed appropriately.
  • Prop max of the ProgressBar is now a MaybeSignal.
  • Prop progress of the ProgressBar is now a MaybeSignal.
  • Prop title of the Alert is now a Callback instead of a generic Fn closure. Expect the now necessary create_callback(move |()| {}) when instantiating a component with a callback prop to become a simple move || {} after a migration to leptos 0.5!
  • The Slider step prop is now optional, making continuous sliders with maximum precision easier to set up.
  • The Input component was split into TextInput, PasswordInput and NumberInput. Their label prop was renamed to placeholder. - The InputType enum was removed.
  • All Select components now require a search_text_provider prop. The SelectOption trait no longer enforces Display to be implemented.

Fixed

  • A button with variants now properly respects its disabled state.
  • A button with variants now only triggers one of its actions (either main or variant) per interaction.
  • Buttons of type flat and color info now receive correct styling.
  • The installation instructions now include a section describing how to enable the required web_sys_unstable_apis opt-in.