Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/validate-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ jobs:

- name: Run asset verification tests
run: uv run pytest tests/test_generated_assets.py

- name: Run docs verification tests
run: uv run pytest tests/test_docs_error.py
2 changes: 1 addition & 1 deletion assets/docs/components/accordion.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 0


```python
from components.ui.accordion import Accordion
from components.ui.accordion import accordion
```

```python
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/attachment.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 0


```python
from components.ui.attachment import Attachment
from components.ui.attachment import attachment
```

```python
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 1


```python
from components.ui.avatar import Avatar
from components.ui.avatar import avatar
```

```python
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/bubble.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 0


```python
from components.ui.bubble import Bubble
from components.ui.bubble import bubble
```

```python
Expand Down
32 changes: 11 additions & 21 deletions assets/docs/components/button-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ order: 3
## Button Group, A Container That Groups Related Buttons Together With Consistent Styling.



> Component `button_group` not found

```python
from components.ui.button_group import button_group
```

```python
from typing import Any
Expand Down Expand Up @@ -323,16 +323,6 @@ def button_group_dropdown() -> rx.Component:
)
```

## Select

Pair with a `select` component.

**Props used:** see the [Select](/docs/components/select) docs for select-specific props.


> Component `button_group_select` not found


# API Reference

## button_group.root
Expand All @@ -344,10 +334,10 @@ button_group.root(
)
```

| Prop | Type | Default |
| ------------- | -------------------------------------- | -------------- |
| `orientation` | `Literal["horizontal", "vertical"]` | `"horizontal"` |
| `class_name` | `str` | `""` |
| Prop | Type | Default |
| ------------- | ----------------------------------- | -------------- |
| `orientation` | `Literal["horizontal", "vertical"]` | `"horizontal"` |
| `class_name` | `str` | `""` |

## button_group.separator

Expand All @@ -359,10 +349,10 @@ button_group.root(
)
```

| Prop | Type | Default |
| ------------- | -------------------------------------- | ------------ |
| `orientation` | `Literal["horizontal", "vertical"]` | `"vertical"` |
| `class_name` | `str` | `""` |
| Prop | Type | Default |
| ------------- | ----------------------------------- | ------------ |
| `orientation` | `Literal["horizontal", "vertical"]` | `"vertical"` |
| `class_name` | `str` | `""` |

## button_group.text

Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 0


```python
from components.ui.card import Card
from components.ui.card import card
```

```python
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 5


```python
from components.ui.checkbox import Checkbox
from components.ui.checkbox import checkbox
```

```python
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/collapsible.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 0


```python
from components.ui.collapsible import Collapsible
from components.ui.collapsible import collapsible
```

```python
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 8


```python
from components.ui.dialog import Dialog
from components.ui.dialog import dialog
```

```python
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/field.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 0


```python
from components.ui.field import Field
from components.ui.field import field
```

```python
Expand Down
6 changes: 3 additions & 3 deletions assets/docs/components/frame.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ order: 0
## Frame, Displays Related Content In A Structured Frame.



> Error processing `usage`: module, class, method, function, traceback, frame, or code object was expected, got Frame

```python
from components.ui.frame import frame
```

```python
from typing import Any
Expand Down
6 changes: 3 additions & 3 deletions assets/docs/components/input-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ order: 0
## Input Group, Add Addons, Buttons, And Helper Content To Inputs.



> Component `input_group` not found

```python
from components.ui.input_group import input_group
```

```python
from typing import Any
Expand Down
6 changes: 3 additions & 3 deletions assets/docs/components/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ order: 11
## Input, A Text Input Component For Forms And User Data Entry With Built-In Styling And Accessibility Features.



> Error processing `usage`: module, class, method, function, traceback, frame, or code object was expected, got Input

```python
from components.ui.input import input
```

```python
from typing import Any
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/marker.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 0


```python
from components.ui.marker import Marker
from components.ui.marker import marker
```

```python
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 0


```python
from components.ui.menu import Menu
from components.ui.menu import menu
```

```python
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/message.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 13


```python
from components.ui.message import Message
from components.ui.message import message
```

```python
Expand Down
6 changes: 3 additions & 3 deletions assets/docs/components/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ order: 13
## Select, A Styled Native Html Select Element With Consistent Design System Integration.



> Error processing `usage`: module, class, method, function, traceback, frame, or code object was expected, got NativeSelect

```python
from components.ui.select import select
```

```python
from typing import Any
Expand Down
10 changes: 5 additions & 5 deletions assets/docs/components/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ order: 0
## Switch, A Control That Allows The User To Toggle Between Checked And Not Checked.



