Skip to content

Commit ea2109d

Browse files
authored
fix(playground): warn if version not specified (#2668)
1 parent 739161e commit ea2109d

File tree

311 files changed

+510
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

311 files changed

+510
-105
lines changed

docs/api/select.md

Lines changed: 2 additions & 2 deletions

src/components/global/Playground/index.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ interface UsageTargetOptions {
9696
*/
9797
declarations?: string[];
9898
};
99-
/**
100-
* The major version of Ionic to use in the generated Stackblitz examples.
101-
* This will also load assets for Stackblitz from the specified version directory.
102-
*/
103-
version?: number;
10499
}
105100

106101
/**
@@ -120,7 +115,7 @@ export default function Playground({
120115
mode,
121116
devicePreview,
122117
includeIonContent = true,
123-
version = 6,
118+
version,
124119
}: {
125120
code: { [key in UsageTarget]?: MdxContent | UsageTargetOptions };
126121
title?: string;
@@ -135,6 +130,10 @@ export default function Playground({
135130
description?: string;
136131
devicePreview?: boolean;
137132
includeIonContent: boolean;
133+
/**
134+
* The major version of Ionic to use in the generated Stackblitz examples.
135+
* This will also load assets for Stackblitz from the specified version directory.
136+
*/
138137
version: number;
139138
}) {
140139
if (!code || Object.keys(code).length === 0) {
@@ -145,6 +144,10 @@ export default function Playground({
145144
console.warn(`Invalid mode provided: ${mode}. Accepted values are: "ios" or "md".`);
146145
return;
147146
}
147+
if (typeof version === 'undefined') {
148+
console.warn('You must specify a `version` for the Playground example. For example: <Playground version="7" />');
149+
return;
150+
}
148151

149152
const { isDarkTheme } = useThemeContext();
150153

static/usage/v6/accordion/accessibility/animations/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/basic/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/customization/advanced-expansion-styles/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/customization/expansion-styles/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/customization/icons/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/customization/theming/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/disable-group/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/disable/group/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/disable/individual/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/listen-changes/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/multiple/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/readonly/group/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/readonly/individual/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/toggle/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/action-sheet/basic/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/action-sheet/theming/css-properties/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/action-sheet/theming/styling/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/alert/buttons/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/alert/customization/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/alert/inputs/radios/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/alert/inputs/text-inputs/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/alert/presenting/controller/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/avatar/basic/index.md

Lines changed: 1 addition & 1 deletion

static/usage/v6/avatar/chip/index.md

Lines changed: 1 addition & 1 deletion

static/usage/v6/avatar/item/index.md

Lines changed: 1 addition & 1 deletion

static/usage/v6/avatar/theming/css-properties/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/back-button/basic/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/back-button/custom/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/backdrop/basic/index.md

Lines changed: 6 additions & 1 deletion

static/usage/v6/backdrop/styling/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/badge/basic/index.md

Lines changed: 1 addition & 1 deletion

static/usage/v6/badge/theming/colors/index.md

Lines changed: 6 additions & 1 deletion

static/usage/v6/badge/theming/css-properties/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/breadcrumbs/basic/index.md

Lines changed: 1 addition & 1 deletion

static/usage/v6/breadcrumbs/collapsing-items/expand-on-click/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/breadcrumbs/collapsing-items/items-before-after/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/breadcrumbs/collapsing-items/max-items/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/breadcrumbs/collapsing-items/popover-on-click/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/breadcrumbs/icons/custom-separators/index.md

Lines changed: 5 additions & 1 deletion

static/usage/v6/breadcrumbs/icons/icons-on-items/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/breadcrumbs/theming/colors/index.md

Lines changed: 5 additions & 1 deletion

static/usage/v6/breadcrumbs/theming/css-properties/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/button/basic/index.md

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)