Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 60 additions & 53 deletions etc/lime-elements.api.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/components/action-bar/action-bar.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';
import { MenuItem } from '../menu/menu.types';

/**
Expand All @@ -16,7 +16,7 @@ export type ActionBarItem<T = any> =
*/
export interface ActionBarItemOnlyIcon<T> extends MenuItem<T> {
iconOnly: true;
icon: string | Icon;
icon: IconName | Icon;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/components/banner/banner.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, h, Method, Prop, State } from '@stencil/core';
import { IconName } from '../../global/shared-types/icon.types';

/**
* @exampleComponent limel-example-banner
Expand All @@ -20,7 +21,7 @@ export class Banner {
* Set icon for the banner
*/
@Prop({ reflect: true })
public icon: string;
public icon: IconName;

@State()
private isOpen = false;
Expand Down
6 changes: 3 additions & 3 deletions src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
makeEnterClickable,
removeEnterClickable,
} from '../../util/make-enter-clickable';
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';
import { getIconName, getIconTitle } from '../icon/get-icon-props';

/**
Expand Down Expand Up @@ -47,7 +47,7 @@ export class Button {
* Set icon for the button
*/
@Prop({ reflect: true })
public icon: string | Icon;
public icon: IconName | Icon;

/**
* Set to `true` to disable the button.
Expand Down Expand Up @@ -149,7 +149,7 @@ export class Button {
];
}

private renderIcon(icon?: string | Icon) {
private renderIcon(icon?: IconName | Icon) {
const iconName = getIconName(icon);
if (!iconName) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/components/card/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
State,
} from '@stencil/core';
import { Image } from '../../global/shared-types/image.types';
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';
import { isItem } from '../action-bar/is-item';
import { getIconName } from '../icon/get-icon-props';
import { ListSeparator } from '../../global/shared-types/separator.types';
Expand Down Expand Up @@ -62,7 +62,7 @@ export class Card {
* An icon, to display along with the heading and subheading.
*/
@Prop({ reflect: true })
public icon?: string | Icon;
public icon?: IconName | Icon;

/**
* The content of the card.
Expand Down
3 changes: 2 additions & 1 deletion src/components/chip-set/chip-set.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { getHref, getTarget } from '../../util/link-helper';
import { isEqual } from 'lodash-es';
import { LimelChipCustomEvent } from '../../components';
import { createRandomString } from '../../util/random-string';
import { IconName } from '../../global/shared-types/icon.types';

/**
* :::note
Expand Down Expand Up @@ -169,7 +170,7 @@ export class ChipSet {
* Leading icon to show to the far left in the text field
*/
@Prop({ reflect: true })
public leadingIcon: string = null;
public leadingIcon: IconName = null;

/**
* For chip-set of type `input`. Sets delimiters between chips.
Expand Down
4 changes: 2 additions & 2 deletions src/components/chip-set/chip.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Image } from '../../global/shared-types/image.types';
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';
import { MenuItem } from '../menu/menu.types';
import { ListSeparator } from '../list-item/list-item.types';
import { Color } from '../../global/shared-types/color.types';
Expand All @@ -21,7 +21,7 @@ export interface Chip<T = any> {
/**
* Name of the icon to use. Not valid for `filter`.
*/
icon?: string | Icon;
icon?: IconName | Icon;

/**
* A picture to be displayed instead of the icon on the chip.
Expand Down
4 changes: 2 additions & 2 deletions src/components/chip/chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Host,
Prop,
} from '@stencil/core';
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';
import { Languages } from '../date-picker/date.types';
import { Link } from '../../global/shared-types/link.types';
import { getRel } from '../../util/link-helper';
Expand Down Expand Up @@ -106,7 +106,7 @@ export class Chip implements ChipInterface {
* Icon of the chip.
*/
@Prop()
public icon?: string | Icon;
public icon?: IconName | Icon;

/**
* A picture to be displayed instead of the icon on the chip.
Expand Down
4 changes: 2 additions & 2 deletions src/components/collapsible-section/collapsible-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
removeEnterClickable,
} from '../../util/make-enter-clickable';
import { createRandomString } from '../../util/random-string';
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';
import {
getIconColor,
getIconName,
Expand Down Expand Up @@ -65,7 +65,7 @@ export class CollapsibleSection {
* Icon to display in the header of the section
*/
@Prop()
public icon?: string | Icon;
public icon?: IconName | Icon;

