Commit Graph

30 Commits

Author SHA1 Message Date
Thomas Brandého
462b023019
use add_imports everywhere (#3448) 2024-06-12 09:26:45 -07:00
Thomas Brandého
4bda3eb233
add style for orientation=vertical in tabs (#3332) 2024-05-21 16:21:46 -07:00
Masen Furer
b95e02a805
rx.accordion customizability overhaul (#3266)
* rx.accordion customizability overhaul

* fix low contrast font in "classic" variant
* relative font sizing, so setting font_size on the root works now
* use CSS vars wherever possible to make downstream styling easier
* optional dividers between accordion items
* support `radius`
* support `duration` and `easing` for controlling the animation
* fix animation jank while keeping padding_y
* lookup `data-variant` via CSS instead of passing props in python
* fix "surface" variant to use `--accent-surface` as radix intended

* Restore default variant: "classic"

* Fix accordion primitive radius
2024-05-10 16:50:02 -07:00
Thomas Brandého
57476966f3
add_style api (#3202) 2024-05-06 16:59:11 -07:00
Thomas Brandého
1817c30e22
add toast component (#3186) 2024-05-03 12:09:11 -07:00
Elijah Ahianyo
04ab2b9a71
[REF-2524] Tuple unpacking should apply at component level (#3062) 2024-04-11 14:04:19 -07:00
Thomas Brandého
0af4770180
generate pyi files when building/publishing 3rd party component (#2945)
* build pyi files when building/publishing 3rd party

* fix typo in workflow

* add future annotation

* add tests to pass coverage check

* add more unit tests

* omit pyi_generator from test coverage

* change black from dev deps to direct deps

* remake all pyi

* format pyi if black is present, return as if otherwise

* fix requested changes

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-03-29 09:54:21 -07:00
Elijah Ahianyo
ec31f00185
Accordion Items unique Value (#2663)
* Accordion Items unique Value

use crypto.randomUUID to generate accordion item value at runtime instead of compile time

* use generateUUID in state.js instead of crypto.randomUUID()
2024-02-20 11:50:50 -08:00
Masen Furer
3350fa0388
Component: translate underscore suffix for props supported by chakra (#2636)
* Component: translate underscore suffix for props supported by chakra

type_ becomes type
min_ becomes min
max_ becomes max
id_ becomes id

The deprecation warning is only displayed when the underscore suffix prop is
passed and the non-underscore suffix prop is defined on the given component.

* Rename type_ to type in accordion and scroll_area

All of the new radix components avoid the underscore suffix names where
possible.

* Update deprecation warning wording

* Refactor for readability

* Do not raise deprecation warning for `id_`

id is kind of a special prop because it exists on all components

* Add test case for deprecating underscore suffix props
2024-02-15 20:46:06 -08:00
Nikhil Rao
7240f8ee6f
Handle component namespaces in global styles (#2630) 2024-02-15 16:03:10 -08:00
Thomas Brandého
411a3a1f13
accordion default classname (#2628) 2024-02-15 13:57:12 -08:00
Thomas Brandého
39486386f4
fix value/default_value in accordion (#2616)
* fix value/default_value in accordion

* fix for 3.8 compat

* update comment
2024-02-14 17:06:28 -08:00
invrainbow
eea3b00deb
Fix AccordionItem interactive docs not showing up (#2600) 2024-02-13 14:08:30 -08:00
Elijah Ahianyo
c1089fc8f9
[REF-1925] Accordion foreach fix (#2598) 2024-02-13 11:58:48 -08:00
Masen Furer
4206afeb7b
[REF-1958] Remove shadowed radix css props (#2590)
* style: shorthand replacements need camelCase

Avoid warning on terminal and in browser console from using kebab-case CSS
props with emotion.

* _rename_props only replace prop name once

In case the value also contains the prop name, we don't want to replace it
multiple times.

* pyi_generator: ignore _rename_props in create signature

* Avoid shadowing CSS prop `display` and `gap`

Replace usages of `gap` with `spacing` to retain Radix sizing number system,
while allowing users to specify a responsive `gap` using CSS units.

Remove `display` props from radix components, allowing `display` to accept
responsive lists.

* checkbox: apply `gap` to `flex` if provided

* Remove _rename_props from .create signatures

* Fix spacing prop in blank template

* Fixup tests after changing style shorthand to return camelCase
2024-02-13 10:06:28 -08:00
Thomas Brandého
798b72825d
fix match import in iconbutton (#2552) 2024-02-12 12:36:48 -08:00
Masen Furer
c124650082
Merge remote-tracking branch 'origin/main' into reflex-0.4.0 2024-02-07 13:53:39 -08:00
Elijah Ahianyo
1e4b0a163c
Map Accordion color schemes to radix colors (#2511) 2024-02-07 09:52:09 -08:00
Elijah Ahianyo
8e2c9681f7
Radix Components Valid children/parents (#2495) 2024-02-06 10:55:00 -08:00
Masen Furer
2f70e3e43a
[REF-1839] Reserve top-level __call__ for a future high level API (#2518)
* Reserve top-level __call__ for a future high level API

Instead of aliasing the top-level `__call__` to `.root`, require users
to explicitly call `.root` to avoid breakage when a future high level
API gets implemented and takes over the top-level `__call__`

Fix REF-1839

* alertdialog: forgot this one
2024-02-02 12:16:59 -08:00
Masen Furer
35b20d26b5
Merge remote-tracking branch 'origin/main' into reflex-0.4.0 2024-02-02 08:39:10 -08:00
Tom Gotsman
1b4229691a
All event handlers inherit from event triggers (#2507)
* update to ensure every radix component only inherits events from EventTriggers class

* update the naming of event handlers to swap name on_value_change and on_checked_change to on_change

* update to call _replace_prop_names in component.py

* small darglint error fix

* update to ensure every radix component only inherits events from EventTriggers class

* update the naming of event handlers to swap name on_value_change and on_checked_change to on_change

* update to call _replace_prop_names in component.py

* small darglint error fix

* updates to pass pytest tests

* small fix

* duplicate removal

---------

Co-authored-by: Tom Gotsman <tomgotsman@toms-mbp.lan>
2024-02-01 16:11:15 -08:00
Nikhil Rao
27b9a10233 Merge branch 'main' into reflex-0.4.0 2024-01-30 16:48:38 -08:00
Nikhil Rao
833507b73a
Fix accordion pyi (#2491) 2024-01-30 16:12:50 -08:00
Masen Furer
bd9d6e6789
Radix Primitive Component Namespaces
Expose subcomponents of radix primitives wrapped in a SimpleNamespace with a
__call__ method that points to the high-level API entry point.
2024-01-29 17:38:58 -08:00
Elijah Ahianyo
5f1751acc2
Vardata for rx.Match (#2439) 2024-01-24 14:55:49 -08:00
Alek Petuskey
d466c2aaa2
Radix Accordion (#2310) 2024-01-18 14:20:21 -08:00
Thomas Brandého
527fa4bc3f
Add slider, progress, and form primitives (#2306) 2023-12-21 10:32:40 -08:00
Nikhil Rao
5d21f0ca60
Add high-level API for accordion (#2285) 2023-12-18 17:21:49 -08:00
Nikhil Rao
96f68cb94d
Implement accordion component (#2262)
* Implement accordion component

* Fix literal annotation

* Use style prop instead of css

* Move accordion to primitives folder

* Add pyi file

* Fix pyright

* Add apply_theme method

* Fix apply_theme

* Use apply_theme method

* Fix lint
2023-12-08 21:20:30 -08:00