fernandes-ui 0.1.5 → 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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ui.esm.js +0 -1
- data/app/assets/javascripts/ui.js +0 -1
- data/app/components/ui/slider.rb +80 -0
- data/app/components/ui/slider_range.rb +33 -0
- data/app/components/ui/slider_thumb.rb +47 -0
- data/app/components/ui/slider_track.rb +35 -0
- data/app/javascript/ui/common.js +0 -1
- data/docs/components/ANNOTATIONS.md +220 -0
- data/docs/components/accordion.yml +109 -0
- data/docs/components/alert.yml +47 -0
- data/docs/components/alert_dialog.yml +151 -0
- data/docs/components/aspect_ratio.yml +37 -0
- data/docs/components/avatar.yml +55 -0
- data/docs/components/badge.yml +24 -0
- data/docs/components/breadcrumb.yml +76 -0
- data/docs/components/button.yml +56 -0
- data/docs/components/button_group.yml +67 -0
- data/docs/components/calendar.yml +166 -0
- data/docs/components/card.yml +99 -0
- data/docs/components/carousel.yml +100 -0
- data/docs/components/checkbox.yml +59 -0
- data/docs/components/collapsible.yml +74 -0
- data/docs/components/combobox.yml +21 -0
- data/docs/components/command.yml +144 -0
- data/docs/components/context_menu.yml +124 -0
- data/docs/components/dialog.yml +155 -0
- data/docs/components/drawer.yml +219 -0
- data/docs/components/dropdown_menu.yml +151 -0
- data/docs/components/empty.yml +88 -0
- data/docs/components/field.yml +81 -0
- data/docs/components/hover_card.yml +75 -0
- data/docs/components/input.yml +51 -0
- data/docs/components/input_group.yml +37 -0
- data/docs/components/input_group_addon.yml +24 -0
- data/docs/components/input_group_button.yml +30 -0
- data/docs/components/input_otp.yml +80 -0
- data/docs/components/input_otp_slot.yml +39 -0
- data/docs/components/item.yml +84 -0
- data/docs/components/kbd.yml +26 -0
- data/docs/components/label.yml +26 -0
- data/docs/components/menubar.yml +201 -0
- data/docs/components/menubar_menu.yml +21 -0
- data/docs/components/navigation_menu.yml +161 -0
- data/docs/components/pagination.yml +86 -0
- data/docs/components/popover.yml +105 -0
- data/docs/components/progress.yml +37 -0
- data/docs/components/radio_button.yml +52 -0
- data/docs/components/resizable.yml +44 -0
- data/docs/components/scroll_area.yml +76 -0
- data/docs/components/select.yml +195 -0
- data/docs/components/separator.yml +26 -0
- data/docs/components/sheet.yml +133 -0
- data/docs/components/sidebar.yml +138 -0
- data/docs/components/skeleton.yml +17 -0
- data/docs/components/sonner.yml +46 -0
- data/docs/components/spinner.yml +22 -0
- data/docs/components/switch.yml +72 -0
- data/docs/components/table.yml +32 -0
- data/docs/components/tabs.yml +126 -0
- data/docs/components/textarea.yml +41 -0
- data/docs/components/toggle.yml +92 -0
- data/docs/components/toggle_group.yml +106 -0
- data/docs/components/tooltip.yml +75 -0
- data/lib/ui/version.rb +1 -1
- metadata +61 -1
|
@@ -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
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Context Menu
|
|
3
|
+
slug: context_menu
|
|
4
|
+
category: overlay
|
|
5
|
+
description: ContextMenu - Phlex implementation
|
|
6
|
+
anatomy:
|
|
7
|
+
- name: Context Menu
|
|
8
|
+
description: Container for context menus triggered by right-click.
|
|
9
|
+
required: true
|
|
10
|
+
- name: Content
|
|
11
|
+
description: Menu items container with animations and positioning.
|
|
12
|
+
required: true
|
|
13
|
+
- name: Item
|
|
14
|
+
description: Individual menu item that can be rendered as a link or div.
|
|
15
|
+
required: false
|
|
16
|
+
- name: Label
|
|
17
|
+
description: Non-interactive label for grouping menu items.
|
|
18
|
+
required: false
|
|
19
|
+
- name: Separator
|
|
20
|
+
description: A visual divider between menu items.
|
|
21
|
+
required: false
|
|
22
|
+
- name: Shortcut
|
|
23
|
+
description: Displays keyboard shortcut text for a menu item.
|
|
24
|
+
required: false
|
|
25
|
+
- name: Trigger
|
|
26
|
+
description: The element that triggers the context menu on right-click.
|
|
27
|
+
required: true
|
|
28
|
+
features:
|
|
29
|
+
- Custom styling with Tailwind classes
|
|
30
|
+
- Keyboard navigation with arrow keys
|
|
31
|
+
- Click outside to close
|
|
32
|
+
api:
|
|
33
|
+
Context Menu:
|
|
34
|
+
description: Container for context menus triggered by right-click.
|
|
35
|
+
parameters: []
|
|
36
|
+
data_attributes: []
|
|
37
|
+
css_variables: []
|
|
38
|
+
Content:
|
|
39
|
+
description: Menu items container with animations and positioning.
|
|
40
|
+
parameters: []
|
|
41
|
+
data_attributes: []
|
|
42
|
+
css_variables: []
|
|
43
|
+
Item:
|
|
44
|
+
description: Individual menu item that can be rendered as a link or div.
|
|
45
|
+
parameters:
|
|
46
|
+
- name: href
|
|
47
|
+
type: String
|
|
48
|
+
default: nil
|
|
49
|
+
description: The href
|
|
50
|
+
- name: inset
|
|
51
|
+
type: Boolean
|
|
52
|
+
default: 'false'
|
|
53
|
+
description: The inset
|
|
54
|
+
- name: variant
|
|
55
|
+
type: String
|
|
56
|
+
default: default
|
|
57
|
+
description: Visual style variant
|
|
58
|
+
data_attributes: []
|
|
59
|
+
css_variables: []
|
|
60
|
+
Label:
|
|
61
|
+
description: Non-interactive label for grouping menu items.
|
|
62
|
+
parameters:
|
|
63
|
+
- name: inset
|
|
64
|
+
type: Boolean
|
|
65
|
+
default: 'false'
|
|
66
|
+
description: The inset
|
|
67
|
+
data_attributes: []
|
|
68
|
+
css_variables: []
|
|
69
|
+
Separator:
|
|
70
|
+
description: A visual divider between menu items.
|
|
71
|
+
parameters: []
|
|
72
|
+
data_attributes: []
|
|
73
|
+
css_variables: []
|
|
74
|
+
Shortcut:
|
|
75
|
+
description: Displays keyboard shortcut text for a menu item.
|
|
76
|
+
parameters: []
|
|
77
|
+
data_attributes: []
|
|
78
|
+
css_variables: []
|
|
79
|
+
Trigger:
|
|
80
|
+
description: The element that triggers the context menu on right-click.
|
|
81
|
+
parameters: []
|
|
82
|
+
data_attributes: []
|
|
83
|
+
css_variables: []
|
|
84
|
+
accessibility:
|
|
85
|
+
aria_pattern: Menu
|
|
86
|
+
w3c_reference: https://www.w3.org/WAI/ARIA/apg/patterns/menu/
|
|
87
|
+
description: Implements the WAI-ARIA Menu pattern with proper roles, states, and
|
|
88
|
+
keyboard navigation.
|
|
89
|
+
aria_attributes: []
|
|
90
|
+
keyboard:
|
|
91
|
+
- key: Enter
|
|
92
|
+
description: Activates the focused element
|
|
93
|
+
- key: Escape
|
|
94
|
+
description: Closes the component
|
|
95
|
+
- key: ArrowDown
|
|
96
|
+
description: Moves focus to next item
|
|
97
|
+
- key: ArrowUp
|
|
98
|
+
description: Moves focus to previous item
|
|
99
|
+
- key: Home
|
|
100
|
+
description: Moves focus to first item
|
|
101
|
+
- key: End
|
|
102
|
+
description: Moves focus to last item
|
|
103
|
+
javascript:
|
|
104
|
+
controller: ui--context-menu
|
|
105
|
+
targets:
|
|
106
|
+
- trigger
|
|
107
|
+
- content
|
|
108
|
+
- item
|
|
109
|
+
values:
|
|
110
|
+
- name: open
|
|
111
|
+
type: Boolean
|
|
112
|
+
description: Controls open state
|
|
113
|
+
actions:
|
|
114
|
+
- open
|
|
115
|
+
- close
|
|
116
|
+
- closeAllContextMenus
|
|
117
|
+
- teardownKeyboardNavigation
|
|
118
|
+
- findCurrentItemIndex
|
|
119
|
+
- trackHoveredItem
|
|
120
|
+
- positionContextMenu
|
|
121
|
+
events: []
|
|
122
|
+
related:
|
|
123
|
+
- dropdown_menu
|
|
124
|
+
- menubar
|