> Component `switch` not found

```python
from components.ui.switch import switch
```

```python
from typing import Any
Expand Down Expand Up @@ -146,12 +146,12 @@ class NativeSwitch(CoreComponent):
)


class SwitchNamespace(ComponentNamespace):
class Switch(ComponentNamespace):
root = staticmethod(NativeSwitch.create)
class_names = ClassNames


switch = SwitchNamespace()
switch = Switch()
```

# Examples
Expand Down
6 changes: 3 additions & 3 deletions assets/docs/components/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ order: 0
## Table, Powerful Table And Datagrids With Built-In Features.



> Component `table` not found

```python
from components.ui.table import table
```

```python
from typing import Any
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/components/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 0


```python
from components.ui.tabs import Tabs
from components.ui.tabs import tabs
```

```python
Expand Down
4 changes: 2 additions & 2 deletions components/ui/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def create(cls, label_text: str = "", **props) -> rx.Component:
)


class SwitchNamespace(ComponentNamespace):
class Switch(ComponentNamespace):
root = staticmethod(NativeSwitch.create)
class_names = ClassNames


switch = SwitchNamespace()
switch = Switch()
24 changes: 8 additions & 16 deletions docs/components/button_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@ A split button group with a `menu` as the second segment.

--DEMO(button_group_dropdown)--

## Select

Pair with a `select` component.

**Props used:** see the [Select](/docs/components/select) docs for select-specific props.

--DEMO(button_group_select)--

# API Reference

## button_group.root
Expand All @@ -85,10 +77,10 @@ button_group.root(
)
```

| Prop | Type | Default |
| ------------- | -------------------------------------- | -------------- |
| `orientation` | `Literal["horizontal", "vertical"]` | `"horizontal"` |
| `class_name` | `str` | `""` |
| Prop | Type | Default |
| ------------- | ----------------------------------- | -------------- |
| `orientation` | `Literal["horizontal", "vertical"]` | `"horizontal"` |
| `class_name` | `str` | `""` |

## button_group.separator

Expand All @@ -100,10 +92,10 @@ button_group.root(
)
```

| Prop | Type | Default |
| ------------- | -------------------------------------- | ------------ |
| `orientation` | `Literal["horizontal", "vertical"]` | `"vertical"` |
| `class_name` | `str` | `""` |
| Prop | Type | Default |
| ------------- | ----------------------------------- | ------------ |
| `orientation` | `Literal["horizontal", "vertical"]` | `"vertical"` |
| `class_name` | `str` | `""` |

## button_group.text

Expand Down
7 changes: 4 additions & 3 deletions native/templates/_intro.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,13 @@ def command_selector():
def intro(raw_arg):
intro = raw_arg.strip("[]").strip()

print(intro)

if "," not in intro:
raise ValueError(f"Invalid INTRO format: {raw_arg!r}")

title, description = intro.split(",", 1)
slug = title.strip().lower().replace(" ", "-")
slug = title.strip().lower().replace(" ", "_")
copy_id = f"copy-command-{slug}"
command_id = f"command-{slug}"

Expand All @@ -142,7 +144,7 @@ def intro(raw_arg):
class_name="text-muted-foreground command-prefix",
),
rx.el.span(
f" {title.strip().lower()}",
f" {slug}",
class_name="font-medium text-foreground",
),
class_name=(
Expand Down Expand Up @@ -188,6 +190,5 @@ def intro(raw_arg):
),
class_name="flex flex-col items-start gap-4 max-w-xl",
),
# rx.el.button("Open Full Preview"),
class_name="flex flex-col gap-6 sm:flex-row sm:items-start sm:justify-between mb-10",
)
5 changes: 4 additions & 1 deletion native/templates/_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def _usage_demo(component_name: str):


def usage(raw_arg):

name = raw_arg.replace("_", " ").title()

return div(
div(
h1(
Expand All @@ -95,7 +98,7 @@ def usage(raw_arg):
),
p(
span("Use the following to build the "),
strong(raw_arg.capitalize()),
strong(name),
span(" component."),
class_name="text-sm text-muted-foreground",
),
Expand Down
Loading
Loading