build: add script to generate component index

- move typedefs for correct type parsing
This commit is contained in:
Eric Liu 2020-08-13 17:24:00 -07:00
commit 5968e22bd9
14 changed files with 5518 additions and 207 deletions

View file

@ -1,8 +1,4 @@
<script>
/**
* @typedef {{ id: string; text: string; }} ComboBoxItem
*/
/**
* Set the combobox items
* @type {ComboBoxItem[]} [items=[]]
@ -111,6 +107,10 @@
*/
export let ref = null;
/**
* @typedef {{ id: string; text: string; }} ComboBoxItem
*/
import { createEventDispatcher, afterUpdate } from "svelte";
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
import {

View file

@ -1,10 +1,4 @@
<script>
/**
* @typedef {string} DropdownItemId
* @typedef {string} DropdownItemText
* @typedef {{ id: DropdownItemId; text: DropdownItemText; }} DropdownItem
*/
/**
* Set the dropdown items
* @type {DropdownItem[]} [items=[]]
@ -113,6 +107,12 @@
*/
export let ref = null;
/**
* @typedef {string} DropdownItemId
* @typedef {string} DropdownItemText
* @typedef {{ id: DropdownItemId; text: DropdownItemText; }} DropdownItem
*/
import { setContext } from "svelte";
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
import {

View file

@ -1,8 +1,4 @@
<script>
/**
* @typedef {string[]} Files
*/
/**
* Specify the accepted file types
* @type {string[]} [accept=[]]
@ -64,6 +60,10 @@
*/
export let ref = null;
/**
* @typedef {string[]} Files
*/
import { createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher();

View file

@ -30,12 +30,6 @@
*/
export let aspectRatio = undefined;
/**
* @typedef {boolean | number} ColumnSize
* @typedef {{span?: ColumnSize; offset: number;}} ColumnSizeDescriptor
* @typedef {ColumnSize | ColumnSizeDescriptor} ColumnBreakpoint
*/
/**
* Set the small breakpoint
* @type {ColumnBreakpoint} [sm]
@ -66,6 +60,12 @@
*/
export let max = undefined;
/**
* @typedef {boolean | number} ColumnSize
* @typedef {{span?: ColumnSize; offset: number;}} ColumnSizeDescriptor
* @typedef {ColumnSize | ColumnSizeDescriptor} ColumnBreakpoint
*/
/**
* Column breakpoints
* @constant

View file

@ -17,10 +17,6 @@
*/
export let tabindex = "-1";
/**
* @typedef {"close" | "open"} ListBoxFieldTranslationId
*/
/**
* Default translation ids
* @constant
@ -46,6 +42,10 @@
*/
export let ref = null;
/**
* @typedef {"close" | "open"} ListBoxFieldTranslationId
*/
import { getContext } from "svelte";
const defaultTranslations = {

View file

@ -12,16 +12,16 @@
*/
export const translationIds = { close: "close", open: "open" };
/**
* @typedef {"close" | "open"} ListBoxMenuIconTranslationId
*/
/**
* Override the default translation ids
* @type {(id: ListBoxMenuIconTranslationId) => string} [translateWithId = (id) => string]
*/
export let translateWithId = (id) => defaultTranslations[id];
/**
* @typedef {"close" | "open"} ListBoxMenuIconTranslationId
*/
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
const defaultTranslations = {

View file

@ -11,10 +11,6 @@
*/
export let disabled = false;
/**
* @typedef {"clearAll" | "clearSelection"} ListBoxSelectionTranslationId
*/
/**
* Default translation ids
* @constant
@ -37,6 +33,10 @@
*/
export let ref = null;
/**
* @typedef {"clearAll" | "clearSelection"} ListBoxSelectionTranslationId
*/
import { createEventDispatcher, getContext } from "svelte";
import Close16 from "carbon-icons-svelte/lib/Close16";

View file

@ -95,10 +95,6 @@
*/
export let hideLabel = false;
/**
* @typedef {"increment" | "decrement"} NumberInputTranslationId
*/
/**
* Override the default translation ids
* @type {(id: NumberInputTranslationId) => string} [translateWithId = (id: NumberInputTranslationId) => string]
@ -133,6 +129,10 @@
*/
export let ref = null;
/**
* @typedef {"increment" | "decrement"} NumberInputTranslationId
*/
import { createEventDispatcher, afterUpdate } from "svelte";
import CaretDownGlyph from "carbon-icons-svelte/lib/CaretDownGlyph";
import CaretUpGlyph from "carbon-icons-svelte/lib/CaretUpGlyph";