fix: CopyButton text prop and Dropdown selectedId prop should be required (#1311)

* chore(deps-dev): upgrade sveld to v0.17.0

* fix(copy-button): text prop is required

* fix(dropdown): selectedId prop is required

* Run "yarn build:docs"

* docs: display "Required" tag for required props
This commit is contained in:
metonym 2022-05-22 12:39:53 -07:00 committed by GitHub
commit 04d758f869
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 2147 additions and 1215 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -68,13 +68,18 @@
<InlineSnippet code="{prop.name}" />
{#if prop.reactive}
<div
style="white-space: nowrap; margin-top: var(--cds-spacing-03); margin-bottom: var(--cds-spacing-03)"
style="white-space: nowrap; margin-top: var(--cds-spacing-03); margin-bottom: var(--cds-spacing-{prop.isRequired
? '01'
: '03'})"
>
<Tag style="margin-left: 0" size="sm" type="cyan">
Reactive
</Tag>
</div>
{/if}
{#if prop.isRequired}
<Tag size="sm" type="magenta">Required</Tag>
{/if}
</StructuredListCell>
<StructuredListCell>
{#each (prop.type || "").split(" | ") as type, i (type)}

View file

@ -38,7 +38,7 @@
"rollup-plugin-svelte": "^7.1.0",
"rollup-plugin-terser": "^7.0.2",
"sass": "^1.49.11",
"sveld": "^0.15.3",
"sveld": "^0.17.0",
"svelte": "^3.46.6",
"svelte-check": "^2.4.6",
"typescript": "^4.6.3"

View file

@ -12,7 +12,7 @@
* Specify the text to copy
* @type {string}
*/
export let text = undefined;
export let text;
/**
* Override the default copy behavior of using the navigator.clipboard.writeText API to copy text

View file

@ -23,7 +23,7 @@
* Specify the selected item id
* @type {DropdownItemId}
*/
export let selectedId = undefined;
export let selectedId;
/**
* Specify the type of dropdown

View file

@ -25,7 +25,7 @@ export interface CopyButtonProps
* Specify the text to copy
* @default undefined
*/
text?: string;
text: string;
/**
* Override the default copy behavior of using the navigator.clipboard.writeText API to copy text

View file

@ -28,7 +28,7 @@ export interface DropdownProps
* Specify the selected item id
* @default undefined
*/
selectedId?: DropdownItemId;
selectedId: DropdownItemId;
/**
* Specify the type of dropdown

View file

@ -1330,10 +1330,10 @@ supports-color@^9.2.1:
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-9.2.2.tgz#502acaf82f2b7ee78eb7c83dcac0f89694e5a7bb"
integrity sha512-XC6g/Kgux+rJXmwokjm9ECpD6k/smUoS5LKlUCcsYr4IY3rW0XyAympon2RmxGrlnZURMpg5T18gWDP9CsHXFA==
sveld@^0.15.3:
version "0.15.3"
resolved "https://registry.yarnpkg.com/sveld/-/sveld-0.15.3.tgz#75fe72f472b9cfbe863f6f0b074612d4132dc960"
integrity sha512-3TYhrLpm8z8elnZ6ffQeq1SeoxzC2zsFY/9QeNHu1UcQxAZ6LqfyUufnOkNkelYJMq9uBn4bGUAYJpbpTMjnOA==
sveld@^0.17.0:
version "0.17.0"
resolved "https://registry.yarnpkg.com/sveld/-/sveld-0.17.0.tgz#af1f3d24a507d7bc84a356bf7f5c4b599ea444c2"
integrity sha512-OB15S0KyT033fXsZL9hnyuQDaSvpuRQs4CwIRVVnwbLy6IbBQyvNl9LG7Cu7z982qoYY3AMkZ0GzjpTtiMI4OQ==
dependencies:
"@rollup/plugin-node-resolve" "^13.2.1"
acorn "^8.7.0"