0.8.0 • Published 12 months ago

@thomasrandolph/glaze v0.8.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
12 months ago

Glaze Components

+++++++++++++++++++++++++

Icon

+++++++++++++++++++++++++

Attributes and Properties

NameAttribute (name)PropertyTypeOptionalReason
type✅ (type)StringWhich FontAwesome Classic style to use. Defaults to "solid".
icon✅ (icon)StringWhich icon to display.
sharp✅ (sharp)BooleanWhether to use the FontAwesome Pro Sharp style.
spin✅ (spin)BooleanWhether to spin this icon.
fixedWidth✅ (fixed-width)BooleanWhether to render this icon as a fixed width.
focusable✅ (focusable)BooleanWhether this icon is focusable via keyboard navigation.
title✅ (title)StringAn alternate title to render for accessibility.
transforms✅ (transforms)StringA string of power transforms to apply to this icon.

Note that while icon is technically optional, you will very likely have a very bad time with a blank icon.
Additionally, note that title is an accessibility feature and while it is an optional property, it should be included.

#register

ParameterReasonOptional
definitionsProvide FontAwesome icon definitions for the Icon component to reference

register defines the glaze-icon custom element so it's available to use.

definitions provide a shortcut for registering FontAwesome icon definitions for the Icon component to use.

#addDefinitions

ParameterReasonOptional
definitionsProvide FontAwesome icon definitions for the Icon component to reference

If the component has already been registered with the custom element registry, addDefinitions can update the list of available icons to use at any time.


+++++++++++++++++++++++++

Modal

+++++++++++++++++++++++++

Attributes and Properties

NameAttribute (name)PropertyTypeOptionalReason
show✅ (show)BooleanWhether the modal is visible or not.
label✅ (label)StringA text label to add to the dialog element for accessibility purposes.

Note that label is an accessibility feature and while it is an optional property, it should be included.

#register

register defines the glaze-modal custom element so it's available to use.

Events

NamePayloadWhen
glaze-modal-opennullWhen the show property is changed, and becomes true.
glaze-modal-closenullWhen the show property is changed, and becomes false.

Slots

NameUse
defaultThis is the content that is displayed in the modal body.
closeThis is the content that is displayed in the top right corner of the modal by default.

CSS Parts

NameUse
closeCan be used to target the close button slot that is normally positioned in the top right corner of the modal.

+++++++++++++++++++++++++

Notification

+++++++++++++++++++++++++

Attributes and Properties

NameAttribute (name)PropertyTypeOptionalReason
type✅ (type)StringWhich notification type to display. Options are neutral (equivalent to no type at all), info, okay, attention, and alert.
dismissible✅ (dismissible)BooleanWhether to render the close slot
centered✅ (centered)BooleanWhether to center the text of this notification.
banner✅ (banner)BooleanWhether to display as a banner, which has fixed position and width.
icon✅ (icon)BooleanWhether to render the icon slot
inline✅ (inline)BooleanWhether to display as a very minimal output.

#register

register defines the glaze-notification custom element so it's available to use.

#createBanner

createBanner creates a new Notification component without needing to render it directly into an HTML template.

ParameterReasonOptional
optionsHow and what to render for this Notification

options defaults to:

{
	"type": "neutral",
	"content": undefined,
	"centered": true,
	"dismissible": true,
	"icon": true
}

These options properties map directly to the attributes and properties of the same names, with the exception of content.

options.content is a required property (unless you would like to render an empty banner notification), and is rendered as a direct child of the Notification (e.g. <Notification>${options.content}</Notification>).

Slots

NameUse
iconThis is a left-side slot that could be very useful to render an icon with the notification.
defaultThis is the content that is displayed in the notification body.
closeThis is a right-side slot that could be very useful to render an close icon with the notification to dismiss it.

CSS Parts

NameUse
iconCan be used to target the icon slot if it's rendered.
contentCan be used to target the div that wraps the main content slot.
closeCan be used to target the close slot if it's rendered.

+++++++++++++++++++++++++

Popover

+++++++++++++++++++++++++

Attributes and Properties

NameAttribute (name)PropertyTypeOptionalReason
attachObjectThe DOM element to attach the popover to. Defaults to document.body.
visible✅ (visible)BooleanWhether this popover should be visible or not. Defaults to false.
placement✅ (placement)StringAny of the values defined by floating-ui. For example: right-end.
blurClose✅ (blur-close)BooleanWhether a click outside the component should close the component. Note that the event listener is bound regardless, but only causes behavior when blurClose is true.
considerInside✅ (consider-inside)ArrayA list of additional nodes to ignore when computing whether a click has occurred "outside" the popover. Normally, only the popover and its .attach are considered "inside". This list allows more nodes that will be added to that list.
offsets✅ (offsets)ObjectAn object with the properties skidding and distance. Skidding moves the popover along the edge of the attach element (parallel), while distance moves the popover away from the edge of the attach element (perpendicular). See the axesOffsets of the Offset middleware for more information. Neither value is optional if any value is provided.

#register

register defines the glaze-popover custom element so it's available to use.

Events

NamePayloadWhen
glaze-popover-visibilityBooleanWhen the visible property is changed.

Slots

NameUse
defaultThis is the content that is displayed in the popover.
0.4.12

12 months ago

0.8.0

12 months ago

0.7.0

12 months ago

0.4.11

2 years ago

0.4.10

2 years ago

0.4.9

2 years ago

0.4.8

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.5.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago