activeadmin 4.0.0.beta2 → 4.0.0.beta22

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 (151) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -2
  3. data/CONTRIBUTING.md +13 -13
  4. data/README.md +4 -4
  5. data/UPGRADING.md +274 -0
  6. data/app/controllers/active_admin/base_controller/authorization.rb +1 -1
  7. data/app/controllers/active_admin/base_controller/menu.rb +2 -2
  8. data/app/controllers/active_admin/resource_controller/data_access.rb +9 -4
  9. data/app/controllers/active_admin/resource_controller/decorators.rb +1 -1
  10. data/app/controllers/active_admin/resource_controller/streaming.rb +3 -3
  11. data/app/controllers/active_admin/resource_controller.rb +1 -1
  12. data/app/helpers/active_admin/display_helper.rb +3 -3
  13. data/app/helpers/active_admin/form_helper.rb +1 -1
  14. data/app/helpers/active_admin/layout_helper.rb +2 -2
  15. data/app/javascript/active_admin/features/batch_actions.js +10 -4
  16. data/app/javascript/active_admin/features/main_menu.js +3 -2
  17. data/app/views/active_admin/_flash_messages.html.erb +4 -4
  18. data/app/views/active_admin/_main_navigation.html.erb +28 -11
  19. data/app/views/active_admin/_page_header.html.erb +2 -2
  20. data/app/views/active_admin/_site_footer.html.erb +1 -1
  21. data/app/views/active_admin/_site_header.html.erb +7 -7
  22. data/app/views/active_admin/devise/confirmations/new.html.erb +1 -1
  23. data/app/views/active_admin/devise/passwords/edit.html.erb +1 -1
  24. data/app/views/active_admin/devise/passwords/new.html.erb +1 -1
  25. data/app/views/active_admin/devise/registrations/new.html.erb +1 -1
  26. data/app/views/active_admin/devise/sessions/new.html.erb +1 -1
  27. data/app/views/active_admin/devise/unlocks/new.html.erb +1 -1
  28. data/app/views/active_admin/kaminari/_gap.html.erb +1 -1
  29. data/app/views/active_admin/kaminari/_next_page.html.erb +1 -1
  30. data/app/views/active_admin/kaminari/_prev_page.html.erb +1 -1
  31. data/app/views/active_admin/page/index.html.arb +1 -2
  32. data/app/views/active_admin/resource/_form.html.arb +0 -1
  33. data/app/views/active_admin/resource/_form_default.html.arb +0 -1
  34. data/app/views/active_admin/resource/_index_as_table_default.html.arb +0 -1
  35. data/app/views/active_admin/resource/_show_default.html.arb +0 -1
  36. data/app/views/active_admin/resource/edit.html.arb +0 -1
  37. data/app/views/active_admin/resource/index.html.arb +1 -2
  38. data/app/views/active_admin/resource/new.html.arb +0 -1
  39. data/app/views/active_admin/resource/show.html.arb +0 -1
  40. data/app/views/active_admin/shared/_resource_comments.html.erb +7 -7
  41. data/app/views/active_admin/shared/_sidebar_section.html.arb +0 -1
  42. data/app/views/layouts/active_admin.html.erb +1 -1
  43. data/config/importmap.rb +5 -0
  44. data/config/locales/ar.yml +136 -100
  45. data/config/locales/az.yml +103 -102
  46. data/config/locales/bg.yml +91 -90
  47. data/config/locales/bs.yml +95 -94
  48. data/config/locales/ca.yml +131 -77
  49. data/config/locales/cs.yml +82 -81
  50. data/config/locales/da.yml +102 -101
  51. data/config/locales/de.yml +130 -125
  52. data/config/locales/el.yml +94 -93
  53. data/config/locales/en-CA.yml +104 -103
  54. data/config/locales/en-GB.yml +104 -103
  55. data/config/locales/en.yml +134 -130
  56. data/config/locales/eo.yml +107 -106
  57. data/config/locales/es-MX.yml +70 -69
  58. data/config/locales/es.yml +129 -122
  59. data/config/locales/fa.yml +91 -90
  60. data/config/locales/fi.yml +84 -83
  61. data/config/locales/fr.yml +135 -126
  62. data/config/locales/he.yml +103 -102
  63. data/config/locales/hr.yml +95 -94
  64. data/config/locales/hu.yml +76 -75
  65. data/config/locales/id.yml +97 -96
  66. data/config/locales/it.yml +134 -124
  67. data/config/locales/ja.yml +109 -104
  68. data/config/locales/ko.yml +136 -92
  69. data/config/locales/lt.yml +106 -105
  70. data/config/locales/lv.yml +70 -69
  71. data/config/locales/mk.yml +100 -99
  72. data/config/locales/nb.yml +98 -97
  73. data/config/locales/nl.yml +113 -114
  74. data/config/locales/pl.yml +137 -130
  75. data/config/locales/pt-BR.yml +134 -105
  76. data/config/locales/pt-PT.yml +71 -70
  77. data/config/locales/ro.yml +74 -73
  78. data/config/locales/ru.yml +142 -106
  79. data/config/locales/sk.yml +131 -130
  80. data/config/locales/sv-SE.yml +126 -125
  81. data/config/locales/tr.yml +105 -104
  82. data/config/locales/uk.yml +140 -103
  83. data/config/locales/vi.yml +125 -124
  84. data/config/locales/zh-CN.yml +135 -125
  85. data/config/locales/zh-TW.yml +136 -100
  86. data/lib/active_admin/application.rb +5 -5
  87. data/lib/active_admin/application_settings.rb +1 -1
  88. data/lib/active_admin/async_count.rb +21 -0
  89. data/lib/active_admin/batch_actions/resource_extension.rb +2 -2
  90. data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -1
  91. data/lib/active_admin/batch_actions/views/selection_cells.rb +1 -1
  92. data/lib/active_admin/batch_actions.rb +4 -4
  93. data/lib/active_admin/collection_decorator.rb +1 -1
  94. data/lib/active_admin/csv_builder.rb +1 -1
  95. data/lib/active_admin/dependency.rb +1 -1
  96. data/lib/active_admin/dsl.rb +2 -2
  97. data/lib/active_admin/dynamic_settings_node.rb +2 -2
  98. data/lib/active_admin/engine.rb +5 -2
  99. data/lib/active_admin/filters/active.rb +2 -2
  100. data/lib/active_admin/filters/active_filter.rb +1 -7
  101. data/lib/active_admin/filters/forms.rb +0 -3
  102. data/lib/active_admin/filters/resource_extension.rb +2 -2
  103. data/lib/active_admin/filters.rb +5 -5
  104. data/lib/active_admin/form_builder.rb +4 -9
  105. data/lib/active_admin/helpers/optional_display.rb +1 -1
  106. data/lib/active_admin/inputs/filters/base/search_method_select.rb +2 -2
  107. data/lib/active_admin/inputs/filters/select_input.rb +1 -3
  108. data/lib/active_admin/localizers.rb +1 -1
  109. data/lib/active_admin/menu.rb +2 -2
  110. data/lib/active_admin/menu_item.rb +1 -1
  111. data/lib/active_admin/namespace.rb +1 -1
  112. data/lib/active_admin/namespace_settings.rb +1 -1
  113. data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +1 -1
  114. data/lib/active_admin/orm/active_record/comments/views.rb +2 -2
  115. data/lib/active_admin/orm/active_record/comments.rb +7 -7
  116. data/lib/active_admin/orm/active_record.rb +1 -1
  117. data/lib/active_admin/pundit_adapter.rb +4 -4
  118. data/lib/active_admin/resource/action_items.rb +3 -3
  119. data/lib/active_admin/resource/attributes.rb +8 -1
  120. data/lib/active_admin/resource/belongs_to.rb +0 -1
  121. data/lib/active_admin/resource/naming.rb +1 -1
  122. data/lib/active_admin/resource/page_presenters.rb +2 -2
  123. data/lib/active_admin/resource/sidebars.rb +1 -1
  124. data/lib/active_admin/resource.rb +21 -19
  125. data/lib/active_admin/resource_collection.rb +1 -1
  126. data/lib/active_admin/resource_dsl.rb +2 -2
  127. data/lib/active_admin/router.rb +5 -5
  128. data/lib/active_admin/scope.rb +10 -0
  129. data/lib/active_admin/version.rb +1 -1
  130. data/lib/active_admin/view_helpers/method_or_proc_helper.rb +1 -1
  131. data/lib/active_admin/views/components/active_admin_form.rb +2 -2
  132. data/lib/active_admin/views/components/attributes_table.rb +10 -4
  133. data/lib/active_admin/views/components/paginated_collection.rb +4 -1
  134. data/lib/active_admin/views/components/panel.rb +1 -1
  135. data/lib/active_admin/views/components/scopes.rb +26 -4
  136. data/lib/active_admin/views/components/table_for.rb +7 -2
  137. data/lib/active_admin/views/index_as_table.rb +22 -6
  138. data/lib/active_admin.rb +11 -6
  139. data/lib/activeadmin.rb +1 -1
  140. data/lib/generators/active_admin/assets/templates/active_admin.css +3 -3
  141. data/lib/generators/active_admin/assets/templates/tailwind.config.js +9 -5
  142. data/lib/generators/active_admin/devise/devise_generator.rb +2 -2
  143. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +1 -1
  144. data/lib/generators/active_admin/resource/resource_generator.rb +6 -2
  145. data/lib/generators/active_admin/resource/templates/resource.rb.erb +2 -2
  146. data/plugin.js +424 -0
  147. data/vendor/javascript/flowbite.js +1 -2
  148. data/vendor/javascript/rails_ujs_esm.js +1 -0
  149. metadata +35 -20
  150. data/config/locales/de-CH.yml +0 -84
  151. data/lib/active_admin/views/components/tabs.rb +0 -40