/**
* `true` if the section is invalid, `false` if valid.
Expand Down
4 changes: 2 additions & 2 deletions src/components/dialog/dialog.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';

/**
* @public
Expand All @@ -7,7 +7,7 @@ export interface DialogHeading {
title: string;
subtitle?: string;
supportingText?: string;
icon?: string | Icon;
icon?: IconName | Icon;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/components/dock/dock.types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { IconName } from '../../global/shared-types/icon.types';

/**
* @public
*/
Expand All @@ -15,7 +17,7 @@ export interface DockItem {
/**
* Name of the icon to use.
*/
icon: string;
icon: IconName;

/**
* Additional helper text for the dock item.
Expand Down
4 changes: 2 additions & 2 deletions src/components/dynamic-label/dynamic-label.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getIconName } from '../icon/get-icon-props';
import { Component, Prop, h } from '@stencil/core';
import { Label, LabelValue } from './label.types';
import { Icon } from '../../interface';
import { Icon, IconName } from '../../global/shared-types/icon.types';

/**
* This components displays a different label depending on the current given
Expand Down Expand Up @@ -59,7 +59,7 @@ export class DynamicLabel {
];
}

private renderIcon(icon?: string | Icon) {
private renderIcon(icon?: IconName | Icon) {
const iconName = getIconName(icon);
if (!iconName) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/components/dynamic-label/label.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Icon } from '../../interface';
import { IconName, Icon } from '../../interface';

export type LabelValue = string | number | boolean | null | undefined;

Expand All @@ -22,5 +22,5 @@ export interface Label<T = LabelValue> {
/**
* Icon to display when the label is active
*/
icon?: string | Icon;
icon?: IconName | Icon;
}
4 changes: 2 additions & 2 deletions src/components/header/header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, h, Prop, Host } from '@stencil/core';
import { Icon } from '../../global/shared-types/icon.types';
import { IconName, Icon } from '../../global/shared-types/icon.types';
import { getIconName } from '../icon/get-icon-props';

/**
Expand Down Expand Up @@ -64,7 +64,7 @@ export class Header {
* Icon to display
*/
@Prop()
public icon?: string | Icon;
public icon?: IconName | Icon;

/**
* Title to display
Expand Down
4 changes: 2 additions & 2 deletions src/components/icon-button/icon-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
removeEnterClickable,
} from '../../util/make-enter-clickable';
import { createRandomString } from '../../util/random-string';
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';
import { getIconName, getIconTitle } from '../icon/get-icon-props';

/**
Expand All @@ -25,7 +25,7 @@ export class IconButton {
* The icon to display.
*/
@Prop()
public icon: string | Icon;
public icon: IconName | Icon;

/**
* Set to `true` to give the button our standard "elevated" look, lifting
Expand Down
9 changes: 5 additions & 4 deletions src/components/input-field/input-field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { JSXBase } from '@stencil/core/internal';
import { createRandomString } from '../../util/random-string';
import { LimelListCustomEvent } from '../../components';
import { globalConfig } from '../../global/config';
import { IconName } from '../../global/shared-types/icon.types';

interface LinkProperties {
href: string;
Expand Down Expand Up @@ -134,13 +135,13 @@ export class InputField {
* Trailing icon to show to the far right in the field.
*/
@Prop({ reflect: true })
public trailingIcon: string;
public trailingIcon: IconName;

/**
* Leading icon to show to the far left in the field.
*/
@Prop({ reflect: true })
public leadingIcon: string;
public leadingIcon: IconName;

/**
* Regular expression that the current value of the input field must match.
Expand Down Expand Up @@ -757,7 +758,7 @@ export class InputField {
return props;
};

private renderLinkIcon = (linkProps: LinkProperties, icon: string) => {
private renderLinkIcon = (linkProps: LinkProperties, icon: IconName) => {
// If the trailing icon uses the class `mdc-text-field__icon--trailing`,
// MDC attaches a click handler to it, which apparently runs
// `preventDefault()` on the event. For links, we don't want that,
Expand All @@ -775,7 +776,7 @@ export class InputField {
);
};

private renderTrailingIcon = (icon: string) => {
private renderTrailingIcon = (icon: IconName) => {
if (this.isInvalid()) {
return (
<i
Expand Down
4 changes: 2 additions & 2 deletions src/components/list-item/list-item.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ListSeparator } from '../../global/shared-types/separator.types';
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';
import { MenuItem } from '../menu/menu.types';
import { Image } from '../../global/shared-types/image.types';
import { Color } from '../../global/shared-types/color.types';
Expand Down Expand Up @@ -27,7 +27,7 @@ export interface ListItem<T = any> {
/**
* Icon of the list item.
*/
icon?: string | Icon;
icon?: IconName | Icon;

