reflex-ant-design 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- reflex_ant_design-0.1.0/LICENSE +21 -0
- reflex_ant_design-0.1.0/PKG-INFO +212 -0
- reflex_ant_design-0.1.0/README.md +179 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/__init__.py +268 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/base.py +124 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/base.pyi +304 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/data_display.py +536 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/data_display.pyi +2403 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/data_entry.py +614 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/data_entry.pyi +2782 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/feedback.py +237 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/feedback.pyi +971 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/general.py +259 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/general.pyi +968 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/layout.py +247 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/layout.pyi +1043 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/namespace.py +244 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/navigation.py +239 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/navigation.pyi +823 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design/py.typed +0 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design.egg-info/PKG-INFO +212 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design.egg-info/SOURCES.txt +27 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design.egg-info/dependency_links.txt +1 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design.egg-info/requires.txt +8 -0
- reflex_ant_design-0.1.0/custom_components/reflex_ant_design.egg-info/top_level.txt +1 -0
- reflex_ant_design-0.1.0/pyproject.toml +78 -0
- reflex_ant_design-0.1.0/setup.cfg +4 -0
- reflex_ant_design-0.1.0/tests/test_catalog.py +41 -0
- reflex_ant_design-0.1.0/tests/test_components.py +84 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ernesto Crespo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: reflex-ant-design
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Ant Design (antd) React components wrapped as Reflex components.
|
|
5
|
+
Author-email: Ernesto Crespo <ecrespo@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/ecrespo/reflex-ant-design
|
|
8
|
+
Project-URL: Repository, https://github.com/ecrespo/reflex-ant-design
|
|
9
|
+
Project-URL: Issues, https://github.com/ecrespo/reflex-ant-design/issues
|
|
10
|
+
Project-URL: Documentation, https://github.com/ecrespo/reflex-ant-design/tree/main/docs
|
|
11
|
+
Keywords: reflex,reflex-custom-components,ant-design,antd,ui,react,components,design-system
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Framework :: AsyncIO
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
20
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: reflex>=0.7.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
28
|
+
Requires-Dist: ruff>=0.5; extra == "dev"
|
|
29
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
30
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
31
|
+
Requires-Dist: trove-classifiers>=2024.1.1; extra == "dev"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# reflex-ant-design
|
|
35
|
+
|
|
36
|
+
[Ant Design](https://ant.design) (`antd`) wrapped as [Reflex](https://reflex.dev)
|
|
37
|
+
components — build enterprise-grade UIs in pure Python.
|
|
38
|
+
|
|
39
|
+
This is a Reflex **custom component** package. It exposes the Ant Design React
|
|
40
|
+
components (Button, Table, Form, DatePicker, Modal, and ~90 more) as Reflex
|
|
41
|
+
components you can drive entirely from Python state, with theming through
|
|
42
|
+
`ConfigProvider`.
|
|
43
|
+
|
|
44
|
+
> Status: **0.1.0 — alpha.** The API surface is broad and may still change.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
With **uv** (recommended):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
uv add reflex-ant-design
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
With pip:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install reflex-ant-design
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The `antd` npm package is installed automatically by Reflex the first time you
|
|
61
|
+
run your app.
|
|
62
|
+
|
|
63
|
+
## Quickstart
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
import reflex as rx
|
|
67
|
+
from reflex_ant_design import antd, icon
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class State(rx.State):
|
|
71
|
+
name: str = ""
|
|
72
|
+
|
|
73
|
+
@rx.event
|
|
74
|
+
def set_name(self, value: str):
|
|
75
|
+
self.name = value
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def index() -> rx.Component:
|
|
79
|
+
return antd.config_provider(
|
|
80
|
+
antd.card(
|
|
81
|
+
antd.space(
|
|
82
|
+
antd.input(
|
|
83
|
+
value=State.name,
|
|
84
|
+
on_change=State.set_name,
|
|
85
|
+
placeholder="Your name",
|
|
86
|
+
prefix=icon("UserOutlined"),
|
|
87
|
+
),
|
|
88
|
+
antd.button("Greet", type="primary", icon=icon("SmileOutlined")),
|
|
89
|
+
antd.text(f"Hello!", strong=True),
|
|
90
|
+
direction="vertical",
|
|
91
|
+
),
|
|
92
|
+
title="reflex-ant-design",
|
|
93
|
+
),
|
|
94
|
+
theme={"token": {"colorPrimary": "#722ed1", "borderRadius": 8}},
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
app = rx.App()
|
|
99
|
+
app.add_page(index)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Two ways to import
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
# 1) Namespace (mirrors rx.*)
|
|
106
|
+
from reflex_ant_design import antd
|
|
107
|
+
antd.button("Save", type="primary")
|
|
108
|
+
|
|
109
|
+
# 2) Flat factories
|
|
110
|
+
from reflex_ant_design import button, table, date_picker
|
|
111
|
+
button("Save", type="primary")
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Examples
|
|
115
|
+
|
|
116
|
+
### Data table from state
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
COLUMNS = [
|
|
120
|
+
{"title": "Name", "dataIndex": "name", "key": "name"},
|
|
121
|
+
{"title": "Role", "dataIndex": "role", "key": "role"},
|
|
122
|
+
]
|
|
123
|
+
DATA = [
|
|
124
|
+
{"key": "1", "name": "Ada", "role": "Engineer"},
|
|
125
|
+
{"key": "2", "name": "Alan", "role": "Researcher"},
|
|
126
|
+
]
|
|
127
|
+
|
|
128
|
+
antd.table(columns=COLUMNS, data_source=DATA, pagination={"pageSize": 5})
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Select bound to state
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
antd.select(
|
|
135
|
+
value=State.country,
|
|
136
|
+
on_change=State.set_country,
|
|
137
|
+
options=[{"label": "Spain", "value": "es"}, {"label": "Japan", "value": "jp"}],
|
|
138
|
+
show_search=True,
|
|
139
|
+
allow_clear=True,
|
|
140
|
+
)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Modal driven by a boolean
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
antd.button("Open", on_click=State.open_modal)
|
|
147
|
+
antd.modal(
|
|
148
|
+
antd.text("Are you sure?"),
|
|
149
|
+
open=State.modal_open,
|
|
150
|
+
title="Confirm",
|
|
151
|
+
on_ok=State.close_modal,
|
|
152
|
+
on_cancel=State.close_modal,
|
|
153
|
+
)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Theming
|
|
157
|
+
|
|
158
|
+
Wrap your app (or any subtree) in `config_provider` and pass design tokens:
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
antd.config_provider(
|
|
162
|
+
your_app(),
|
|
163
|
+
theme={"token": {"colorPrimary": "#13c2c2", "borderRadius": 6}},
|
|
164
|
+
component_size="large",
|
|
165
|
+
)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Component catalog
|
|
169
|
+
|
|
170
|
+
| Category | Components |
|
|
171
|
+
| --- | --- |
|
|
172
|
+
| **General** | Button, FloatButton (+ Group, BackTop), Typography (Title/Text/Paragraph/Link), `icon()` |
|
|
173
|
+
| **Layout** | Divider, Flex, Row/Col, Layout (Header/Sider/Content/Footer), Space (+ Compact), Splitter |
|
|
174
|
+
| **Navigation** | Anchor, Breadcrumb, Dropdown (+ Button), Menu, Pagination, Steps, Tabs |
|
|
175
|
+
| **Data Entry** | Input (+ TextArea/Search/Password/OTP), InputNumber, Checkbox, Radio, Select, Switch, Slider, Rate, DatePicker, RangePicker, TimePicker, AutoComplete, Cascader, TreeSelect, Mentions, ColorPicker, Transfer, Upload, Form |
|
|
176
|
+
| **Data Display** | Avatar, Badge, Card, Carousel, Collapse, Descriptions, Empty, Image, List, Popover, Tooltip, QRCode, Segmented, Statistic, Table, Tag, Timeline, Tour, Tree |
|
|
177
|
+
| **Feedback** | Alert, Drawer, Modal, Popconfirm, Progress, Result, Skeleton, Spin, Watermark |
|
|
178
|
+
| **Config** | ConfigProvider, App |
|
|
179
|
+
|
|
180
|
+
See [`docs/guides/usage.md`](docs/guides/usage.md) for per-category notes and
|
|
181
|
+
the gotchas (date values, imperative `message`/`notification`, form binding).
|
|
182
|
+
|
|
183
|
+
## Try the demo
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
git clone https://github.com/ecrespo/reflex-ant-design
|
|
187
|
+
cd reflex-ant-design
|
|
188
|
+
make install
|
|
189
|
+
cd reflex_ant_design_demo && uv run reflex run
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Documentation
|
|
193
|
+
|
|
194
|
+
- [`docs/sdd`](docs/sdd) — the Spec-Driven Design docs (PRD, requirements,
|
|
195
|
+
architecture, component catalog, roadmap, implementation plan).
|
|
196
|
+
- [`docs/guides/usage.md`](docs/guides/usage.md) — usage patterns and tips.
|
|
197
|
+
- [`docs/guides/compatibility.md`](docs/guides/compatibility.md) — antd / React
|
|
198
|
+
/ Reflex version matrix.
|
|
199
|
+
|
|
200
|
+
## Compatibility
|
|
201
|
+
|
|
202
|
+
- Reflex `>= 0.7`
|
|
203
|
+
- `antd@^6` (works with React 19 shipped by Reflex 0.7+). Pin `antd@^5` for apps
|
|
204
|
+
on React 18 — see the compatibility guide.
|
|
205
|
+
|
|
206
|
+
## Contributing
|
|
207
|
+
|
|
208
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
209
|
+
|
|
210
|
+
## License
|
|
211
|
+
|
|
212
|
+
MIT © Ernesto Crespo
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# reflex-ant-design
|
|
2
|
+
|
|
3
|
+
[Ant Design](https://ant.design) (`antd`) wrapped as [Reflex](https://reflex.dev)
|
|
4
|
+
components — build enterprise-grade UIs in pure Python.
|
|
5
|
+
|
|
6
|
+
This is a Reflex **custom component** package. It exposes the Ant Design React
|
|
7
|
+
components (Button, Table, Form, DatePicker, Modal, and ~90 more) as Reflex
|
|
8
|
+
components you can drive entirely from Python state, with theming through
|
|
9
|
+
`ConfigProvider`.
|
|
10
|
+
|
|
11
|
+
> Status: **0.1.0 — alpha.** The API surface is broad and may still change.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
With **uv** (recommended):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uv add reflex-ant-design
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
With pip:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install reflex-ant-design
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The `antd` npm package is installed automatically by Reflex the first time you
|
|
28
|
+
run your app.
|
|
29
|
+
|
|
30
|
+
## Quickstart
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
import reflex as rx
|
|
34
|
+
from reflex_ant_design import antd, icon
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class State(rx.State):
|
|
38
|
+
name: str = ""
|
|
39
|
+
|
|
40
|
+
@rx.event
|
|
41
|
+
def set_name(self, value: str):
|
|
42
|
+
self.name = value
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def index() -> rx.Component:
|
|
46
|
+
return antd.config_provider(
|
|
47
|
+
antd.card(
|
|
48
|
+
antd.space(
|
|
49
|
+
antd.input(
|
|
50
|
+
value=State.name,
|
|
51
|
+
on_change=State.set_name,
|
|
52
|
+
placeholder="Your name",
|
|
53
|
+
prefix=icon("UserOutlined"),
|
|
54
|
+
),
|
|
55
|
+
antd.button("Greet", type="primary", icon=icon("SmileOutlined")),
|
|
56
|
+
antd.text(f"Hello!", strong=True),
|
|
57
|
+
direction="vertical",
|
|
58
|
+
),
|
|
59
|
+
title="reflex-ant-design",
|
|
60
|
+
),
|
|
61
|
+
theme={"token": {"colorPrimary": "#722ed1", "borderRadius": 8}},
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
app = rx.App()
|
|
66
|
+
app.add_page(index)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Two ways to import
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
# 1) Namespace (mirrors rx.*)
|
|
73
|
+
from reflex_ant_design import antd
|
|
74
|
+
antd.button("Save", type="primary")
|
|
75
|
+
|
|
76
|
+
# 2) Flat factories
|
|
77
|
+
from reflex_ant_design import button, table, date_picker
|
|
78
|
+
button("Save", type="primary")
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Examples
|
|
82
|
+
|
|
83
|
+
### Data table from state
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
COLUMNS = [
|
|
87
|
+
{"title": "Name", "dataIndex": "name", "key": "name"},
|
|
88
|
+
{"title": "Role", "dataIndex": "role", "key": "role"},
|
|
89
|
+
]
|
|
90
|
+
DATA = [
|
|
91
|
+
{"key": "1", "name": "Ada", "role": "Engineer"},
|
|
92
|
+
{"key": "2", "name": "Alan", "role": "Researcher"},
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
antd.table(columns=COLUMNS, data_source=DATA, pagination={"pageSize": 5})
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Select bound to state
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
antd.select(
|
|
102
|
+
value=State.country,
|
|
103
|
+
on_change=State.set_country,
|
|
104
|
+
options=[{"label": "Spain", "value": "es"}, {"label": "Japan", "value": "jp"}],
|
|
105
|
+
show_search=True,
|
|
106
|
+
allow_clear=True,
|
|
107
|
+
)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Modal driven by a boolean
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
antd.button("Open", on_click=State.open_modal)
|
|
114
|
+
antd.modal(
|
|
115
|
+
antd.text("Are you sure?"),
|
|
116
|
+
open=State.modal_open,
|
|
117
|
+
title="Confirm",
|
|
118
|
+
on_ok=State.close_modal,
|
|
119
|
+
on_cancel=State.close_modal,
|
|
120
|
+
)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Theming
|
|
124
|
+
|
|
125
|
+
Wrap your app (or any subtree) in `config_provider` and pass design tokens:
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
antd.config_provider(
|
|
129
|
+
your_app(),
|
|
130
|
+
theme={"token": {"colorPrimary": "#13c2c2", "borderRadius": 6}},
|
|
131
|
+
component_size="large",
|
|
132
|
+
)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Component catalog
|
|
136
|
+
|
|
137
|
+
| Category | Components |
|
|
138
|
+
| --- | --- |
|
|
139
|
+
| **General** | Button, FloatButton (+ Group, BackTop), Typography (Title/Text/Paragraph/Link), `icon()` |
|
|
140
|
+
| **Layout** | Divider, Flex, Row/Col, Layout (Header/Sider/Content/Footer), Space (+ Compact), Splitter |
|
|
141
|
+
| **Navigation** | Anchor, Breadcrumb, Dropdown (+ Button), Menu, Pagination, Steps, Tabs |
|
|
142
|
+
| **Data Entry** | Input (+ TextArea/Search/Password/OTP), InputNumber, Checkbox, Radio, Select, Switch, Slider, Rate, DatePicker, RangePicker, TimePicker, AutoComplete, Cascader, TreeSelect, Mentions, ColorPicker, Transfer, Upload, Form |
|
|
143
|
+
| **Data Display** | Avatar, Badge, Card, Carousel, Collapse, Descriptions, Empty, Image, List, Popover, Tooltip, QRCode, Segmented, Statistic, Table, Tag, Timeline, Tour, Tree |
|
|
144
|
+
| **Feedback** | Alert, Drawer, Modal, Popconfirm, Progress, Result, Skeleton, Spin, Watermark |
|
|
145
|
+
| **Config** | ConfigProvider, App |
|
|
146
|
+
|
|
147
|
+
See [`docs/guides/usage.md`](docs/guides/usage.md) for per-category notes and
|
|
148
|
+
the gotchas (date values, imperative `message`/`notification`, form binding).
|
|
149
|
+
|
|
150
|
+
## Try the demo
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
git clone https://github.com/ecrespo/reflex-ant-design
|
|
154
|
+
cd reflex-ant-design
|
|
155
|
+
make install
|
|
156
|
+
cd reflex_ant_design_demo && uv run reflex run
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Documentation
|
|
160
|
+
|
|
161
|
+
- [`docs/sdd`](docs/sdd) — the Spec-Driven Design docs (PRD, requirements,
|
|
162
|
+
architecture, component catalog, roadmap, implementation plan).
|
|
163
|
+
- [`docs/guides/usage.md`](docs/guides/usage.md) — usage patterns and tips.
|
|
164
|
+
- [`docs/guides/compatibility.md`](docs/guides/compatibility.md) — antd / React
|
|
165
|
+
/ Reflex version matrix.
|
|
166
|
+
|
|
167
|
+
## Compatibility
|
|
168
|
+
|
|
169
|
+
- Reflex `>= 0.7`
|
|
170
|
+
- `antd@^6` (works with React 19 shipped by Reflex 0.7+). Pin `antd@^5` for apps
|
|
171
|
+
on React 18 — see the compatibility guide.
|
|
172
|
+
|
|
173
|
+
## Contributing
|
|
174
|
+
|
|
175
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
MIT © Ernesto Crespo
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"""reflex-ant-design -- Ant Design (antd) components wrapped for Reflex.
|
|
2
|
+
|
|
3
|
+
Two ways to use the library:
|
|
4
|
+
|
|
5
|
+
1. Flat factory functions::
|
|
6
|
+
|
|
7
|
+
from reflex_ant_design import button, card, table
|
|
8
|
+
|
|
9
|
+
button("Save", type="primary")
|
|
10
|
+
|
|
11
|
+
2. Namespaced access (mirrors Reflex's own ``rx.*`` style)::
|
|
12
|
+
|
|
13
|
+
from reflex_ant_design import antd
|
|
14
|
+
|
|
15
|
+
antd.button("Save", type="primary")
|
|
16
|
+
antd.config_provider(
|
|
17
|
+
antd.card(antd.table(columns=cols, data_source=rows)),
|
|
18
|
+
theme={"token": {"colorPrimary": "#1677ff"}},
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
Wrap your app (or a subtree) in :func:`config_provider` to set the design
|
|
22
|
+
tokens (theme), the default component size, and the locale.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
from __future__ import annotations
|
|
26
|
+
|
|
27
|
+
from .base import (
|
|
28
|
+
ANTD_ICONS_VERSION,
|
|
29
|
+
ANTD_VERSION,
|
|
30
|
+
AntdComponent,
|
|
31
|
+
App,
|
|
32
|
+
ConfigProvider,
|
|
33
|
+
app,
|
|
34
|
+
config_provider,
|
|
35
|
+
)
|
|
36
|
+
from .data_display import (
|
|
37
|
+
avatar,
|
|
38
|
+
avatar_group,
|
|
39
|
+
badge,
|
|
40
|
+
badge_ribbon,
|
|
41
|
+
calendar,
|
|
42
|
+
card,
|
|
43
|
+
card_grid,
|
|
44
|
+
card_meta,
|
|
45
|
+
carousel,
|
|
46
|
+
checkable_tag,
|
|
47
|
+
collapse,
|
|
48
|
+
descriptions,
|
|
49
|
+
empty,
|
|
50
|
+
image,
|
|
51
|
+
list_item,
|
|
52
|
+
list_item_meta,
|
|
53
|
+
list_view,
|
|
54
|
+
popover,
|
|
55
|
+
qr_code,
|
|
56
|
+
segmented,
|
|
57
|
+
statistic,
|
|
58
|
+
statistic_countdown,
|
|
59
|
+
table,
|
|
60
|
+
tag,
|
|
61
|
+
timeline,
|
|
62
|
+
tooltip,
|
|
63
|
+
tour,
|
|
64
|
+
tree,
|
|
65
|
+
)
|
|
66
|
+
from .data_entry import (
|
|
67
|
+
auto_complete,
|
|
68
|
+
cascader,
|
|
69
|
+
checkbox,
|
|
70
|
+
checkbox_group,
|
|
71
|
+
color_picker,
|
|
72
|
+
date_picker,
|
|
73
|
+
form,
|
|
74
|
+
form_item,
|
|
75
|
+
form_list,
|
|
76
|
+
input,
|
|
77
|
+
input_number,
|
|
78
|
+
input_otp,
|
|
79
|
+
mentions,
|
|
80
|
+
password_input,
|
|
81
|
+
radio,
|
|
82
|
+
radio_button,
|
|
83
|
+
radio_group,
|
|
84
|
+
range_picker,
|
|
85
|
+
rate,
|
|
86
|
+
search_input,
|
|
87
|
+
select,
|
|
88
|
+
slider,
|
|
89
|
+
switch,
|
|
90
|
+
text_area,
|
|
91
|
+
time_picker,
|
|
92
|
+
transfer,
|
|
93
|
+
tree_select,
|
|
94
|
+
upload,
|
|
95
|
+
upload_dragger,
|
|
96
|
+
)
|
|
97
|
+
from .feedback import (
|
|
98
|
+
alert,
|
|
99
|
+
drawer,
|
|
100
|
+
modal,
|
|
101
|
+
popconfirm,
|
|
102
|
+
progress,
|
|
103
|
+
result,
|
|
104
|
+
skeleton,
|
|
105
|
+
skeleton_button,
|
|
106
|
+
skeleton_image,
|
|
107
|
+
spin,
|
|
108
|
+
watermark,
|
|
109
|
+
)
|
|
110
|
+
from .general import (
|
|
111
|
+
back_top,
|
|
112
|
+
button,
|
|
113
|
+
float_button,
|
|
114
|
+
float_button_group,
|
|
115
|
+
icon,
|
|
116
|
+
link,
|
|
117
|
+
paragraph,
|
|
118
|
+
text,
|
|
119
|
+
title,
|
|
120
|
+
typography,
|
|
121
|
+
)
|
|
122
|
+
from .layout import (
|
|
123
|
+
col,
|
|
124
|
+
content,
|
|
125
|
+
divider,
|
|
126
|
+
flex,
|
|
127
|
+
footer,
|
|
128
|
+
header,
|
|
129
|
+
layout,
|
|
130
|
+
row,
|
|
131
|
+
sider,
|
|
132
|
+
space,
|
|
133
|
+
space_compact,
|
|
134
|
+
splitter,
|
|
135
|
+
splitter_panel,
|
|
136
|
+
)
|
|
137
|
+
from .namespace import antd
|
|
138
|
+
from .navigation import (
|
|
139
|
+
affix,
|
|
140
|
+
anchor,
|
|
141
|
+
breadcrumb,
|
|
142
|
+
dropdown,
|
|
143
|
+
dropdown_button,
|
|
144
|
+
menu,
|
|
145
|
+
pagination,
|
|
146
|
+
steps,
|
|
147
|
+
tabs,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
__version__ = "0.1.0"
|
|
151
|
+
|
|
152
|
+
__all__ = [
|
|
153
|
+
"antd",
|
|
154
|
+
"AntdComponent",
|
|
155
|
+
"ConfigProvider",
|
|
156
|
+
"App",
|
|
157
|
+
"ANTD_VERSION",
|
|
158
|
+
"ANTD_ICONS_VERSION",
|
|
159
|
+
# providers
|
|
160
|
+
"config_provider",
|
|
161
|
+
"app",
|
|
162
|
+
# general
|
|
163
|
+
"button",
|
|
164
|
+
"float_button",
|
|
165
|
+
"float_button_group",
|
|
166
|
+
"back_top",
|
|
167
|
+
"icon",
|
|
168
|
+
"typography",
|
|
169
|
+
"title",
|
|
170
|
+
"text",
|
|
171
|
+
"paragraph",
|
|
172
|
+
"link",
|
|
173
|
+
# layout
|
|
174
|
+
"divider",
|
|
175
|
+
"flex",
|
|
176
|
+
"row",
|
|
177
|
+
"col",
|
|
178
|
+
"layout",
|
|
179
|
+
"header",
|
|
180
|
+
"content",
|
|
181
|
+
"footer",
|
|
182
|
+
"sider",
|
|
183
|
+
"space",
|
|
184
|
+
"space_compact",
|
|
185
|
+
"splitter",
|
|
186
|
+
"splitter_panel",
|
|
187
|
+
# navigation
|
|
188
|
+
"affix",
|
|
189
|
+
"anchor",
|
|
190
|
+
"breadcrumb",
|
|
191
|
+
"dropdown",
|
|
192
|
+
"dropdown_button",
|
|
193
|
+
"menu",
|
|
194
|
+
"pagination",
|
|
195
|
+
"steps",
|
|
196
|
+
"tabs",
|
|
197
|
+
# data entry
|
|
198
|
+
"input",
|
|
199
|
+
"text_area",
|
|
200
|
+
"search_input",
|
|
201
|
+
"password_input",
|
|
202
|
+
"input_otp",
|
|
203
|
+
"input_number",
|
|
204
|
+
"checkbox",
|
|
205
|
+
"checkbox_group",
|
|
206
|
+
"radio",
|
|
207
|
+
"radio_group",
|
|
208
|
+
"radio_button",
|
|
209
|
+
"select",
|
|
210
|
+
"switch",
|
|
211
|
+
"slider",
|
|
212
|
+
"rate",
|
|
213
|
+
"date_picker",
|
|
214
|
+
"range_picker",
|
|
215
|
+
"time_picker",
|
|
216
|
+
"auto_complete",
|
|
217
|
+
"cascader",
|
|
218
|
+
"tree_select",
|
|
219
|
+
"mentions",
|
|
220
|
+
"color_picker",
|
|
221
|
+
"transfer",
|
|
222
|
+
"upload",
|
|
223
|
+
"upload_dragger",
|
|
224
|
+
"form",
|
|
225
|
+
"form_item",
|
|
226
|
+
"form_list",
|
|
227
|
+
# data display
|
|
228
|
+
"avatar",
|
|
229
|
+
"avatar_group",
|
|
230
|
+
"badge",
|
|
231
|
+
"badge_ribbon",
|
|
232
|
+
"calendar",
|
|
233
|
+
"card",
|
|
234
|
+
"card_meta",
|
|
235
|
+
"card_grid",
|
|
236
|
+
"carousel",
|
|
237
|
+
"collapse",
|
|
238
|
+
"descriptions",
|
|
239
|
+
"empty",
|
|
240
|
+
"image",
|
|
241
|
+
"list_view",
|
|
242
|
+
"list_item",
|
|
243
|
+
"list_item_meta",
|
|
244
|
+
"tooltip",
|
|
245
|
+
"popover",
|
|
246
|
+
"qr_code",
|
|
247
|
+
"segmented",
|
|
248
|
+
"statistic",
|
|
249
|
+
"statistic_countdown",
|
|
250
|
+
"table",
|
|
251
|
+
"tag",
|
|
252
|
+
"checkable_tag",
|
|
253
|
+
"timeline",
|
|
254
|
+
"tour",
|
|
255
|
+
"tree",
|
|
256
|
+
# feedback
|
|
257
|
+
"alert",
|
|
258
|
+
"drawer",
|
|
259
|
+
"modal",
|
|
260
|
+
"popconfirm",
|
|
261
|
+
"progress",
|
|
262
|
+
"result",
|
|
263
|
+
"skeleton",
|
|
264
|
+
"skeleton_button",
|
|
265
|
+
"skeleton_image",
|
|
266
|
+
"spin",
|
|
267
|
+
"watermark",
|
|
268
|
+
]
|