cronixui 1.1.2 → 1.1.3

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.
Files changed (76) hide show
  1. package/README.md +1 -1
  2. package/package.json +71 -71
  3. package/packages/flutter/.qwen/settings.json +7 -0
  4. package/packages/flutter/pubspec.yaml +20 -20
  5. package/packages/go/cronixui/cronixui.go +926 -926
  6. package/packages/python/README.md +142 -0
  7. package/packages/python/cronixui/__init__.py +15 -6
  8. package/packages/python/cronixui/__pycache__/__init__.cpython-314.pyc +0 -0
  9. package/packages/python/cronixui/__pycache__/accordion.cpython-314.pyc +0 -0
  10. package/packages/python/cronixui/__pycache__/alert.cpython-314.pyc +0 -0
  11. package/packages/python/cronixui/__pycache__/avatar.cpython-314.pyc +0 -0
  12. package/packages/python/cronixui/__pycache__/badge.cpython-314.pyc +0 -0
  13. package/packages/python/cronixui/__pycache__/button.cpython-314.pyc +0 -0
  14. package/packages/python/cronixui/__pycache__/card.cpython-314.pyc +0 -0
  15. package/packages/python/cronixui/__pycache__/command_palette.cpython-314.pyc +0 -0
  16. package/packages/python/cronixui/__pycache__/core.cpython-314.pyc +0 -0
  17. package/packages/python/cronixui/__pycache__/dropdown.cpython-314.pyc +0 -0
  18. package/packages/python/cronixui/__pycache__/form.cpython-314.pyc +0 -0
  19. package/packages/python/cronixui/__pycache__/layout.cpython-314.pyc +0 -0
  20. package/packages/python/cronixui/__pycache__/list.cpython-314.pyc +0 -0
  21. package/packages/python/cronixui/__pycache__/loading.cpython-314.pyc +0 -0
  22. package/packages/python/cronixui/__pycache__/modal.cpython-314.pyc +0 -0
  23. package/packages/python/cronixui/__pycache__/nav.cpython-314.pyc +0 -0
  24. package/packages/python/cronixui/__pycache__/pagination.cpython-314.pyc +0 -0
  25. package/packages/python/cronixui/__pycache__/progress.cpython-314.pyc +0 -0
  26. package/packages/python/cronixui/__pycache__/search.cpython-314.pyc +0 -0
  27. package/packages/python/cronixui/__pycache__/table.cpython-314.pyc +0 -0
  28. package/packages/python/cronixui/__pycache__/tabs.cpython-314.pyc +0 -0
  29. package/packages/python/cronixui/__pycache__/toast.cpython-314.pyc +0 -0
  30. package/packages/python/cronixui/__pycache__/toggle.cpython-314.pyc +0 -0
  31. package/packages/python/cronixui/__pycache__/tokens.cpython-314.pyc +0 -0
  32. package/packages/python/cronixui/__pycache__/tooltip.cpython-314.pyc +0 -0
  33. package/packages/python/cronixui/alert.py +119 -36
  34. package/packages/python/cronixui/avatar.py +129 -22
  35. package/packages/python/cronixui/badge.py +161 -24
  36. package/packages/python/cronixui/button.py +96 -27
  37. package/packages/python/cronixui/card.py +206 -33
  38. package/packages/python/cronixui/core.py +212 -23
  39. package/packages/python/cronixui/form.py +552 -141
  40. package/packages/python/cronixui/layout.py +358 -96
  41. package/packages/python/cronixui/list.py +140 -37
  42. package/packages/python/cronixui/loading.py +107 -17
  43. package/packages/python/cronixui/progress.py +189 -47
  44. package/packages/python/cronixui/table.py +118 -31
  45. package/packages/python/cronixui/tooltip.py +117 -15
  46. package/packages/react/src/components/Accordion.tsx +82 -82
  47. package/packages/react/src/components/Button.tsx +47 -47
  48. package/packages/react/src/components/Card.tsx +69 -69
  49. package/packages/react/src/components/CommandPalette.tsx +131 -131
  50. package/packages/react/src/components/Dropdown.tsx +88 -88
  51. package/packages/react/src/components/FileInput.tsx +86 -86
  52. package/packages/react/src/components/FormGroup.tsx +36 -36
  53. package/packages/react/src/components/List.tsx +55 -55
  54. package/packages/react/src/components/Pagination.tsx +107 -107
  55. package/packages/react/src/components/Progress.tsx +49 -49
  56. package/packages/react/src/components/Search.tsx +95 -95
  57. package/packages/react/src/components/Sidebar.tsx +64 -64
  58. package/packages/react/src/components/Stack.tsx +69 -69
  59. package/packages/react/src/components/Table.tsx +90 -90
  60. package/packages/react/src/components/Toast.tsx +134 -134
  61. package/packages/react/src/components/Typography.tsx +66 -66
  62. package/packages/react/src/index.ts +40 -40
  63. package/packages/react/src/styles.css +2039 -2039
  64. package/packages/rust/cronixui/src/components/avatar.rs +85 -85
  65. package/packages/rust/cronixui/src/components/breadcrumb.rs +58 -58
  66. package/packages/rust/cronixui/src/components/card.rs +259 -259
  67. package/packages/rust/cronixui/src/components/command_palette.rs +254 -254
  68. package/packages/rust/cronixui/src/components/dropdown.rs +179 -179
  69. package/packages/rust/cronixui/src/components/file_input.rs +74 -74
  70. package/packages/rust/cronixui/src/components/mod.rs +51 -51
  71. package/packages/rust/cronixui/src/components/search.rs +185 -185
  72. package/packages/rust/cronixui/src/components/skeleton.rs +63 -63
  73. package/packages/rust/cronixui/src/components/table.rs +56 -56
  74. package/packages/rust/cronixui/src/lib.rs +128 -128
  75. package/packages/web/dist/cronixui.css +97 -93
  76. package/packages/web/dist/cronixui.min.css +1 -1
