Module: Spark

Defined in:
lib/fleetio_spark/helper.rb,
app/components/spark/card.rb,
app/components/spark/grid.rb,
app/components/spark/icon.rb,
app/components/spark/page.rb,
app/components/spark/badge.rb,
app/components/spark/block.rb,
app/components/spark/table.rb,
app/components/spark/banner.rb,
app/components/spark/button.rb,
app/components/spark/header.rb,
app/components/spark/tooltip.rb,
app/helpers/spark/tag_helper.rb,
app/components/spark/nav/item.rb,
app/components/spark/nav/tabs.rb,
app/components/spark/nav/tree.rb,
app/helpers/spark/icon_helper.rb,
app/helpers/spark/menu_helper.rb,
app/components/spark/checklist.rb,
app/components/spark/nav/group.rb,
app/components/spark/table/row.rb,
app/helpers/spark/image_helper.rb,
app/helpers/spark/input_helper.rb,
app/helpers/spark/modal_helper.rb,
app/helpers/spark/trial_helper.rb,
app/components/spark/blankslate.rb,
app/components/spark/input/base.rb,
app/components/spark/nav/toggle.rb,
app/components/spark/table/cell.rb,
app/helpers/spark/search_helper.rb,
app/components/spark/grid/column.rb,
app/components/spark/input/label.rb,
app/components/spark/media_block.rb,
app/components/spark/menu_button.rb,
app/components/spark/nav/sidebar.rb,
app/components/spark/placeholder.rb,
app/components/spark/widget_card.rb,
app/components/spark/button/group.rb,
app/components/spark/input/switch.rb,
app/components/spark/sticky_panel.rb,
app/components/spark/table/detail.rb,
app/components/spark/table/object.rb,
app/components/spark/trial_notice.rb,
app/helpers/spark/nav_menu_helper.rb,
app/components/spark/checklist/item.rb,
app/components/spark/component/base.rb,
app/components/spark/input/checkbox.rb,
app/components/spark/nav/tab_panels.rb,
app/components/spark/nav/tree/group.rb,
app/helpers/spark/application_helper.rb,
app/components/spark/checklist/trigger.rb,
app/components/spark/embed/wistia_media.rb,
app/components/spark/checklist/container.rb

Defined Under Namespace

Modules: ApplicationHelper, Component, Embed, Helpers, IconHelper, ImageHelper, Input, InputHelper, MenuHelper, ModalHelper, Nav, NavMenuHelper, SearchHelper, TagHelper, TrialHelper Classes: Badge, Banner, Blankslate, Block, Button, Card, Checklist, Grid, Header, Helper, Icon, MediaBlock, MenuButton, Page, Placeholder, StickyPanel, Table, Tooltip, TrialNotice, WidgetCard

Constant Summary collapse

DEFAULT_DATA_KEYS =
%w(toggle show hide show-menu show-panel show-dialog stack stack-nav)
DEFAULT_ARIA_KEYS =
%w(haspopup expanded)
INPUT_OPTIONS =
{
  email: {
    type: "email",
    placeholder: "Email address",
    pattern: "[^@]+@[^@]+\\.[a-zA-Z]{2,}",
    autocorrect: "off",
    autocapitalize: "off",
    spellcheck: "false",
    data: { message: "Please enter a valid email address." }
  },

  password: {
    type: "password",
    placeholder: "Password"
  },

  text: {
    type: "text"
  },

  search: {
    autocorrect: "off",
    role: "search",
    type: "text"
  },

  number: {
    type: "number",
    step: "any"
  },

  tel: {
    type: "tel",
    placeholder: "Phone number"
  },

  url: {
    type: "text",
    placeholder: "Web address",
    autocorrect: "off",
    autocapitalize: "off",
    spellcheck: "false",
    pattern: ".+\\.[a-zA-Z]{2,}"
  },

  card_number: {
    type: "text",
    required: true,
    pattern: "[0-9 -]{13,20}",
    placeholder: "Credit Card Number",
    data: {
      stripe: "number",
      message: "Please enter a valid credit card number."
    }
  },

  card_month: {
    type: "text",
    required: true,
    pattern: "0[1-9]|1[012]",
    placeholder: "MM",
    data: {
      stripe: "exp_month",
      message: "Please enter a valid expiration month."
    }
  },

  card_year: {
    type: "text",
    required: true,
    pattern: "[0-9]{4}",
    placeholder: "YYYY",
    data: {
      stripe: "exp_year",
      message: "Please enter a valid expiration year."
    }
  },

  card_cvc: {
    type: "text",
    required: true,
    pattern: "[0-9]{3,4}",
    placeholder: "CVC",
    data: {
      stripe: "cvc",
      message: "Please enter a valid security code."
    }
  }
}