appkit-ui 0.7.3__py3-none-any.whl → 0.7.4__py3-none-any.whl

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.
@@ -0,0 +1,519 @@
1
+ Metadata-Version: 2.4
2
+ Name: appkit-ui
3
+ Version: 0.7.4
4
+ Summary: Add your description here
5
+ Author: Jens Rehpöhler
6
+ Requires-Python: >=3.13
7
+ Requires-Dist: appkit-commons
8
+ Requires-Dist: reflex>=0.8.12
9
+ Description-Content-Type: text/markdown
10
+
11
+ # appkit-ui
12
+
13
+ [![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
14
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
15
+
16
+ **Shared UI components and layouts for AppKit applications.**
17
+
18
+ appkit-ui provides a collection of reusable UI components, layouts, and styling utilities designed to create consistent, professional interfaces across AppKit applications. It includes responsive page templates, navigation components, form helpers, and common UI patterns built on Reflex and Mantine.
19
+
20
+ ---
21
+
22
+ ## ✨ Features
23
+
24
+ - **Layout Components** - Responsive page templates and navigation headers
25
+ - **Form Helpers** - Pre-built form inputs with validation and styling
26
+ - **Dialog Components** - Confirmation dialogs and modal interfaces
27
+ - **Rich Text Editor** - Full-featured WYSIWYG editor based on SunEditor
28
+ - **Collapsible Sections** - Expandable/collapsible content areas
29
+ - **Global State Management** - Shared state for loading indicators and UI feedback
30
+ - **Styling Utilities** - Consistent themes, colors, and CSS utilities
31
+ - **Responsive Design** - Mobile-first components that work across all screen sizes
32
+
33
+ ---
34
+
35
+ ## 🚀 Installation
36
+
37
+ ### As Part of AppKit Workspace
38
+
39
+ If you're using the full AppKit workspace:
40
+
41
+ ```bash
42
+ git clone https://github.com/jenreh/appkit.git
43
+ cd appkit
44
+ uv sync
45
+ ```
46
+
47
+ ### Standalone Installation
48
+
49
+ Install from PyPI:
50
+
51
+ ```bash
52
+ pip install appkit-ui
53
+ ```
54
+
55
+ Or with uv:
56
+
57
+ ```bash
58
+ uv add appkit-ui
59
+ ```
60
+
61
+ ### Dependencies
62
+
63
+ - `appkit-commons` (shared utilities)
64
+ - `reflex>=0.8.12` (UI framework)
65
+
66
+ ---
67
+
68
+ ## 🏁 Quick Start
69
+
70
+ ### Basic Layout
71
+
72
+ Create a responsive page layout with header:
73
+
74
+ ```python
75
+ import reflex as rx
76
+ import appkit_ui as ui
77
+
78
+ def my_page():
79
+ return rx.vstack(
80
+ ui.header("My Application"),
81
+ rx.container(
82
+ rx.text("Welcome to my app!"),
83
+ max_width="800px",
84
+ padding="2em"
85
+ ),
86
+ spacing="0",
87
+ min_height="100vh"
88
+ )
89
+ ```
90
+
91
+ ### Using Form Components
92
+
93
+ Add styled form inputs:
94
+
95
+ ```python
96
+ from appkit_ui.components.form_inputs import inline_form_field
97
+
98
+ def contact_form():
99
+ return rx.form(
100
+ inline_form_field(
101
+ icon="user",
102
+ label="Name",
103
+ placeholder="Enter your name",
104
+ required=True
105
+ ),
106
+ inline_form_field(
107
+ icon="mail",
108
+ label="Email",
109
+ type="email",
110
+ placeholder="Enter your email"
111
+ ),
112
+ rx.button("Submit", type="submit")
113
+ )
114
+ ```
115
+
116
+ ### Rich Text Editor
117
+
118
+ Add a WYSIWYG editor to your page:
119
+
120
+ ```python
121
+ from appkit_ui.components import editor
122
+
123
+ def blog_editor():
124
+ return editor(
125
+ placeholder="Write your blog post...",
126
+ button_list=editor.EditorButtonList.COMPLEX,
127
+ height="400px"
128
+ )
129
+ ```
130
+
131
+ ---
132
+
133
+ ## 📖 Usage
134
+
135
+ ### Layout Components
136
+
137
+ #### Header
138
+
139
+ Create a fixed header with responsive design:
140
+
141
+ ```python
142
+ from appkit_ui.components.header import header
143
+
144
+ # Basic header
145
+ header("Application Title")
146
+
147
+ # Indented header (for sidebar layouts)
148
+ header("Dashboard", indent=True)
149
+ ```
150
+
151
+ #### Styles and Themes
152
+
153
+ Apply consistent styling:
154
+
155
+ ```python
156
+ import appkit_ui.styles as styles
157
+
158
+ def styled_page():
159
+ return rx.box(
160
+ rx.text("Content"),
161
+ **styles.splash_container # Gradient background
162
+ )
163
+ ```
164
+
165
+ ### Form Components
166
+
167
+ #### Inline Form Fields
168
+
169
+ Create labeled form inputs with icons:
170
+
171
+ ```python
172
+ from appkit_ui.components.form_inputs import inline_form_field
173
+
174
+ # Text input
175
+ inline_form_field(
176
+ icon="user",
177
+ label="Username",
178
+ placeholder="Enter username",
179
+ min_length=3,
180
+ max_length=50
181
+ )
182
+
183
+ # Email input
184
+ inline_form_field(
185
+ icon="mail",
186
+ label="Email",
187
+ type="email",
188
+ required=True
189
+ )
190
+
191
+ # Password input
192
+ inline_form_field(
193
+ icon="lock",
194
+ label="Password",
195
+ type="password",
196
+ hint="Must be at least 8 characters"
197
+ )
198
+ ```
199
+
200
+ #### Hidden Fields
201
+
202
+ Add hidden form data:
203
+
204
+ ```python
205
+ from appkit_ui.components.form_inputs import hidden_field
206
+
207
+ hidden_field(name="csrf_token", value="abc123")
208
+ ```
209
+
210
+ ### Dialog Components
211
+
212
+ #### Delete Confirmation Dialog
213
+
214
+ Create a confirmation dialog for destructive actions:
215
+
216
+ ```python
217
+ from appkit_ui.components.dialogs import delete_dialog
218
+
219
+ def user_management():
220
+ return rx.vstack(
221
+ delete_dialog(
222
+ title="Delete User",
223
+ content="user@example.com",
224
+ on_click=lambda: print("User deleted")
225
+ ),
226
+ # Other user management UI
227
+ )
228
+ ```
229
+
230
+ ### Editor Component
231
+
232
+ #### Rich Text Editor
233
+
234
+ Configure the editor with different button sets:
235
+
236
+ ```python
237
+ from appkit_ui.components import editor
238
+
239
+ # Basic editor
240
+ editor(placeholder="Enter text...")
241
+
242
+ # Full-featured editor
243
+ editor(
244
+ button_list=editor.EditorButtonList.COMPLEX,
245
+ height="500px",
246
+ placeholder="Write your content...",
247
+ on_change=lambda value: print(f"Content: {value}")
248
+ )
249
+ ```
250
+
251
+ #### Editor Options
252
+
253
+ Customize editor behavior:
254
+
255
+ ```python
256
+ from appkit_ui.components.editor import EditorOptions
257
+
258
+ custom_options = EditorOptions(
259
+ height="400px",
260
+ placeholder="Custom placeholder...",
261
+ button_list=[
262
+ ["bold", "italic"],
263
+ ["link", "image"],
264
+ ["undo", "redo"]
265
+ ]
266
+ )
267
+
268
+ editor(options=custom_options)
269
+ ```
270
+
271
+ ### Collapsible Components
272
+
273
+ #### Collapsible Sections
274
+
275
+ Create expandable content areas:
276
+
277
+ ```python
278
+ from appkit_ui.components import collabsible
279
+
280
+ def settings_page():
281
+ return rx.vstack(
282
+ collabsible(
283
+ rx.text("Account settings content..."),
284
+ title="Account Settings",
285
+ info_text="Configure your account",
286
+ expanded=True
287
+ ),
288
+ collabsible(
289
+ rx.text("Notification settings content..."),
290
+ title="Notifications",
291
+ info_text="Manage email preferences"
292
+ )
293
+ )
294
+ ```
295
+
296
+ ### Global State
297
+
298
+ #### Loading State
299
+
300
+ Manage loading indicators across your app:
301
+
302
+ ```python
303
+ from appkit_ui.global_states import LoadingState
304
+
305
+ class MyState(LoadingState):
306
+ def load_data(self):
307
+ self.set_is_loading(True)
308
+ # Simulate async operation
309
+ await asyncio.sleep(2)
310
+ self.set_is_loading(False)
311
+
312
+ def loading_component():
313
+ return rx.cond(
314
+ LoadingState.is_loading,
315
+ rx.text(LoadingState.is_loading_message),
316
+ rx.text("Content loaded")
317
+ )
318
+ ```
319
+
320
+ ---
321
+
322
+ ## 🔧 Configuration
323
+
324
+ ### Editor Configuration
325
+
326
+ Customize the rich text editor:
327
+
328
+ ```python
329
+ from appkit_ui.components.editor import EditorOptions
330
+
331
+ options = EditorOptions(
332
+ mode="classic", # or "inline", "balloon"
333
+ height="300px",
334
+ min_height="200px",
335
+ max_height="600px",
336
+ placeholder="Start writing...",
337
+ button_list=editor.EditorButtonList.FORMATTING,
338
+ font_size: ["8px", "10px", "12px", "14px", "16px", "18px", "20px"],
339
+ color_list: ["#ff0000", "#00ff00", "#0000ff"],
340
+ # Additional SunEditor options...
341
+ )
342
+ ```
343
+
344
+ ### Styling Customization
345
+
346
+ Override default styles:
347
+
348
+ ```python
349
+ import appkit_ui.styles as styles
350
+
351
+ # Custom dialog styles
352
+ custom_dialog_styles = {
353
+ **styles.dialog_styles,
354
+ "border_radius": "15px",
355
+ "box_shadow": "0 10px 25px rgba(0,0,0,0.1)"
356
+ }
357
+ ```
358
+
359
+ ---
360
+
361
+ ## 📋 API Reference
362
+
363
+ ### Component API
364
+
365
+ #### Layout API
366
+
367
+ - `header()` - Fixed page header with responsive design
368
+
369
+ #### Form API
370
+
371
+ - `inline_form_field()` - Labeled form input with icon and validation
372
+ - `hidden_field()` - Hidden form input field
373
+
374
+ #### Dialog API
375
+
376
+ - `delete_dialog()` - Confirmation dialog for delete operations
377
+
378
+ #### Editor API
379
+
380
+ - `editor()` - Rich text WYSIWYG editor
381
+ - `EditorButtonList` - Predefined button configurations (BASIC, FORMATTING, COMPLEX)
382
+ - `EditorOptions` - Editor configuration options
383
+
384
+ #### Utility API
385
+
386
+ - `collabsible()` - Expandable/collapsible content sections
387
+
388
+ #### State API
389
+
390
+ - `LoadingState` - Global loading state with message support
391
+
392
+ #### Style API
393
+
394
+ - `splash_container` - Gradient background styles
395
+ - `dialog_styles` - Dialog component styling
396
+ - `label_styles` - Form label styling
397
+
398
+ ---
399
+
400
+ ## 🔒 Security
401
+
402
+ > [!IMPORTANT]
403
+ > Form components include basic client-side validation, but always implement server-side validation for security.
404
+
405
+ - Input sanitization for editor content
406
+ - CSRF protection support through hidden fields
407
+ - Secure handling of form data
408
+
409
+ ---
410
+
411
+ ## 🤝 Integration Examples
412
+
413
+ ### With AppKit Components
414
+
415
+ Combine with other AppKit packages:
416
+
417
+ ```python
418
+ import reflex as rx
419
+ import appkit_ui as ui
420
+ import appkit_mantine as mn
421
+ import appkit_user as user
422
+
423
+ def dashboard():
424
+ return rx.vstack(
425
+ ui.header("Dashboard", indent=True),
426
+ rx.hstack(
427
+ # Sidebar navigation
428
+ mn.sidebar(),
429
+ # Main content
430
+ rx.container(
431
+ ui.collabsible(
432
+ mn.data_table(), # From appkit-mantine
433
+ title="User Data",
434
+ expanded=True
435
+ ),
436
+ max_width="1200px"
437
+ ),
438
+ flex_grow="1"
439
+ ),
440
+ min_height="100vh"
441
+ )
442
+ ```
443
+
444
+ ### Custom Form with Validation
445
+
446
+ Create forms with integrated validation:
447
+
448
+ ```python
449
+ from appkit_ui.components.form_inputs import inline_form_field
450
+
451
+ def registration_form():
452
+ return rx.form(
453
+ inline_form_field(
454
+ icon="user",
455
+ label="Username",
456
+ name="username",
457
+ min_length=3,
458
+ max_length=20,
459
+ pattern=r"^[a-zA-Z0-9_]+$",
460
+ required=True
461
+ ),
462
+ inline_form_field(
463
+ icon="mail",
464
+ label="Email",
465
+ name="email",
466
+ type="email",
467
+ required=True
468
+ ),
469
+ inline_form_field(
470
+ icon="lock",
471
+ label="Password",
472
+ name="password",
473
+ type="password",
474
+ min_length=8,
475
+ hint="At least 8 characters",
476
+ required=True
477
+ ),
478
+ rx.button("Register", type="submit")
479
+ )
480
+ ```
481
+
482
+ ### Editor Integration
483
+
484
+ Use the editor in content management:
485
+
486
+ ```python
487
+ from appkit_ui.components import editor
488
+
489
+ class BlogState(rx.State):
490
+ content: str = ""
491
+
492
+ def save_post(self):
493
+ # Save self.content to database
494
+ pass
495
+
496
+ def blog_editor_page():
497
+ return rx.vstack(
498
+ ui.header("New Blog Post"),
499
+ editor(
500
+ value=BlogState.content,
501
+ on_change=BlogState.set_content,
502
+ button_list=editor.EditorButtonList.COMPLEX,
503
+ height="600px",
504
+ placeholder="Write your blog post..."
505
+ ),
506
+ rx.button("Save", on_click=BlogState.save_post),
507
+ spacing="4",
508
+ padding="2em"
509
+ )
510
+ ```
511
+
512
+ ---
513
+
514
+ ## 📚 Related Components
515
+
516
+ - **[appkit-mantine](./../appkit-mantine)** - Mantine UI components used throughout appkit-ui
517
+ - **[appkit-user](./../appkit-user)** - User authentication components
518
+ - **[appkit-commons](./../appkit-commons)** - Shared utilities and configuration
519
+ - **[appkit-assistant](./../appkit-assistant)** - AI assistant with UI components
@@ -7,6 +7,6 @@ appkit_ui/components/dialogs.py,sha256=nc4-5PNUwzz-8ZB-Y3bUGkw6z6RlEfNto7icPHjyc
7
7
  appkit_ui/components/editor.py,sha256=Z9cew7hrLuBoXBYk7xW-OsbhIcdW4LFlBqi_8eYtCTY,7956
8
8
  appkit_ui/components/form_inputs.py,sha256=L3akQp92N7M-2Yi0lLSg7rbZTijneLg3FiPwWF1wcik,11546
9
9
  appkit_ui/components/header.py,sha256=JLAiDEVku99pRgAsQAMUIui7i70hS6H6Bbbe8FVj0DU,715
10
- appkit_ui-0.7.3.dist-info/METADATA,sha256=W26Au3CnrvR2C2Dh9Ho6gguqouIcgWPLa3RxOjOpTAg,196
11
- appkit_ui-0.7.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
- appkit_ui-0.7.3.dist-info/RECORD,,
10
+ appkit_ui-0.7.4.dist-info/METADATA,sha256=Gkmsau1qNKTNvDU0zg6plBWY7nWzmElYBmUaR--79qw,11144
11
+ appkit_ui-0.7.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
+ appkit_ui-0.7.4.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: appkit-ui
3
- Version: 0.7.3
4
- Summary: Add your description here
5
- Author: Jens Rehpöhler
6
- Requires-Python: >=3.13
7
- Requires-Dist: appkit-commons
8
- Requires-Dist: reflex>=0.8.12