Socket
Socket
Sign inDemoInstall

@limetech/mdc-p2-notched-outline

Package Overview
Dependencies
9
Maintainers
5
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @limetech/mdc-p2-notched-outline

The Material Components for the web notched-outline component


Version published
Weekly downloads
0
decreased by-100%
Maintainers
5
Created
Weekly downloads
 

Changelog

Source

4.0.0 (2019-11-02)

Bug Fixes

  • button: Add overflow: visible to button. (#4973) (905e84e)
  • button: Adjust touch target size when density is applied (#5112) (e2506f4)
  • checkbox: Change minimum ripple size of checkbox & switch 24px => 28px (#5140) (3eae309)
  • checkbox: Fix checkbox terminology in sass mixins (#5014) (2161c02)
  • checkbox: Remove RTL styles from checkbox ripple (#5134) (a646516)
  • chips: Ignore selection events in chip set (#4878) (94c6a00)
  • chips: Remove keyCode check (#4966) (e6304c4)
  • chips: Reset touch target when chip density mixin is applied. (#5116) (d3b515e)
  • chips: Stack trailing/leading icons above touch target el (#5040) (048d4b7)
  • chips: Stop emitting events in handlers (#4969) (cfd81dc)
  • data-table: Minor fixes for data table layout (#5037) (37b1f93)
  • fab: Add overflow: hidden; to ripple target to fix bounded ripple. (#5214) (97cbbdc)
  • fab: Use FAB ripple target selector (#5146) (9d91acc)
  • form-field: Fix radio RTL alignment bug. (#5064) (ef99808)
  • linear-progress: Fix indeterminate animation bug (#5180) (062ade5)
  • linear-progress: Prefix animation keyframes to prevent clashing (#5155) (fc0e474)
  • linear-progress: Restore buffer after determinate is toggl… (#5156) (09b1598)
  • linear-progress: Support high contrast mode (#5190) (d4141c9)
  • list: Add #adapter.listItemAtIndexHasClass to prevent user state change to disabled items (#4922) (b6d213c)
  • menu: Vertically center the group icon (#4862) (c5738ed)
  • menu-surface: remove duplicate export from menu-surface (#5200) (0b120ae)
  • radio: Fix touch target margins: 0px => 4px. (#5096) (a48d06e)
  • ripple: Add overflow: hidden; to the bounded ripple mixin (#5173) (996b091)
  • ripple: Always set even num when initial ripple size is ca… (#5141) (b26ad23)
  • ripple: Remove unnecessary overflow: hidden. (#5191) (5916d18)
  • tabs: Fix tab img icon styling. (#5041) (d0e6cd1)
  • text-field: Do not trigger shake animation when text field is empty (#5097) (4913db9)
  • text-field: Fixes input text alignment on IE11 for densed text field (#5136) (892dd4e)
  • text-field: Fixes input text alignment on IE11 for densed… (#5147) (c8f7693)
  • text-field: Updated shape mixins to set density scale (#5207) (719b57e)
  • touch-target: Add class to touch target wrapper. (#5174) (e7799b8)
  • touch-target: Add missing dependency - touch target to com… (#5098) (9306bd0)

Code Refactoring

Features

  • button: Add support for increased touch target to button. (#4948) (1d7a2e6)
  • checkbox: Add disabled state color mixins (#5167) (01628ef)
  • checkbox: Add support for 48px touch target (#5025) (b5685a8)
  • checkbox: Move ripple to child node (#4981) (9712b24)
  • chip: Add density mixin to chip. (#5109) (bdf3430)
  • chips: Add keyboard navigation (#4844) (42065fe), closes #2259
  • chips: Add setSelectedFromChipset method (#4872) (283bd55)
  • chips: Add support for increased touch target to chips. (#4970) (6aa109d)
  • chips: Use index for all chip operations (#4869) (07078bb)
  • density: Add density subsystem to components (#5059) (73a5e4c)
  • dialog: Add dialog mixin for dialogs with increased touch target buttons. (#5024) (2ef1ddd)
  • icon-button: Add density mixin to icon button (#5122) (37d6458)
  • list: Add density mixin to list (#5069) (5132f89)
  • list: Add mixin for disabled text opacity (#4861) (d68f8a7)
  • radio: Add density mixin to radio (#5118) (199534d)
  • radio: Add disabled state color mixins (#5168) (b5c6d66)
  • radio: Add support for 48px touch target (#5032) (87b0a4c)
  • radio: Move ripple to child element (#4983) (100ab37)
  • ripple: Add support for ripple target to mixins. (#4880) (08dbe69)
  • snackbar: Add option for indefinite timeout (#4998) (4f11851)
  • switch: Add density support for switch component. (#5124) (2c793b4), closes #5104
  • switch: add ripple opacity customization mixins (#5126) (8c0273f)
  • tab: Add text transform mixin (#5144) (22d7ad2)
  • tab-bar: Add a mixin to set scroller animation (#5172) (d7c938a)
  • tab-bar: Add density mixin to tab-bar (#5070) (45dc002)
  • tab-scroller: Add incrementScrollImmediate to bypass animation (#5184) (2b878b3), closes #5123
  • tab-scroller: Mixin for scroll transition (#5154) (efda83d)
  • text-field: Add density mixin to text field variants (#5066) (a12101d)
  • text-field: Center align inner elements for dynamic height (#4990) (4d94b22)
  • touch-target: Add touch target mixins. (#4940) (b2e0fea)

BREAKING CHANGES

  • checkbox: mdc-checkbox-ink-color mixin now only applies to enabled checkboxes

  • chips: Chips markup, adapters, foundations, and events have changed.

  • select: In MDCMenu and MDCMenuSurface, hoistMenuToBody adapter method removed. In MDCSelect, HTML structure changed: the select anchor is now wrapped in a parent element, and the anchor's sibling is the select menu. Support for native select removed. Support added for select with no label. MDCSelectAdapter methods removed: getValue, setValue, isMenuOpen, setSelectedIndex, checkValidity, setValid, toggleClassAtIndex. MDCSelectAdapter methods added: hasLabel, getSelectedMenuItem, setSelectedText, isSelectedTextFocused, get/setSelectedTextAttr, getAnchorElement, setMenuAnchorElement, setMenuAnchorCorner, setMenuWrapFocus, set/removeAttributeAtIndex, focusMenuItemAtIndex, getMenuItemValues, getMenuItemCount, getMenuItemCount, getMenuItemAttr, getMenuItemTextAtIndex, add/removeClassAtIndex. MDCSelectFoundation setValue method removed; getDisabled, handleMenuItemAction, getSelectedIndex, get/setRequired, init added.

  • radio: In Checkbox, Renamed sass variables $mdc-radio-touch-area => $mdc-radio-ripple-size & $mdc-radio-ui-size => $mdc-radio-icon-size to be consistent with checkbox. Also, removed $mdc-radio-ui-pct sass variable.

  • switch: Renames switch variables $mdc-switch-tap-target-size => $mdc-switch-ripple-size, removes $mdc-switch-tap-target-initial-position and $mdc-switch-native-control-width.

  • list: New adapter method listItemAtIndexHasClass

  • list: Renamed mixin mdc-list-item-shape-radius() => mdc-list-single-line-shape-radius()

  • linear-progress: MDCLinearProgressAdapter adapter has new forceLayout method

  • text-field: Removed sass variable in notched outline - $mdc-notched-outline-transition-duration.

  • mdc-fab: This changes the structure of the FAB element by moving the ripple from the outer element to an inner mdc-fab__ripple element.

    OLD

    <button class="mdc-fab" aria-label="Favorite">
      <span class="mdc-fab__icon material-icons">favorite</span>
    </button>
    

    NEW

    <button class="mdc-fab" aria-label="Favorite">
      <div class="mdc-fab__ripple"></div>
      <span class="mdc-fab__icon material-icons">favorite</span>
    </button>
    
  • radio: Ripple has been moved to a child element. See readme for updates.

  • slider: remove adapter methods appendTrackMarkers, removeTrackMarkers , setLastTrackMarkersStyleProperty , and add adapter method setTrackMarkers.

  • button: This changes the structure of the button element by moving the ripple from the outer <button> element to an inner mdc-button__ripple element.

    OLD

    <button class="mdc-button">
      <span class="mdc-button__label">Hello World</span>
    </button>
    

    NEW

    <button class="mdc-button">
      <div class="mdc-button__ripple"></div>
      <span class="mdc-button__label">Hello World</span>
    </button>
    
  • chips: MDCChipSetAdapter#removeChip has been replaced with MDCChipSetAdapter#removeChipAtIndex. MDCChipSetAdapter#setSelected has been replaced with MDCChipSetAdapter#selectChipAtIndex

  • density: Renamed sass mixins & variables in MDC Data Table - mdc-data-table-header-row-height => mdc-data-table-header-cell-height & mdc-data-table-row-height => mdc-data-table-cell-height. Also removed mdc-button--dense variant, use button's density mixin instead.

Readme

Source

Notched Outline

The notched outline is a border around all sides of either a Text Field or Select component. This is used for the Outlined variant of either a Text Field or Select.

Design & API Documentation

Installation

npm install @limetech/mdc-p2-notched-outline

Basic Usage

HTML Structure

<div class="mdc-notched-outline">
  <div class="mdc-notched-outline__leading"></div>
  <div class="mdc-notched-outline__notch">
    <label class="mdc-floating-label">Label</label>
  </div>
  <div class="mdc-notched-outline__trailing"></div>
</div>

Note that the MDC Floating Label component is placed inside the notch element when used together with MDC Notched Outline.

See the MDC Text Field and MDC Select documentation for information on using Notched Outline in the context of those components.

Styles

@import "@limetech/mdc-p2-notched-outline/mdc-notched-outline";

JavaScript Instantiation

import {MDCNotchedOutline} from '@limetech/mdc-p2-notched-outline';

const notchedOutline = new MDCNotchedOutline(document.querySelector('.mdc-notched-outline'));

See Importing the JS component for more information on how to import JavaScript.

Style Customization

CSS Classes

CSS ClassDescription
mdc-notched-outlineMandatory. Container for the outline's sides and notch.
mdc-notched-outline--notchedModifier class to open the notched outline.
mdc-notched-outline--no-labelModifier class to use when the floating label is empty or not used.
mdc-notched-outline__leadingMandatory. Element representing the leading side of the notched outline (before the notch).
mdc-notched-outline__notchMandatory. Element representing the notch.
mdc-notched-outline__trailingMandatory. Element representing the trailing side of the notched outline (after the notch).

Sass Mixins

MixinDescription
mdc-notched-outline-color($color)Customizes the border color of the notched outline.
mdc-notched-outline-stroke-width($width)Changes notched outline width to a specified pixel value.
mdc-notched-outline-shape-radius($radius, $rtl-reflexive)Sets the rounded shape to notched outline element with given radius size. Set $rtl-reflexive to true to flip radius values in RTL context, defaults to false.
mdc-notched-outline-floating-label-float-position($positionY, $positionX, $scale)Sets the position and scale of the floating label inside the notched outline.

MDCNotchedOutline Properties and Methods

Method SignatureDescription
notch(notchWidth: number) => voidOpens the notch with the specified width.
closeNotch() => voidCloses the notch, rendering a full outline.

Usage Within Frameworks

If you are using a JavaScript framework, such as React or Angular, you can create a Notched Outline for your framework. Depending on your needs, you can use the Simple Approach: Wrapping MDC Web Vanilla Components, or the Advanced Approach: Using Foundations and Adapters. Please follow the instructions here.

MDCNotchedOutlineAdapter

Method SignatureDescription
addClass(className: string) => voidAdds a class to the notched outline element.
removeClass(className: string) => voidRemoves a class from the notched outline element.
setNotchWidthProperty(width: number) => voidSets the width of the notch in pixels.
removeNotchWidthProperty() => voidRemoves the width property from the notch element.

MDCNotchedOutlineFoundation

Method SignatureDescription
notch(notchWidth: number) => voidAdds the mdc-notched-outline--notched class and updates the notch element's style based on notchWidth.
closeNotch() => voidRemoves the mdc-notched-outline--notched class.

Keywords

FAQs

Last updated on 09 Dec 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc