ruflet 0.0.1

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 (71) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +3 -0
  3. data/lib/ruflet/version.rb +5 -0
  4. data/lib/ruflet.rb +40 -0
  5. data/lib/ruflet_protocol/ruflet/protocol.rb +62 -0
  6. data/lib/ruflet_protocol.rb +4 -0
  7. data/lib/ruflet_ui/ruflet/app.rb +20 -0
  8. data/lib/ruflet_ui/ruflet/colors.rb +200 -0
  9. data/lib/ruflet_ui/ruflet/control.rb +154 -0
  10. data/lib/ruflet_ui/ruflet/dsl.rb +182 -0
  11. data/lib/ruflet_ui/ruflet/event.rb +28 -0
  12. data/lib/ruflet_ui/ruflet/icon_data.rb +57 -0
  13. data/lib/ruflet_ui/ruflet/icons/cupertino/cupertino_icons.rb +54 -0
  14. data/lib/ruflet_ui/ruflet/icons/cupertino_icon_lookup.rb +112 -0
  15. data/lib/ruflet_ui/ruflet/icons/material_icon_lookup.rb +112 -0
  16. data/lib/ruflet_ui/ruflet/icons/material_icons.rb +55 -0
  17. data/lib/ruflet_ui/ruflet/page.rb +550 -0
  18. data/lib/ruflet_ui/ruflet/ui/control_factory.rb +22 -0
  19. data/lib/ruflet_ui/ruflet/ui/control_methods.rb +16 -0
  20. data/lib/ruflet_ui/ruflet/ui/control_registry.rb +13 -0
  21. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_action_sheet_control.rb +13 -0
  22. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_alert_dialog_control.rb +13 -0
  23. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_button_control.rb +13 -0
  24. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_dialog_action_control.rb +13 -0
  25. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_filled_button_control.rb +13 -0
  26. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_navigation_bar_control.rb +13 -0
  27. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_slider_control.rb +13 -0
  28. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_switch_control.rb +13 -0
  29. data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_text_field_control.rb +13 -0
  30. data/lib/ruflet_ui/ruflet/ui/controls/material/alert_dialog_control.rb +13 -0
  31. data/lib/ruflet_ui/ruflet/ui/controls/material/app_bar_control.rb +13 -0
  32. data/lib/ruflet_ui/ruflet/ui/controls/material/bottom_sheet_control.rb +13 -0
  33. data/lib/ruflet_ui/ruflet/ui/controls/material/button_control.rb +24 -0
  34. data/lib/ruflet_ui/ruflet/ui/controls/material/checkbox_control.rb +13 -0
  35. data/lib/ruflet_ui/ruflet/ui/controls/material/column_control.rb +13 -0
  36. data/lib/ruflet_ui/ruflet/ui/controls/material/container_control.rb +13 -0
  37. data/lib/ruflet_ui/ruflet/ui/controls/material/drag_target_control.rb +13 -0
  38. data/lib/ruflet_ui/ruflet/ui/controls/material/draggable_control.rb +13 -0
  39. data/lib/ruflet_ui/ruflet/ui/controls/material/elevated_button_control.rb +13 -0
  40. data/lib/ruflet_ui/ruflet/ui/controls/material/filled_button_control.rb +13 -0
  41. data/lib/ruflet_ui/ruflet/ui/controls/material/floating_action_button_control.rb +28 -0
  42. data/lib/ruflet_ui/ruflet/ui/controls/material/gesture_detector_control.rb +13 -0
  43. data/lib/ruflet_ui/ruflet/ui/controls/material/icon_button_control.rb +13 -0
  44. data/lib/ruflet_ui/ruflet/ui/controls/material/icon_control.rb +24 -0
  45. data/lib/ruflet_ui/ruflet/ui/controls/material/image_control.rb +13 -0
  46. data/lib/ruflet_ui/ruflet/ui/controls/material/markdown_control.rb +13 -0
  47. data/lib/ruflet_ui/ruflet/ui/controls/material/navigation_bar_control.rb +13 -0
  48. data/lib/ruflet_ui/ruflet/ui/controls/material/navigation_bar_destination_control.rb +13 -0
  49. data/lib/ruflet_ui/ruflet/ui/controls/material/radio_control.rb +13 -0
  50. data/lib/ruflet_ui/ruflet/ui/controls/material/radio_group_control.rb +13 -0
  51. data/lib/ruflet_ui/ruflet/ui/controls/material/row_control.rb +13 -0
  52. data/lib/ruflet_ui/ruflet/ui/controls/material/snack_bar_control.rb +13 -0
  53. data/lib/ruflet_ui/ruflet/ui/controls/material/stack_control.rb +13 -0
  54. data/lib/ruflet_ui/ruflet/ui/controls/material/tab_bar_control.rb +13 -0
  55. data/lib/ruflet_ui/ruflet/ui/controls/material/tab_bar_view_control.rb +13 -0
  56. data/lib/ruflet_ui/ruflet/ui/controls/material/tab_control.rb +13 -0
  57. data/lib/ruflet_ui/ruflet/ui/controls/material/tabs_control.rb +63 -0
  58. data/lib/ruflet_ui/ruflet/ui/controls/material/text_button_control.rb +13 -0
  59. data/lib/ruflet_ui/ruflet/ui/controls/material/text_control.rb +13 -0
  60. data/lib/ruflet_ui/ruflet/ui/controls/material/text_field_control.rb +13 -0
  61. data/lib/ruflet_ui/ruflet/ui/controls/material/view_control.rb +13 -0
  62. data/lib/ruflet_ui/ruflet/ui/cupertino_control_factory.rb +40 -0
  63. data/lib/ruflet_ui/ruflet/ui/cupertino_control_methods.rb +26 -0
  64. data/lib/ruflet_ui/ruflet/ui/cupertino_control_registry.rb +35 -0
  65. data/lib/ruflet_ui/ruflet/ui/material_control_factory.rb +94 -0
  66. data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +116 -0
  67. data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +88 -0
  68. data/lib/ruflet_ui/ruflet/ui/shared_control_forwarders.rb +85 -0
  69. data/lib/ruflet_ui/ruflet/ui/widget_builder.rb +48 -0
  70. data/lib/ruflet_ui.rb +112 -0
  71. metadata +109 -0
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class CupertinoSwitchControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "cupertino_switch", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class CupertinoTextFieldControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "cupertino_text_field", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class AlertDialogControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "alertdialog", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class AppBarControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "appbar", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class BottomSheetControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "bottomsheet", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class ButtonControl < Ruflet::Control
7
+ def initialize(id: nil, type: "button", **props)
8
+ super(type: type, id: id, **props)
9
+ end
10
+
11
+ private
12
+
13
+ def preprocess_props(props)
14
+ mapped = props.dup
15
+ if mapped.key?(:text) || mapped.key?("text")
16
+ value = mapped.delete(:text) || mapped.delete("text")
17
+ mapped[:content] = value unless mapped.key?(:content) || mapped.key?("content")
18
+ end
19
+ mapped
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class CheckboxControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "checkbox", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class ColumnControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "column", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class ContainerControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "container", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class DragTargetControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "dragtarget", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class DraggableControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "draggable", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class ElevatedButtonControl < ButtonControl
7
+ def initialize(id: nil, **props)
8
+ super(type: "elevatedbutton", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class FilledButtonControl < ButtonControl
7
+ def initialize(id: nil, **props)
8
+ super(type: "filledbutton", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class FloatingActionButtonControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "floatingactionbutton", id: id, **props)
9
+ end
10
+
11
+ private
12
+
13
+ def preprocess_props(props)
14
+ normalized = props.dup
15
+
16
+ # Accept both correct and common-misspelled foreground color keys.
17
+ if !normalized.key?(:color) && !normalized.key?("color")
18
+ fg = normalized.delete(:foreground_color) || normalized.delete("foreground_color")
19
+ fg ||= normalized.delete(:forground_color) || normalized.delete("forground_color")
20
+ normalized[:color] = fg if fg
21
+ end
22
+
23
+ normalized
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class GestureDetectorControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "gesturedetector", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class IconButtonControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "iconbutton", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class IconControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "icon", id: id, **props)
9
+ end
10
+
11
+ private
12
+
13
+ def preprocess_props(props)
14
+ mapped = props.dup
15
+ if mapped.key?(:name) || mapped.key?("name")
16
+ value = mapped.delete(:name) || mapped.delete("name")
17
+ mapped[:icon] = value unless mapped.key?(:icon) || mapped.key?("icon")
18
+ end
19
+ mapped
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class ImageControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "image", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class MarkdownControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "markdown", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class NavigationBarControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "navigationbar", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class NavigationBarDestinationControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "navigationbardestination", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class RadioControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "radio", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class RadioGroupControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "radiogroup", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class RowControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "row", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class SnackBarControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "snackbar", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class StackControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "stack", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class TabBarControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "tabbar", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class TabBarViewControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "tabbarview", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class TabControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "tab", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "column_control"
4
+ require_relative "tab_control"
5
+ require_relative "tab_bar_control"
6
+ require_relative "tab_bar_view_control"
7
+
8
+ module Ruflet
9
+ module UI
10
+ module Controls
11
+ class TabsControl < Ruflet::Control
12
+ def initialize(id: nil, **props)
13
+ super(type: "tabs", id: id, **props)
14
+ end
15
+
16
+ private
17
+
18
+ # Normalize shorthand tabs payload into Flet's expected structure:
19
+ # Tabs(length, content: Column(TabBar, TabBarView))
20
+ def preprocess_props(props)
21
+ mapped = props.dup
22
+ tabs = mapped.delete(:tabs) || mapped.delete("tabs")
23
+ return mapped if tabs.nil?
24
+ return mapped unless tabs.is_a?(Array)
25
+ return mapped if mapped.key?(:content) || mapped.key?("content")
26
+
27
+ tab_controls = []
28
+ view_controls = []
29
+
30
+ tabs.each do |tab|
31
+ unless tab.is_a?(Ruflet::Control) && tab.type == "tab"
32
+ # Keep TabBar and TabBarView lengths aligned.
33
+ tab_controls << Ruflet::UI::Controls::TabControl.new(label: tab)
34
+ view_controls << Ruflet::UI::Controls::ColumnControl.new(controls: [])
35
+ next
36
+ end
37
+
38
+ label = tab.props["label"]
39
+ icon = tab.props["icon"]
40
+ header_tab = Ruflet::UI::Controls::TabControl.new(label: label, icon: icon)
41
+ tab_controls << header_tab
42
+
43
+ content = tab.props["content"]
44
+ view_controls << (content.is_a?(Ruflet::Control) ? content : Ruflet::UI::Controls::ColumnControl.new(controls: []))
45
+ end
46
+
47
+ tab_bar = Ruflet::UI::Controls::TabBarControl.new(tabs: tab_controls)
48
+ tab_bar_view_props = { controls: view_controls }
49
+ # Only opt into flexed TabBarView when developer explicitly sizes Tabs.
50
+ if mapped.key?(:expand) || mapped.key?("expand") || mapped.key?(:height) || mapped.key?("height")
51
+ tab_bar_view_props[:expand] = 1
52
+ end
53
+ tab_bar_view = Ruflet::UI::Controls::TabBarViewControl.new(**tab_bar_view_props)
54
+ content = Ruflet::UI::Controls::ColumnControl.new(expand: true, spacing: 0, controls: [tab_bar, tab_bar_view])
55
+
56
+ mapped[:length] = tab_controls.length unless mapped.key?(:length) || mapped.key?("length")
57
+ mapped[:content] = content
58
+ mapped
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class TextButtonControl < ButtonControl
7
+ def initialize(id: nil, **props)
8
+ super(type: "textbutton", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class TextControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "text", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class TextFieldControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "textfield", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ class ViewControl < Ruflet::Control
7
+ def initialize(id: nil, **props)
8
+ super(type: "view", id: id, **props)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "controls/cupertino/cupertino_button_control"
4
+ require_relative "controls/cupertino/cupertino_filled_button_control"
5
+ require_relative "controls/cupertino/cupertino_text_field_control"
6
+ require_relative "controls/cupertino/cupertino_switch_control"
7
+ require_relative "controls/cupertino/cupertino_slider_control"
8
+ require_relative "controls/cupertino/cupertino_alert_dialog_control"
9
+ require_relative "controls/cupertino/cupertino_action_sheet_control"
10
+ require_relative "controls/cupertino/cupertino_dialog_action_control"
11
+ require_relative "controls/cupertino/cupertino_navigation_bar_control"
12
+
13
+ module Ruflet
14
+ module UI
15
+ module CupertinoControlFactory
16
+ module_function
17
+
18
+ CLASS_MAP = {
19
+ "cupertino_button" => Controls::CupertinoButtonControl,
20
+ "cupertinobutton" => Controls::CupertinoButtonControl,
21
+ "cupertino_filled_button" => Controls::CupertinoFilledButtonControl,
22
+ "cupertinofilledbutton" => Controls::CupertinoFilledButtonControl,
23
+ "cupertino_text_field" => Controls::CupertinoTextFieldControl,
24
+ "cupertinotextfield" => Controls::CupertinoTextFieldControl,
25
+ "cupertino_switch" => Controls::CupertinoSwitchControl,
26
+ "cupertinoswitch" => Controls::CupertinoSwitchControl,
27
+ "cupertino_slider" => Controls::CupertinoSliderControl,
28
+ "cupertinoslider" => Controls::CupertinoSliderControl,
29
+ "cupertino_alert_dialog" => Controls::CupertinoAlertDialogControl,
30
+ "cupertinoalertdialog" => Controls::CupertinoAlertDialogControl,
31
+ "cupertino_action_sheet" => Controls::CupertinoActionSheetControl,
32
+ "cupertinoactionsheet" => Controls::CupertinoActionSheetControl,
33
+ "cupertino_dialog_action" => Controls::CupertinoDialogActionControl,
34
+ "cupertinodialogaction" => Controls::CupertinoDialogActionControl,
35
+ "cupertino_navigation_bar" => Controls::CupertinoNavigationBarControl,
36
+ "cupertinonavigationbar" => Controls::CupertinoNavigationBarControl
37
+ }.freeze
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module CupertinoControlMethods
6
+ def cupertino_button(**props) = build_widget(:cupertino_button, **props)
7
+ def cupertinobutton(**props) = cupertino_button(**props)
8
+ def cupertino_filled_button(**props) = build_widget(:cupertino_filled_button, **props)
9
+ def cupertinofilledbutton(**props) = cupertino_filled_button(**props)
10
+ def cupertino_text_field(**props) = build_widget(:cupertino_text_field, **props)
11
+ def cupertinotextfield(**props) = cupertino_text_field(**props)
12
+ def cupertino_switch(**props) = build_widget(:cupertino_switch, **props)
13
+ def cupertinoswitch(**props) = cupertino_switch(**props)
14
+ def cupertino_slider(**props) = build_widget(:cupertino_slider, **props)
15
+ def cupertinoslider(**props) = cupertino_slider(**props)
16
+ def cupertino_alert_dialog(**props) = build_widget(:cupertino_alert_dialog, **props)
17
+ def cupertinoalertdialog(**props) = cupertino_alert_dialog(**props)
18
+ def cupertino_action_sheet(**props) = build_widget(:cupertino_action_sheet, **props)
19
+ def cupertinoactionsheet(**props) = cupertino_action_sheet(**props)
20
+ def cupertino_dialog_action(**props) = build_widget(:cupertino_dialog_action, **props)
21
+ def cupertinodialogaction(**props) = cupertino_dialog_action(**props)
22
+ def cupertino_navigation_bar(**props) = build_widget(:cupertino_navigation_bar, **props)
23
+ def cupertinonavigationbar(**props) = cupertino_navigation_bar(**props)
24
+ end
25
+ end
26
+ end