/**
* Background color of the icon. Overrides `--icon-background-color`.
Expand Down
4 changes: 2 additions & 2 deletions src/components/menu/menu.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ListSeparator } from '../../global/shared-types/separator.types';
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';
import { Color } from '../../global/shared-types/color.types';

/**
Expand Down Expand Up @@ -79,7 +79,7 @@ export interface MenuItem<T = any> {
/**
* Name of the icon to use.
*/
icon?: string | Icon;
icon?: IconName | Icon;

/**
* Background color of the icon. Overrides `--icon-background-color`.
Expand Down
3 changes: 2 additions & 1 deletion src/components/picker/picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
import { getIconFillColor, getIconName } from '../icon/get-icon-props';
import { PickerValue } from './value.types';
import { DebouncedFunc, debounce } from 'lodash-es';
import { IconName } from '../../global/shared-types/icon.types';

const SEARCH_DEBOUNCE = 300;
const CHIP_SET_TAG_NAME = 'limel-chip-set';
Expand Down Expand Up @@ -81,7 +82,7 @@ export class Picker {
* Leading icon to show to the far left in the text field
*/
@Prop()
public leadingIcon: string;
public leadingIcon: IconName;

/**
* A message to display when the search returned an empty result
Expand Down
4 changes: 2 additions & 2 deletions src/components/profile-picture/profile-picture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@stencil/core';
import { FileInfo } from '../../global/shared-types/file.types';
import { isTypeAccepted } from '../../util/files';
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';
import { getIconName } from '../icon/get-icon-props';
import translate from '../../global/translations';
import { Languages } from '../date-picker/date.types';
Expand Down Expand Up @@ -60,7 +60,7 @@ export class ProfilePicture {
* Placeholder icon of the component, displayed when no image is present.
*/
@Prop()
public icon: string | Icon = 'user';
public icon: IconName | Icon = 'user';

/**
* Helper text shown as a tooltip on hover or focus.
Expand Down
4 changes: 2 additions & 2 deletions src/components/select/option.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Color } from '../../global/shared-types/color.types';
import { Icon } from '../../global/shared-types/icon.types';
import { Icon, IconName } from '../../global/shared-types/icon.types';
/**
* Describes an option for limel-select.
* @public
Expand Down Expand Up @@ -37,7 +37,7 @@ export interface Option<T extends string = string> {
/**
* Displays an icon beside the name of the option.
*/
icon?: string | Icon;
icon?: IconName | Icon;

/**
* Adds a color to the icon.
Expand Down
3 changes: 2 additions & 1 deletion src/components/shortcut/shortcut.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, Prop, h, Element, Host } from '@stencil/core';
import { Link } from '../../global/shared-types/link.types';
import { getRel } from '../../util/link-helper';
import { getMouseEventHandlers } from '../../util/3d-tilt-hover-effect';
import { IconName } from '../../global/shared-types/icon.types';

/**
* This component can be used on places such as a start page or a dashboard.
Expand All @@ -28,7 +29,7 @@ export class Shortcut {
* Name of icon for the shortcut.
*/
@Prop({ reflect: true })
public icon: string;
public icon: IconName;

/**
* The text to show below the shortcut. Long label will be truncated.
Expand Down
3 changes: 2 additions & 1 deletion src/components/split-button/split-button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, Event, EventEmitter, Host, h, Prop } from '@stencil/core';
import { ListSeparator } from '../list-item/list-item.types';
import { MenuItem } from '../menu/menu.types';
import { IconName } from '../../global/shared-types/icon.types';

/**
* A split button is a button with two components:
Expand Down Expand Up @@ -41,7 +42,7 @@ export class SplitButton {
* Set icon for the button
*/
@Prop({ reflect: true })
public icon: string;
public icon: IconName;

/**
* Set to `true` to disable the button.
Expand Down
Loading
Loading