django-unfold 0.55.3__py3-none-any.whl → 1.0.0__py3-none-any.whl

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 (124) hide show
  1. {django_unfold-0.55.3.dist-info → django_unfold-1.0.0.dist-info}/METADATA +1 -1
  2. {django_unfold-0.55.3.dist-info → django_unfold-1.0.0.dist-info}/RECORD +124 -123
  3. {django_unfold-0.55.3.dist-info → django_unfold-1.0.0.dist-info}/WHEEL +1 -1
  4. unfold/contrib/filters/templates/unfold/filters/filters_numeric_slider.html +2 -2
  5. unfold/contrib/forms/templates/unfold/forms/array.html +5 -5
  6. unfold/contrib/forms/templates/unfold/forms/helpers/toolbar.html +23 -23
  7. unfold/contrib/forms/widgets.py +7 -7
  8. unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage.html +4 -2
  9. unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_group.html +5 -3
  10. unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_user.html +5 -3
  11. unfold/contrib/guardian/templates/unfold/guardian/group_form.html +4 -4
  12. unfold/contrib/guardian/templates/unfold/guardian/user_form.html +4 -4
  13. unfold/contrib/import_export/templates/admin/import_export/change_form.html +1 -1
  14. unfold/contrib/import_export/templates/admin/import_export/export.html +4 -4
  15. unfold/contrib/import_export/templates/admin/import_export/import.html +1 -1
  16. unfold/contrib/import_export/templates/admin/import_export/import_confirm.html +2 -2
  17. unfold/contrib/import_export/templates/admin/import_export/import_errors.html +18 -12
  18. unfold/contrib/import_export/templates/admin/import_export/import_form.html +2 -2
  19. unfold/contrib/import_export/templates/admin/import_export/import_preview.html +2 -2
  20. unfold/contrib/import_export/templates/admin/import_export/import_validation.html +7 -7
  21. unfold/contrib/simple_history/templates/simple_history/object_history.html +3 -3
  22. unfold/contrib/simple_history/templates/simple_history/object_history_form.html +2 -2
  23. unfold/contrib/simple_history/templates/simple_history/object_history_list.html +2 -2
  24. unfold/contrib/simple_history/templates/simple_history/submit_line.html +4 -4
  25. unfold/forms.py +1 -1
  26. unfold/settings.py +22 -22
  27. unfold/sites.py +7 -2
  28. unfold/static/unfold/css/styles.css +2 -1
  29. unfold/static/unfold/fonts/material-symbols/styles.css +0 -16
  30. unfold/styles.css +140 -84
  31. unfold/templates/admin/actions.html +4 -4
  32. unfold/templates/admin/app_index.html +1 -1
  33. unfold/templates/admin/app_list.html +2 -2
  34. unfold/templates/admin/auth/user/add_form.html +1 -1
  35. unfold/templates/admin/auth/user/change_password.html +2 -2
  36. unfold/templates/admin/base.html +6 -6
  37. unfold/templates/admin/change_form.html +6 -4
  38. unfold/templates/admin/change_list.html +11 -9
  39. unfold/templates/admin/change_list_results.html +4 -4
  40. unfold/templates/admin/date_hierarchy.html +1 -1
  41. unfold/templates/admin/delete_confirmation.html +4 -4
  42. unfold/templates/admin/delete_selected_confirmation.html +3 -3
  43. unfold/templates/admin/edit_inline/stacked.html +2 -2
  44. unfold/templates/admin/edit_inline/tabular.html +3 -3
  45. unfold/templates/admin/filter.html +3 -3
  46. unfold/templates/admin/includes/fieldset.html +1 -1
  47. unfold/templates/admin/index.html +1 -1
  48. unfold/templates/admin/login.html +6 -6
  49. unfold/templates/admin/nav_sidebar.html +11 -3
  50. unfold/templates/admin/object_history.html +4 -4
  51. unfold/templates/admin/pagination.html +18 -24
  52. unfold/templates/admin/search_form.html +3 -3
  53. unfold/templates/admin/submit_line.html +53 -56
  54. unfold/templates/auth/widgets/read_only_password_hash.html +1 -1
  55. unfold/templates/registration/logged_out.html +6 -8
  56. unfold/templates/registration/password_change_done.html +1 -1
  57. unfold/templates/registration/password_change_form.html +1 -1
  58. unfold/templates/unfold/components/button.html +1 -1
  59. unfold/templates/unfold/components/card.html +5 -5
  60. unfold/templates/unfold/components/chart/cohort.html +2 -2
  61. unfold/templates/unfold/components/navigation.html +2 -2
  62. unfold/templates/unfold/components/progress.html +1 -1
  63. unfold/templates/unfold/components/table.html +3 -3
  64. unfold/templates/unfold/components/tracker.html +1 -1
  65. unfold/templates/unfold/helpers/account_links.html +7 -7
  66. unfold/templates/unfold/helpers/actions_row.html +3 -3
  67. unfold/templates/unfold/helpers/app_list.html +7 -7
  68. unfold/templates/unfold/helpers/app_list_default.html +2 -2
  69. unfold/templates/unfold/helpers/change_list_actions.html +1 -1
  70. unfold/templates/unfold/helpers/change_list_filter.html +4 -4
  71. unfold/templates/unfold/helpers/change_list_filter_actions.html +5 -5
  72. unfold/templates/unfold/helpers/delete_submit_line.html +2 -2
  73. unfold/templates/unfold/helpers/display_dropdown.html +3 -3
  74. unfold/templates/unfold/helpers/display_header.html +1 -1
  75. unfold/templates/unfold/helpers/edit_inline/tabular_delete.html +1 -1
  76. unfold/templates/unfold/helpers/edit_inline/tabular_field.html +1 -1
  77. unfold/templates/unfold/helpers/edit_inline/tabular_row.html +1 -1
  78. unfold/templates/unfold/helpers/edit_inline/tabular_title.html +1 -1
  79. unfold/templates/unfold/helpers/empty_results.html +4 -4
  80. unfold/templates/unfold/helpers/field_readonly_value.html +1 -1
  81. unfold/templates/unfold/helpers/fieldset_row_checkbox.html +2 -2
  82. unfold/templates/unfold/helpers/fieldset_row_field.html +1 -1
  83. unfold/templates/unfold/helpers/fieldsets_tabs.html +1 -1
  84. unfold/templates/unfold/helpers/header.html +3 -1
  85. unfold/templates/unfold/helpers/header_back_button.html +1 -1
  86. unfold/templates/unfold/helpers/history.html +2 -2
  87. unfold/templates/unfold/helpers/label.html +1 -1
  88. unfold/templates/unfold/helpers/language_switch.html +3 -3
  89. unfold/templates/unfold/helpers/messages/debug.html +1 -1
  90. unfold/templates/unfold/helpers/messages/error.html +1 -1
  91. unfold/templates/unfold/helpers/messages/errornote.html +1 -1
  92. unfold/templates/unfold/helpers/messages/info.html +1 -1
  93. unfold/templates/unfold/helpers/messages/success.html +1 -1
  94. unfold/templates/unfold/helpers/messages/warning.html +1 -1
  95. unfold/templates/unfold/helpers/messages.html +1 -1
  96. unfold/templates/unfold/helpers/navigation.html +10 -14
  97. unfold/templates/unfold/helpers/navigation_header.html +6 -4
  98. unfold/templates/unfold/helpers/pagination.html +7 -0
  99. unfold/templates/unfold/helpers/search.html +2 -2
  100. unfold/templates/unfold/helpers/search_results.html +1 -1
  101. unfold/templates/unfold/helpers/site_dropdown.html +2 -2
  102. unfold/templates/unfold/helpers/site_icon.html +6 -6
  103. unfold/templates/unfold/helpers/submit.html +1 -1
  104. unfold/templates/unfold/helpers/tab_action.html +5 -5
  105. unfold/templates/unfold/helpers/tab_actions.html +1 -1
  106. unfold/templates/unfold/helpers/tab_items.html +6 -6
  107. unfold/templates/unfold/helpers/tab_list.html +1 -1
  108. unfold/templates/unfold/helpers/theme_switch.html +8 -8
  109. unfold/templates/unfold/helpers/welcomemsg.html +3 -3
  110. unfold/templates/unfold/layouts/base_simple.html +3 -3
  111. unfold/templates/unfold/layouts/skeleton.html +2 -2
  112. unfold/templates/unfold/widgets/clearable_file_input.html +3 -3
  113. unfold/templates/unfold/widgets/clearable_file_input_small.html +5 -5
  114. unfold/templates/unfold/widgets/foreign_key_raw_id.html +5 -5
  115. unfold/templates/unfold/widgets/related_widget_wrapper.html +8 -8
  116. unfold/templates/unfold/widgets/split_datetime.html +2 -2
  117. unfold/templates/unfold_crispy/field.html +1 -1
  118. unfold/templates/unfold_crispy/inputs.html +1 -1
  119. unfold/templates/unfold_crispy/layout/checkbox.html +1 -1
  120. unfold/templates/unfold_crispy/layout/fieldset.html +1 -1
  121. unfold/templates/unfold_crispy/layout/table_inline_formset.html +2 -2
  122. unfold/templatetags/unfold.py +23 -9
  123. unfold/widgets.py +29 -34
  124. {django_unfold-0.55.3.dist-info → django_unfold-1.0.0.dist-info}/LICENSE.md +0 -0