@@ -16,8 +16,12 @@ module ActiveAdmin
16
16
  @attributes ||= class_name.constantize.new.attributes.keys
17
17
  end
18
18
 
19
+ def primary_key
20
+ @primary_key ||= [class_name.constantize.primary_key].flatten
21
+ end
22
+
19
23
  def assignable_attributes
20
- @assignable_attributes ||= attributes - %w(id created_at updated_at)
24
+ @assignable_attributes ||= attributes - primary_key - %w(created_at updated_at)
21
25
  end
22
26
 
23
27
  def permit_params
@@ -33,7 +37,7 @@ module ActiveAdmin
33
37
  end
34
38
 
35
39
  def columns
36
- attributes.map { |a| column(a) }.join("\n ")
40
+ (attributes - primary_key).map { |a| column(a) }.join("\n ")
37
41
  end
38
42
 
39
43
  def column(name)
@@ -16,7 +16,7 @@ ActiveAdmin.register <%= class_name %> do
16
16
  # Add or remove filters to toggle their visibility
17
17
  <%= filters %>
18
18
 
19
- # Add or remove columns to toggle their visiblity in the index action
19
+ # Add or remove columns to toggle their visibility in the index action
20
20
  index do
21
21
  selectable_column
22
22
  id_column
@@ -24,7 +24,7 @@ ActiveAdmin.register <%= class_name %> do
24
24
  actions