@@ -1,85 +1,85 @@
1
- //! Avatar component
2
-
3
- use egui::*;
4
- use crate::{colors::*, tokens::*};
5
-
6
- pub struct Avatar {
7
- pub initials: String,
8
- pub size: AvatarSize,
9
- }
10
-
11
- #[derive(Clone, Copy)]
12
- pub enum AvatarSize {
13
- SM,
14
- MD,
15
- LG,
16
- XL,
17
- }
18
-
19
- impl AvatarSize {
20
- pub fn diameter(&self) -> f32 {
21
- match self {
22
- AvatarSize::SM => 24.0,
23
- AvatarSize::MD => 32.0,
24
- AvatarSize::LG => 40.0,
25
- AvatarSize::XL => 56.0,
26
- }
27
- }
28
-
29
- pub fn font_size(&self) -> f32 {
30
- match self {
31
- AvatarSize::SM => 10.0,
32
- AvatarSize::MD => 12.0,
33
- AvatarSize::LG => 14.0,
34
- AvatarSize::XL => 18.0,
35
- }
36
- }
37
- }
38
-
39
- impl Avatar {
40
- pub fn new(initials: impl Into<String>) -> Self {
41
- Self {
42
- initials: initials.into(),
43
- size: AvatarSize::MD,
44
- }
45
- }
46
-
47
- pub fn size(mut self, size: AvatarSize) -> Self {
48
- self.size = size;
49
- self
50
- }
51
-
52
- pub fn show(&self, ui: &mut Ui) -> Response {
53
- let colors = Colors::default();
54
- let diameter = self.size.diameter();
55
- let font_size = self.size.font_size();
56
- let radius = diameter / 2.0;
57
-
58
- let (rect, response) = ui.allocate_exact_size(vec2(diameter, diameter), Sense::hover());
59
-
60
- // Draw background circle
61
- ui.painter().circle_filled(
62
- rect.center(),
63
- radius,
64
- colors.accent,
65
- );
66
-
67
- // Draw border
68
- ui.painter().circle_stroke(
69
- rect.center(),
70
- radius,
71
- Stroke::new(1.0, colors.border),
72
- );
73
-
74
- // Draw initials text
75
- ui.painter().text(
76
- rect.center(),
77
- Align2::CENTER_CENTER,
78
- &self.initials,
79
- FontId::new(font_size, FontFamily::Proportional),
80
- colors.accent_text,
81
- );
82
-
83
- response
84
- }
85
- }
1
+ //! Avatar component
2
+
3
+ use egui::*;
4
+ use crate::{colors::*, tokens::*};
5
+
6
+ pub struct Avatar {
7
+ pub initials: String,
8
+ pub size: AvatarSize,
9
+ }
10
+
11
+ #[derive(Clone, Copy)]
12
+ pub enum AvatarSize {
13
+ SM,
14
+ MD,
15
+ LG,
16
+ XL,
17
+ }
18
+
19
+ impl AvatarSize {
20
+ pub fn diameter(&self) -> f32 {
21
+ match self {
22
+ AvatarSize::SM => 24.0,
23
+ AvatarSize::MD => 32.0,
24
+ AvatarSize::LG => 40.0,
25
+ AvatarSize::XL => 56.0,
26
+ }
27
+ }
28
+
29
+ pub fn font_size(&self) -> f32 {
30
+ match self {
31
+ AvatarSize::SM => 10.0,
32
+ AvatarSize::MD => 12.0,
33
+ AvatarSize::LG => 14.0,
34
+ AvatarSize::XL => 18.0,
35
+ }
36
+ }
37
+ }
38
+
39
+ impl Avatar {
40
+ pub fn new(initials: impl Into<String>) -> Self {
41
+ Self {
42
+ initials: initials.into(),
43
+ size: AvatarSize::MD,
44
+ }
45
+ }
46
+
47
+ pub fn size(mut self, size: AvatarSize) -> Self {
48
+ self.size = size;
49
+ self
50
+ }
51
+
52
+ pub fn show(&self, ui: &mut Ui) -> Response {
53
+ let colors = Colors::default();
54
+ let diameter = self.size.diameter();
55
+ let font_size = self.size.font_size();
56
+ let radius = diameter / 2.0;
57
+
58
+ let (rect, response) = ui.allocate_exact_size(vec2(diameter, diameter), Sense::hover());
59
+
60
+ // Draw background circle
61
+ ui.painter().circle_filled(
62
+ rect.center(),
63
+ radius,
64
+ colors.accent,
65
+ );
66
+
67
+ // Draw border
68
+ ui.painter().circle_stroke(
69
+ rect.center(),
70
+ radius,
71
+ Stroke::new(1.0, colors.border),
72
+ );
73
+
74
+ // Draw initials text
75
+ ui.painter().text(
76
+ rect.center(),
77
+ Align2::CENTER_CENTER,
78
+ &self.initials,
79
+ FontId::new(font_size, FontFamily::Proportional),
80
+ colors.accent_text,
81
+ );
82
+
83
+ response
84
+ }
85
+ }
@@ -1,58 +1,58 @@
1
- //! Breadcrumb component
2
-
3
- use egui::*;
4
- use crate::{colors::*, tokens::*};
5
-
6
- pub struct Breadcrumb {
7
- pub items: Vec<String>,
8
- }
9
-
10
- impl Breadcrumb {
11
- pub fn new() -> Self {
12
- Self { items: Vec::new() }
13
- }
14
-
15
- pub fn item(mut self, item: impl Into<String>) -> Self {
16
- self.items.push(item.into());
17
- self
18
- }
19
-
20
- pub fn show(&self, ui: &mut Ui) -> Response {
21
- let colors = Colors::default();
22
-
23
- ui.horizontal(|ui| {
24
- for (i, item) in self.items.iter().enumerate() {
25
- if i > 0 {
26
- ui.label(
27
- RichText::new("/")
28
- .size(tokens::FONT_SIZE_SM)
29
- .color(colors.text_muted),
30
- );
31
- }
32
-
33
- let is_last = i == self.items.len() - 1;
34
- if is_last {
35
- ui.label(
36
- RichText::new(item)
37
- .size(tokens::FONT_SIZE_BASE)
38
- .color(colors.text)
39
- .strong(),
40
- );
41
- } else {
42
- ui.hyperlink_to(
43
- RichText::new(item)
44
- .size(tokens::FONT_SIZE_BASE)
45
- .color(colors.accent_text),
46
- format!("#{}", item.to_lowercase().replace(" ", "-")),
47
- );
48
- }
49
- }
50
- }).response
51
- }
52
- }
53
-
54
- impl Default for Breadcrumb {
55
- fn default() -> Self {
56
- Self::new()
57
- }
58
- }
1
+ //! Breadcrumb component
2
+
3
+ use egui::*;
4
+ use crate::{colors::*, tokens::*};
5
+
6
+ pub struct Breadcrumb {
7
+ pub items: Vec<String>,
8
+ }
9
+
10
+ impl Breadcrumb {
11
+ pub fn new() -> Self {
12
+ Self { items: Vec::new() }
13
+ }
14
+
15
+ pub fn item(mut self, item: impl Into<String>) -> Self {
16
+ self.items.push(item.into());
17
+ self
18
+ }
19
+
20
+ pub fn show(&self, ui: &mut Ui) -> Response {
21
+ let colors = Colors::default();
22
+
23
+ ui.horizontal(|ui| {
24
+ for (i, item) in self.items.iter().enumerate() {
25
+ if i > 0 {
26
+ ui.label(
27
+ RichText::new("/")
28
+ .size(tokens::FONT_SIZE_SM)
29
+ .color(colors.text_muted),
30
+ );
31
+ }
32
+
33
+ let is_last = i == self.items.len() - 1;
34
+ if is_last {
35
+ ui.label(
36
+ RichText::new(item)
37
+ .size(tokens::FONT_SIZE_BASE)
38
+ .color(colors.text)
39
+ .strong(),
40
+ );
41
+ } else {
42
+ ui.hyperlink_to(
43
+ RichText::new(item)
44
+ .size(tokens::FONT_SIZE_BASE)
45
+ .color(colors.accent_text),
46
+ format!("#{}", item.to_lowercase().replace(" ", "-")),
47
+ );
48
+ }
49
+ }
50
+ }).response
51
+ }
52
+ }
53
+
54
+ impl Default for Breadcrumb {
55
+ fn default() -> Self {
56
+ Self::new()
57
+ }
58
+ }