@@ -322,6 +322,17 @@ def preserve_changelist_filters(context: Context) -> dict[str, dict[str, str]]:
322
322
  return {"params": preserved_params}
323
323
 
324
324
 
325
+ @register.simple_tag(takes_context=True)
326
+ def element_classes(context: Context, key: str) -> str:
327
+ if key in context.get("element_classes", {}):
328
+ if isinstance(context["element_classes"][key], list | tuple):
329
+ return " ".join(context["element_classes"][key])
330
+
331
+ return context["element_classes"][key]
332
+
333
+ return ""
334
+
335
+
325
336
  @register.simple_tag(takes_context=True)
326
337
  def fieldset_rows_classes(context: Context) -> str:
327
338
  classes = [
@@ -334,8 +345,8 @@ def fieldset_rows_classes(context: Context) -> str:
334
345
  "border",
335
346
  "border-base-200",
336
347
  "mb-8",
337
- "rounded",
338
- "shadow-sm",
348
+ "rounded-default",
349
+ "shadow-xs",
339
350
  "dark:border-base-800",
340
351
  ]
341
352
  )
@@ -384,7 +395,8 @@ def fieldset_line_classes(context: Context) -> str:
384
395
  "field-line",
385
396
  "flex",
386
397
  "flex-col",
387
- "flex-grow",
398
+ "grow",
399
+ "group",
388
400
  "group/line",
