Module: Cmdk

Extended by:
Phlex::Kit
Defined in:
lib/cmdk.rb,
lib/cmdk/base.rb,
lib/cmdk/item.rb,
lib/cmdk/list.rb,
lib/cmdk/root.rb,
lib/cmdk/empty.rb,
lib/cmdk/group.rb,
lib/cmdk/input.rb,
lib/cmdk/dialog.rb,
lib/cmdk/footer.rb,
lib/cmdk/loading.rb,
lib/cmdk/version.rb,
lib/cmdk/separator.rb

Overview

Phlex port of the cmdk React command menu. Renders the same markup contract (cmdk-* attributes, ARIA roles) as the React package; runtime behavior is provided by assets/js/cmdk.js.

Defined Under Namespace

Classes: Base, Dialog, Empty, Footer, Group, Input, Item, List, Loading, Root, Separator

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.javascript_pathObject

Absolute path to the JS runtime, for serving or copying into asset pipelines.



11
12
13
# File 'lib/cmdk.rb', line 11

def self.javascript_path
  File.expand_path('../assets/js/cmdk.js', __dir__)
end

.stimulus_controller_pathObject

Absolute path to the optional Stimulus base controller (requires @hotwired/stimulus and the runtime pinned/aliased as ‘cmdk`).



24
25
26
# File 'lib/cmdk.rb', line 24

def self.stimulus_controller_path
  File.expand_path('../assets/js/cmdk_controller.js', __dir__)
end

.stylesheet_pathObject

Absolute path to the optional themes stylesheet (cmdk-vercel, cmdk-linear, cmdk-raycast). Plain dependency-free CSS — serve it, copy it, or import it into a Tailwind build.



18
19
20
# File 'lib/cmdk.rb', line 18

def self.stylesheet_path
  File.expand_path('../assets/css/cmdk_themes.css', __dir__)
end