/* eslint-disable */ /* tslint:disable */ /** * This is an autogenerated file created by the Stencil compiler. * It contains typing information for all components that exist in this project. */ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime"; import { Color, ControlValidity, ControlValidityEventDetail, StyleEventDetail, TextFieldTypes } from "./types/shared"; import { AlgoliaSearchResultDetail, FilterChangeEventDetail, IndexResult, PageChangeEventDetail, SearchIndex } from "./components/algolia/algolia-interface"; import { StorageMethods } from "./utils/store/component-store"; import { AnimationEasing, AnimationName } from "./components/animation/animation-interface"; import { Breadcrumb } from "./components/breadcrumb/breadcrumb"; import { CheckboxChangeEventDetail } from "./components/checkbox/checkbox-interface"; import { TableTypes } from "./components/data-table/table-interface"; import { Dropdown, Dropdown as DropdownInterface } from "./components/dropdown/dropdown"; import { OptionInterface } from "./components/option/option-interface"; import { DateInputChangeEventDetail, DuetLocalizedText, LocalDateOpts } from "./components/date-input/date-input-interface"; import { DaysOfWeek } from "./utils/date-utils"; import { DateDisabledPredicate, PickerChangeEvent } from "./components/date-picker/date-picker-interface"; import { DuetLocalizedText as DuetLocalizedText1 } from "./components/date-picker/duet-date-picker/date-localization"; import { PopoverPlacement } from "./utils/popover"; import { Element, EventEmitter } from "./stencil-public-runtime"; import { ObservableMap } from "@stencil/store"; import { NanoFormEles, PlainFormEles, ValidationState, ValidatorValueStore } from "./components/field-validator/field-validator-interface"; import { FileInputChangeEventDetail, FileWithUrl } from "./components/file-upload/file-upload-interface"; import { AlgoliaNetworkError, MyAccountData } from "./components/global-nav/global-nav-interface"; import { NanoDatePicker } from "./components/date-picker/date-picker"; import { InputChangeEventDetail } from "./components/input/input-interface"; import { InputOtpChangeEventDetail, InputOtpCompleteEventDetail, InputOtpInputEventDetail } from "./components/input-otp/input-otp-interface.js"; import { NavItemEventDetail } from "./components/nav-item/nav-item-interface"; import { RangeChangeEventDetail, RangeValue } from "./components/range/range-interface"; import { ResizeStateChangeEventDetail } from "./components/resize-observe/resize-observe-interface"; import { SelectChangeEventDetail } from "./components/select/select-interface"; import { DragEvent, Flickity, FlickityOptions, SlideAnimation } from "./components/slides/slides-interface"; export { Color, ControlValidity, ControlValidityEventDetail, StyleEventDetail, TextFieldTypes } from "./types/shared"; export { AlgoliaSearchResultDetail, FilterChangeEventDetail, IndexResult, PageChangeEventDetail, SearchIndex } from "./components/algolia/algolia-interface"; export { StorageMethods } from "./utils/store/component-store"; export { AnimationEasing, AnimationName } from "./components/animation/animation-interface"; export { Breadcrumb } from "./components/breadcrumb/breadcrumb"; export { CheckboxChangeEventDetail } from "./components/checkbox/checkbox-interface"; export { TableTypes } from "./components/data-table/table-interface"; export { Dropdown, Dropdown as DropdownInterface } from "./components/dropdown/dropdown"; export { OptionInterface } from "./components/option/option-interface"; export { DateInputChangeEventDetail, DuetLocalizedText, LocalDateOpts } from "./components/date-input/date-input-interface"; export { DaysOfWeek } from "./utils/date-utils"; export { DateDisabledPredicate, PickerChangeEvent } from "./components/date-picker/date-picker-interface"; export { DuetLocalizedText as DuetLocalizedText1 } from "./components/date-picker/duet-date-picker/date-localization"; export { PopoverPlacement } from "./utils/popover"; export { Element, EventEmitter } from "./stencil-public-runtime"; export { ObservableMap } from "@stencil/store"; export { NanoFormEles, PlainFormEles, ValidationState, ValidatorValueStore } from "./components/field-validator/field-validator-interface"; export { FileInputChangeEventDetail, FileWithUrl } from "./components/file-upload/file-upload-interface"; export { AlgoliaNetworkError, MyAccountData } from "./components/global-nav/global-nav-interface"; export { NanoDatePicker } from "./components/date-picker/date-picker"; export { InputChangeEventDetail } from "./components/input/input-interface"; export { InputOtpChangeEventDetail, InputOtpCompleteEventDetail, InputOtpInputEventDetail } from "./components/input-otp/input-otp-interface.js"; export { NavItemEventDetail } from "./components/nav-item/nav-item-interface"; export { RangeChangeEventDetail, RangeValue } from "./components/range/range-interface"; export { ResizeStateChangeEventDetail } from "./components/resize-observe/resize-observe-interface"; export { SelectChangeEventDetail } from "./components/select/select-interface"; export { DragEvent, Flickity, FlickityOptions, SlideAnimation } from "./components/slides/slides-interface"; export namespace Components { /** * Groups multiple details elements together, allowing only one to be open at a time. * @version 1.0 * @status stable */ interface NanoAccordion { /** * Force one details element to always be open * @default false */ "alwaysOpen": boolean; } /** * Alerts are used to display important messages either inline, as toast notifications or as modals requiring action. * @status stable * @version 2.0.0 */ interface NanoAlert { /** * Displays the alert as a dialog / modal - more akin to a traditional js alert(). * @param label a label for assistive technology */ "alert": (label: string) => Promise; /** * Set to true to make the alert closable. * @default false */ "closable": boolean; /** * The color to use from the application's color palette. * @deprecated Use `theme` instead. */ "color"?: Color; /** * Enables a countdown that indicates the remaining time the alert will be displayed. Typically used to indicate the remaining time before a whole app refresh. * @default true */ "countdown"?: boolean; /** * The length of time, in milliseconds, the alert will show before closing itself. If the user interacts with the alert before it closes (e.g. moves the mouse over it), the timer will restart. * @default Infinity */ "duration": number; /** * Hides the alert * @returns a promise that resolves after the alert is hidden */ "hide": () => Promise; /** * Relocate the dialog to the root of the DOM. Most useful in conjunction with `alert()` when parental elements have css stacking constraints which don't allow for `position: fixed` * @default false */ "hoist": boolean; /** * Indicates whether or not the alert is open. You can use this in lieu of the show/hide methods. * @default false */ "open": boolean; /** * Shows the alert. * @returns a promise that resolves after the alert is shown */ "show": () => Promise; /** * The color to use from the application's color palette. */ "theme"?: Color; /** * Displays the alert as a toast notification. This will move the alert out of its position in the DOM and, when dismissed, it will be removed from the DOM completely. By storing a reference to the alert, you can reuse it by calling this method again. The returned promise will resolve after the alert is hidden. * @param position options are tr (top-right - default), tl (top-left), br (bottom-right), bl (bottom-left) * @returns a promise which will resolve after the alert has hidden */ "toast": (position?: "tr" | "tl" | "bl" | "br") => Promise; } /** * Algolia search container to contain and sync nano-algolia-results and nano-algolia-filter components. */ interface NanoAlgolia { /** * An Algolia API Key. Used in conjunction with 'searchIndex' & 'appId'. */ "apiKey": string; /** * An Algolia App ID key. Used in conjunction with 'searchIndex' & 'apiKey'. */ "appId": string; /** * Will maintain a search all / '*' on init and reset allowing for a view then filter experience rather than a search first experience * @default false */ "browseIndex": boolean; /** * Query filters to apply to all searches. Refer to https://www.algolia.com/doc/api-reference/api-parameters/filters for format. * @default [] */ "filters": Array; /** * JS querySelector string of a `nano-input` / `input` element from which to listen to `nano-change` or `change` events and change the `query` prop. Not required if an appropriate field is in the 'search-input' slot * @default null */ "listenTo"?: string; /** * Minimum number of characters before performing a search * @default 2 */ "minChars": number; /** * The external operator joining filter values. * @default 'and' */ "operator": 'or' | 'and'; /** * The query string used to search the index. Will automatically be set with any slotted `search-input` input elements or from elements linked to from `listen-to` * @default '' */ "query": string; /** * @param facetName - will clear all filter selections of that type * @param facetValue - will remove a single filter selection Remove facet filters (as set from nano-algolia-filter elements). The omission or both will remove all facet filters */ "removeFilters": (facetName?: string, facetValue?: string) => Promise; /** * Changes the index without removing any current filters. Most appropriate for algolia replicas. * @default '' */ "replicaIndex": string; /** * The current algolia page of results currently being viewed or to get. * @default 0 */ "resultsPage": number; /** * Algolia search index. Used in conjunction with 'apiKey' & 'appId'. ``` { index: string, // algolia index name domain?: string, // used in template filters to resolve incomplete url fields filters?: [string], // algolia facets to retrive hitsPerPage?: number, name?: string // human readable index name } ``` * @default {} as SearchIndex */ "searchIndex": SearchIndex; /** * Algolia search index name. Alternative to 'searchIndex'. A simplified shortcut for setting an index. Properties such as hitsPerPage and facets will come from the algolia index * @default '' */ "searchIndexName": string; /** * Show the result panel. By default it will automatically show when the result receives new hits. * @default false */ "showResults": boolean; /** * Store search queries (against this ID) to the component store. Use in conjunction with storeMethod */ "storeId"?: string; /** * The method of storage. Either session storage, url hash (after the '#') or url query (after the '?'). * @default 'session' */ "storeMethod": StorageMethods; /** * Template engine render function to use when rendering results and filters. Defaults to Squirrel v8's render (https://squirrelly.js.org/). * @default Squirrel.render */ "tplRenderFn": (...args: any[]) => any; } /** * Displays and syncs algolia filters * Must be nested within an nano-algolia component. */ interface NanoAlgoliaFilter { /** * Name of this filter - must match an appropriate algolia facet on a parent nano-algolia index to display * @default null */ "filterName": string; /** * The internal operator joining filter values. * @default 'or' */ "operator": 'or' | 'and'; /** * Store search queries (against this ID) to the component store. Use in conjunction with storeMethod */ "storeId"?: string; /** * The method of storage. Either session storage, url hash (after the '#') or url query (after the '?'). * @default 'session' */ "storeMethod": StorageMethods; /** * Set values of this filter. Will result in form elements being selected. '|' delimited string or array. * @default '' */ "value": string | Array; } /** * Displays results from Algolia searches. * TODO / WIP */ interface NanoAlgoliaPagination { /** * Go to a particular page */ "goToPage": (page: number) => Promise; /** * Max number of page numbers to show * @default null */ "maxToShow": number; /** * Go to next page from current */ "nextPage": () => Promise; /** * Go to previous page from current */ "prevPage": () => Promise; } /** * Displays and syncs results from Algolia searches. * Must be nested within an nano-algolia component. */ interface NanoAlgoliaResults { /** * Whether new pages loaded by pagination will replace or be appended to the results block (this will be ignored if 'infiniteScroll' is set to true) * @default false */ "appendPages": boolean; /** * Load and append pages automatically on scroll * @default false */ "infiniteScroll": boolean; } /** * Animate elements declaratively with [~100 baked-in presets](https://animate.style/), or make your own with custom keyframes. * Powered by the [Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API). * @version 6.0.0 * @status stable */ interface NanoAnimation { /** * Clears all keyframe effects caused by this animation and aborts its playback. */ "cancel": () => Promise; /** * Gets and sets the current animation time. */ "currentTime": CSSNumberish; /** * The number of milliseconds to delay the start of the animation. * @default 0 */ "delay": number; /** * Determines the direction of playback as well as the behavior when reaching the end of an iteration. [Learn more](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction) * @default 'normal' */ "direction": PlaybackDirection; /** * The number of milliseconds each iteration of the animation takes to complete. * @default 1000 */ "duration": number; /** * The easing function to use for the animation. This can be a easing function or a custom easing function such as `cubic-bezier(0, 1, .76, 1.14)`. * @default 'ease' */ "easing": AnimationEasing; /** * The number of milliseconds to delay after the active period of an animation sequence. * @default 0 */ "endDelay": number; /** * Sets how the animation applies styles to its target before and after its execution. * @default 'auto' */ "fill": FillMode; /** * Sets the playback time to the end of the animation corresponding to the current playback direction. */ "finish": () => Promise; /** * The offset at which to start the animation, usually between 0 (start) and 1 (end). * @default 0 */ "iterationStart": number; /** * The number of iterations to run before the animation completes. Defaults to `Infinity`, which loops. * @default Infinity */ "iterations": number; /** * The keyframes to use for the animation. If this is set, `name` will be ignored. */ "keyframes"?: Keyframe[]; /** * The name of the built-in animation to use. For custom animations, use the `keyframes` prop. * @default 'none' */ "name": AnimationName | 'none'; /** * Plays the animation. When omitted, the animation will be paused. This attribute will be automatically removed when the animation finishes or gets canceled. * @default false */ "play": boolean; /** * Sets the animation's playback rate. The default is `1`, which plays the animation at a normal speed. Setting this to `2`, for example, will double the animation's speed. A negative value can be used to reverse the animation. This value can be changed without causing the animation to restart. * @default 1 */ "playbackRate": number; } /** * Avatars are used to represent a person or object. * @status new * @version 8.0.0 * @type CSS Only */ interface NanoAvatar { /** * Initials to use as when no image is available (1–2 characters max recommended). */ "initials"?: string; } /** * Badges are used to draw attention and display statuses or counts. * @status new * @version 8.0.0 * @type CSS Only * @supportedTags none */ interface NanoBadge { /** * Use pulse to draw attention to the badge with an animation */ "pulse"?: boolean; /** * The semantic theme of the button. Defaults to primary / brand blue */ "theme"?: Color; } /** * Breadcrumbs are used to indicate the current page's location within a navigational hierarchy. * @status new * @version 8.0.0 */ interface NanoBreadcrumb { /** * Array of breadcrumb items to render * @default [] */ "breadcrumbs": Breadcrumb[]; } /** * Cards are used to display content in a compact and organized way. * @status new * @version 8.0.0 * @type CSS Only */ interface NanoCard { /** * If true, disables the whole-card click effect. */ "disableCardClick"?: boolean; /** * The layout of the card. `landscape` only applies when the card is large enough. Defaults to portrait. */ "layout"?: 'portrait' | 'landscape'; /** * Size of card's heading. Defaults to `large`. Has no baring on `variant="promo"` cards */ "size"?: 'small' | 'large'; /** * The variant of card. Changes the styling of the card and of nested elements */ "variant"?: | 'promo' | 'promo-aero' | 'promo-plain' | 'promo-grey' | 'product'; } /** * Showcase up to 6 pieces of content in a slide-show format. * @status new * @version 8.0.0 */ interface NanoCardCarousel { /** * The title of the carousel. Alternatively use the `slot="title"` for more control over markup */ "carouselTitle": string; } /** * Checkboxes are used to let a user choose one or more values from a limited number of options. * @status stable * @version 1.0.0 */ interface NanoCheckbox { /** * checked property that can be used to get/set the value. accepts only boolean values * @default false */ "checked": boolean; /** * If `true`, the user cannot interact with the checkbox. * @default false */ "disabled": boolean; /** * The form element to associate the input with (its form owner). Must be the id of a form. */ "form"?: string | null; /** * Returns the native input control * @returns the native input control */ "getInputElement": () => Promise; /** * @default false */ "hasFocus": boolean; /** * Visually hide the label - but make it accessible. * @default false */ "hideLabel"?: boolean; /** * If `true`, the checkbox will visually appear as indeterminate (only relevant for type="checkbox") * @default false */ "indeterminate": boolean; /** * This will be true when the control is in an invalid state. Validity is determined by the `required` prop. Or if custom validity message is set. * @readonly * @default false */ "invalid": boolean; /** * label property that can be used to set the label text. Alternatively you may use a label slot. */ "label"?: string; /** * The name of the control, which is submitted with the form data. */ "name": string; /** * Removes focus from the checkbox. */ "removeFocus": () => Promise; /** * Get the current state of the control. * @param validateFirst - perform validation first before reporting * @returns `Promise<{ isValid: boolean, errorMessage: string }>` */ "reportValidity": (validateFirst?: boolean) => Promise; /** * Set to true to make the field required. * @default false */ "required": boolean; /** * Sets a custom validation message. If `message` is not empty, the field will be considered invalid. Use in conjunction with `nano-checkbox-group` */ "setError": (message: string, updateStatus?: boolean) => Promise; /** * Sets focus on the checkbox. */ "setFocus": () => Promise; /** * Controls the underlying field type and style. * @default 'checkbox' */ "type": | 'radio' | 'checkbox' | 'tag' | 'segment' | 'switch'; /** * Current validation message - if any. * @readonly */ "validityMessage": string; /** * The value of a checkbox is analogous to the value of an ``, it's only present when `checked` is true. * @default 'on' */ "value": string; } /** * Checkbox group is an optional wrapper for all [checkbox](/components/checkbox) controls. * It provides a convenient place to anchor labels and validation messages. * @status stable * @version 1.0.0 */ interface NanoCheckboxGroup { /** * Disable all the nested form controls * @default null */ "disabled": boolean | null; /** * Visually hide the legend but still available to screen readers. * @default false */ "hideLegend"?: boolean; /** * This will be true when the control is in an invalid state. Validity is determined by the `required` prop. Or if custom validity message is set. * @readonly * @default false */ "invalid": boolean; /** * A collective label for children controls * @default '' */ "legend": string; /** * The maximum number of checkboxes allowed. Only relevant for checkbox type controls. Other controls will automatically be disabled upon reaching this number. * @default null */ "max": number; /** * The minimum number of checkboxes required to be valid. Only relevant for checkbox type controls. A validation error will be thrown if not enough controls are checked. * @default 0 */ "min": number; /** * Get the current state of the control. * @param validateFirst - perform validation first before reporting * @returns `{ isValid: boolean, errorMessage: string }` */ "reportValidity": (validateFirst: boolean) => Promise; /** * Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string. * @param message - the error message to show * @param optVal - optionally supply an option value to target which checkbox to show invalidate against (default is the first) */ "showError": (message: string, optVal?: string) => Promise; /** * Whether to show validation errors underneath input * @default true */ "showInlineError": boolean; /** * When should the field perform validation * @default 'submitThenDirty' */ "validateOn"?: 'dirty' | 'submit' | 'submitThenDirty'; /** * Current validation message - if any. * @readonly * @default '' */ "validityMessage": string; /** * The current, collective checkbox value */ "value": string[] | string; } /** * Collapsible comparison allows users to compare two short lists of titles which can be expanded to reveal more detail about each item. * @version 8.0.0 * @status new */ interface NanoCollapsibleComparison { /** * Optional toggle button label to hide details * @default 'Hide details' */ "hideLabel"?: string; /** * Controls whether the comparison is open or closed. * @default false */ "open": boolean; /** * Optional toggle button label to show details * @default 'Show details' */ "showLabel"?: string; } /** * Content links are used to group multiple links together. * @status new * @version 8.0.0 * @type CSS Only * @supportedTags a */ interface NanoContentLinks { } /** * CTAs (Call To Actions) invite the user to take action. * They are used to highlight important content and interactions and are often used in conjunction with other components like cards, modals, and forms. * @status new * @version 8.0.0 * @type CSS Only */ interface NanoCta { /** * Predefined styles when displaying a number of CTAs together */ "group"?: 'balanced' | 'stacked'; /** * A predefined icon to show. Defaults to no icon. *note* Will be overruled if a `` or `` is detected */ "icon"?: | 'false' | 'forward' | 'back' | 'up' | 'down' | 'download' | 'open'; /** * Show a loading spinner */ "loading"?: boolean; /** * Turn on the secondary style. Every theme also has a secondary style */ "secondary"?: boolean; /** * The size of the button. Defaults to large */ "size"?: 'small' | 'medium' | 'large'; /** * The semantic theme of the button. Defaults to primary / brand blue */ "theme"?: Omit<'success' | 'warning', Color>; } /** * Enables the search, filter and sort of tabular data. * @version 3.0.0 * @status stable */ interface NanoDataTable { /** * Apply a filter on a column * @param filters - the filters to apply * @param additive - if true, will add the filters to any currently applied * @returns a promise which resolves when complete */ "addFilters": (filters: TableTypes.Filter[], additive?: boolean) => Promise; /** * Apply a sort on a column * @returns a promise which resolves when complete */ "addSort": (column: TableTypes.Prop, order: TableTypes.Order) => Promise; /** * @readonly - shows the currently applied filters * @default [] */ "appliedFilters": TableTypes.Filter[]; /** * The number of total blocks currently rendered in the table. * @readonly */ "blocksLength": number; /** * A descriptive title of the table. You must use this or the `slot="caption"` for accessibility */ "caption": string; /** * The column config used to present the rows of data * @default [] */ "columns": TableTypes.NanoTable['columns']; /** * A custom filtering function. Should return a promise. If the promise resolves as `true` the column UI will be updated. If the promise resolves as falsy, the sort will be performed by the component. A good use-case would be performing the filter on a server / via fetch. Then on success, updating the table's data via the `rows` property */ "customFilterFn"?: ( filters: TableTypes.Filter[] ) => Promise; /** * Function called whenever `col.cellTemplate` renders an unknown object. The function should render a valid HTMLElement to the cell arg. Example usage - render JSX from a 3rd party lib and append the result to the cell element. */ "customRenderer": ( node: any, cell: HTMLElement | DocumentFragment ) => void | Promise; /** * A custom sorting function. Should return a promise. If the promise resolves as `true` the column UI will be updated. If the promise resolves as falsey, the sort will be performed by the component. A good use-case would be performing the sort on a server / via fetch. Then on success, updating the table's data via the `rows` property */ "customSortFn"?: ( property: TableTypes.Prop, order: TableTypes.Order ) => Promise; /** * The default sortable option for all columns. `true` will enable column sorting unless you set `sortable: false` on a column `false` will disable column sorting unless you set `sortable: true` on a column * @default true */ "defaultSort": boolean; /** * Used for custom tfoot row rendering * @default { pinned: 'bottom' } */ "footRender": TableTypes.HeadFootRenderer; /** * Used for custom thead row rendering * @default { pinned: 'top' } */ "headRender": TableTypes.HeadFootRenderer; /** * Will show a loading state when set to true. By default, will be shown automatically if `rows` is a promise waiting to resolve / or falsy *or* when performing custom filtering or sorting. *Note* when set manually, will overwrite any internal loading state. Set to 'undefined' to revert to default behaviour. * @default undefined */ "loading": boolean; /** * To improve performance, data is split into blocks which are shown / hidden and rendered as they become visible. Use this to control the number of hits within a block - A block should fill a scrolling viewport. The less perBlock the better for performance * @default 50 */ "perBlock": number; /** * When loading rows asynchronously render this number of placeholder rows * @default 10 */ "placeholderSize": number; /** * Remove filters from a column * @param columnNames - the filters to apply * @returns a promise which resolves when complete */ "removeFilters": (columnNames: TableTypes.Prop[]) => Promise; /** * Remove any column filters currently applied * @returns a promise which resolves when complete */ "resetFilters": () => Promise; /** * Remove any column sorts currently applied * @returns a promise which resolves when complete */ "resetSorting": () => Promise; /** * Used for custom row rendering */ "rowRender": TableTypes.RowRenderer; /** * The data to place in the table */ "rows": | TableTypes.NanoTable['rows'] | Promise; /** * If true, will render any nested table in a scrollable container (using `overflow: auto`) * @default false */ "scrollable": boolean; /** * Term to search for in the data */ "searchTerm": string; /** * Show the caption on-screen * @default false */ "showCaption": boolean; /** * Whether to show a `` component * @default false */ "showFooter": boolean; /** * If true, will show a spinner at the bottom of the table when loading * @default false */ "showPaginateSpinner": boolean; /** * Updates a row model at a given index * @param row - the row to update. * @param rowIndex - the row index to insert this row */ "updateRow": (row: TableTypes.RowData, rowIndex: number) => Promise; /** * Use this to render the table with roughly the correct dimensions. a use-case might be; fetch a small initial dataset to minimise load-time, render the table with the correct dimensions, the table becomes interactive, load the rest of the data * @default 0 */ "virtualTotalItems": number; } /** * Represents a permissible or recommended list of options available to choose from within other controls. * @version 2.0.0 * @status stable */ interface NanoDatalist { /** * return all the active options currently within the datalist. Can be useful for validation * @readonly */ "activeOptions": HTMLNanoOptionElement[]; /** * Use this option to disable to default filtering. This is useful if filtering happens externally via another method (e.g. via ajax) * @default false */ "disableFilter": boolean; /** * Activate / deactivate the datalist control * @default false */ "disabled": boolean; /** * nano-dropdown config options you can pass to the nested dropdown component * @default { skidding: -1, } */ "dropDownConfig": Partial; /** * A selector to a HTMLInputElement */ "input"?: string | HTMLInputElement; /** * Force datalist open * @default false */ "open": boolean; /** * Provide an option list. Options can be defined declaratively by nesting `` elements or imperatively using this prop * @default [] */ "options"?: OptionInterface[]; /** * By default, items in the list will appear 'selected' when the value in the linked input control matches. However you can add other selected options via the the selected prop. * @default [] */ "selected": string[]; /** * Tweaks the datalist behaviour and linked control semantics and behaviour. e.g. 'select' will make the linked input control `readonly`. * @default 'input' */ "type": 'select' | 'selectMulti' | 'input'; } /** * Enables date selection and input in a form. * @version 1.0.0 * @status deprecated * @deprecated - use `nano-input` with `type="date"` instead. */ interface NanoDateInput { /** * This Boolean attribute lets you specify that a form control should have input focus when the page loads. * @default false */ "autofocus": boolean; /** * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input. * @default false */ "clearable": boolean; /** * Close the picker after a date is selected * @default true */ "closeAfterPicked": boolean; /** * The color to use from the application's color palette. */ "color"?: Color; /** * The order of the date parts for entry and display. e.g. dmy = dd mm yyyy * @default 'dmy' */ "dateOrder": 'dmy' | 'mdy' | 'ymd' | 'dym'; /** * @readonly get the value as a `Date` */ "dateValue": Date; /** * If `true`, the user cannot interact with the input. * @default false */ "disabled": boolean; /** * nano-dropdown config options you can pass to the nested dropdown component * @default {} */ "dropDownConfig": Partial; /** * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc. Default is Monday. */ "firstDayOfWeek"?: DaysOfWeek; /** * Enable floating label behaviour. Will disable placeholder if set. * @default false */ "floatLabel": boolean; /** * The form element to associate the select with (its form owner). Must be the id of a form. */ "form"?: string | null; /** * Returns the native `` element used under the hood. * @returns `HTMLInputElement` */ "getInputElement": () => Promise; /** * Whether to show a long form, confirmation date string of the one currently entered * @default true */ "helperText": boolean; /** * Options for the date string display. Refer to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString. * @default { year: 'numeric', month: 'long', day: 'numeric', } */ "helperTextFormat": LocalDateOpts; /** * Visually hide the label - but make it accessible. * @default false */ "hideLabel"?: boolean; /** * Initial picker date. Defaults to `value` if set and today's date if not. Must be in IS0-8601 format: YYYY-MM-DD. */ "initialPickerDate"?: string; /** * This will be true when the control is in an invalid state. Validity is determined by the `required` prop. Or if custom validity message is set. * @readonly * @default false */ "invalid": boolean; /** * Controls which days are disabled and therefore disallowed. For example, this can be used to disallow selection of weekends. * @returns `false` for not disabled and `true` for disabled * @default () => false */ "isDateDisabled": DateDisabledPredicate; /** * String to place within a label element. Alternatively you may use a label slot. */ "label"?: string; /** * Button labels, day names, month names, etc, used for localization. Default is English. */ "localization"?: DuetLocalizedText; /** * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. This setting can be used alone or together with the min property. */ "max"?: string; /** * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. This setting can be used alone or together with the max property. */ "min"?: string; /** * The name of the control, which is submitted with the form data. * @default this.inputId */ "name": string; /** * Show a date picker. Date pickers are not very useful if the potential input is too far in the distance or past e.g. Birthdays * @default true */ "picker": boolean; /** * Set / read whether the picker is currently open. * @default false */ "pickerOpen": boolean; /** * Instructional text that shows before the input has a value. The pattern prop will be used to create a placeholder automatically if unused. */ "placeholder": string; /** * If `true`, the user cannot modify the value. * @default false */ "readonly": boolean; /** * Get the current state of the control. * @param validateFirst - perform validation first before reporting * @returns `{ isValid: boolean, errorMessage: string }` */ "reportValidity": (validateFirst: boolean) => Promise; /** * If `true`, the user must fill in a value before submitting a form. * @default false */ "required": boolean; /** * Sets focus on the child `nano-input`. */ "setFocus": () => Promise; /** * Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string. */ "showError": (message: string) => Promise; /** * Whether to show validation errors underneath input * @default true */ "showInlineError": boolean; /** * The initial size (number of characters) of the control. */ "size"?: number; /** * When should the field perform validation * @default 'submitThenDirty' */ "validateOn"?: 'dirty' | 'submit' | 'submitThenDirty'; /** * Current validation message - if any. * @readonly */ "validityMessage": string; /** * Current value. Must be in IS0-8601 format: YYYY-MM-DD. * @default '' */ "value": string; } /** * Enables the selection of a date from a calendar view. * @version 1.0.0 * @status stable */ interface NanoDatePicker { /** * Which day is considered first day of the week. `0` for Sunday, `1` for Monday, etc. Default is Monday. * @default DaysOfWeek.Monday */ "firstDayOfWeek": DaysOfWeek; "firstFocusEle": HTMLElement; /** * Controls which days are disabled and therefore disallowed. For example, this can be used to disallow selection of weekends. * @returns `false` for not disabled and `true` for disabled * @default () => false */ "isDateDisabled": DateDisabledPredicate; /** * Controls whether the picker is within a modal control and will therefore keep focus within the control * @default false */ "isModal": boolean; /** * Button labels, day names, month names, etc, used for localization. Default is English. * @default defaultLocalization */ "localization": DuetLocalizedText1; /** * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. This setting can be used alone or together with the min property. * @default '' */ "max": string; /** * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. This setting can be used alone or together with the max property. * @default '' */ "min": string; /** * Selected Date. Must be in IS0-8601 format: YYYY-MM-DD. * @default '' */ "selectedDate": string; /** * Focus to the calendar * @param day - focus to the current selected day */ "setFocus": (day?: boolean) => Promise; } /** * Details show a brief summary and on interaction expand to show additional content. * @version 1.0 * @status stable */ interface NanoDetails { /** * Disables the details so it can't be toggled. * @default false */ "disabled": boolean; /** * Summary / handle text. Use the `label` slot for HTML markup * @default '' */ "label": string; /** * Should item be open on load * @default false */ "open": boolean; /** * The size of the details. Primarily controls the trigger element and overall padding. * @default 'medium' */ "size": 'small' | 'medium' | 'large'; } /** * Dialogs, sometimes called "modals", appear above the page and require the user's immediate attention. * @version 1.0.0 * @status stable */ interface NanoDialog { /** * Hides the dialog */ "hide": () => Promise; /** * Relocate the dialog to the root of the DOM. Useful for elements bound via css `transform: ...` * @default false */ "hoist": boolean; /** * The dialog's label as displayed in the header. You should always include a relevant label even when using `no-header`, as it is required for proper accessibility. */ "label": string; /** * Set to true to disable the header. This will also remove the default close button, so please ensure you provide an easy, accessible way for users to dismiss the dialog. * @default false */ "noHeader": boolean; /** * An alternative to `preventDefault()` on the `nanoRequestClose` event. This will hide the close button and disable clicks on the overlay or presses the `Escape` key * @default false */ "noUserDismiss": boolean; /** * Indicates whether or not the dialog is open. You can use this in lieu of the show/hide methods. * @default false */ "open": boolean; /** * Shows the dialog */ "show": () => Promise; /** * Show a colour ribbon at the top of the modal * @default true */ "showRibbon": boolean; /** * Store search queries (against this ID) to the component store. Use in conjunction with storeMethod */ "storeId"?: string; /** * The method of storage. Either session storage, url hash (after the '#') or url query (after the '?'). * @default 'url-hash' */ "storeMethod": StorageMethods; } /** * Drawers slide in from a container to expose additional options and information. * @version 5.0.0 * @status stable */ interface NanoDrawer { /** * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of its parent element, set this attribute and add `position: relative` to the parent. * @default false */ "contained": boolean; /** * Hides the drawer * @returns a promise that resolves when the drawer has finished closing */ "hide": () => Promise; /** * Relocate the dialog to the root of the DOM. Useful for elements bound via css `transform: ...` * @default false */ "hoist": boolean; /** * The drawer's label as displayed in the header. You should always include a relevant label even when using `no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead. */ "label": string; /** * Removes the header. This will also remove the default close button, so please ensure you provide an easy, accessible way for users to dismiss the drawer. * @default false */ "noHeader": boolean; /** * An alternative to `preventDefault()` on the `nanoRequestClose` event. This will hide the close button and disable clicks on the overlay or presses the `Escape` key * @default false */ "noUserDismiss": boolean; /** * Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state. * @default false */ "open": boolean; /** * The direction from which the drawer will open. * @default 'end' */ "placement": 'top' | 'end' | 'bottom' | 'start'; /** * Makes the drawer resizable * @default false */ "resizable": boolean; /** * Shows the drawer. * @returns a promise that resolves when the drawer has finished opening */ "show": () => Promise; /** * Store search queries (against this ID) to the component store. Use in conjunction with storeMethod */ "storeId"?: string; /** * The method of storage. Either session storage, url hash (after the '#') or url query (after the '?'). * @default 'url-hash' */ "storeMethod": StorageMethods; } /** * Dropdowns expose additional content that “drops down” in a panel. * @version 1.0.0 * @status stable */ interface NanoDropdown { /** * Determines if the dropdown should open automatically when the trigger is clicked * @default true */ "autoOpen": boolean; /** * Determines whether the dropdown should hide when a menu item is selected. * @default true */ "closeOnSelect": boolean; /** * The dropdown will close when the user interacts outside of this element (e.g. clicking). */ "containingElement": HTMLElement; /** * Title used to describe the dropdown content for accessibility */ "dialogTitle": string; /** * The distance in pixels from which to offset the panel away from its trigger. * @default 5 */ "distance": number; "eventType": EventEmitter; /** * Hides the dropdown panel */ "hide": () => Promise; /** * Enable this option to prevent the panel from being clipped when the component is placed inside a container with `overflow: auto|scroll`. * @default false */ "hoist": boolean; /** * Indicates whether or not the dropdown is open. You can use this in lieu of the show/hide methods. * @default false */ "open": boolean; /** * The preferred placement of the dropdown panel. Note that the actual placement may vary as needed to keep the panel inside of the viewport. * @default 'bottom-start' */ "placement": PopoverPlacement; /** * Shows the dropdown panel */ "show": () => Promise; /** * The distance in pixels from which to offset the panel along its trigger. * @default 0 */ "skidding": number; /** * If you don't want to use the trigger slot, you can use this to 'tether' the dropdown to another element. And you will still need to control when the component is opened (using show() / hide() or the `open` prop) * @default null */ "tetherTo": HTMLElement; } /** * Highlights a key message on a landing page. * @status new * @version 8.0.0 * @type CSS Only */ interface NanoFeatureBox { /** * The position of the image of the feature-box (`start` being left on a l2r page) * @default 'start' */ "imgPosition"?: 'start' | 'end'; } /** * A toolbox to expose a form's data model and validation state * @version 3.0.0 * @status stable */ interface NanoFieldValidator { /** * Returns true if any nested fields have been changed * @readonly * @default false */ "dirty": boolean; /** * By default, `nano-field-validator` will also track all native form field elements. You can add extra web-component form fields to listen to (as long as they match the standard form field spec) by using the `fieldSelector` prop. * @default 'input, select, textarea' */ "extraFieldSelector": string; /** * The current form payload as a reactive proxy. * @readonly */ "payload": ValidatorValueStore; /** * Clear all custom validation. * @returns a promise, resolved when all errors are cleared */ "resetValidity": () => Promise; /** * Scrolls to first invalid form field. * @param force - forces the scroll behaviour (default). Otherwise will use the default set in `scrollToInvalid` prop */ "scrollToFirstInvalid": (force?: boolean) => Promise; /** * Tries to scroll to the first invalid field on submit * @default true */ "scrollToInvalid": boolean; /** * Sets custom validity for all / some form fields. * @param validity - a validity object of `{fieldName: errorString}` pairs. Set as an empty string to clear the error. * @param scrollToInvalid - whether to scroll to the first invalid field. If not present, will follow the value set on `scrollToInvalid` prop. * @returns a promise, resolved when all errors are set */ "setCustomValidity": (validity: { [key: string]: string; }, scrollToInvalid?: boolean) => Promise; /** * Sets the state of the form using an object of key / value pairs. * @param state - the state to load in the store */ "setStore": (state: ValidatorValueStore) => Promise; /** * Returns true if validation errors will be displayed to the user. * @readonly */ "showValidation": boolean; /** * The current form state as a stencil store. * @readonly */ "store": ObservableMap; /** * Returns true if all the nested fields are currently valid * @readonly */ "valid": boolean; /** * When should the fields perform validation. Will override / sync all nested `nano-...` controls * @default 'submitThenDirty' */ "validateOn"?: 'dirty' | 'submit' | 'submitThenDirty'; /** * A validation callback method. * @param field - The field name currently being evaluated * @param value - The value of the field currently being evaluated * @param fields - an array of all currently observered form fields and values * @returns field names mapped to an object of status message and validity e.g. ```js {field1: {msg: `This is invalid!`}, field2: {msg: `This is valid!`, valid: true}} ``` */ "validation": ( field: string, value: string, fields: ValidatorValueStore ) => { [errorMsg: string]: { fields?: string[]; valid?: boolean } }; /** * Get the current validation state of all form fields. * @readonly ``` { fields: NanoFormEles[]; valid: boolean; validityMessage: string; dirty: boolean; name: string | number; value: any; }[] ``` */ "validationState": ValidationState[]; } /** * Enables the selection of files for upload. * @version 1.0.0 * @status stable */ interface NanoFileUpload { /** * The accept attribute value is a string that defines the file types the file input should accept. E.g. for a MS Word file: `.doc, .docx,application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document` */ "accept"?: string; /** * Specifies which camera to use for capture of image or video data. `user` for the user-facing camera and/or microphone. `environment` specifies the the outward-facing camera and/or microphone. If the requested facing mode isn't available, the user agent may fall back to its preferred default mode. */ "capture"?: 'user' | 'environment'; /** * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input. Only used within single file uploads. * @default false */ "clearable": boolean; /** * If `true`, the user cannot interact with the select. * @default false */ "disabled": boolean; /** * A File array that lists every selected file. Has an added `objectURL` property returning a `DOMString` containing an object URL that can be used to reference the contents of the specified source This list has no more than one member unless the multiple attribute is specified */ "files": FileWithUrl[]; /** * The form element to associate with this input (its form owner). Must be the id of a form. */ "form"?: string | null; /** * @returns the native `` element used under the hood */ "getInputElement": () => Promise; /** * Visually hide the label - but make it accessible. * @default false */ "hideLabel"?: boolean; /** * This will be true when the control is in an invalid state. Validity is determined by the `required` prop. Or if custom validity message is set. * @readonly * @default null */ "invalid": any; /** * String to place within a label element. */ "label": string; /** * The maximum file size allowed per file (Megabytes) * @default 1 */ "maxFileSize": number; /** * The maximum number of files that can be selected. Defaults to 1 * @default 1 */ "maxFiles": number; /** * Name of the form control. Submitted with the form as part of a name/value pair. */ "name": string; /** * Placeholder only used within single file uploads. * @default 'Choose a file' */ "placeholder": string; /** * Get the current state of the control. * @param validateFirst - perform validation first before reporting * @returns `{ isValid: boolean, errorMessage: string }` */ "reportValidity": (validateFirst: boolean) => Promise; /** * If `true`, the user must select a file to upload before submitting a form. * @default false */ "required": boolean; /** * Sets focus on the specified `nano-input`. Use this method instead of the global `input.focus()`. */ "setFocus": () => Promise; /** * Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string. * @param message */ "showError": (message: string) => Promise; /** * Whether to show validation errors underneath input * @default true */ "showInlineError": boolean; /** * When should the field perform validation * @default 'submitThenDirty' */ "validateOn"?: 'dirty' | 'submit' | 'submitThenDirty'; /** * Current validation message - if any. * @readonly */ "validityMessage": string; /** * A file input's value attribute contains a DOMString that represents the path to the selected file(s). If the user selected multiple files, the value represents the first file in the list of files they selected. You can reset the file-upload control by setting the value to an empty string e.g. `var input.value = ''` */ "value": string; } /** * The footer is used to provide navigation, copyright info and links to social media platforms. * @status new * @version 8.0.0 */ interface NanoFooter { } /** * The Global nav component standardises navigation within and across web applications. * @version 8.0.0 * @status new */ interface NanoGlobalNav { /** * MyAccount store cart count. * @default 0 */ "cartCount": number; /** * Url to the Nanopore store cart. Will default to the url supplied by MyAccount * @default '' */ "cartUrl": string; /** * Manually close the overflow menu */ "closeOverflowMenu": () => Promise; /** * Url to the Nanopore contact page * @default 'https://nanoporetech.com/contact' */ "contactUrl": string; /** * Url to the Nanopore login page. Will default to the url supplied by MyAccount * @default '' */ "loginUrl": string | (() => void); /** * The link to put on the logo * @default location.protocol + '//' + location.host */ "logoUrl": string; /** * Url to the Nanopore login page. Will default to the url supplied by MyAccount * @default '' */ "logoutUrl": string | (() => void); /** * MyAccount un-read message count. * @default 0 */ "msgCount": number; /** * Url to the Nanopore message center. Will default to the url supplied by MyAccount * @default '' */ "msgUrl": string; /** * MyAccount data is automatically set via `myAccountUrl`. Alternatively you can directly provide a JSON object which is useful for SSR (ref https://myaccount.nanoporetech.com/nav_bar_data.json) */ "myAccountData": MyAccountData | null; /** * A base url to retrieve global nav / sso data. `nav_bar_data.json` will be appended to this url */ "myAccountUrl"?: string; /** * Logged in user details automatically populated from MyAccount * @readonly */ "myAccountUser": MyAccountData['user']; /** * Manually open the overflow menu */ "openOverflowMenu": () => Promise; /** * Algolia search index to search within * @default 'All' */ "searchIndex": string; /** * A search string used to load and show autocomplete results * @default '' */ "searchValue": string; /** * A url to take the user after login or logout. Defaults to current URL. Is automatically URI encoded * @default window.location.href */ "sessionRedirect": string; /** * Send the current search term and selected index to a nested `nano-global-search-results` */ "submitSearch": () => Promise; /** * Manually triggers the main menu bar resize behaviour. This can be useful if you append new children to the global-nav */ "triggerResize": () => Promise; } /** * Nanopore Global Search results component * to be used in conjunction with [Globla-Nav](/story/nano-compounds-global-nav). * A shortcut / helper which combines algolia components. * There should only be one per page * and should be a direct child of */ interface NanoGlobalSearchResults { /** * Manually close the search panel */ "closeSearch": (clearHistory?: boolean) => Promise; } /** * A context-aware CSS grid implementation. * @version 1.0.0 * @status deprecated */ interface NanoGrid { /** * the number of columns the grid has at the large breakpoint. */ "lCols": number; /** * the component's large breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem` * @default 800 */ "lSize": number | string; /** * Optional large `grid-template`. *Note* - you must set `lCols` for this to take affect */ "lTpl"?: string; /** * the number of columns the grid has at the medium breakpoint. */ "mCols": number; /** * the component's medium breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem` * @default 550 */ "mSize": number | string; /** * Optional medium `grid-template`. *Note* - you must set `mCols` for this to take affect */ "mTpl"?: string; /** * the number of columns the grid has at the small breakpoint. */ "sCols": number; /** * the component's small breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem` * @default 300 */ "sSize": number | string; /** * Optional small `grid-template`. *Note* - you must set `sCols` for this to take affect */ "sTpl"?: string; /** * shows a grid helper to visualise where columns are * @default false */ "showHelper": boolean; /** * the number of columns the grid has at the xl breakpoint. */ "xlCols": number; /** * the component's xl breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem` * @default 1000 */ "xlSize": number | string; /** * Optional xl `grid-template`. *Note* - you must set `xlCols` for this to take affect */ "xlTpl"?: string; /** * the number of columns the grid has at the xxl breakpoint (anything greater than the xl breakpoint) */ "xxlCols": number; /** * Optional xxl `grid-template`. *Note* - you must set `xxlCols` for this to take affect */ "xxlTpl"?: string; } /** * @deprecated - you can now use `grid-states="..."` * on any direct `nano-grid` descendent without limitation rendering `nano-grid-item` obsolete. * Grid items to be used with [grid](/story/nano-components-grid) elements */ interface NanoGridItem { } /** * Adds visual impact to the top of a page using headlines, images and CTAs. * @version 1.0.0 * @status deprecated */ interface NanoHero { /** * src for background image. For more control use the `background` slot instead. */ "imgSrc"?: string; /** * Optional list string providing media sizes with corresponding image srcs. i.e. show img-x at 300px wide. Format `srcSet="200w src/imgSmall.jpg, 500h src/imgMed.png"` * @default null */ "imgSrcSet"?: string; /** * The Break Point width that the hero component will change to the large view. Defaults to the XL grid size (900px) * @default 900 */ "largeScreenBP": number; /** * Set the content structure level of the hero. Defaults to 'top' * @default 'top' */ "level": 'top' | 'sub'; /** * Base style for the hero. Either 'light' (white bg / dark text), or 'dark' (dark bg / white text) * @default 'dark' */ "theme": 'dark' | 'light'; } /** * An SVG loader / helper. Comes bundled with font-awesome pro icons & ONT pictogram and device icons. * Lazily loads SVG as icons become visible. * @status stable * @version 1.0.0 */ interface NanoIcon { /** * Specifies the label to use for accessibility. Defaults to the icon name. */ "ariaLabel": string; /** * Specifies whether the icon should horizontally flip when `dir` is `"rtl"`. By default, when an 'arrow' or 'chevron' icon is used, it will flip automatically when detecting `dir="rtl"` on the document or closest ancestor. */ "flipRtl"?: boolean; /** * A combination of both `name` and `src`. If a `src` url is detected it will set the `src` property. Otherwise it assumes it's a built-in named SVG and set the `name` property. */ "icon"?: any; /** * If enabled, nano-icon will be loaded lazily when it's visible in the viewport. Default, `true`. * @default true */ "lazy": boolean; /** * Specifies which icon to use from the built-in set of icons. */ "name"?: string; /** * Specifies the role to use for accessibility. Defaults to 'presentation' (invisible to screen-readers) */ "role": string; /** * The size of the icon. `auto` automatically sizes according to the font-size of the parent element. *Note*: size will be different on 'pictogram' and 'device' vs 'font awesome' icons. * @default 'auto' */ "size"?: | 'small' | 'regular' | 'large' | 'xl' | 'auto'; /** * Specifies the exact `src` of an SVG file to use. */ "src"?: string; } /** * Simple icon-only buttons designed to be used for actions and in toolbars. * @version 1.0.0 * @status stable */ interface NanoIconButton { /** * Set to true to disable the button. * @default false */ "disabled": boolean; /** * The HTML form element or form element id. Used to submit a form when the button is not a child of the form. */ "form": HTMLFormElement | string; /** * Contains a URL or a URL fragment that the hyperlink points to. If this property is set, an anchor tag will be rendered. */ "href": string | undefined; /** * The name of the icon to draw. */ "iconName"?: string; /** * An external URL of an SVG file. */ "iconSrc"?: string; /** * A description that gets read by screen readers and other assistive devices. For optimal accessibility, you should always include a label that describes what the icon button does. */ "label": string; /** * The name of the button, submitted as a pair with the button’s value as part of the form data. */ "name"?: string; /** * Specifies the relationship of the target object to the link object. The value is a space-separated list of [link types](https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types) */ "rel": string | undefined; /** * Sets focus on the internal button */ "setFocus": () => Promise; /** * display the label as a `` * @default false */ "showTooltip": boolean; /** * Specifies where to display the linked URL. Only applies when an `href` is provided. Special keywords: `"_blank"`, `"_self"`, `"_parent"`, `"_top"`. */ "target": string | undefined; /** * The default behavior of the button. * @default 'button' */ "type": 'submit' | 'reset' | 'button'; /** * Defines the value associated with the button’s name when it’s submitted with the form data. */ "value"?: string; } /** * Icon Items are a standard way of displaying a Pictogram or Device Icon with some concise text. * @status new * @version 8.0.0 * @type CSS Only */ interface NanoIconItem { /** * The layout of the icon items. Defaults to portrait. * @default 'portrait' */ "layout"?: 'portrait' | 'landscape'; /** * The size of the icon. Defaults to regular * @default 'regular' */ "size"?: 'regular' | 'large'; } /** * Utilities for displaying images; standard or background. * @status deprecated * @version 1.0.0 */ interface NanoImg { /** * This attribute defines the alternative text describing the image. Users will see this text displayed if the image URL is wrong, or if the image is not yet downloaded. */ "alt"?: string; /** * When the image is rendered as a background, and there is no preset dimensions of the component, you can set how the component height will be set. Via image size or via the content * * @default 'content' */ "autoHeight": 'content' | 'image'; /** * Render the image as a background image * */ "background"?: boolean; /** * Render image lazily, when it comes into the browser viewport * * @default true */ "lazy": boolean; /** * The image URL. This attribute is mandatory for the `` element. */ "src": string; /** * Optional list string providing media sizes with corresponding image srcs. i.e. show img-x at 300px wide. Format `srcSet="200w src/imgSmall.jpg, 500h src/imgMed.png"` */ "srcSet"?: string; } /** * In-page navigation allows users to quickly find different sections on a page. * @status new * @version 8.0.0 */ interface NanoInPageNav { /** * Whether the active link should be automatically set based on when a corresponding #id is in view. Defaults to true * @default true */ "autoActive"?: boolean; /** * Menus that contain links to external pages should have different styling from in-page anchors * @default 'auto' */ "externalLinks"?: true | false | 'auto'; } /** * Increments and decrements a value using an [input](/components/input). * @status new * @version 8.2.0 */ interface NanoIncrement { } /** * Inputs collect text data from the user. * @status stable * @version 1.0.0 */ interface NanoInput { /** * If the value of the type attribute is `"file"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers. */ "accept"?: string; /** * Sometimes it can be helpful to always show the placeholder, even when the input has a value. For example a postcode field could have a placeholder `e.g. LD1 1AA` which is helpful to show. * @default false */ "alwaysShowPlaceholder": boolean; /** * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user. * @default 'none' */ "autocapitalise": 'none' | 'sentences' | 'words' | 'characters'; /** * Indicates whether the value of the control can be automatically completed by the browser. * @default 'off' */ "autocomplete": 'on' | 'off'; /** * Whether auto correction should be enabled when the user is entering/editing the text value. * @default 'off' */ "autocorrect": 'on' | 'off'; /** * This Boolean attribute lets you specify that a form control should have input focus when the page loads. * @default false */ "autofocus": boolean; /** * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `"password"`, `false` for all other types. */ "clearOnEdit"?: boolean; /** * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input. * @default false */ "clearable": boolean; /** * relevant to `type="date"`. If `true`, the input will close after a date is picked. * @default true */ "closeAfterPicked": boolean; /** * Set the amount of time, in milliseconds, to wait to trigger the `nanoChange` event after each keystroke. * @default 0 */ "debounce": number; /** * If `true`, the user cannot interact with the input. * @default false */ "disabled": boolean; /** * Enable floating label behaviour. Will disable placeholder if set. * @default false */ "floatLabel": boolean; /** * The form element to associate the input with (its form owner). Must be the id of a form. */ "form"?: string | null; /** * @returns the native `` element used under the hood. */ "getInputElement": () => Promise; /** * Visually hide the label - but make it accessible. * @default false */ "hideLabel"?: boolean; /** * relevant to `type="date"`. Initial picker date. Defaults to `value` if set and today's date if not. Must be in IS0-8601 format: YYYY-MM-DD. */ "initialPickerDate"?: string; /** * A hint to the browser for which keyboard to display. Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`, and `"search"`. */ "inputmode"?: | 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'; /** * This will be true when the control is in an invalid state. Validity is determined by the `required` prop. Or if custom validity message is set. * @readonly * @default null */ "invalid": any; /** * relevant to `type="date"`. Controls which days are disabled and therefore disallowed. For example, this can be used to disallow selection of weekends. * @returns `false` for not disabled and `true` for disabled * @default () => false */ "isDateDisabled": DateDisabledPredicate; /** * String to place within a label element. Alternatively you may use a label slot. */ "label": string; /** * The maximum value, which must not be less than its minimum (min attribute) value. */ "max"?: string; /** * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter. */ "maxlength"?: number; /** * The minimum value, which must not be greater than its maximum (max attribute) value. */ "min"?: string; /** * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter. */ "minlength"?: number; /** * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `"email"` or `"file"`, otherwise it is ignored. */ "multiple"?: boolean; /** * The name of the control, which is submitted with the form data. * @default this.inputId */ "name": string; /** * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `"text"`, `"search"`, `"tel"`, `"url"`, `"email"`, or `"password"`, otherwise it is ignored. */ "pattern"?: string; /** * relevant to `type="date"`. Other options to pass to the date picker. See the `nano-date-picker` docs for more information. * @default {} */ "pickerOptions": Partial; /** * Instructional text that shows before the input has a value. */ "placeholder"?: string | null; /** * If `true`, the user cannot modify the value. * @default false */ "readonly": boolean; /** * Get the current state of the control. * @param validateFirst - perform validation first before reporting * @returns `{ isValid: boolean, errorMessage: string }` */ "reportValidity": (validateFirst: boolean) => Promise; /** * If `true`, the user must fill in a value before submitting a form. By default, setting this will also add an asterisk to the label. * @default false */ "required": boolean; /** * relevant to `type="textarea"`. Vertical resizing - enable / disable or make automatic. * @default 'auto' */ "resize": 'true' | 'false' | 'auto'; /** * relevant to `type="textarea"`. Default number of rows to show * @default 2 */ "rows": number; /** * Sets focus and select the text on the specified `nano-input`. Use this method instead of the global `input.select()`. */ "select": () => Promise; /** * Sets focus on the specified `nano-input`. Use this method instead of the global `input.focus()`. */ "setFocus": () => Promise; /** * Whether to show a character count / remaining count when using the `maxlength` attribute. * @default false */ "showCharCount": boolean; /** * Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string. */ "showError": (message: string) => Promise; /** * Whether to show validation errors underneath input * @default true */ "showInlineError": boolean; /** * relevant to `type="date"`. Whether to show a date picker. Date pickers are not very useful if the potential input is too far in the distance or past e.g. Birthdays * @default true */ "showPicker": boolean; /** * The initial size of the control. This value is in pixels unless the value of the type attribute is `"text"` or `"password"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `"text"`, `"search"`, `"tel"`, `"url"`, `"email"`, or `"password"`, otherwise it is ignored. */ "size"?: number; /** * If `true`, the element will have its spelling and grammar checked. * @default false */ "spellcheck": boolean; /** * Works with the min and max attributes to limit the increments at which a value can be set. Possible values are: `"any"` or a positive floating point number. */ "step"?: string; /** * The type of control to display. The default type is text. * @default 'text' */ "type": TextFieldTypes; /** * When should the field perform validation * @default 'submitThenDirty' */ "validateOn": 'dirty' | 'submit' | 'submitThenDirty'; /** * Current validation message - if any. * @readonly */ "validityMessage": string; /** * The value of the input. * @default '' */ "value"?: string | null; /** * Represents the current value of the input as a Date, or null if conversion is not possible * @readonly */ "valueAsDate": Date; /** * Represents the value of the input or NaN if numeric conversion is impossible * @readonly */ "valueAsNumber": number; } /** * A component for entering one-time passwords (OTP) with multiple input fields. * @version 8.8.0 * @status new */ interface NanoInputOtp { /** * If `true`, allows the input to be completely filled with invalid values. By default, if any input box contains an invalid value, the entire input group is marked as invalid. Default is `false`. * @default false */ "allowInvalid": boolean; /** * Resets the input boxes to empty values. */ "clear": () => Promise; /** * If `true`, the user cannot interact with the input. * @default false */ "disabled": boolean; /** * A hint to the browser for which keyboard to display. Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`, and `"search"`. For numbers (type="number"): "numeric" For text (type="text"): "text" */ "inputmode"?: | 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'; /** * The number of input boxes to display. * @default 6 */ "length": number; /** * A regex pattern string for allowed characters. Defaults based on type. For numbers (`type="number"`): `"[\p{N}]"` For text (`type="text"`): `"[\p{L}\p{N}]"` */ "pattern"?: string; /** * If `true`, the user cannot modify the value. * @default false */ "readonly": boolean; /** * Sets focus to an input box. * @param index - The index of the input box to focus (0-based). If provided and the input box has a value, the input box at that index will be focused. Otherwise, the first empty input box or the last input if all are filled will be focused. */ "setFocus": (index?: number) => Promise; /** * If `true`, shows a validity icon when all input boxes are filled. A check icon is shown if all values are valid, and an X icon is shown if any value is invalid. This does not affect the `invalid` or `valid` states of the input group. Default is `false`. * @default false */ "showValidity": boolean; /** * The type of input allowed in the input boxes. * @default 'number' */ "type": 'text' | 'number'; /** * The value of the input group. * @default '' */ "value"?: string | number | null; } /** * A thin, declarative interface to the [IntersectionObserver API](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver). * @version 6.0.0 * @status stable */ interface NanoIntersectionObserve { /** * The element that is used as the viewport for checking visibility of the target. Must be an ancestor of the target. Defaults to an automatic check for ancestors that `overflow: auto` or otherwise the `Document`. * @default 'auto' */ "root": globalThis.Element | string; /** * Margin around the root. Can be similar to CSS margins property, e.g. "10px 20px 30px 40px" (top, right, bottom, left). The values can be percentages. This set of values serves to grow or shrink each side of the root element's bounding box before computing intersections. Defaults to zeros. */ "rootMargin"?: string; /** * Indicate at what percentage of the target's visibility the observer's callback should be executed. If you only want to detect when visibility passes the 50% mark, you can use a value of '0.5'. If you want the callback to run every time visibility passes another '25%', you would specify a string of values (separated by ',') array '0, 0.25, 0.5, 0.75, 1'. A value of '1.0' means that the threshold isn't considered passed until every pixel is visible. */ "threshold"?: string; } /** * A container for content that can horizontally or vertically scroll * @version 4.0.0 * @status stable */ interface NanoMaskedOverflow { /** * A function called when an item becomes 'active' (via click or keyboard) * @param item - html element currently being assessed * @param _index - the index of the html element currently being assessed * @returns void * @default (item: HTMLElement, _index: number) => item.classList.add('active') */ "activeHandler": (item: HTMLElement, _index: number) => void; /** * Show or hide the browser's default scrollbars. Defaults to `true` on vertical orientation and `false` on `horizontal` orientation */ "hideScrollbars": any; /** * A function called when an item becomes 'inactive' (because another item was made active) * @param item - html element currently being assessed * @param _index - the index of the html element currently being assessed * @returns void * @default (item: HTMLElement, _index: number) => item.classList.remove('active') */ "inactiveHandler": (item: HTMLElement, _index: number) => void; /** * A function called to assess an initial, active item * @param item - html element currently being assessed * @param _index - the index of the html element currently being assessed * @returns void * @default (item: HTMLElement, _index: number) => item.classList.contains('active') */ "isActiveHandler": (item: HTMLElement, _index: number) => boolean; /** * Used to appropriately label the scrolling element for screen-readers */ "label": string; /** * The flex direction of the element * @default 'horizontal' */ "orientation": 'horizontal' | 'vertical'; /** * Disables the scroll arrow buttons that appear when content overflows * @default true */ "scrollControls": boolean; /** * Shows a track and a highlight line that automatically moves the currently active item. * @default false */ "showIndicator": boolean; /** * Sync up the view to the active item. Use this when the active item changes outside of this component. */ "syncActiveItem": () => Promise; } /** * Mega drop-down container. Groups `nano-mdd-item` elements and optionally * enforces accordion behaviour (only one item open at a time). * @version 8.24.0 * @status experimental */ interface NanoMdd { /** * When true, only one item can be open at a time * @default false */ "accordion": boolean; } /** * An item within a `nano-mdd`. Renders as a plain labelled column in grid mode, * or as a collapsible `nano-details` in accordion mode. * @version 8.24.0 * @status experimental */ interface NanoMddItem { /** * Set by parent nano-mdd — switches between column and accordion rendering * @default false */ "accordion": boolean; /** * Controlled open state (used by nano-mdd in accordion mode) * @default false */ "open": boolean; } /** * Menus provide a list of options for the user to choose from. * @version 1.0.0 * @status stable */ interface NanoMenu { /** * get the focus state of the menu * @readonly * @default false */ "hasFocus": boolean; /** * an accessible label */ "label": string; /** * Removes focus from the menu. */ "removeFocus": () => Promise; /** * Removes any active item's state */ "resetActiveItem": () => Promise; /** * Sets focus on the menu. */ "setFocus": () => Promise; /** * Sets the current active item */ "showActiveElement": () => Promise; /** * changes the role of the underlying control (required for accessibility semantics). By default this will be set via the frequency of element type (e.g. `