-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add MaskedInput component * Update ruby ui version
- Loading branch information
Showing
6 changed files
with
66 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# frozen_string_literal: true | ||
|
||
class Docs::MaskedInputView < ApplicationView | ||
def view_template | ||
component = "MaskedInput" | ||
|
||
div(class: "max-w-2xl mx-auto w-full py-10 space-y-10") do | ||
render Docs::Header.new(title: "MaskedInput", description: "Displays a form input field with applied mask.") | ||
|
||
Heading(level: 2) { "Usage" } | ||
|
||
Text do | ||
plain "For advanced usage, check out the " | ||
InlineLink(href: "https://beholdr.github.io/maska/v3", target: "_blank") { "Maska website" } | ||
plain "." | ||
end | ||
|
||
render Docs::VisualCodeExample.new(title: "Phone number", context: self) do | ||
<<~RUBY | ||
div(class: 'grid w-full max-w-sm items-center gap-1.5') do | ||
MaskedInput(data: {maska: "(##) #####-####"}) | ||
end | ||
RUBY | ||
end | ||
|
||
render Docs::VisualCodeExample.new(title: "Hex color code", context: self) do | ||
<<~RUBY | ||
div(class: 'grid w-full max-w-sm items-center gap-1.5') do | ||
MaskedInput(data: {maska: "!#HHHHHH", maska_tokens: "H:[0-9a-fA-F]"}) | ||
end | ||
RUBY | ||
end | ||
|
||
render Docs::VisualCodeExample.new(title: "CPF / CNPJ", context: self) do | ||
<<~RUBY | ||
div(class: 'grid w-full max-w-sm items-center gap-1.5') do | ||
MaskedInput(data: {maska: "['###.###.###-##', '##.###.###/####-##']"}) | ||
end | ||
RUBY | ||
end | ||
|
||
render Docs::ComponentsTable.new(component_references(component, Docs::VisualCodeExample.collected_code), component_files(component)) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters