orbital_ui 0.3.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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +224 -0
- data/app/assets/config/orbital_ui_manifest.js +2 -0
- data/app/assets/javascripts/orbital_ui/index.js +6 -0
- data/app/assets/javascripts/orbital_ui/index.js.map +1 -0
- data/app/assets/stylesheets/orbital_ui/index.css +3 -0
- data/app/assets/stylesheets/orbital_ui/index.css.map +1 -0
- data/app/assets/stylesheets/orbital_ui/theme.css +113 -0
- data/app/assets/stylesheets/orbital_ui/themes/blue.css +43 -0
- data/app/assets/stylesheets/orbital_ui/themes/green.css +43 -0
- data/app/assets/stylesheets/orbital_ui/themes/orange.css +43 -0
- data/app/assets/stylesheets/orbital_ui/themes/rose.css +43 -0
- data/app/assets/stylesheets/orbital_ui/themes/violet.css +43 -0
- data/app/components/orbital_ui/accordion/item.rb +32 -0
- data/app/components/orbital_ui/accordion.rb +23 -0
- data/app/components/orbital_ui/alert.rb +80 -0
- data/app/components/orbital_ui/avatar.rb +87 -0
- data/app/components/orbital_ui/badge.rb +28 -0
- data/app/components/orbital_ui/button.rb +46 -0
- data/app/components/orbital_ui/button_group.rb +20 -0
- data/app/components/orbital_ui/card/action.rb +17 -0
- data/app/components/orbital_ui/card/content.rb +17 -0
- data/app/components/orbital_ui/card/description.rb +17 -0
- data/app/components/orbital_ui/card/footer.rb +17 -0
- data/app/components/orbital_ui/card/header.rb +25 -0
- data/app/components/orbital_ui/card/title.rb +17 -0
- data/app/components/orbital_ui/card.rb +30 -0
- data/app/components/orbital_ui/check_box.rb +59 -0
- data/app/components/orbital_ui/component.rb +12 -0
- data/app/components/orbital_ui/concerns/icon_prop.rb +14 -0
- data/app/components/orbital_ui/confirmation_dialog.rb +142 -0
- data/app/components/orbital_ui/delete_dialog.rb +143 -0
- data/app/components/orbital_ui/dialog.rb +46 -0
- data/app/components/orbital_ui/dialog_frame.rb +17 -0
- data/app/components/orbital_ui/dropdown.rb +58 -0
- data/app/components/orbital_ui/expander.rb +20 -0
- data/app/components/orbital_ui/grid.rb +22 -0
- data/app/components/orbital_ui/heading.rb +65 -0
- data/app/components/orbital_ui/icon.rb +21 -0
- data/app/components/orbital_ui/image.rb +26 -0
- data/app/components/orbital_ui/inline_stack.rb +31 -0
- data/app/components/orbital_ui/kbd.rb +15 -0
- data/app/components/orbital_ui/kbd_group.rb +15 -0
- data/app/components/orbital_ui/menu/item.rb +74 -0
- data/app/components/orbital_ui/menu/label.rb +20 -0
- data/app/components/orbital_ui/menu/separator.rb +21 -0
- data/app/components/orbital_ui/menu/sub.rb +68 -0
- data/app/components/orbital_ui/menu.rb +36 -0
- data/app/components/orbital_ui/modal.rb +36 -0
- data/app/components/orbital_ui/modal_frame.rb +17 -0
- data/app/components/orbital_ui/navigation_menu.rb +51 -0
- data/app/components/orbital_ui/popcard.rb +18 -0
- data/app/components/orbital_ui/popover.rb +50 -0
- data/app/components/orbital_ui/progress_bar.rb +33 -0
- data/app/components/orbital_ui/prose.rb +15 -0
- data/app/components/orbital_ui/select.rb +140 -0
- data/app/components/orbital_ui/separator.rb +22 -0
- data/app/components/orbital_ui/spinner.rb +14 -0
- data/app/components/orbital_ui/stack.rb +29 -0
- data/app/components/orbital_ui/text.rb +41 -0
- data/app/components/orbital_ui/text_field.rb +132 -0
- data/app/components/orbital_ui/tooltip.rb +42 -0
- data/app/components/orbital_ui/typography.rb +38 -0
- data/lib/orbital_ui/attribute_utils.rb +152 -0
- data/lib/orbital_ui/components/attributes.rb +164 -0
- data/lib/orbital_ui/components/styles.rb +40 -0
- data/lib/orbital_ui/engine.rb +7 -0
- data/lib/orbital_ui/icons.rb +17312 -0
- data/lib/orbital_ui/type/any.rb +17 -0
- data/lib/orbital_ui/type/array.rb +27 -0
- data/lib/orbital_ui/type/breakpoints.rb +46 -0
- data/lib/orbital_ui/type/symbol.rb +17 -0
- data/lib/orbital_ui/version.rb +5 -0
- data/lib/orbital_ui.rb +49 -0
- metadata +162 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OrbitalUi
|
|
4
|
+
module Type
|
|
5
|
+
class Array < ActiveModel::Type::Value
|
|
6
|
+
def type
|
|
7
|
+
:array
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def serialize(value)
|
|
11
|
+
value.to_json
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def cast_value(value)
|
|
17
|
+
if value.is_a?(::Array)
|
|
18
|
+
value
|
|
19
|
+
elsif value.is_a?(::String)
|
|
20
|
+
JSON.parse(value)
|
|
21
|
+
else
|
|
22
|
+
[]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OrbitalUi
|
|
4
|
+
module Type
|
|
5
|
+
class Breakpoints < ActiveModel::Type::Value
|
|
6
|
+
def type
|
|
7
|
+
:breakpoints
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
BREAKPOINTS = %w[xs sm md lg xl].freeze
|
|
11
|
+
BREAKPOINTS_REGEX = /((xs|sm|md|lg|xl)\s*:\s*[0-9]+,?)+/
|
|
12
|
+
|
|
13
|
+
def serialize(value)
|
|
14
|
+
value.map do |breakpoint, val|
|
|
15
|
+
"#{breakpoint}:#{val}"
|
|
16
|
+
end.join(',')
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def cast_value(value)
|
|
22
|
+
if value.is_a?(::Hash)
|
|
23
|
+
value.select { |k, _v| BREAKPOINTS.include?(k.to_s) }
|
|
24
|
+
elsif value.is_a?(::String) && value.match?(BREAKPOINTS_REGEX)
|
|
25
|
+
cast_from_string(value)
|
|
26
|
+
elsif value.is_a?(::Integer) || (value.is_a?(::String) && value.match?(/\A[0-9]+\z/))
|
|
27
|
+
{ xs: value }
|
|
28
|
+
else
|
|
29
|
+
{}
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def cast_from_string(value)
|
|
34
|
+
result = {}
|
|
35
|
+
return result unless value.is_a?(::String) && value.present?
|
|
36
|
+
|
|
37
|
+
value.split(',').each do |pair|
|
|
38
|
+
breakpoint, val = pair.split(':').map(&:strip)
|
|
39
|
+
result[breakpoint.to_sym] = val if BREAKPOINTS.include?(breakpoint)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
result
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
data/lib/orbital_ui.rb
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "view_component"
|
|
4
|
+
require "orb_template"
|
|
5
|
+
require_relative "orbital_ui/version"
|
|
6
|
+
require_relative "orbital_ui/engine"
|
|
7
|
+
require_relative "orbital_ui/icons"
|
|
8
|
+
require_relative "orbital_ui/attribute_utils"
|
|
9
|
+
require_relative "orbital_ui/components/attributes"
|
|
10
|
+
require_relative "orbital_ui/components/styles"
|
|
11
|
+
require_relative "orbital_ui/type/any"
|
|
12
|
+
require_relative "orbital_ui/type/array"
|
|
13
|
+
require_relative "orbital_ui/type/breakpoints"
|
|
14
|
+
require_relative "orbital_ui/type/symbol"
|
|
15
|
+
|
|
16
|
+
module OrbitalUi
|
|
17
|
+
class Error < StandardError; end
|
|
18
|
+
|
|
19
|
+
class << self
|
|
20
|
+
attr_accessor :configuration
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.configure
|
|
24
|
+
self.configuration ||= Configuration.new
|
|
25
|
+
yield(configuration)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class Configuration
|
|
29
|
+
attr_accessor :dialog_portal_id
|
|
30
|
+
|
|
31
|
+
def initialize
|
|
32
|
+
@dialog_portal_id = "dialogs"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Backward compatibility for modal_portal_id (deprecated)
|
|
36
|
+
def modal_portal_id
|
|
37
|
+
warn "[DEPRECATION] `modal_portal_id` is deprecated. Please use `dialog_portal_id` instead."
|
|
38
|
+
@dialog_portal_id
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def modal_portal_id=(value)
|
|
42
|
+
warn "[DEPRECATION] `modal_portal_id=` is deprecated. Please use `dialog_portal_id=` instead."
|
|
43
|
+
@dialog_portal_id = value
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Default configuration
|
|
48
|
+
self.configuration = Configuration.new
|
|
49
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: orbital_ui
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.3.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- KUY.io Inc.
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: orb_template
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: 0.3.0
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: 0.3.0
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: rails
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '7.1'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '7.1'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: view_component
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '4.0'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '4.0'
|
|
54
|
+
description: Orbital is a themable set of ViewComponents built with the ORB template
|
|
55
|
+
language and Tailwind CSS, with bundled styles, Stimulus controllers and icons.
|
|
56
|
+
email:
|
|
57
|
+
- dev@kuy.io
|
|
58
|
+
executables: []
|
|
59
|
+
extensions: []
|
|
60
|
+
extra_rdoc_files: []
|
|
61
|
+
files:
|
|
62
|
+
- LICENSE
|
|
63
|
+
- README.md
|
|
64
|
+
- app/assets/config/orbital_ui_manifest.js
|
|
65
|
+
- app/assets/javascripts/orbital_ui/index.js
|
|
66
|
+
- app/assets/javascripts/orbital_ui/index.js.map
|
|
67
|
+
- app/assets/stylesheets/orbital_ui/index.css
|
|
68
|
+
- app/assets/stylesheets/orbital_ui/index.css.map
|
|
69
|
+
- app/assets/stylesheets/orbital_ui/theme.css
|
|
70
|
+
- app/assets/stylesheets/orbital_ui/themes/blue.css
|
|
71
|
+
- app/assets/stylesheets/orbital_ui/themes/green.css
|
|
72
|
+
- app/assets/stylesheets/orbital_ui/themes/orange.css
|
|
73
|
+
- app/assets/stylesheets/orbital_ui/themes/rose.css
|
|
74
|
+
- app/assets/stylesheets/orbital_ui/themes/violet.css
|
|
75
|
+
- app/components/orbital_ui/accordion.rb
|
|
76
|
+
- app/components/orbital_ui/accordion/item.rb
|
|
77
|
+
- app/components/orbital_ui/alert.rb
|
|
78
|
+
- app/components/orbital_ui/avatar.rb
|
|
79
|
+
- app/components/orbital_ui/badge.rb
|
|
80
|
+
- app/components/orbital_ui/button.rb
|
|
81
|
+
- app/components/orbital_ui/button_group.rb
|
|
82
|
+
- app/components/orbital_ui/card.rb
|
|
83
|
+
- app/components/orbital_ui/card/action.rb
|
|
84
|
+
- app/components/orbital_ui/card/content.rb
|
|
85
|
+
- app/components/orbital_ui/card/description.rb
|
|
86
|
+
- app/components/orbital_ui/card/footer.rb
|
|
87
|
+
- app/components/orbital_ui/card/header.rb
|
|
88
|
+
- app/components/orbital_ui/card/title.rb
|
|
89
|
+
- app/components/orbital_ui/check_box.rb
|
|
90
|
+
- app/components/orbital_ui/component.rb
|
|
91
|
+
- app/components/orbital_ui/concerns/icon_prop.rb
|
|
92
|
+
- app/components/orbital_ui/confirmation_dialog.rb
|
|
93
|
+
- app/components/orbital_ui/delete_dialog.rb
|
|
94
|
+
- app/components/orbital_ui/dialog.rb
|
|
95
|
+
- app/components/orbital_ui/dialog_frame.rb
|
|
96
|
+
- app/components/orbital_ui/dropdown.rb
|
|
97
|
+
- app/components/orbital_ui/expander.rb
|
|
98
|
+
- app/components/orbital_ui/grid.rb
|
|
99
|
+
- app/components/orbital_ui/heading.rb
|
|
100
|
+
- app/components/orbital_ui/icon.rb
|
|
101
|
+
- app/components/orbital_ui/image.rb
|
|
102
|
+
- app/components/orbital_ui/inline_stack.rb
|
|
103
|
+
- app/components/orbital_ui/kbd.rb
|
|
104
|
+
- app/components/orbital_ui/kbd_group.rb
|
|
105
|
+
- app/components/orbital_ui/menu.rb
|
|
106
|
+
- app/components/orbital_ui/menu/item.rb
|
|
107
|
+
- app/components/orbital_ui/menu/label.rb
|
|
108
|
+
- app/components/orbital_ui/menu/separator.rb
|
|
109
|
+
- app/components/orbital_ui/menu/sub.rb
|
|
110
|
+
- app/components/orbital_ui/modal.rb
|
|
111
|
+
- app/components/orbital_ui/modal_frame.rb
|
|
112
|
+
- app/components/orbital_ui/navigation_menu.rb
|
|
113
|
+
- app/components/orbital_ui/popcard.rb
|
|
114
|
+
- app/components/orbital_ui/popover.rb
|
|
115
|
+
- app/components/orbital_ui/progress_bar.rb
|
|
116
|
+
- app/components/orbital_ui/prose.rb
|
|
117
|
+
- app/components/orbital_ui/select.rb
|
|
118
|
+
- app/components/orbital_ui/separator.rb
|
|
119
|
+
- app/components/orbital_ui/spinner.rb
|
|
120
|
+
- app/components/orbital_ui/stack.rb
|
|
121
|
+
- app/components/orbital_ui/text.rb
|
|
122
|
+
- app/components/orbital_ui/text_field.rb
|
|
123
|
+
- app/components/orbital_ui/tooltip.rb
|
|
124
|
+
- app/components/orbital_ui/typography.rb
|
|
125
|
+
- lib/orbital_ui.rb
|
|
126
|
+
- lib/orbital_ui/attribute_utils.rb
|
|
127
|
+
- lib/orbital_ui/components/attributes.rb
|
|
128
|
+
- lib/orbital_ui/components/styles.rb
|
|
129
|
+
- lib/orbital_ui/engine.rb
|
|
130
|
+
- lib/orbital_ui/icons.rb
|
|
131
|
+
- lib/orbital_ui/type/any.rb
|
|
132
|
+
- lib/orbital_ui/type/array.rb
|
|
133
|
+
- lib/orbital_ui/type/breakpoints.rb
|
|
134
|
+
- lib/orbital_ui/type/symbol.rb
|
|
135
|
+
- lib/orbital_ui/version.rb
|
|
136
|
+
homepage: https://github.com/kuyio/orbital_ui
|
|
137
|
+
licenses:
|
|
138
|
+
- MIT
|
|
139
|
+
metadata:
|
|
140
|
+
allowed_push_host: https://rubygems.org
|
|
141
|
+
homepage_uri: https://github.com/kuyio/orbital_ui
|
|
142
|
+
source_code_uri: https://github.com/kuyio/orbital_ui/tree/main
|
|
143
|
+
changelog_uri: https://github.com/kuyio/orbital_ui/blob/main/CHANGELOG.md
|
|
144
|
+
rubygems_mfa_required: 'true'
|
|
145
|
+
rdoc_options: []
|
|
146
|
+
require_paths:
|
|
147
|
+
- lib
|
|
148
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
149
|
+
requirements:
|
|
150
|
+
- - ">="
|
|
151
|
+
- !ruby/object:Gem::Version
|
|
152
|
+
version: '3.4'
|
|
153
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
|
+
requirements:
|
|
155
|
+
- - ">="
|
|
156
|
+
- !ruby/object:Gem::Version
|
|
157
|
+
version: '0'
|
|
158
|
+
requirements: []
|
|
159
|
+
rubygems_version: 4.0.23
|
|
160
|
+
specification_version: 4
|
|
161
|
+
summary: A design system and component library for Ruby on Rails.
|
|
162
|
+
test_files: []
|