fernandes-ui 0.1.4 → 0.1.6

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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ui.esm.js +0 -1
  3. data/app/assets/javascripts/ui.js +0 -1
  4. data/app/behaviors/ui/button_behavior.rb +7 -5
  5. data/app/behaviors/ui/button_group_behavior.rb +6 -4
  6. data/app/behaviors/ui/input_group_button_behavior.rb +5 -3
  7. data/app/components/ui/slider.rb +80 -0
  8. data/app/components/ui/slider_range.rb +33 -0
  9. data/app/components/ui/slider_thumb.rb +47 -0
  10. data/app/components/ui/slider_track.rb +35 -0
  11. data/app/javascript/ui/common.js +0 -1
  12. data/app/views/ui/_item.html.erb +6 -1
  13. data/app/views/ui/field/_label.html.erb +2 -1
  14. data/app/views/ui/field/_separator.html.erb +7 -1
  15. data/docs/components/ANNOTATIONS.md +220 -0
  16. data/docs/components/accordion.yml +109 -0
  17. data/docs/components/alert.yml +47 -0
  18. data/docs/components/alert_dialog.yml +151 -0
  19. data/docs/components/aspect_ratio.yml +37 -0
  20. data/docs/components/avatar.yml +55 -0
  21. data/docs/components/badge.yml +24 -0
  22. data/docs/components/breadcrumb.yml +76 -0
  23. data/docs/components/button.yml +56 -0
  24. data/docs/components/button_group.yml +67 -0
  25. data/docs/components/calendar.yml +166 -0
  26. data/docs/components/card.yml +99 -0
  27. data/docs/components/carousel.yml +100 -0
  28. data/docs/components/checkbox.yml +59 -0
  29. data/docs/components/collapsible.yml +74 -0
  30. data/docs/components/combobox.yml +21 -0
  31. data/docs/components/command.yml +144 -0
  32. data/docs/components/context_menu.yml +124 -0
  33. data/docs/components/dialog.yml +155 -0
  34. data/docs/components/drawer.yml +219 -0
  35. data/docs/components/dropdown_menu.yml +151 -0
  36. data/docs/components/empty.yml +88 -0
  37. data/docs/components/field.yml +81 -0
  38. data/docs/components/hover_card.yml +75 -0
  39. data/docs/components/input.yml +51 -0
  40. data/docs/components/input_group.yml +37 -0
  41. data/docs/components/input_group_addon.yml +24 -0
  42. data/docs/components/input_group_button.yml +30 -0
  43. data/docs/components/input_otp.yml +80 -0
  44. data/docs/components/input_otp_slot.yml +39 -0
  45. data/docs/components/item.yml +84 -0
  46. data/docs/components/kbd.yml +26 -0
  47. data/docs/components/label.yml +26 -0
  48. data/docs/components/menubar.yml +201 -0
  49. data/docs/components/menubar_menu.yml +21 -0
  50. data/docs/components/navigation_menu.yml +161 -0
  51. data/docs/components/pagination.yml +86 -0
  52. data/docs/components/popover.yml +105 -0
  53. data/docs/components/progress.yml +37 -0
  54. data/docs/components/radio_button.yml +52 -0
  55. data/docs/components/resizable.yml +44 -0
  56. data/docs/components/scroll_area.yml +76 -0
  57. data/docs/components/select.yml +195 -0
  58. data/docs/components/separator.yml +26 -0
  59. data/docs/components/sheet.yml +133 -0
  60. data/docs/components/sidebar.yml +138 -0
  61. data/docs/components/skeleton.yml +17 -0
  62. data/docs/components/sonner.yml +46 -0
  63. data/docs/components/spinner.yml +22 -0
  64. data/docs/components/switch.yml +72 -0
  65. data/docs/components/table.yml +32 -0
  66. data/docs/components/tabs.yml +126 -0
  67. data/docs/components/textarea.yml +41 -0
  68. data/docs/components/toggle.yml +92 -0
  69. data/docs/components/toggle_group.yml +106 -0
  70. data/docs/components/tooltip.yml +75 -0
  71. data/lib/ui/version.rb +1 -1
  72. metadata +61 -1
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: Calendar
3
+ slug: calendar
4
+ category: forms
5
+ description: Calendar component (Phlex) A date picker calendar with support for single,
6
+ range, and multiple selection
7
+ anatomy:
8
+ - name: Calendar
9
+ description: Root container for calendar
10
+ required: true
11
+ features:
12
+ - Keyboard navigation
13
+ - Form integration
14
+ - Disabled state support
15
+ - ARIA attributes for accessibility
16
+ - Keyboard navigation with arrow keys
17
+ - Click outside to close
18
+ - Animation support
19
+ api:
20
+ Calendar:
21
+ description: ''
22
+ parameters:
23
+ - name: mode
24
+ type: Symbol
25
+ default: ":single"
26
+ description: The mode
27
+ - name: selected
28
+ type: String
29
+ default: nil
30
+ description: The selected
31
+ - name: month
32
+ type: String
33
+ default: Date.today
34
+ description: The month
35
+ - name: number_of_months
36
+ type: Integer
37
+ default: '1'
38
+ description: The number of months
39
+ - name: week_starts_on
40
+ type: Integer
41
+ default: '0'
42
+ description: The week starts on
43
+ - name: locale
44
+ type: String
45
+ default: en-US
46
+ description: The locale
47
+ - name: min_date
48
+ type: String
49
+ default: nil
50
+ description: The min date
51
+ - name: max_date
52
+ type: String
53
+ default: nil
54
+ description: The max date
55
+ - name: disabled_dates
56
+ type: Array
57
+ default: "[]"
58
+ description: The disabled dates
59
+ - name: show_outside_days
60
+ type: Boolean
61
+ default: 'true'
62
+ description: The show outside days
63
+ - name: fixed_weeks
64
+ type: Boolean
65
+ default: 'false'
66
+ description: The fixed weeks
67
+ - name: show_dropdowns
68
+ type: Boolean
69
+ default: 'false'
70
+ description: The show dropdowns
71
+ - name: year_range
72
+ type: Integer
73
+ default: '100'
74
+ description: The year range
75
+ - name: min_range_days
76
+ type: Integer
77
+ default: '0'
78
+ description: The min range days
79
+ - name: max_range_days
80
+ type: Integer
81
+ default: '0'
82
+ description: The max range days
83
+ - name: exclude_disabled
84
+ type: Boolean
85
+ default: 'false'
86
+ description: The exclude disabled
87
+ - name: use_native_select
88
+ type: Boolean
89
+ default: 'true'
90
+ description: The use native select
91
+ - name: name
92
+ type: String
93
+ default: nil
94
+ description: Form field name
95
+ data_attributes: []
96
+ css_variables: []
97
+ keyboard:
98
+ - key: Enter
99
+ description: Activates the focused element
100
+ - key: Space
101
+ description: Activates the focused element
102
+ - key: ArrowDown
103
+ description: Moves focus to next item
104
+ - key: ArrowUp
105
+ description: Moves focus to previous item
106
+ - key: ArrowLeft
107
+ description: Moves focus left or decreases value
108
+ - key: ArrowRight
109
+ description: Moves focus right or increases value
110
+ - key: Home
111
+ description: Moves focus to first item
112
+ - key: End
113
+ description: Moves focus to last item
114
+ - key: PageUp
115
+ description: Moves focus up by page
116
+ - key: PageDown
117
+ description: Moves focus down by page
118
+ javascript:
119
+ controller: ui--calendar
120
+ targets:
121
+ - grid
122
+ - monthLabel
123
+ - input
124
+ - monthSelect
125
+ - yearSelect
126
+ - liveRegion
127
+ - weekdaysHeader
128
+ - monthContainer
129
+ values:
130
+ - name: mode
131
+ type: String
132
+ description: The mode
133
+ actions:
134
+ - initializeLocale
135
+ - previousMonth
136
+ - nextMonth
137
+ - previousYear
138
+ - nextYear
139
+ - goToMonth
140
+ - goToYear
141
+ - goToToday
142
+ - dispatchMonthChange
143
+ - announceMonthChange
144
+ - announceSelection
145
+ - selectDate
146
+ - selectRange
147
+ - hasDisabledDatesInRange
148
+ - toggleDate
149
+ - isInRangePreview
150
+ - isRangePreviewStart
151
+ - isRangePreviewEnd
152
+ - animateMonthTransition
153
+ - isSelected
154
+ - isDisabled
155
+ - isInRange
156
+ - isRangeStart
157
+ - isRangeEnd
158
+ - moveFocus
159
+ - selectFocusedDate
160
+ - restoreFocus
161
+ - navigateAndFocus
162
+ - moveToStartOfWeek
163
+ - moveToEndOfWeek
164
+ events: []
165
+ related:
166
+ - date_picker
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: Card
3
+ slug: card
4
+ category: layout
5
+ description: A container component for displaying content in a structured, visually distinct box with optional header, footer, and actions.
6
+ anatomy:
7
+ - name: Card
8
+ description: Root container for card with border, shadow, and background styling.
9
+ required: true
10
+ - name: Header
11
+ description: Header section containing title, description, and optional actions.
12
+ required: false
13
+ - name: Title
14
+ description: The main title text element within the header.
15
+ required: false
16
+ - name: Description
17
+ description: Secondary descriptive text element within the header.
18
+ required: false
19
+ - name: Action
20
+ description: Container for action buttons positioned in the header.
21
+ required: false
22
+ - name: Content
23
+ description: Main content area of the card.
24
+ required: true
25
+ - name: Footer
26
+ description: Footer section typically containing action buttons.
27
+ required: false
28
+ features:
29
+ - Custom styling with Tailwind classes
30
+ - Flexible layout with header, content, and footer sections
31
+ - Action button support in header
32
+ - Responsive grid layout in header
33
+ - Border separator support for header and footer
34
+ api:
35
+ Card:
36
+ description: Root container for card with border, shadow, and background styling.
37
+ parameters: []
38
+ data_attributes:
39
+ - name: data-slot
40
+ value: card
41
+ description: Identifies this element as a card container
42
+ css_variables: []
43
+ Header:
44
+ description: Header section with grid layout that automatically adjusts when actions are present.
45
+ parameters: []
46
+ data_attributes:
47
+ - name: data-slot
48
+ value: card-header
49
+ description: Identifies this element as a card header
50
+ css_variables: []
51
+ Title:
52
+ description: The main title text element with semibold font styling.
53
+ parameters: []
54
+ data_attributes:
55
+ - name: data-slot
56
+ value: card-title
57
+ description: Identifies this element as a card title
58
+ css_variables: []
59
+ Description:
60
+ description: Secondary descriptive text with muted foreground color.
61
+ parameters: []
62
+ data_attributes:
63
+ - name: data-slot
64
+ value: card-description
65
+ description: Identifies this element as a card description
66
+ css_variables: []
67
+ Action:
68
+ description: Container for action buttons, positioned at top-right of header using CSS grid.
69
+ parameters: []
70
+ data_attributes:
71
+ - name: data-slot
72
+ value: card-action
73
+ description: Identifies this element as a card action container
74
+ css_variables: []
75
+ Content:
76
+ description: Main content area with horizontal padding.
77
+ parameters: []
78
+ data_attributes:
79
+ - name: data-slot
80
+ value: card-content
81
+ description: Identifies this element as the card content area
82
+ css_variables: []
83
+ Footer:
84
+ description: Footer section with flexbox layout for action buttons.
85
+ parameters: []
86
+ data_attributes:
87
+ - name: data-slot
88
+ value: card-footer
89
+ description: Identifies this element as a card footer
90
+ css_variables: []
91
+ accessibility:
92
+ aria_pattern: Landmark
93
+ w3c_reference: https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/
94
+ description: Card is a presentational container. Use appropriate semantic elements within (headings, paragraphs, buttons) for accessibility.
95
+ aria_attributes: []
96
+ related:
97
+ - dialog
98
+ - sheet
99
+ - alert
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: Carousel
3
+ slug: carousel
4
+ category: data
5
+ anatomy:
6
+ - name: Carousel
7
+ description: Root container with state management
8
+ required: true
9
+ - name: Content
10
+ description: Main content container
11
+ required: true
12
+ - name: Item
13
+ description: Individual item element
14
+ required: false
15
+ - name: Next
16
+ description: Navigate to next item
17
+ required: false
18
+ - name: Previous
19
+ description: Navigate to previous item
20
+ required: false
21
+ features:
22
+ - Custom styling with Tailwind classes
23
+ - ARIA attributes for accessibility
24
+ - Keyboard navigation with arrow keys
25
+ api:
26
+ Carousel:
27
+ description: ''
28
+ parameters:
29
+ - name: orientation
30
+ type: String
31
+ default: horizontal
32
+ description: Orientation (horizontal or vertical)
33
+ - name: opts
34
+ type: Hash
35
+ default: "{}"
36
+ description: The opts
37
+ - name: plugins
38
+ type: String
39
+ default: nil
40
+ description: The plugins
41
+ data_attributes: []
42
+ css_variables: []
43
+ Content:
44
+ description: ''
45
+ parameters: []
46
+ data_attributes: []
47
+ css_variables: []
48
+ Item:
49
+ description: ''
50
+ parameters: []
51
+ data_attributes: []
52
+ css_variables: []
53
+ Next:
54
+ description: ''
55
+ parameters: []
56
+ data_attributes: []
57
+ css_variables: []
58
+ Previous:
59
+ description: ''
60
+ parameters: []
61
+ data_attributes: []
62
+ css_variables: []
63
+ accessibility:
64
+ aria_pattern: Carousel
65
+ w3c_reference: https://www.w3.org/WAI/ARIA/apg/patterns/carousel/
66
+ description: Implements the WAI-ARIA Carousel pattern with proper roles, states,
67
+ and keyboard navigation.
68
+ aria_attributes:
69
+ - aria-roledescription
70
+ - role="region"
71
+ keyboard:
72
+ - key: ArrowDown
73
+ description: Moves focus to next item
74
+ - key: ArrowUp
75
+ description: Moves focus to previous item
76
+ - key: ArrowLeft
77
+ description: Moves focus left or decreases value
78
+ - key: ArrowRight
79
+ description: Moves focus right or increases value
80
+ javascript:
81
+ controller: ui--carousel
82
+ targets:
83
+ - viewport
84
+ - prevButton
85
+ - nextButton
86
+ - container
87
+ values:
88
+ - name: orientation
89
+ type: String
90
+ description: Layout orientation
91
+ actions:
92
+ - initializeCarousel
93
+ - buildPlugins
94
+ - applyOrientationClasses
95
+ - keydown
96
+ events:
97
+ - name: carousel:init
98
+ description: Fired when carousel init
99
+ related:
100
+ - scroll_area
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: Checkbox
3
+ slug: checkbox
4
+ category: forms
5
+ anatomy:
6
+ - name: Checkbox
7
+ description: Root checkbox element
8
+ required: true
9
+ features:
10
+ - Custom styling with Tailwind classes
11
+ - Disabled state support
12
+ - ARIA attributes for accessibility
13
+ api:
14
+ Checkbox:
15
+ description: ''
16
+ parameters:
17
+ - name: name
18
+ type: String
19
+ default: nil
20
+ description: Form field name
21
+ - name: id
22
+ type: String
23
+ default: nil
24
+ description: HTML id attribute
25
+ - name: value
26
+ type: String
27
+ default: nil
28
+ description: The current value
29
+ - name: checked
30
+ type: Boolean
31
+ default: 'false'
32
+ description: Whether the element is checked
33
+ - name: disabled
34
+ type: Boolean
35
+ default: 'false'
36
+ description: Whether the element is disabled
37
+ - name: required
38
+ type: Boolean
39
+ default: 'false'
40
+ description: The required
41
+ data_attributes: []
42
+ css_variables: []
43
+ accessibility:
44
+ aria_pattern: Checkbox
45
+ w3c_reference: https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/
46
+ description: Implements the WAI-ARIA Checkbox pattern with proper roles, states,
47
+ and keyboard navigation.
48
+ aria_attributes:
49
+ - aria-checked
50
+ javascript:
51
+ controller: ui--checkbox
52
+ targets: []
53
+ values: []
54
+ actions: []
55
+ events: []
56
+ related:
57
+ - switch
58
+ - toggle
59
+ - radio_button
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: Collapsible
3
+ slug: collapsible
4
+ category: data
5
+ anatomy:
6
+ - name: Collapsible
7
+ description: Root container with state management
8
+ required: true
9
+ - name: Content
10
+ description: Main content container
11
+ required: true
12
+ - name: Trigger
13
+ description: Button or element that activates the component
14
+ required: true
15
+ features:
16
+ - Custom styling with Tailwind classes
17
+ - Disabled state support
18
+ - Animation support
19
+ api:
20
+ Collapsible:
21
+ description: ''
22
+ parameters:
23
+ - name: open
24
+ type: Boolean
25
+ default: 'false'
26
+ description: Whether the element is open
27
+ - name: disabled
28
+ type: Boolean
29
+ default: 'false'
30
+ description: Whether the element is disabled
31
+ - name: as_child
32
+ type: Boolean
33
+ default: 'false'
34
+ description: When true, yields attributes to block instead of rendering wrapper
35
+ data_attributes: []
36
+ css_variables: []
37
+ Content:
38
+ description: ''
39
+ parameters:
40
+ - name: force_mount
41
+ type: Boolean
42
+ default: 'false'
43
+ description: The force mount
44
+ data_attributes: []
45
+ css_variables: []
46
+ Trigger:
47
+ description: ''
48
+ parameters:
49
+ - name: as_child
50
+ type: Boolean
51
+ default: 'false'
52
+ description: When true, yields attributes to block instead of rendering wrapper
53
+ data_attributes: []
54
+ css_variables: []
55
+ accessibility:
56
+ aria_pattern: Disclosure
57
+ w3c_reference: https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
58
+ description: Implements the WAI-ARIA Disclosure pattern with proper roles, states,
59
+ and keyboard navigation.
60
+ aria_attributes: []
61
+ javascript:
62
+ controller: ui--collapsible
63
+ targets:
64
+ - trigger
65
+ - content
66
+ values:
67
+ - name: open
68
+ type: Boolean
69
+ description: Controls open state
70
+ actions:
71
+ - toggle
72
+ events: []
73
+ related:
74
+ - accordion
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: Combobox
3
+ slug: combobox
4
+ category: other
5
+ description: Wrapper - Phlex implementation
6
+ anatomy:
7
+ - name: Combobox Wrapper
8
+ description: Wrapper component that yields combobox attributes to be spread into
9
+ a container component.
10
+ required: true
11
+ api:
12
+ Combobox Wrapper:
13
+ description: Wrapper component that yields combobox attributes to be spread into
14
+ a container component.
15
+ parameters:
16
+ - name: value
17
+ type: String
18
+ default: ''
19
+ description: The current value
20
+ data_attributes: []
21
+ css_variables: []
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: Command
3
+ slug: command
4
+ category: data
5
+ anatomy:
6
+ - name: Command
7
+ description: Root container for command palette
8
+ required: true
9
+ - name: Empty
10
+ description: Content shown when no items
11
+ required: false
12
+ - name: Group
13
+ description: Container for grouping related items
14
+ required: false
15
+ - name: Input
16
+ description: Text input field
17
+ required: false
18
+ - name: Item
19
+ description: Individual item element
20
+ required: false
21
+ - name: List
22
+ description: Container for list items
23
+ required: false
24
+ - name: Separator
25
+ description: Visual divider between sections
26
+ required: false
27
+ - name: Shortcut
28
+ description: Keyboard shortcut indicator
29
+ required: false
30
+ features:
31
+ - Custom styling with Tailwind classes
32
+ - Keyboard navigation with arrow keys
33
+ api:
34
+ Command:
35
+ description: ''
36
+ parameters:
37
+ - name: loop
38
+ type: Boolean
39
+ default: 'true'
40
+ description: Whether keyboard navigation loops from last to first item
41
+ - name: autofocus
42
+ type: Boolean
43
+ default: 'false'
44
+ description: Whether to focus the input when the command opens (set to true in CommandDialog)
45
+ data_attributes: []
46
+ css_variables: []
47
+ Empty:
48
+ description: ''
49
+ parameters: []
50
+ data_attributes: []
51
+ css_variables: []
52
+ Group:
53
+ description: ''
54
+ parameters:
55
+ - name: heading
56
+ type: String
57
+ default: nil
58
+ description: The heading
59
+ data_attributes: []
60
+ css_variables: []
61
+ Input:
62
+ description: ''
63
+ parameters:
64
+ - name: placeholder
65
+ type: String
66
+ default: Type a command or search...
67
+ description: Placeholder text when no value is selected
68
+ data_attributes: []
69
+ css_variables: []
70
+ Item:
71
+ description: ''
72
+ parameters:
73
+ - name: value
74
+ type: String
75
+ default: nil
76
+ description: The current value
77
+ - name: disabled
78
+ type: Boolean
79
+ default: 'false'
80
+ description: Whether the element is disabled
81
+ data_attributes: []
82
+ css_variables: []
83
+ List:
84
+ description: ''
85
+ parameters: []
86
+ data_attributes: []
87
+ css_variables: []
88
+ Separator:
89
+ description: ''
90
+ parameters: []
91
+ data_attributes: []
92
+ css_variables: []
93
+ Shortcut:
94
+ description: ''
95
+ parameters: []
96
+ data_attributes: []
97
+ css_variables: []
98
+ accessibility:
99
+ aria_pattern: Listbox
100
+ w3c_reference: https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
101
+ description: Implements the WAI-ARIA Listbox pattern with proper roles, states,
102
+ and keyboard navigation.
103
+ aria_attributes: []
104
+ keyboard:
105
+ - key: Enter
106
+ description: Activates the focused element
107
+ - key: ArrowDown
108
+ description: Moves focus to next item
109
+ - key: ArrowUp
110
+ description: Moves focus to previous item
111
+ - key: Home
112
+ description: Moves focus to first item
113
+ - key: End
114
+ description: Moves focus to last item
115
+ javascript:
116
+ controller: ui--command
117
+ targets:
118
+ - input
119
+ - list
120
+ - item
121
+ - group
122
+ - empty
123
+ values:
124
+ - name: loop
125
+ type: Boolean
126
+ description: Whether keyboard navigation loops from last to first item
127
+ - name: autofocus
128
+ type: Boolean
129
+ description: Whether to focus the input when the command opens
130
+ actions:
131
+ - filter
132
+ - selectNext
133
+ - selectPrevious
134
+ - selectFirst
135
+ - selectLast
136
+ - selectCurrent
137
+ - select
138
+ - triggerSelect
139
+ events:
140
+ - name: command:select
141
+ description: Fired when command select
142
+ related:
143
+ - combobox
144
+ - dialog