389
401
  "px-3",
390
402
  "py-2.5",
@@ -412,7 +424,7 @@ def fieldset_line_classes(context: Context) -> str:
412
424
  "lg:border-l",
413
425
  "lg:flex-row",
414
426
  "dark:border-base-800",
415
- "first:lg:border-l-0",
427
+ "lg:first:border-l-0",
416
428
  ]
417
429
  )
418
430
 
@@ -423,11 +435,13 @@ def fieldset_line_classes(context: Context) -> str:
423
435
  def action_item_classes(context: Context, action: UnfoldAction) -> str:
424
436
  classes = [
425
437
  "border",
426
- "-ml-px",
427
- "max-md:first:rounded-t",
428
- "max-md:last:rounded-b",
429
- "md:first:rounded-l",
430
- "md:last:rounded-r",
438
+ "border-base-200",
439
+ "max-md:-mt-px",
440
+ "max-md:first:rounded-t-default",
441
+ "max-md:last:rounded-b-default",
442
+ "md:-ml-px",
443
+ "md:first:rounded-l-default",
444
+ "md:last:rounded-r-default",
431
445
  ]
432
446
 
433
447
  if "variant" not in action:
unfold/widgets.py CHANGED
@@ -39,7 +39,7 @@ BUTTON_CLASSES = [
39
39
  "font-medium",
40
40
  "px-3",
41
41
  "py-2",
42
- "rounded",
42
+ "rounded-default",
43
43
  "text-center",
44
44
  "whitespace-nowrap",
45
45
  "bg-primary-600",
@@ -71,24 +71,21 @@ BASE_CLASSES = [
71
71
  "font-medium",
72
72
  "min-w-20",
73
73
  "placeholder-base-400",
74
- "rounded",
75
- "shadow-sm",
74
+ "rounded-default",
75
+ "shadow-xs",
76
76
  "text-font-default-light",
77
77
  "text-sm",
78
- "focus:ring",
79
- "focus:ring-primary-300",
80
- "focus:border-primary-600",
81
- "focus:outline-none",
78
+ "focus:outline-2",
79
+ "focus:-outline-offset-2",
80
+ "focus:outline-primary-600",
82
81
  "group-[.errors]:border-red-600",
83
- "group-[.errors]:focus:ring-red-200",
82
+ "focus:group-[.errors]:outline-red-600",
84
83
  "dark:bg-base-900",
85
84
  "dark:border-base-700",
86
85
  "dark:text-font-default-dark",
87
- "dark:focus:border-primary-600",
88
- "dark:focus:ring-primary-700",
89
- "dark:focus:ring-opacity-50",
90
86
  "dark:group-[.errors]:border-red-500",
91
- "dark:group-[.errors]:focus:ring-red-600/40",
87
+ "dark:focus:group-[.errors]:outline-red-500",
88
+ "dark:scheme-dark",
92
89
  ]
93
90
 
94
91
  BASE_INPUT_CLASSES = [
@@ -102,7 +99,7 @@ INPUT_CLASSES = [*BASE_INPUT_CLASSES, "max-w-2xl"]
102
99
 
103
100
  DATETIME_CLASSES = [*BASE_INPUT_CLASSES, "min-w-52"]
104
101
 
105
- COLOR_CLASSES = [*BASE_CLASSES, "h-9.5", "px-2", "py-2", "w-32"]
102
+ COLOR_CLASSES = [*BASE_CLASSES, "h-[38px]", "px-2", "py-2", "w-32"]
106
103
 
107
104
  INPUT_CLASSES_READONLY = [*BASE_INPUT_CLASSES, "bg-base-50"]
108
105
 
@@ -137,7 +134,7 @@ PROSE_CLASSES = [
137
134
  "prose-blockquote:border-l-4",
138
135
  "prose-blockquote:not-italic",
139
136
  "prose-pre:bg-base-50",
140
- "prose-pre:rounded",
137
+ "prose-pre:rounded-default",
141
138
  "prose-headings:font-medium",
142
139
  "prose-a:text-primary-600",
143
140
  "prose-headings:font-medium",
@@ -163,19 +160,19 @@ CHECKBOX_CLASSES = [
163
160
  "min-w-4",
164
161
  "relative",
165
162
  "rounded-[4px]",
166
- "shadow-sm",
163
+ "shadow-xs",
167
164
  "w-4",
168
165
  "hover:border-base-400",
169
166
  "dark:bg-base-700",
170
167
  "dark:border-base-500",
171
- "dark:after:checked:text-white",
168
+ "dark:checked:after:text-white",
172
169
  "focus:outline",
173
170
  "focus:outline-1",
174
171
  "focus:outline-offset-2",
175
172
  "focus:outline-primary-500",
176
173
  "after:absolute",
177
174
  "after:content-['done']",
178
- "after:!flex",
175
+ "after:flex!",
179
176
  "after:h-4",
180
177
  "after:items-center",
181
178
  "after:justify-center",
@@ -183,15 +180,15 @@ CHECKBOX_CLASSES = [
183
180
  "after:material-symbols-outlined",
184
181
  "after:-ml-px",
185
182
  "after:-mt-px",
186
- "after:!text-sm",
183
+ "after:text-sm!",
187
184
  "after:text-white",
188
185
  "after:transition-all",
189
186
  "after:w-4",
190
- "after:dark:text-base-700",
187
+ "dark:after:text-base-700",
191
188
  "checked:bg-primary-600",
192
- "checked:dark:bg-primary-600",
189
+ "dark:checked:bg-primary-600",
193
190
  "checked:border-primary-600",
194
- "checked:dark:border-primary-600",
191
+ "dark:checked:border-primary-600",
195
192
  "checked:transition-all",
196
193
  "checked:hover:border-primary-600",
197
194
  ]
@@ -232,13 +229,13 @@ RADIO_CLASSES = [
232
229
  "after:-translate-y-1/2",
233
230
  "after:text-sm",
234
231
  "after:w-2",
235
- "after:dark:text-base-700",
236
- "after:dark:bg-transparent",
232
+ "dark:after:text-base-700",
233
+ "dark:after:bg-transparent",
237
234
  "checked:bg-primary-600",
238
235
  "checked:border-primary-600",
239
236
  "checked:transition-all",
240
237
  "checked:after:bg-white",
241
- "checked:after:dark:bg-base-900",
238
+ "dark:checked:after:bg-base-900",
242
239
  "checked:hover:border-base-900/20",
243
240
  ]
244
241
 
@@ -258,7 +255,7 @@ SWITCH_CLASSES = [
258
255
  "after:bg-red-300",
259
256
  "after:h-3",
260
257
  "after:rounded-full",
261
- "after:shadow-sm",
258
+ "after:shadow-xs",
262
259
  "after:left-1",
263
260
  "after:top-1",
264
261
  "after:w-3",
@@ -275,19 +272,17 @@ FILE_CLASSES = [
275
272
  "grow",
276
273
  "items-center",
277
274
  "overflow-hidden",
278
- "rounded",
279
- "shadow-sm",
275
+ "rounded-default",
276
+ "shadow-xs",
280
277
  "max-w-2xl",
281
- "focus-within:ring",
278
+ "focus-within:outline-2",
279
+ "focus-within:-outline-offset-2",
280
+ "focus-within:outline-primary-600",
282
281
  "group-[.errors]:border-red-600",
283
- "group-[.errors]:focus-within:ring-red-200",
284
- "focus-within:ring-primary-300",
285
- "focus-within:border-primary-600",
282
+ "focus-within:group-[.errors]:outline-red-500",
286
283
  "dark:border-base-700",
287
- "dark:focus-within:border-primary-600",
288
- "dark:focus-within:ring-primary-700",
289
284
  "dark:group-[.errors]:border-red-500",
290
- "dark:group-[.errors]:focus-within:ring-red-600/40",
285
+ "dark:focus-within:group-[.errors]:outline-red-500",
291
286
  ]
292
287
 
293
288