recurrence_ui 0.3.3 → 0.4.0
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 +4 -4
- data/README.md +6 -12
- data/app/assets/stylesheets/recurrence_ui/application.css +962 -12
- data/app/components/recurrence_ui/recurrence_picker_component.html.erb +85 -83
- data/app/javascript/recurrence_ui/recurrence_ui_controller.js +53 -42
- data/app/views/recurrence_ui/_daily.html.erb +3 -3
- data/app/views/recurrence_ui/_duration.html.erb +33 -36
- data/app/views/recurrence_ui/_end_at.html.erb +5 -4
- data/app/views/recurrence_ui/_exceptions.html.erb +22 -22
- data/app/views/recurrence_ui/_footer_actions.html.erb +1 -1
- data/app/views/recurrence_ui/_monthly_by_day_of_month.html.erb +5 -5
- data/app/views/recurrence_ui/_monthly_by_weekday.html.erb +12 -12
- data/app/views/recurrence_ui/_rdates.html.erb +22 -22
- data/app/views/recurrence_ui/_rule_card.html.erb +9 -9
- data/app/views/recurrence_ui/_single_rule.html.erb +13 -11
- data/app/views/recurrence_ui/_start_at.html.erb +17 -21
- data/app/views/recurrence_ui/_summary_link.html.erb +4 -4
- data/app/views/recurrence_ui/_termination.html.erb +13 -12
- data/app/views/recurrence_ui/_time_zone.html.erb +11 -9
- data/app/views/recurrence_ui/_weekly.html.erb +19 -24
- data/app/views/recurrence_ui/_yearly_by_day_of_month.html.erb +9 -10
- data/app/views/recurrence_ui/_yearly_by_weekday.html.erb +11 -12
- data/config/locales/recurrence_ui.ru.yml +2 -2
- data/config/routes.rb +0 -3
- data/lib/generators/recurrence_ui/install/install_generator.rb +29 -23
- data/lib/generators/recurrence_ui/install/templates/recurrence_ui.rb +40 -0
- data/lib/recurrence_ui/engine.rb +1 -0
- data/lib/recurrence_ui/version.rb +1 -1
- metadata +3 -4
- data/app/assets/stylesheets/recurrence_ui/components.css +0 -295
- data/app/assets/stylesheets/recurrence_ui/tokens.css +0 -102
|
@@ -3,7 +3,7 @@ module RecurrenceUi
|
|
|
3
3
|
class InstallGenerator < Rails::Generators::Base
|
|
4
4
|
source_root File.expand_path("templates", __dir__)
|
|
5
5
|
|
|
6
|
-
desc "Installs RecurrenceUi Stimulus controller registration
|
|
6
|
+
desc "Installs RecurrenceUi Stimulus controller registration, CSS styles, and initializer"
|
|
7
7
|
|
|
8
8
|
def register_controller
|
|
9
9
|
say "1. Installing RecurrenceUi Stimulus controller registration", :green
|
|
@@ -22,17 +22,9 @@ module RecurrenceUi
|
|
|
22
22
|
recurrence_import = 'import { registerRecurrenceUiController } from "recurrence_ui"'
|
|
23
23
|
recurrence_registration = "registerRecurrenceUiController(application)"
|
|
24
24
|
|
|
25
|
-
unless content.include?(application_import)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
unless content.include?(recurrence_import)
|
|
30
|
-
additions << recurrence_import
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
unless content.include?(recurrence_registration)
|
|
34
|
-
additions << recurrence_registration
|
|
35
|
-
end
|
|
25
|
+
additions << application_import unless content.include?(application_import)
|
|
26
|
+
additions << recurrence_import unless content.include?(recurrence_import)
|
|
27
|
+
additions << recurrence_registration unless content.include?(recurrence_registration)
|
|
36
28
|
|
|
37
29
|
if additions.empty?
|
|
38
30
|
say "RecurrenceUi controller is already registered", :blue
|
|
@@ -43,37 +35,51 @@ module RecurrenceUi
|
|
|
43
35
|
end
|
|
44
36
|
|
|
45
37
|
def register_styles
|
|
46
|
-
say "2. Installing RecurrenceUi
|
|
38
|
+
say "2. Installing RecurrenceUi CSS styles", :green
|
|
47
39
|
|
|
48
|
-
|
|
49
|
-
Rails.root.join("app/assets/
|
|
50
|
-
Rails.root.join("app/assets/stylesheets/application.
|
|
51
|
-
Rails.root.join("app/assets/stylesheets/application.
|
|
40
|
+
stylesheet_paths = [
|
|
41
|
+
Rails.root.join("app/assets/stylesheets/application.css"),
|
|
42
|
+
Rails.root.join("app/assets/stylesheets/application.scss"),
|
|
43
|
+
Rails.root.join("app/assets/stylesheets/application.sass")
|
|
52
44
|
]
|
|
53
45
|
|
|
54
|
-
target_css =
|
|
46
|
+
target_css = stylesheet_paths.find { |path| File.exist?(path) }
|
|
55
47
|
|
|
56
48
|
unless target_css
|
|
57
|
-
say '
|
|
49
|
+
say 'Stylesheet not found. Please import "recurrence_ui/application" in your main stylesheet manually.', :yellow
|
|
58
50
|
return
|
|
59
51
|
end
|
|
60
52
|
|
|
61
53
|
content = File.read(target_css)
|
|
62
|
-
import_line = '@import "recurrence_ui/application
|
|
54
|
+
import_line = '@import "recurrence_ui/application";'
|
|
63
55
|
|
|
64
|
-
if content.include?(
|
|
56
|
+
if content.include?("recurrence_ui/application")
|
|
65
57
|
say "RecurrenceUi styles are already imported in #{target_css.relative_path_from(Rails.root)}", :blue
|
|
66
58
|
return
|
|
67
59
|
end
|
|
68
60
|
|
|
69
|
-
if content.include?(
|
|
70
|
-
|
|
61
|
+
if content.include?("*= require_tree .") || content.include?("*= require_self")
|
|
62
|
+
# Для Sprockets-манифестов с директивами *=
|
|
63
|
+
inject_into_file target_css, "\n *= require recurrence_ui/application", after: "*= require_self"
|
|
71
64
|
else
|
|
72
65
|
prepend_to_file target_css, "#{import_line}\n"
|
|
73
66
|
end
|
|
74
67
|
|
|
75
68
|
say "Added RecurrenceUi styles import to #{target_css.relative_path_from(Rails.root)}", :green
|
|
76
69
|
end
|
|
70
|
+
|
|
71
|
+
def create_initializer
|
|
72
|
+
say "3. Adding RecurrenceUi initializer", :green
|
|
73
|
+
|
|
74
|
+
initializer_path = "config/initializers/recurrence_ui.rb"
|
|
75
|
+
if File.exist?(initializer_path)
|
|
76
|
+
say "RecurrenceUi initializer already exists", :blue
|
|
77
|
+
return
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
template "recurrence_ui.rb", initializer_path
|
|
81
|
+
say "Created RecurrenceUi initializer at #{initializer_path}", :green
|
|
82
|
+
end
|
|
77
83
|
end
|
|
78
84
|
end
|
|
79
85
|
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# config/initializers/recurrence_ui.rb
|
|
2
|
+
|
|
3
|
+
RecurrenceUi.configure do |config|
|
|
4
|
+
# General settings
|
|
5
|
+
config.locale = :en # Default locale for the RecurrenceUi component. Supported locales: :en, :uk, :ja, :ru, :be
|
|
6
|
+
config.time_zone = "Asia/Tokyo"
|
|
7
|
+
config.week_start = 0 # 0 = Sunday, 1 = Monday
|
|
8
|
+
|
|
9
|
+
# Default event settings
|
|
10
|
+
config.start_time = "06:00" # Default start time for events, string in "HH:MM" format
|
|
11
|
+
config.end_time = "16:00" # Default end time for events, string in "HH:MM" format
|
|
12
|
+
config.duration = 3600 # Default duration for events in seconds (1 hour = 3600 seconds)
|
|
13
|
+
|
|
14
|
+
# UI options
|
|
15
|
+
config.allow_multiple_rules = true
|
|
16
|
+
config.show_duration = true
|
|
17
|
+
config.show_start_date_time = true
|
|
18
|
+
config.show_time_zone = true
|
|
19
|
+
config.show_end_date_time = true
|
|
20
|
+
config.show_exceptions = true
|
|
21
|
+
config.show_rdates = true
|
|
22
|
+
config.show_termination = true
|
|
23
|
+
|
|
24
|
+
# Enabled recurrence rule types
|
|
25
|
+
config.enabled_rule_types = %w[
|
|
26
|
+
monthly_by_day_of_month
|
|
27
|
+
weekly
|
|
28
|
+
daily
|
|
29
|
+
monthly_by_day_of_week]
|
|
30
|
+
|
|
31
|
+
# Supported rule types for the recurrence UI
|
|
32
|
+
#config.supported_rule_types = %w[
|
|
33
|
+
# daily
|
|
34
|
+
# weekly
|
|
35
|
+
# monthly_by_day_of_month
|
|
36
|
+
# monthly_by_day_of_week
|
|
37
|
+
# yearly_by_day_of_month
|
|
38
|
+
# yearly_by_day_of_week
|
|
39
|
+
#]
|
|
40
|
+
end
|
data/lib/recurrence_ui/engine.rb
CHANGED
|
@@ -8,6 +8,7 @@ module RecurrenceUi
|
|
|
8
8
|
initializer "recurrence_ui.assets" do |app|
|
|
9
9
|
if app.config.respond_to?(:assets)
|
|
10
10
|
app.config.assets.paths << root.join("app/javascript")
|
|
11
|
+
app.config.assets.paths << root.join("app/assets/stylesheets")
|
|
11
12
|
app.config.assets.precompile += %w(recurrence_ui/application.css)
|
|
12
13
|
end
|
|
13
14
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: recurrence_ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Katerina German
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -133,8 +133,6 @@ files:
|
|
|
133
133
|
- Rakefile
|
|
134
134
|
- app/assets/config/recurrence_ui_manifest.js
|
|
135
135
|
- app/assets/stylesheets/recurrence_ui/application.css
|
|
136
|
-
- app/assets/stylesheets/recurrence_ui/components.css
|
|
137
|
-
- app/assets/stylesheets/recurrence_ui/tokens.css
|
|
138
136
|
- app/components/recurrence_ui/recurrence_picker_component.html.erb
|
|
139
137
|
- app/components/recurrence_ui/recurrence_picker_component.rb
|
|
140
138
|
- app/controllers/recurrence_ui/application_controller.rb
|
|
@@ -174,6 +172,7 @@ files:
|
|
|
174
172
|
- config/locales/recurrence_ui.uk.yml
|
|
175
173
|
- config/routes.rb
|
|
176
174
|
- lib/generators/recurrence_ui/install/install_generator.rb
|
|
175
|
+
- lib/generators/recurrence_ui/install/templates/recurrence_ui.rb
|
|
177
176
|
- lib/generators/recurrence_ui/views_generator.rb
|
|
178
177
|
- lib/recurrence_ui.rb
|
|
179
178
|
- lib/recurrence_ui/configuration.rb
|
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
.recurrence-ui-hidden{
|
|
2
|
-
display: none !important;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
@layer components {
|
|
6
|
-
/* Main Container */
|
|
7
|
-
.rui-container {
|
|
8
|
-
background-color: var(--rui-bg-main);
|
|
9
|
-
color: var(--rui-text-main);
|
|
10
|
-
@apply space-y-3 w-full rounded-lg p-4 transition-colors;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/* Universal Input & Select Field Styles */
|
|
14
|
-
.rui-input,
|
|
15
|
-
.rui-select,
|
|
16
|
-
.rui-textarea {
|
|
17
|
-
background-color: var(--rui-input-bg);
|
|
18
|
-
color: var(--rui-text-main);
|
|
19
|
-
border-color: var(--rui-border-color);
|
|
20
|
-
@apply text-sm rounded-md border
|
|
21
|
-
shadow-sm focus:border-blue-500 focus:ring-1 focus:ring-blue-500
|
|
22
|
-
disabled:opacity-50 px-2.5 py-1.5 transition-colors;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.rui-input:disabled,
|
|
26
|
-
.rui-select:disabled,
|
|
27
|
-
.rui-textarea:disabled {
|
|
28
|
-
background-color: var(--rui-input-disabled-bg);
|
|
29
|
-
color: var(--rui-text-muted) !important;
|
|
30
|
-
opacity: 0.6;
|
|
31
|
-
}
|
|
32
|
-
/* Подписи возле полей ввода (день, час, мин) */
|
|
33
|
-
.rui-duration-unit {
|
|
34
|
-
color: var(--rui-text-muted);
|
|
35
|
-
@apply text-sm;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.rui-input-sm {
|
|
39
|
-
@apply text-xs px-2 py-1 rounded;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/* Labels and Captions */
|
|
43
|
-
.rui-label {
|
|
44
|
-
color: var(--rui-text-main);
|
|
45
|
-
@apply block font-semibold tracking-wider mb-1;
|
|
46
|
-
}
|
|
47
|
-
.rui-inline-label {
|
|
48
|
-
color: var(--rui-text-main);
|
|
49
|
-
@apply text-sm font-medium;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/* Primary Buttons */
|
|
53
|
-
.rui-btn-primary {
|
|
54
|
-
background-color: var(--rui-primary-bg);
|
|
55
|
-
color: var(--rui-primary-text);
|
|
56
|
-
@apply px-3 py-1.5 text-xs font-medium rounded-md shadow-sm transition-colors;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.rui-btn-primary:hover:not(:disabled) {
|
|
60
|
-
background-color: var(--rui-primary-hover);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* Condition, when date is not yet entered */
|
|
64
|
-
.rui-btn-primary:disabled {
|
|
65
|
-
background-color: var(--rui-secondary-bg);
|
|
66
|
-
color: var(--rui-text-muted);
|
|
67
|
-
border: 1px solid var(--rui-border-color);
|
|
68
|
-
cursor: not-allowed;
|
|
69
|
-
opacity: 0.6;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.rui-btn-primary:active:not(:disabled) {
|
|
74
|
-
background-color: var(--rui-primary-active);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/* Secondary Buttons */
|
|
78
|
-
.rui-btn-secondary {
|
|
79
|
-
background-color: var(--rui-secondary-bg);
|
|
80
|
-
color: var(--rui-secondary-text);
|
|
81
|
-
border-color: var(--rui-secondary-border);
|
|
82
|
-
@apply px-3 py-1.5 text-xs font-medium border rounded-lg transition-colors;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.rui-btn-secondary:hover {
|
|
86
|
-
background-color: var(--rui-secondary-hover);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/* Icon Buttons */
|
|
90
|
-
.rui-btn-icon {
|
|
91
|
-
color: var(--rui-text-muted);
|
|
92
|
-
@apply p-1 rounded transition-colors;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.rui-btn-icon:hover {
|
|
96
|
-
color: var(--rui-text-main);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/* Toggle Day Button Grid Item */
|
|
100
|
-
.rui-day-btn {
|
|
101
|
-
background-color: var(--rui-bg-main);
|
|
102
|
-
color: var(--rui-secondary-text);
|
|
103
|
-
border-color: var(--rui-border-color);
|
|
104
|
-
@apply w-full py-1.5 rounded-md text-xs font-medium border transition-all;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.rui-day-btn:hover {
|
|
108
|
-
background-color: var(--rui-hover-bg-soft);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.rui-day-btn[data-selected='true'] {
|
|
112
|
-
background-color: var(--rui-primary-bg);
|
|
113
|
-
color: var(--rui-primary-text);
|
|
114
|
-
border-color: var(--rui-primary-bg);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* Section Dividers */
|
|
118
|
-
.rui-divider {
|
|
119
|
-
border-color: var(--rui-border-color);
|
|
120
|
-
@apply border-t my-2;
|
|
121
|
-
}
|
|
122
|
-
/* Large header for the editor */
|
|
123
|
-
.rui-header-title {
|
|
124
|
-
color: var(--rui-text-main);
|
|
125
|
-
@apply text-base font-semibold tracking-tight;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/* Panel header for editing */
|
|
129
|
-
.rui-panel-header {
|
|
130
|
-
border-bottom: 1px solid var(--rui-border-color);
|
|
131
|
-
@apply flex items-center justify-between pb-2 mb-3;
|
|
132
|
-
}
|
|
133
|
-
/* Header for the editing panel (title on the left, button on the right) */
|
|
134
|
-
.rui-panel-header {
|
|
135
|
-
border-bottom: 1px solid var(--rui-border-color);
|
|
136
|
-
@apply flex items-center justify-between pb-2 mb-3;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/* Интерактивная ссылка-действие (например, "+ Добавить правило") */
|
|
140
|
-
.rui-link-action {
|
|
141
|
-
color: var(--rui-primary-bg);
|
|
142
|
-
cursor: pointer;
|
|
143
|
-
text-decoration-line: underline;
|
|
144
|
-
text-decoration-style: dashed;
|
|
145
|
-
text-underline-offset: 4px;
|
|
146
|
-
@apply inline-flex items-center text-xs font-medium gap-1 transition-colors select-none;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.rui-link-action:hover {
|
|
150
|
-
color: var(--rui-primary-hover);
|
|
151
|
-
text-decoration-style: solid;
|
|
152
|
-
}
|
|
153
|
-
.rui-accordion-link {
|
|
154
|
-
color: var(--rui-primary-bg);
|
|
155
|
-
cursor: pointer;
|
|
156
|
-
text-decoration-line: underline;
|
|
157
|
-
text-decoration-style: dashed;
|
|
158
|
-
text-underline-offset: 4px;
|
|
159
|
-
@apply text-sm font-medium transition-colors select-none;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.rui-accordion-link:hover {
|
|
163
|
-
color: var(--rui-primary-hover);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/* Rule Card Body Container */
|
|
167
|
-
.rui-card-body {
|
|
168
|
-
border-left: 2px solid var(--rui-primary-bg);
|
|
169
|
-
background-color: var(--rui-secondary-bg);
|
|
170
|
-
@apply mt-1 pt-2 pb-2 pl-3 space-y-2 rounded-r-md transition-colors;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/* Danger / Remove Action Button */
|
|
174
|
-
.rui-btn-remove {
|
|
175
|
-
color: var(--rui-text-muted);
|
|
176
|
-
@apply font-normal text-xs px-1 rounded transition-colors;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.rui-btn-remove:hover {
|
|
180
|
-
color: #dc2626; /* red-600 */
|
|
181
|
-
background-color: var(--rui-hover-bg-soft);
|
|
182
|
-
}
|
|
183
|
-
.rui-chip {
|
|
184
|
-
display: inline-flex;
|
|
185
|
-
align-items: center;
|
|
186
|
-
gap: 0.25rem;
|
|
187
|
-
padding: 0.125rem 0.5rem;
|
|
188
|
-
border-radius: 0.375rem;
|
|
189
|
-
font-size: 0.75rem;
|
|
190
|
-
line-height: 1rem;
|
|
191
|
-
font-weight: 400;
|
|
192
|
-
border: 1px solid var(--rui-chip-rdate-border, #a7f3d0);
|
|
193
|
-
background-color: var(--rui-chip-rdate-bg, #ecfdf5);
|
|
194
|
-
color: var(--rui-chip-rdate-text, #047857);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.rui-chip__remove-btn {
|
|
198
|
-
padding-right: 0.125rem;
|
|
199
|
-
transition: opacity 150ms ease-in-out;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.rui-chip__remove-btn:hover {
|
|
203
|
-
opacity: 0.75;
|
|
204
|
-
}
|
|
205
|
-
.rui-chip--exdate {
|
|
206
|
-
border: 1px solid var(--rui-chip-exdate-border, #fecaca);
|
|
207
|
-
background-color: var(--rui-chip-exdate-bg, #fef2f2);
|
|
208
|
-
color: var(--rui-chip-exdate-text, #b91c1c);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/* Interactive Summary Link & Rule Card Header Link */
|
|
212
|
-
.rui-summary-link {
|
|
213
|
-
@apply text-sm font-medium text-blue-600 dark:text-blue-400
|
|
214
|
-
hover:text-blue-800 dark:hover:text-blue-300
|
|
215
|
-
underline underline-offset-4 decoration-dashed
|
|
216
|
-
decoration-blue-400 hover:decoration-blue-600
|
|
217
|
-
dark:decoration-blue-500 dark:hover:decoration-blue-300
|
|
218
|
-
transition-colors cursor-pointer;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/* Edit Icon wrapper */
|
|
222
|
-
.rui-summary-icon {
|
|
223
|
-
@apply opacity-0 group-hover:opacity-100 transition-opacity duration-200 text-[var(--app-text-muted)] dark:text-gray-500;
|
|
224
|
-
}
|
|
225
|
-
/* Rule Accordion Card Container */
|
|
226
|
-
.rui-card-container {
|
|
227
|
-
border: 1px solid var(--rui-border-color);
|
|
228
|
-
background-color: var(--rui-secondary-bg);
|
|
229
|
-
@apply rounded-md w-full my-1 transition-colors overflow-hidden;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/* Rule Header (Main Clickable Area & Border Header) */
|
|
233
|
-
.rui-card-header {
|
|
234
|
-
background-color: var(--rui-secondary-bg);
|
|
235
|
-
color: var(--rui-text-main);
|
|
236
|
-
@apply flex items-start justify-between w-full p-2.5 text-xs font-medium
|
|
237
|
-
cursor-pointer select-none transition-colors;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.rui-card-header:hover {
|
|
241
|
-
background-color: var(--rui-hover-bg-soft);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/* Full Rule Summary Text (Text wraps naturally without truncating) */
|
|
245
|
-
.rui-accordion-link {
|
|
246
|
-
color: var(--rui-primary-bg);
|
|
247
|
-
@apply text-xs font-medium cursor-pointer leading-relaxed transition-colors select-none whitespace-normal;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.rui-accordion-link:hover {
|
|
251
|
-
color: var(--rui-primary-hover);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/* Expanded Rule Card Body (Inside the same outer container) */
|
|
255
|
-
.rui-card-body {
|
|
256
|
-
background-color: var(--rui-bg-main);
|
|
257
|
-
border-top: 1px solid var(--rui-border-color);
|
|
258
|
-
@apply p-3 space-y-3 transition-colors;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/* Delete Rule Action Button (Positioned on the Right Top) */
|
|
262
|
-
.rui-btn-remove-card {
|
|
263
|
-
color: var(--rui-text-muted);
|
|
264
|
-
@apply text-xs px-1.5 py-0.5 rounded font-normal transition-colors ml-2 cursor-pointer;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
.rui-btn-remove-card:hover {
|
|
268
|
-
color: #dc2626; /* red-600 */
|
|
269
|
-
background-color: var(--rui-hover-bg-soft);
|
|
270
|
-
}
|
|
271
|
-
/* Базовый класс мета-информации */
|
|
272
|
-
.rui-meta-info {
|
|
273
|
-
display: block;
|
|
274
|
-
margin-top: 0.25rem;
|
|
275
|
-
font-size: 0.875rem;
|
|
276
|
-
font-style: italic;
|
|
277
|
-
transition: color 0.2s ease;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/* 1. Главная строка правил */
|
|
281
|
-
.rui-meta-info--main {
|
|
282
|
-
color: var(--rui-rule-main-text);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/* 2. Блок исключений (Exdates) */
|
|
286
|
-
.rui-meta-info--exceptions {
|
|
287
|
-
color: var(--rui-rule-exception-text); /* Исключения (например, красноватый) */
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/* 3. Блок дополнительных дат (Rdates) */
|
|
291
|
-
.rui-meta-info--rdates {
|
|
292
|
-
color: var(--rui-rule-rdate-text); /* Доп. даты (например, изумрудный) */
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/* 1. Значения по умолчанию (Светлая тема) */
|
|
2
|
-
:root {
|
|
3
|
-
--rui-bg-main: #ffffff;
|
|
4
|
-
--rui-text-main: #111827; /* gray-900 */
|
|
5
|
-
--rui-text-muted: #6b7280; /* gray-500 */
|
|
6
|
-
--rui-border-color: #d1d5db; /* gray-300 */
|
|
7
|
-
|
|
8
|
-
--rui-input-bg: #ffffff;
|
|
9
|
-
--rui-input-disabled-bg: #f3f4f6;
|
|
10
|
-
|
|
11
|
-
/* Primary (Акцентный цвет: кнопки, выбранные дни) */
|
|
12
|
-
--rui-primary-bg: #2563eb; /* blue-600 */
|
|
13
|
-
--rui-primary-hover: #1d4ed8; /* blue-700 */
|
|
14
|
-
--rui-primary-active: #1e40af; /* blue-800 */
|
|
15
|
-
--rui-primary-text: #ffffff;
|
|
16
|
-
|
|
17
|
-
/* Secondary (Второстепенные кнопки) */
|
|
18
|
-
--rui-secondary-bg: #f3f4f6; /* gray-100 */
|
|
19
|
-
--rui-secondary-hover: #e5e7eb; /* gray-200 */
|
|
20
|
-
--rui-secondary-text: #374151; /* gray-700 */
|
|
21
|
-
--rui-secondary-border: #d1d5db;
|
|
22
|
-
|
|
23
|
-
/* Hover эффекты */
|
|
24
|
-
--rui-hover-bg-soft: #eff6ff; /* blue-50 */
|
|
25
|
-
|
|
26
|
-
--rui-rule-main-text: #1e293b;
|
|
27
|
-
--rui-rule-exception-text: #b91c1c; /* red-700 */
|
|
28
|
-
--rui-rule-rdate-text: #047857; /* emerald-700 */
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/* 2. Автоматический тёмный режим (системный / Firefox DevTools) */
|
|
32
|
-
@media (prefers-color-scheme: dark) {
|
|
33
|
-
:root:not([data-rui-theme="light"]) {
|
|
34
|
-
--rui-bg-main: #1f2937; /* ИСПРАВЛЕНО: gray-800 (было #eff6ff) */
|
|
35
|
-
--rui-text-main: #f9fafb; /* gray-100 */
|
|
36
|
-
--rui-text-muted: #9ca3af; /* gray-400 */
|
|
37
|
-
--rui-border-color: #374151; /* gray-700 */
|
|
38
|
-
|
|
39
|
-
--rui-input-bg: #1f2937;
|
|
40
|
-
--rui-input-disabled-bg: #111827;
|
|
41
|
-
|
|
42
|
-
--rui-primary-bg: #3b82f6; /* blue-500 */
|
|
43
|
-
--rui-primary-hover: #2563eb;
|
|
44
|
-
|
|
45
|
-
--rui-secondary-bg: #1f2937;
|
|
46
|
-
--rui-secondary-hover: #374151;
|
|
47
|
-
--rui-secondary-text: #e5e7eb;
|
|
48
|
-
--rui-secondary-border: #4b5563;
|
|
49
|
-
|
|
50
|
-
--rui-hover-bg-soft: #374151; /* gray-700 */
|
|
51
|
-
--rui-rule-main-text: #f8fafc; /* slate-50 */
|
|
52
|
-
--rui-rule-exception-text: #fca5a5; /* red-300 (мягче для глаза на темном) */
|
|
53
|
-
--rui-rule-rdate-text: #6ee7b7; /* emerald-300 */
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/* 3. Ручной тёмный режим (по классу .dark на <html> или атрибуту data-rui-theme="dark") */
|
|
58
|
-
.dark:not([data-rui-theme="light"]),
|
|
59
|
-
[data-rui-theme="dark"] {
|
|
60
|
-
--rui-bg-main: #1f2937;
|
|
61
|
-
--rui-text-main: #f9fafb;
|
|
62
|
-
--rui-text-muted: #9ca3af;
|
|
63
|
-
--rui-border-color: #374151;
|
|
64
|
-
|
|
65
|
-
--rui-input-bg: #1f2937;
|
|
66
|
-
--rui-input-disabled-bg: #111827;
|
|
67
|
-
|
|
68
|
-
--rui-primary-bg: #3b82f6;
|
|
69
|
-
--rui-primary-hover: #2563eb;
|
|
70
|
-
|
|
71
|
-
--rui-secondary-bg: #1f2937;
|
|
72
|
-
--rui-secondary-hover: #374151;
|
|
73
|
-
--rui-secondary-text: #e5e7eb;
|
|
74
|
-
--rui-secondary-border: #4b5563;
|
|
75
|
-
|
|
76
|
-
--rui-hover-bg-soft: #374151;
|
|
77
|
-
--rui-rule-main-text: #f8fafc; /* slate-50 */
|
|
78
|
-
--rui-rule-exception-text: #fca5a5; /* red-300 (мягче для глаза на темном) */
|
|
79
|
-
--rui-rule-rdate-text: #6ee7b7; /* emerald-300 */
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/* 4. Принудительный режим "Только светлая тема" (высший приоритет) */
|
|
83
|
-
[data-rui-theme="light"] {
|
|
84
|
-
--rui-bg-main: #ffffff;
|
|
85
|
-
--rui-text-main: #111827;
|
|
86
|
-
--rui-text-muted: #6b7280;
|
|
87
|
-
--rui-border-color: #d1d5db;
|
|
88
|
-
--rui-input-bg: #ffffff;
|
|
89
|
-
--rui-input-disabled-bg: #f3f4f6;
|
|
90
|
-
--rui-primary-bg: #2563eb;
|
|
91
|
-
--rui-primary-hover: #1d4ed8;
|
|
92
|
-
--rui-primary-active: #1e40af;
|
|
93
|
-
--rui-primary-text: #ffffff;
|
|
94
|
-
--rui-secondary-bg: #f3f4f6;
|
|
95
|
-
--rui-secondary-hover: #e5e7eb;
|
|
96
|
-
--rui-secondary-text: #374151;
|
|
97
|
-
--rui-secondary-border: #d1d5db;
|
|
98
|
-
--rui-hover-bg-soft: #eff6ff;
|
|
99
|
-
--rui-rule-main-text: #1e293b;
|
|
100
|
-
--rui-rule-exception-text: #b91c1c;
|
|
101
|
-
--rui-rule-rdate-text: #047857;
|
|
102
|
-
}
|