phlex_kit 0.10.0 → 0.12.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/app/assets/stylesheets/phlex_kit/phlex_kit.css +1 -0
- data/app/components/phlex_kit/accordion/accordion.css +7 -0
- data/app/components/phlex_kit/alert_dialog/alert_dialog.css +3 -1
- data/app/components/phlex_kit/alert_dialog/alert_dialog_content.rb +13 -2
- data/app/components/phlex_kit/alert_dialog/alert_dialog_controller.js +38 -7
- data/app/components/phlex_kit/attachment/attachment.css +15 -0
- data/app/components/phlex_kit/attachment/attachment_group.rb +6 -1
- data/app/components/phlex_kit/attachment/attachment_trigger.rb +8 -0
- data/app/components/phlex_kit/avatar/avatar_badge.rb +9 -2
- data/app/components/phlex_kit/badge/badge.css +1 -1
- data/app/components/phlex_kit/breadcrumb/breadcrumb.css +1 -0
- data/app/components/phlex_kit/bubble/bubble.rb +4 -6
- data/app/components/phlex_kit/bubble/bubble_reactions.rb +4 -6
- data/app/components/phlex_kit/calendar/calendar_controller.js +56 -15
- data/app/components/phlex_kit/carousel/carousel.rb +3 -2
- data/app/components/phlex_kit/carousel/carousel_controller.js +59 -4
- data/app/components/phlex_kit/chart/chart.rb +10 -2
- data/app/components/phlex_kit/chart/chart_controller.js +37 -8
- data/app/components/phlex_kit/clipboard/clipboard_controller.js +9 -2
- data/app/components/phlex_kit/clipboard/clipboard_trigger.rb +1 -1
- data/app/components/phlex_kit/codeblock/codeblock.rb +11 -1
- data/app/components/phlex_kit/collapsible/collapsible.rb +4 -1
- data/app/components/phlex_kit/combobox/combobox.css +1 -1
- data/app/components/phlex_kit/combobox/combobox_badge_trigger.rb +6 -2
- data/app/components/phlex_kit/combobox/combobox_controller.js +72 -3
- data/app/components/phlex_kit/combobox/combobox_input_trigger.rb +4 -1
- data/app/components/phlex_kit/combobox/combobox_list.rb +6 -2
- data/app/components/phlex_kit/combobox/combobox_toggle_all_checkbox.rb +4 -0
- data/app/components/phlex_kit/command/command_controller.js +23 -2
- data/app/components/phlex_kit/command/command_input.rb +3 -2
- data/app/components/phlex_kit/command/command_item.rb +4 -0
- data/app/components/phlex_kit/command/command_list.rb +6 -2
- data/app/components/phlex_kit/context_menu/context_menu.css +3 -0
- data/app/components/phlex_kit/context_menu/context_menu.rb +9 -1
- data/app/components/phlex_kit/context_menu/context_menu_controller.js +74 -12
- data/app/components/phlex_kit/context_menu/context_menu_sub.rb +3 -1
- data/app/components/phlex_kit/context_menu/context_menu_sub_trigger.rb +3 -1
- data/app/components/phlex_kit/data_table/data_table.css +1 -11
- data/app/components/phlex_kit/data_table/data_table_column_toggle.rb +4 -1
- data/app/components/phlex_kit/data_table/data_table_controller.js +4 -0
- data/app/components/phlex_kit/data_table/data_table_pagination.rb +4 -1
- data/app/components/phlex_kit/data_table/data_table_per_page_select.rb +8 -3
- data/app/components/phlex_kit/data_table/data_table_search.rb +7 -2
- data/app/components/phlex_kit/date_picker/date_picker.rb +19 -2
- data/app/components/phlex_kit/date_picker/date_picker_controller.js +28 -0
- data/app/components/phlex_kit/dialog/dialog.css +3 -1
- data/app/components/phlex_kit/dialog/dialog_content.rb +1 -1
- data/app/components/phlex_kit/dialog/dialog_controller.js +16 -2
- data/app/components/phlex_kit/drawer/drawer.rb +1 -1
- data/app/components/phlex_kit/drawer/drawer_content.rb +10 -3
- data/app/components/phlex_kit/dropdown_menu/dropdown_menu.css +9 -2
- data/app/components/phlex_kit/dropdown_menu/dropdown_menu.rb +3 -1
- data/app/components/phlex_kit/dropdown_menu/dropdown_menu_controller.js +81 -13
- data/app/components/phlex_kit/dropdown_menu/dropdown_menu_sub.rb +3 -1
- data/app/components/phlex_kit/dropdown_menu/dropdown_menu_sub_trigger.rb +3 -1
- data/app/components/phlex_kit/field/field_separator.rb +1 -1
- data/app/components/phlex_kit/form_field/form_field_controller.js +54 -25
- data/app/components/phlex_kit/form_field/form_field_hint.rb +6 -2
- data/app/components/phlex_kit/hover_card/hover_card.css +10 -2
- data/app/components/phlex_kit/hover_card/hover_card_controller.js +24 -0
- data/app/components/phlex_kit/icon/icon.css +9 -0
- data/app/components/phlex_kit/icon/icon.rb +7 -1
- data/app/components/phlex_kit/input/input.css +0 -1
- data/app/components/phlex_kit/input_group/input_group.css +0 -1
- data/app/components/phlex_kit/input_otp/input_otp.rb +6 -3
- data/app/components/phlex_kit/input_otp/input_otp_controller.js +24 -2
- data/app/components/phlex_kit/item/item.css +2 -1
- data/app/components/phlex_kit/kbd/kbd.css +2 -1
- data/app/components/phlex_kit/label/label.css +1 -1
- data/app/components/phlex_kit/link/link.rb +1 -0
- data/app/components/phlex_kit/marker/marker.css +2 -1
- data/app/components/phlex_kit/marker/marker.rb +9 -2
- data/app/components/phlex_kit/masked_input/masked_input_controller.js +20 -14
- data/app/components/phlex_kit/menubar/menubar.css +3 -0
- data/app/components/phlex_kit/menubar/menubar_controller.js +46 -16
- data/app/components/phlex_kit/message/message.rb +5 -0
- data/app/components/phlex_kit/message_scroller/message_scroller_controller.js +3 -0
- data/app/components/phlex_kit/native_select/native_select.css +14 -0
- data/app/components/phlex_kit/native_select/native_select.rb +12 -3
- data/app/components/phlex_kit/navigation_menu/navigation_menu.rb +4 -1
- data/app/components/phlex_kit/navigation_menu/navigation_menu_link.rb +8 -1
- data/app/components/phlex_kit/pagination/pagination.rb +10 -2
- data/app/components/phlex_kit/pagination/pagination_next.rb +3 -1
- data/app/components/phlex_kit/pagination/pagination_previous.rb +3 -1
- data/app/components/phlex_kit/popover/popover_controller.js +42 -1
- data/app/components/phlex_kit/progress/progress.css +8 -0
- data/app/components/phlex_kit/progress/progress.rb +14 -5
- data/app/components/phlex_kit/resizable/resizable_controller.js +3 -0
- data/app/components/phlex_kit/scroll_area/scroll_area.rb +5 -15
- data/app/components/phlex_kit/select/select.css +5 -2
- data/app/components/phlex_kit/select/select_controller.js +49 -4
- data/app/components/phlex_kit/select/select_trigger.rb +4 -1
- data/app/components/phlex_kit/separator/separator.rb +5 -1
- data/app/components/phlex_kit/sheet/sheet.css +4 -2
- data/app/components/phlex_kit/sheet/sheet_content.rb +13 -3
- data/app/components/phlex_kit/sheet/sheet_content_controller.js +40 -0
- data/app/components/phlex_kit/sheet/sheet_controller.js +31 -1
- data/app/components/phlex_kit/sidebar/sidebar_menu_button.rb +9 -1
- data/app/components/phlex_kit/sidebar/sidebar_menu_sub_button.rb +8 -1
- data/app/components/phlex_kit/slider/slider.css +15 -0
- data/app/components/phlex_kit/spinner/spinner.rb +6 -3
- data/app/components/phlex_kit/switch/switch.css +5 -0
- data/app/components/phlex_kit/switch/switch.rb +6 -0
- data/app/components/phlex_kit/table/table.css +2 -1
- data/app/components/phlex_kit/table/table.rb +5 -2
- data/app/components/phlex_kit/tabs/tabs_content.rb +4 -2
- data/app/components/phlex_kit/tabs/tabs_controller.js +8 -2
- data/app/components/phlex_kit/tabs/tabs_list.rb +7 -2
- data/app/components/phlex_kit/tabs/tabs_trigger.rb +11 -2
- data/app/components/phlex_kit/theme_toggle/theme_toggle_controller.js +14 -0
- data/app/components/phlex_kit/toast/toast.css +2 -1
- data/app/components/phlex_kit/toast/toast_action.rb +4 -1
- data/app/components/phlex_kit/toast/toast_close.rb +6 -3
- data/app/components/phlex_kit/toast/toast_controller.js +40 -21
- data/app/components/phlex_kit/toast/toast_item.rb +11 -7
- data/app/components/phlex_kit/toast/toast_region.rb +29 -10
- data/app/components/phlex_kit/toast/toaster_controller.js +17 -7
- data/app/components/phlex_kit/toggle_group/toggle_group.rb +17 -2
- data/app/components/phlex_kit/toggle_group/toggle_group_controller.js +16 -9
- data/app/components/phlex_kit/toggle_group/toggle_group_item.rb +20 -2
- data/app/components/phlex_kit/tooltip/tooltip.css +5 -1
- data/app/components/phlex_kit/tooltip/tooltip_controller.js +7 -1
- data/app/components/phlex_kit/typography/heading.rb +7 -1
- data/app/components/phlex_kit/typography/list.rb +22 -0
- data/app/components/phlex_kit/typography/text.rb +7 -1
- data/app/javascript/phlex_kit/controllers/index.js +2 -0
- data/lib/phlex_kit/base_component.rb +23 -0
- data/lib/phlex_kit/version.rb +1 -1
- data/lib/phlex_kit.rb +1 -0
- metadata +4 -1
|
@@ -24,6 +24,7 @@ import ContextMenuController from "phlex_kit/controllers/context_menu_controller
|
|
|
24
24
|
import DataTableController from "phlex_kit/controllers/data_table_controller"
|
|
25
25
|
import DataTableColumnVisibilityController from "phlex_kit/controllers/data_table_column_visibility_controller"
|
|
26
26
|
import DataTableSearchController from "phlex_kit/controllers/data_table_search_controller"
|
|
27
|
+
import DatePickerController from "phlex_kit/controllers/date_picker_controller"
|
|
27
28
|
import DialogController from "phlex_kit/controllers/dialog_controller"
|
|
28
29
|
import DropdownMenuController from "phlex_kit/controllers/dropdown_menu_controller"
|
|
29
30
|
import FormFieldController from "phlex_kit/controllers/form_field_controller"
|
|
@@ -65,6 +66,7 @@ export function registerPhlexKitControllers(application) {
|
|
|
65
66
|
application.register("phlex-kit--data-table", DataTableController)
|
|
66
67
|
application.register("phlex-kit--data-table-column-visibility", DataTableColumnVisibilityController)
|
|
67
68
|
application.register("phlex-kit--data-table-search", DataTableSearchController)
|
|
69
|
+
application.register("phlex-kit--date-picker", DatePickerController)
|
|
68
70
|
application.register("phlex-kit--dialog", DialogController)
|
|
69
71
|
application.register("phlex-kit--dropdown-menu", DropdownMenuController)
|
|
70
72
|
application.register("phlex-kit--form-field", FormFieldController)
|
|
@@ -30,5 +30,28 @@ module PhlexKit
|
|
|
30
30
|
"valid: #{map.keys.map(&:inspect).join(", ")}"
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
|
+
|
|
34
|
+
# True when the caller supplied an accessible name in @attrs — via the
|
|
35
|
+
# aria: hash or flat aria_label/aria-label(ledby) keys. Components with a
|
|
36
|
+
# generated default label must skip it then: `mix` merges duplicate string
|
|
37
|
+
# attrs ("pagination Résultats") instead of overriding.
|
|
38
|
+
def aria_labelled?
|
|
39
|
+
aria_key_set?(:label) || aria_key_set?(:labelledby)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# True when the caller already supplied their own value for a given aria
|
|
43
|
+
# attribute — via the aria: hash (aria: { <key>: ... }) or the flat
|
|
44
|
+
# "aria-<key>"/aria_<key> spelling. A component with a generated default
|
|
45
|
+
# for that attribute must skip it then: `mix` merges duplicate attrs
|
|
46
|
+
# (aria-modal="true false") instead of overriding.
|
|
47
|
+
def aria_key_set?(key)
|
|
48
|
+
aria = @attrs[:aria] || @attrs["aria"]
|
|
49
|
+
if aria.is_a?(Hash)
|
|
50
|
+
return true if aria.key?(key) || aria.key?(key.to_s)
|
|
51
|
+
end
|
|
52
|
+
dashed = "aria-#{key}"
|
|
53
|
+
underscored = "aria_#{key}"
|
|
54
|
+
[ dashed.to_sym, dashed, underscored.to_sym, underscored ].any? { |k| @attrs[k] }
|
|
55
|
+
end
|
|
33
56
|
end
|
|
34
57
|
end
|
data/lib/phlex_kit/version.rb
CHANGED
data/lib/phlex_kit.rb
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
require "json" # Carousel serializes its options value standalone (no Rails to_json)
|
|
4
4
|
require "securerandom" # DatePicker generates a default input id
|
|
5
5
|
require "cgi" # DataTable sort/pagination build query strings standalone
|
|
6
|
+
require "date" # Phlex 2.4's attribute type-dispatch references Date on every render
|
|
6
7
|
# phlex-rails references ActiveSupport::SafeBuffer at require time; in a Rails
|
|
7
8
|
# app it's already loaded, but a bare `require "phlex_kit"` (script/console)
|
|
8
9
|
# crashes with "uninitialized constant Phlex::ActiveSupport" without these.
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: phlex_kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Kennedy
|
|
@@ -306,6 +306,7 @@ files:
|
|
|
306
306
|
- app/components/phlex_kit/data_table/data_table_toolbar.rb
|
|
307
307
|
- app/components/phlex_kit/date_picker/date_picker.css
|
|
308
308
|
- app/components/phlex_kit/date_picker/date_picker.rb
|
|
309
|
+
- app/components/phlex_kit/date_picker/date_picker_controller.js
|
|
309
310
|
- app/components/phlex_kit/dialog/dialog.css
|
|
310
311
|
- app/components/phlex_kit/dialog/dialog.rb
|
|
311
312
|
- app/components/phlex_kit/dialog/dialog_close.rb
|
|
@@ -373,6 +374,7 @@ files:
|
|
|
373
374
|
- app/components/phlex_kit/hover_card/hover_card_content.rb
|
|
374
375
|
- app/components/phlex_kit/hover_card/hover_card_controller.js
|
|
375
376
|
- app/components/phlex_kit/hover_card/hover_card_trigger.rb
|
|
377
|
+
- app/components/phlex_kit/icon/icon.css
|
|
376
378
|
- app/components/phlex_kit/icon/icon.rb
|
|
377
379
|
- app/components/phlex_kit/input/input.css
|
|
378
380
|
- app/components/phlex_kit/input/input.rb
|
|
@@ -587,6 +589,7 @@ files:
|
|
|
587
589
|
- app/components/phlex_kit/typography/heading.rb
|
|
588
590
|
- app/components/phlex_kit/typography/inline_code.rb
|
|
589
591
|
- app/components/phlex_kit/typography/inline_link.rb
|
|
592
|
+
- app/components/phlex_kit/typography/list.rb
|
|
590
593
|
- app/components/phlex_kit/typography/text.rb
|
|
591
594
|
- app/components/phlex_kit/typography/typography.css
|
|
592
595
|
- app/javascript/phlex_kit/controllers/index.js
|