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,88 @@
1
+ ---
2
+ name: Empty
3
+ slug: empty
4
+ category: data
5
+ description: Displays empty states in applications with customizable media, titles, descriptions, and actions.
6
+ anatomy:
7
+ - name: Empty
8
+ description: Root container for empty state display with centered layout and dashed border.
9
+ required: true
10
+ - name: Header
11
+ description: Wraps the media, title, and description elements with proper spacing and alignment.
12
+ required: false
13
+ - name: Media
14
+ description: Displays visual content like icons, images, or avatars.
15
+ required: false
16
+ - name: Title
17
+ description: Displays the main heading text of the empty state.
18
+ required: false
19
+ - name: Description
20
+ description: Displays secondary text explaining the empty state or providing guidance.
21
+ required: false
22
+ - name: Content
23
+ description: Container for action elements such as buttons, links, or inputs.
24
+ required: false
25
+ features:
26
+ - Custom styling with Tailwind classes
27
+ - Flexible composition with optional sub-components
28
+ - Icon variant for media with background styling
29
+ - Centered layout with responsive padding
30
+ api:
31
+ Empty:
32
+ description: Root container that provides centered flexbox layout with dashed border styling.
33
+ parameters: []
34
+ data_attributes:
35
+ - name: data-slot
36
+ value: '"empty"'
37
+ description: Identifies the empty state container
38
+ css_variables: []
39
+ Header:
40
+ description: Groups media, title, and description with centered alignment and consistent spacing.
41
+ parameters: []
42
+ data_attributes:
43
+ - name: data-slot
44
+ value: '"empty-header"'
45
+ description: Identifies the header container
46
+ css_variables: []
47
+ Media:
48
+ description: Container for visual content with optional icon variant styling.
49
+ parameters:
50
+ - name: variant
51
+ type: String
52
+ default: '"default"'
53
+ description: Visual style variant ("default" for transparent background, "icon" for muted background with rounded corners)
54
+ data_attributes:
55
+ - name: data-slot
56
+ value: '"empty-media"'
57
+ description: Identifies the media container
58
+ css_variables: []
59
+ Title:
60
+ description: Renders an h3 heading element with semibold font styling.
61
+ parameters: []
62
+ data_attributes:
63
+ - name: data-slot
64
+ value: '"empty-title"'
65
+ description: Identifies the title element
66
+ css_variables: []
67
+ Description:
68
+ description: Renders a paragraph element with muted text color for secondary information.
69
+ parameters: []
70
+ data_attributes:
71
+ - name: data-slot
72
+ value: '"empty-description"'
73
+ description: Identifies the description element
74
+ css_variables: []
75
+ Content:
76
+ description: Container for action elements like buttons or links placed below the header.
77
+ parameters: []
78
+ data_attributes:
79
+ - name: data-slot
80
+ value: '"empty-content"'
81
+ description: Identifies the content container
82
+ css_variables: []
83
+ accessibility:
84
+ description: Empty states should provide clear, descriptive text to help users understand why content is missing and what actions they can take.
85
+ aria_attributes: []
86
+ related:
87
+ - card
88
+ - alert
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: Field
3
+ slug: field
4
+ category: forms
5
+ description: Field - Phlex implementation
6
+ anatomy:
7
+ - name: Field
8
+ description: Core wrapper for a single form field with support for different orientations.
9
+ required: true
10
+ - name: Content
11
+ description: Flex column that groups control and descriptions.
12
+ required: true
13
+ - name: Description
14
+ description: Helper text for form fields.
15
+ required: false
16
+ - name: Group
17
+ description: Layout wrapper that stacks Field components.
18
+ required: false
19
+ - name: Label
20
+ description: Label styled for form fields with disability states.
21
+ required: false
22
+ - name: Separator
23
+ description: Visual divider to separate sections inside FieldGroup.
24
+ required: false
25
+ - name: Title
26
+ description: Title with label styling inside FieldContent.
27
+ required: false
28
+ features:
29
+ - Custom styling with Tailwind classes
30
+ - Form integration
31
+ api:
32
+ Field:
33
+ description: Core wrapper for a single form field with support for different orientations.
34
+ parameters:
35
+ - name: orientation
36
+ type: String
37
+ default: vertical
38
+ description: Orientation (horizontal or vertical)
39
+ - name: data_invalid
40
+ type: String
41
+ default: nil
42
+ description: The data invalid
43
+ data_attributes: []
44
+ css_variables: []
45
+ Content:
46
+ description: Flex column that groups control and descriptions.
47
+ parameters: []
48
+ data_attributes: []
49
+ css_variables: []
50
+ Description:
51
+ description: Helper text for form fields.
52
+ parameters: []
53
+ data_attributes: []
54
+ css_variables: []
55
+ Group:
56
+ description: Layout wrapper that stacks Field components.
57
+ parameters: []
58
+ data_attributes: []
59
+ css_variables: []
60
+ Label:
61
+ description: Label styled for form fields with disability states.
62
+ parameters:
63
+ - name: for_id
64
+ type: String
65
+ default: nil
66
+ description: The for id
67
+ data_attributes: []
68
+ css_variables: []
69
+ Separator:
70
+ description: Visual divider to separate sections inside FieldGroup.
71
+ parameters: []
72
+ data_attributes: []
73
+ css_variables: []
74
+ Title:
75
+ description: Title with label styling inside FieldContent.
76
+ parameters: []
77
+ data_attributes: []
78
+ css_variables: []
79
+ related:
80
+ - input
81
+ - label
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: Hover Card
3
+ slug: hover_card
4
+ category: overlay
5
+ description: HoverCard - Phlex implementation
6
+ anatomy:
7
+ - name: Hover Card
8
+ description: Container for hover card trigger and content.
9
+ required: true
10
+ - name: Content
11
+ description: The content that appears on hover.
12
+ required: true
13
+ - name: Trigger
14
+ description: Element that triggers the hover card on hover.
15
+ required: true
16
+ features:
17
+ - Custom styling with Tailwind classes
18
+ api:
19
+ Hover Card:
20
+ description: Container for hover card trigger and content.
21
+ parameters: []
22
+ data_attributes: []
23
+ css_variables: []
24
+ Content:
25
+ description: The content that appears on hover.
26
+ parameters:
27
+ - name: align
28
+ type: String
29
+ default: center
30
+ description: Alignment within container
31
+ - name: side_offset
32
+ type: Integer
33
+ default: '4'
34
+ description: The side offset
35
+ data_attributes: []
36
+ css_variables: []
37
+ Trigger:
38
+ description: Element that triggers the hover card on hover.
39
+ parameters:
40
+ - name: as_child
41
+ type: Boolean
42
+ default: 'false'
43
+ description: When true, yields attributes to block instead of rendering wrapper
44
+ - name: tag
45
+ type: Symbol
46
+ default: ":span"
47
+ description: The tag
48
+ data_attributes: []
49
+ css_variables: []
50
+ accessibility:
51
+ aria_pattern: Tooltip
52
+ w3c_reference: https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/
53
+ description: Implements the WAI-ARIA Tooltip pattern with proper roles, states,
54
+ and keyboard navigation.
55
+ aria_attributes: []
56
+ javascript:
57
+ controller: ui--hover-card
58
+ targets:
59
+ - trigger
60
+ - content
61
+ values:
62
+ - name: open
63
+ type: Boolean
64
+ description: Controls open state
65
+ actions:
66
+ - show
67
+ - hide
68
+ - keepOpen
69
+ - scheduleHide
70
+ - clearTimeouts
71
+ - positionContent
72
+ events: []
73
+ related:
74
+ - popover
75
+ - tooltip
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: Input
3
+ slug: input
4
+ category: forms
5
+ anatomy:
6
+ - name: Input
7
+ description: Text input field
8
+ required: true
9
+ - name: Group
10
+ description: A wrapper component for grouping inputs with addons, buttons, and text.
11
+ required: false
12
+ features:
13
+ - Custom styling with Tailwind classes
14
+ - Form integration
15
+ - Disabled state support
16
+ - ARIA attributes for accessibility
17
+ api:
18
+ Input:
19
+ description: ''
20
+ parameters:
21
+ - name: type
22
+ type: String
23
+ default: text
24
+ description: The type
25
+ - name: placeholder
26
+ type: String
27
+ default: nil
28
+ description: Placeholder text when no value is selected
29
+ - name: value
30
+ type: String
31
+ default: nil
32
+ description: The current value
33
+ - name: name
34
+ type: String
35
+ default: nil
36
+ description: Form field name
37
+ - name: id
38
+ type: String
39
+ default: nil
40
+ description: HTML id attribute
41
+ data_attributes: []
42
+ css_variables: []
43
+ Group:
44
+ description: Shared behavior for InputGroup component across ERB, ViewComponent,
45
+ and Phlex implementations.
46
+ parameters: []
47
+ data_attributes: []
48
+ css_variables: []
49
+ related:
50
+ - textarea
51
+ - field
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: Input Group
3
+ slug: input_group
4
+ category: other
5
+ description: Textarea - Phlex implementation
6
+ anatomy:
7
+ - name: Input Group Textarea
8
+ description: A textarea element styled for use within input groups.
9
+ required: true
10
+ features:
11
+ - Custom styling with Tailwind classes
12
+ api:
13
+ Input Group Textarea:
14
+ description: A textarea element styled for use within input groups.
15
+ parameters:
16
+ - name: placeholder
17
+ type: String
18
+ default: nil
19
+ description: Placeholder text when no value is selected
20
+ - name: value
21
+ type: String
22
+ default: nil
23
+ description: The current value
24
+ - name: name
25
+ type: String
26
+ default: nil
27
+ description: Form field name
28
+ - name: id
29
+ type: String
30
+ default: nil
31
+ description: HTML id attribute
32
+ - name: rows
33
+ type: String
34
+ default: nil
35
+ description: The rows
36
+ data_attributes: []
37
+ css_variables: []
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: Input Group Addon
3
+ slug: input_group_addon
4
+ category: other
5
+ description: Addon - Phlex implementation
6
+ anatomy:
7
+ - name: Input Group Addon
8
+ description: An addon element for input groups that can contain text, icons, or
9
+ other elements.
10
+ required: true
11
+ features:
12
+ - Custom styling with Tailwind classes
13
+ - Disabled state support
14
+ api:
15
+ Input Group Addon:
16
+ description: An addon element for input groups that can contain text, icons, or
17
+ other elements.
18
+ parameters:
19
+ - name: align
20
+ type: String
21
+ default: inline-start
22
+ description: Alignment within container
23
+ data_attributes: []
24
+ css_variables: []
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: Input Group Button
3
+ slug: input_group_button
4
+ category: other
5
+ description: Button - Phlex implementation
6
+ anatomy:
7
+ - name: Input Group Button
8
+ description: A button component specifically styled for use within input groups.
9
+ required: true
10
+ features:
11
+ - Custom styling with Tailwind classes
12
+ - Disabled state support
13
+ api:
14
+ Input Group Button:
15
+ description: A button component specifically styled for use within input groups.
16
+ parameters:
17
+ - name: size
18
+ type: String
19
+ default: xs
20
+ description: Size of the element
21
+ - name: variant
22
+ type: String
23
+ default: ghost
24
+ description: Visual style variant
25
+ - name: type
26
+ type: String
27
+ default: button
28
+ description: The type
29
+ data_attributes: []
30
+ css_variables: []
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: Input OTP
3
+ slug: input_otp
4
+ category: forms
5
+ description: InputOtp - Phlex implementation
6
+ anatomy:
7
+ - name: Input OTP
8
+ description: Accessible one-time password container component.
9
+ required: true
10
+ - name: Group
11
+ description: Container for grouping OTP input slots together visually.
12
+ required: false
13
+ - name: Separator
14
+ description: Visual divider between OTP input groups.
15
+ required: false
16
+ features:
17
+ - Custom styling with Tailwind classes
18
+ - Disabled state support
19
+ api:
20
+ Input OTP:
21
+ description: Accessible one-time password container component.
22
+ parameters:
23
+ - name: length
24
+ type: Integer
25
+ default: '6'
26
+ description: The length
27
+ - name: pattern
28
+ type: String
29
+ default: "\\\\d"
30
+ description: The pattern
31
+ - name: name
32
+ type: String
33
+ default: nil
34
+ description: Form field name
35
+ - name: id
36
+ type: String
37
+ default: nil
38
+ description: HTML id attribute
39
+ - name: disabled
40
+ type: Boolean
41
+ default: 'false'
42
+ description: Whether the element is disabled
43
+ data_attributes: []
44
+ css_variables: []
45
+ Group:
46
+ description: Container for grouping OTP input slots together visually.
47
+ parameters: []
48
+ data_attributes: []
49
+ css_variables: []
50
+ Separator:
51
+ description: Visual divider between OTP input groups.
52
+ parameters: []
53
+ data_attributes: []
54
+ css_variables: []
55
+ keyboard:
56
+ - key: ArrowLeft
57
+ description: Moves focus left or decreases value
58
+ - key: ArrowRight
59
+ description: Moves focus right or increases value
60
+ - key: Home
61
+ description: Moves focus to first item
62
+ - key: End
63
+ description: Moves focus to last item
64
+ javascript:
65
+ controller: ui--input-otp
66
+ targets:
67
+ - input
68
+ values:
69
+ - name: length
70
+ type: Number
71
+ description: The length
72
+ actions:
73
+ - input
74
+ - keydown
75
+ - paste
76
+ - checkComplete
77
+ - clear
78
+ events:
79
+ - name: inputotp:complete
80
+ description: Fired when inputotp complete
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: Input OTP Slot
3
+ slug: input_otp_slot
4
+ category: other
5
+ description: Slot - Phlex implementation
6
+ anatomy:
7
+ - name: Input OTP Slot
8
+ description: Individual OTP input slot for a single character.
9
+ required: true
10
+ features:
11
+ - Keyboard navigation
12
+ - Custom styling with Tailwind classes
13
+ - Disabled state support
14
+ api:
15
+ Input OTP Slot:
16
+ description: Individual OTP input slot for a single character.
17
+ parameters:
18
+ - name: index
19
+ type: Integer
20
+ default: '0'
21
+ description: The index
22
+ - name: value
23
+ type: String
24
+ default: ''
25
+ description: The current value
26
+ - name: name
27
+ type: String
28
+ default: nil
29
+ description: Form field name
30
+ - name: id
31
+ type: String
32
+ default: nil
33
+ description: HTML id attribute
34
+ - name: disabled
35
+ type: Boolean
36
+ default: 'false'
37
+ description: Whether the element is disabled
38
+ data_attributes: []
39
+ css_variables: []
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: Item
3
+ slug: item
4
+ category: data
5
+ anatomy:
6
+ - name: Item
7
+ description: Individual item element
8
+ required: true
9
+ - name: Content
10
+ description: Main content container
11
+ required: true
12
+ - name: Description
13
+ description: Descriptive text element
14
+ required: false
15
+ - name: Footer
16
+ description: Footer section with actions
17
+ required: false
18
+ - name: Group
19
+ description: Container for grouping related items
20
+ required: false
21
+ - name: Header
22
+ description: Header section with title and controls
23
+ required: false
24
+ - name: Separator
25
+ description: Visual divider between sections
26
+ required: false
27
+ - name: Title
28
+ description: Title text element
29
+ required: false
30
+ features:
31
+ - Custom styling with Tailwind classes
32
+ api:
33
+ Item:
34
+ description: ''
35
+ parameters:
36
+ - name: variant
37
+ type: String
38
+ default: default
39
+ description: Visual style variant
40
+ - name: size
41
+ type: String
42
+ default: default
43
+ description: Size of the element
44
+ - name: as_child
45
+ type: Boolean
46
+ default: 'false'
47
+ description: When true, yields attributes to block instead of rendering wrapper
48
+ data_attributes: []
49
+ css_variables: []
50
+ Content:
51
+ description: ''
52
+ parameters: []
53
+ data_attributes: []
54
+ css_variables: []
55
+ Description:
56
+ description: ''
57
+ parameters: []
58
+ data_attributes: []
59
+ css_variables: []
60
+ Footer:
61
+ description: ''
62
+ parameters: []
63
+ data_attributes: []
64
+ css_variables: []
65
+ Group:
66
+ description: ''
67
+ parameters: []
68
+ data_attributes: []
69
+ css_variables: []
70
+ Header:
71
+ description: ''
72
+ parameters: []
73
+ data_attributes: []
74
+ css_variables: []
75
+ Separator:
76
+ description: ''
77
+ parameters: []
78
+ data_attributes: []
79
+ css_variables: []
80
+ Title:
81
+ description: ''
82
+ parameters: []
83
+ data_attributes: []
84
+ css_variables: []
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: Kbd
3
+ slug: kbd
4
+ category: data
5
+ description: Kbd - Phlex implementation
6
+ anatomy:
7
+ - name: Kbd
8
+ description: Displays textual user input from keyboard, helping users understand
9
+ required: true
10
+ - name: Group
11
+ description: Groups multiple keyboard keys together with consistent spacing.
12
+ required: false
13
+ features:
14
+ - Keyboard navigation
15
+ - Custom styling with Tailwind classes
16
+ api:
17
+ Kbd:
18
+ description: Displays textual user input from keyboard, helping users understand
19
+ parameters: []
20
+ data_attributes: []
21
+ css_variables: []
22
+ Group:
23
+ description: Groups multiple keyboard keys together with consistent spacing.
24
+ parameters: []
25
+ data_attributes: []
26
+ css_variables: []
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: Label
3
+ slug: label
4
+ category: forms
5
+ description: Label - Phlex implementation
6
+ anatomy:
7
+ - name: Label
8
+ description: Accessible label for form inputs following shadcn/ui design patterns.
9
+ required: true
10
+ features:
11
+ - Custom styling with Tailwind classes
12
+ - Form integration
13
+ - Disabled state support
14
+ api:
15
+ Label:
16
+ description: Accessible label for form inputs following shadcn/ui design patterns.
17
+ parameters:
18
+ - name: for_id
19
+ type: String
20
+ default: nil
21
+ description: The for id
22
+ data_attributes: []
23
+ css_variables: []
24
+ related:
25
+ - field
26
+ - input