25
25
  end
26
26
 
27
- # Add or remove rows to toggle their visiblity in the show action
27
+ # Add or remove rows to toggle their visibility in the show action
28
28
  show do
29
29
  attributes_table_for(resource) do
30
30
  <%= rows %>
data/plugin.js ADDED
@@ -0,0 +1,424 @@
1
+ import plugin from 'tailwindcss/plugin';
2
+ import defaultTheme from 'tailwindcss/defaultTheme';
3
+ import colors from 'tailwindcss/colors';
4
+ const { spacing, borderWidth, borderRadius } = defaultTheme;
5
+
6
+ // https://github.com/tailwindlabs/tailwindcss/discussions/9336
7
+ // https://github.com/tailwindlabs/tailwindcss/discussions/2049
8
+ // https://github.com/tailwindlabs/tailwindcss/discussions/2049#discussioncomment-45546
9
+
10
+ const svgToTinyDataUri = (() => {
11
+ // Source: https://github.com/tigt/mini-svg-data-uri
12
+ const reWhitespace = /\s+/g,
13
+ reUrlHexPairs = /%[\dA-F]{2}/g,
14
+ hexDecode = { '%20': ' ', '%3D': '=', '%3A': ':', '%2F': '/' },
15
+ specialHexDecode = match => hexDecode[match] || match.toLowerCase(),
16
+ svgToTinyDataUri = svg => {
17
+ svg = String(svg);
18
+ if (svg.charCodeAt(0) === 0xfeff) svg = svg.slice(1);
19
+ svg = svg
20
+ .trim()
21
+ .replace(reWhitespace, ' ')
22
+ .replaceAll('"', '\'');
23
+ svg = encodeURIComponent(svg);
24
+ svg = svg.replace(reUrlHexPairs, specialHexDecode);
25
+ return 'data:image/svg+xml,' + svg;
26
+ };
27
+ svgToTinyDataUri.toSrcset = svg => svgToTinyDataUri(svg).replace(/ /g, '%20');
28
+ return svgToTinyDataUri;
29
+ })();
30
+
31
+ export default plugin(
32
+ function({ addBase, addComponents, theme }) {
33
+ addBase({
34
+ [[
35
+ "[type='text']",
36
+ "[type='email']",
37
+ "[type='url']",
38
+ "[type='password']",
39
+ "[type='number']",
40
+ "[type='date']",
41
+ "[type='datetime-local']",
42
+ "[type='month']",
43
+ "[type='search']",
44
+ "[type='tel']",
45
+ "[type='time']",
46
+ "[type='week']",
47
+ 'textarea',
48
+ 'select',
49
+ ]]: {
50
+ '@apply dark:scheme-dark': {},
51
+ 'appearance': 'none',
52
+ 'padding': `${spacing[2]} ${spacing[3]}`,
53
+ '--tw-shadow': '0 0 #0000',
54
+ '&:focus': {
55
+ outline: '2px solid transparent',
56
+ 'outline-offset': '2px',
57
+ '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
58
+ '--tw-ring-offset-width': '0px',
59
+ '--tw-ring-offset-color': '#fff',
60
+ '--tw-ring-color': theme(
61
+ 'colors.blue.600',
62
+ colors.blue[600]
63
+ ),
64
+ '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`,
65
+ '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)`,
66
+ 'box-shadow': `var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)`,
67
+ 'border-color': theme('colors.blue.600', colors.blue[600]),
68
+ },
69
+ },
70
+ ['::-webkit-datetime-edit']: {
71
+ display: 'inline-flex',
72
+ },
73
+ [[
74
+ '::-webkit-datetime-edit',
75
+ '::-webkit-datetime-edit-year-field',
76
+ '::-webkit-datetime-edit-month-field',
77
+ '::-webkit-datetime-edit-day-field',
78
+ '::-webkit-datetime-edit-hour-field',
79
+ '::-webkit-datetime-edit-minute-field',
80
+ '::-webkit-datetime-edit-second-field',
81
+ '::-webkit-datetime-edit-millisecond-field',
82
+ '::-webkit-datetime-edit-meridiem-field',
83
+ ]]: {
84
+ 'padding-bottom': '0',
85
+ 'padding-top': '0',
86
+ },
87
+ ['::-webkit-date-and-time-value']: {
88
+ 'min-height': '1.5em',
89
+ 'text-align': 'inherit',
90
+ },
91
+ ['select']: {
92
+ 'background-image': `url("${svgToTinyDataUri(
93
+ `<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
94
+ <path stroke="${theme('colors.gray.500', colors.gray[500])}" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
95
+ </svg>`
96
+ )}")`,
97
+ 'background-position': `right ${spacing[3]} center`,
98
+ 'background-repeat': `no-repeat`,
99
+ 'background-size': `0.75em 0.75em`,
100
+ 'padding-inline-end': spacing[8],
101
+ 'print-color-adjust': `exact`,
102
+ },
103
+ [':is(:where([dir=rtl]) select)']: {
104
+ 'background-position': `left ${spacing[3]} center`,
105
+ },
106
+ ['[multiple]']: {
107
+ 'background-image': 'initial',
108
+ 'background-position': 'initial',
109
+ 'background-repeat': 'unset',
110
+ 'background-size': 'initial',
111
+ 'padding-inline-end': spacing[3],
112
+ 'print-color-adjust': 'unset',
113
+ },
114
+ [[`[type='checkbox']`, `[type='radio']`]]: {
115
+ appearance: 'none',
116
+ 'background-origin': 'border-box',
117
+ color: theme('colors.blue.600', colors.blue[600]),
118
+ display: 'inline-block',
119
+ 'flex-shrink': '0',
120
+ 'print-color-adjust': 'exact',
121
+ 'user-select': 'none',
122
+ 'vertical-align': 'middle',
123
+ '--tw-shadow': '0 0 #0000',
124
+ },
125
+ [[`[type='checkbox']:focus`, `[type='radio']:focus`]]: {
126
+ outline: '2px solid transparent',
127
+ 'outline-offset': '2px',
128
+ '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
129
+ '--tw-ring-offset-width': '2px',
130
+ '--tw-ring-offset-color': '#fff',
131
+ '--tw-ring-color': theme('colors.blue.600', colors.blue[600]),
132
+ '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`,
133
+ '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)`,
134
+ 'box-shadow': `var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)`,
135
+ },
136
+ [[
137
+ `[type='checkbox']:checked`,
138
+ `[type='checkbox']:indeterminate`,
139
+ `[type='radio']:checked`,
140
+ ]]: {
141
+ 'background-color': `currentColor`,
142
+ 'background-position': `center`,
143
+ 'background-repeat': `no-repeat`,
144
+ 'background-size': `100% 100%`,
145
+ 'border-color': `transparent`,
146
+ },
147
+ [`[type='checkbox']:checked`]: {
148
+ 'background-image': `url("${svgToTinyDataUri(
149
+ `<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
150
+ <path d="M4 8 L7 11 L12 5" stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" />
151
+ </svg>`
152
+ )}")`,
153
+ 'print-color-adjust': `exact`,
154
+ },
155
+ [`[type='radio']:checked`]: {
156
+ 'background-image': `url("${svgToTinyDataUri(
157
+ `<svg viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="3"/></svg>`
158
+ )}")`,
159
+ },
160
+ [`[type='checkbox']:indeterminate`]: {
161
+ 'background-image': `url("${svgToTinyDataUri(
162
+ `<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
163
+ <path d="M4 8 L12 8" stroke="white" stroke-linecap="round" stroke-width="2.5" />
164
+ </svg>`
165
+ )}")`,
166
+ 'print-color-adjust': `exact`,
167
+ },
168
+ [[
169
+ `button:not(:disabled)`,
170
+ `[role='button']:not(:disabled)`,
171
+ `[type='file']`,
172
+ ]]: {
173
+ cursor: 'pointer',
174
+ },
175
+ [`[type=file]::file-selector-button`]: {
176
+ 'background-color': theme('colors.gray.100', colors.gray[100]),
177
+ 'border': `${borderWidth['DEFAULT']} solid ${theme('colors.gray.200', colors.gray[200])}`,
178
+ 'border-radius': borderRadius['DEFAULT'],
179
+ cursor: 'pointer',
180
+ 'padding': `${spacing[2]} ${spacing[3]}`,
181
+ '&:hover': {
182
+ 'background-color': theme('colors.gray.200', colors.gray[200]),
183
+ },
184
+ },
185
+ [`.dark [type=file]::file-selector-button`]: {
186
+ '@apply bg-white/5 border-white/5 text-white hover:bg-white/10': {}
187
+ },
188
+ '[type=checkbox]': {
189
+ '@apply w-4 h-4 bg-gray-100 border border-gray-300 rounded-sm focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-white/5 dark:border-white/10': {}
190
+ },
191
+ '[type=radio]': {
192
+ '@apply w-4 h-4 bg-gray-100 border border-gray-300 rounded-full focus:ring-2 focus:ring-blue-300 dark:focus:ring-blue-600 dark:focus:bg-blue-600 dark:bg-white/5 dark:border-white/10': {}
193
+ },
194
+ [['[type=datetime-local]', '[type=month]', '[type=week]', '[type=search]', '[type=date]', '[type=email]', '[type=number]', '[type=password]', '[type=tel]', '[type=text]', '[type=time]', '[type=url]', 'select', 'textarea']]: {
195
+ '@apply bg-gray-50 border border-gray-300 text-gray-900 placeholder:text-gray-400 rounded-md focus:ring-blue-500 focus:border-blue-500 w-full dark:bg-white/5 dark:border-white/10 dark:text-white dark:placeholder:text-gray-500 dark:focus:ring-blue-500 dark:focus:border-blue-500': {}
196
+ },
197
+ [':where(select:not([multiple]))']: {
198
+ 'option, optgroup': {
199
+ '@apply dark:bg-gray-800': {}
200
+ }
201
+ },
202
+ 'a': {
203
+ '@apply text-blue-600 dark:text-blue-500 underline underline-offset-[.2rem]': {}
204
+ },
205
+ });
206
+ addComponents({
207
+ '.action-item-button': {
208
+ '@apply py-2 px-3 text-sm font-medium no-underline text-gray-900 focus:outline-hidden bg-white rounded-md border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-700 dark:hover:text-white dark:hover:bg-gray-700': {}
209
+ },
210
+ '.index-data-table-toolbar': {
211
+ '@apply flex flex-col lg:flex-row gap-4 mb-4': {}
212
+ },
213
+ '.scopes': {
214
+ '@apply flex flex-wrap gap-1.5': {}
215
+ },
216
+ '.index-button-group': {
217
+ '@apply inline-flex flex-wrap items-stretch rounded-md': {}
218
+ },
219
+ // Prevent double borders when buttons are next to each other
220
+ '.index-button-group > :where(*:not(:first-child))': {
221
+ '@apply -ms-px my-0': {}
222
+ },
223
+ '.index-button': {
224
+ '@apply inline-flex items-center justify-center px-3 py-2 text-sm font-medium no-underline text-gray-900 bg-white border border-gray-200 hover:bg-gray-100 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 first:rounded-s-md last:rounded-e-md dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:hover:text-gray-200 dark:hover:bg-gray-800 dark:focus:ring-blue-500 dark:focus:text-white': {}
225
+ },
226
+ '.index-button-selected': {
227
+ '@apply bg-gray-100 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-800': {}
228
+ },
229
+ '.scopes-count': {
230
+ '@apply inline-flex items-center justify-center rounded-full bg-indigo-100 text-indigo-700 dark:bg-indigo-800/60 dark:text-indigo-400 px-1.5 py-1 text-xs font-normal ms-2 leading-none': {}
231
+ },
232
+ '.paginated-collection': {
233
+ '@apply border border-gray-200 dark:border-gray-800 rounded-md shadow-xs overflow-hidden': {}
234
+ },
235
+ '.paginated-collection-contents': {
236
+ '@apply overflow-x-auto': {}
237
+ },
238
+ '.paginated-collection-pagination': {
239
+ '@apply p-2 lg:p-3 flex flex-col-reverse lg:flex-row gap-4 items-center justify-between border-t border-gray-200 dark:border-gray-800': {}
240
+ },
241
+ '.paginated-collection-footer': {
242
+ '@apply p-3 flex gap-2 items-center justify-between text-sm border-t border-gray-200 dark:border-gray-800': {}
243
+ },
244
+ '.pagination-per-page': {
245
+ '@apply text-sm py-1 pe-7 w-auto w-min': {}
246
+ },
247
+ '.index-as-table': {
248
+ '@apply relative overflow-x-auto': {}
249
+ },
250
+ '.data-table': {
251
+ '@apply w-full text-sm text-gray-800 dark:text-gray-300': {}
252
+ },
253
+ '.data-table :where(thead > tr > th)': {
254
+ '@apply px-3 py-3.5 font-semibold text-start text-xs uppercase border-b border-gray-200 text-gray-700 bg-gray-50 dark:bg-gray-950/50 dark:border-gray-800 dark:text-white': {}
255
+ },
256
+ '.data-table :where(thead > tr > th > a)': {
257
+ '@apply text-inherit no-underline inline-flex items-center gap-2': {}
258
+ },
259
+ '.data-table-sorted-icon': {
260
+ '@apply invisible w-[8px] h-[5px]': {}
261
+ },
262
+ ':where(th[data-sort-direction]) .data-table-sorted-icon': {
263
+ '@apply visible': {}
264
+ },
265
+ ':where(th[data-sort-direction="asc"]) .data-table-sorted-icon': {
266
+ '@apply rotate-180': {}
267
+ },
268
+ '.data-table :where(tbody > tr)': {
269
+ '@apply border-b border-gray-200 dark:border-gray-800 last:border-b-0': {}
270
+ },
271
+ '.data-table :where(td)': {
272
+ '@apply px-3 py-4': {}
273
+ },
274
+ '.data-table-resource-actions': {
275
+ '@apply flex gap-2': {}
276
+ },
277
+ '.filters-form': {
278
+ '@apply text-sm mb-6': {}
279
+ },
280
+ '.filters-form-title': {
281
+ '@apply text-gray-700 dark:text-gray-200 font-bold text-lg mb-4': {}
282
+ },
283
+ '.filters-form :where(.label)': {
284
+ '@apply block mb-1.5 text-sm': {}
285
+ },
286
+ '.filters-form-input-group': {
287
+ '@apply grid grid-cols-2 gap-2': {}
288
+ },
289
+ '.filters-form-field': {
290
+ '@apply mb-4': {}
291
+ },
292
+ '.filters-form-field :where(.choices > label)': {
293
+ '@apply flex gap-2 items-center mb-1': {}
294
+ },
295
+ '.filters-form-buttons': {
296
+ '@apply flex gap-2 items-center': {}
297
+ },
298
+ '.filters-form-submit': {
299
+ '@apply min-w-24 font-bold text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:outline-hidden focus:ring-blue-300 rounded-md px-3 py-2 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 cursor-pointer': {}
300
+ },
301
+ '.filters-form-clear': {
302
+ '@apply rounded-md px-3 py-2 font-semibold text-gray-700 hover:bg-gray-100 no-underline dark:text-gray-400 dark:hover:bg-inherit dark:hover:text-gray-100 dark:focus:ring-blue-800': {}
303
+ },
304
+ '.active-filters-title': {
305
+ '@apply text-gray-700 dark:text-gray-200 font-bold text-lg mb-4': {}
306
+ },
307
+ '.active-filters-list': {
308
+ '@apply ps-5 list-disc space-y-1 text-gray-700 dark:text-gray-200': {}
309
+ },
310
+ '.batch-actions-dropdown': {
311
+ '@apply relative': {}
312
+ },
313
+ '.batch-actions-dropdown-toggle': {
314
+ '@apply transition-opacity rounded-md inline-flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium text-gray-900 bg-white border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-800 dark:border-gray-700 dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:ring-blue-500 dark:focus:text-white disabled:text-gray-400 disabled:border-gray-200/70 dark:disabled:bg-gray-900 dark:disabled:text-gray-700 dark:disabled:border-gray-800 disabled:pointer-events-none': {}
315
+ },
316
+ '.batch-actions-dropdown-arrow': {
317
+ '@apply w-2.5 h-2.5': {}
318
+ },
319
+ '.batch-actions-dropdown-menu': {
320
+ '@apply z-10 hidden min-w-28 bg-white rounded-md shadow-lg ring-1 ring-black/5 focus:outline-hidden dark:bg-gray-800 py-1 text-sm text-gray-700 dark:text-gray-200': {}
321
+ },
322
+ '.batch-actions-dropdown-menu :where(li > a)': {
323
+ '@apply block px-2.5 py-2 no-underline text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-white dark:hover:bg-gray-700 dark:hover:text-white': {}
324
+ },
325
+ '.panel': {
326
+ '@apply mb-6 border border-gray-200 rounded-md shadow-xs dark:border-gray-800': {}
327
+ },
328
+ '.panel-title': {
329
+ '@apply font-bold bg-gray-100 dark:bg-gray-950/50 rounded-t-md p-3': {}
330
+ },
331
+ '.panel-body': {
332
+ '@apply py-5 px-3': {}
333
+ },
334
+ '.attributes-table': {
335
+ '@apply overflow-hidden mb-6 border border-gray-200 rounded-md shadow-xs dark:border-gray-800': {}
336
+ },
337
+ '.attributes-table > :where(table)': {
338
+ '@apply w-full text-sm text-gray-800 dark:text-gray-300': {}
339
+ },
340
+ '.attributes-table :where(tbody > tr)': {
341
+ '@apply border-b border-gray-200 dark:border-gray-800 last:border-b-0 align-baseline': {}
342
+ },
343
+ '.attributes-table :where(tbody > tr > th)': {
344
+ '@apply w-32 sm:w-40 text-start text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-950/50 dark:text-gray-300': {}
345
+ },
346
+ '.attributes-table :where(tbody > tr > th, tbody > tr > td)': {
347
+ '@apply p-3': {}
348
+ },
349
+ '.attributes-table-empty-value': {
350
+ '@apply text-gray-400/50 dark:text-gray-600/50 text-xs uppercase font-semibold': {}
351
+ },
352
+ '.status-tag': {
353
+ '@apply bg-gray-200 text-gray-600 dark:bg-gray-400/20 dark:text-gray-400 inline-flex items-center rounded-full text-sm font-medium px-2.5 py-0.5 whitespace-nowrap': {}
354
+ },
355
+ '.status-tag:where([data-status=yes])': {
356
+ '@apply bg-green-100 text-green-700 dark:bg-green-400/20 dark:text-green-400': {}
357
+ },
358
+ // Forms
359
+ '.formtastic': {
360
+ '@apply text-sm': {}
361
+ },
362
+ '.formtastic :where(.inputs,.has-many-fields)': {
363
+ '@apply mb-6': {}
364
+ },
365
+ '.formtastic :where(.fieldset-title, .has-many-fields-title)': {
366
+ '@apply block w-full mb-3 border-b border-gray-200 dark:border-gray-800 font-bold text-lg': {}
367
+ },
368
+ '.formtastic :where(.label)': {
369
+ '@apply block mb-1.5': {}
370
+ },
371
+ '.formtastic :where(.label abbr)': {
372
+ '@apply ms-1 no-underline': {}
373
+ },
374
+ '.formtastic :where(.input)': {
375
+ '@apply py-3': {}
376
+ },
377
+ '.formtastic :where(.choice)': {
378
+ '@apply mb-1': {}
379
+ },
380
+ '.formtastic :where(.boolean label, .choice label)': {
381
+ '@apply flex gap-2 items-center': {}
382
+ },
383
+ '.formtastic :where(.fragments-group)': {
384
+ '@apply inline-flex flex-wrap gap-1': {}
385
+ },
386
+ '.formtastic :where(.fragment label)': {
387
+ '@apply sr-only': {}
388
+ },
389
+ '.formtastic :where(.inline-hints)': {
390
+ '@apply text-gray-500 dark:text-gray-400 mt-2': {}
391
+ },
392
+ '.formtastic :where(.errors)': {
393
+ '@apply p-4 mb-6 rounded-md space-y-2 bg-red-50 text-red-800 dark:bg-red-500/15 dark:text-red-200': {}
394
+ },
395
+ '.formtastic :where(.errors > li)': {
396
+ '@apply list-disc ms-4': {}
397
+ },
398
+ '.formtastic :where(.inline-errors)': {
399
+ '@apply font-bold mt-2 text-red-600 dark:text-red-400': {}
400
+ },
401
+ '.formtastic :where(.error [type=email], .error [type=number], .error [type=password], .error [type=tel], .error [type=text], .error [type=url], .error select, .error textarea)': {
402
+ '@apply border-red-500/50': {}
403
+ },
404
+ '.formtastic :where(.buttons, .actions)': {
405
+ '@apply mt-3': {}
406
+ },
407
+ '.formtastic :where(.actions > ol)': {
408
+ '@apply flex items-center gap-6': {}
409
+ },
410
+ '.formtastic :where([type=submit], [type=button], button)': {
411
+ '@apply font-bold text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:outline-hidden focus:ring-blue-300 rounded-lg px-4 py-2 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 cursor-pointer': {}
412
+ },
413
+ '.formtastic :where(.actions .cancel-link)': {
414
+ '@apply font-semibold leading-6 text-gray-900 dark:text-white no-underline': {}
415
+ },
416
+ '.formtastic :where(.has-many-add)': {
417
+ '@apply inline-block py-3 mb-3': {}
418
+ },
419
+ '.formtastic :where(.has-many-fields)': {
420
+ '@apply ps-3 border-s-4 border-s-gray-200 dark:border-s-gray-700': {}
421
+ }
422
+ });
423
+ }
424
+ )