Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

feat(codesandbox): skip-to-content #913

Merged
merged 4 commits into from
Dec 27, 2021
Merged
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
13 changes: 3 additions & 10 deletions examples/codesandbox/basic/components/inline-loading/cdn.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,13 @@
href="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/plex.css"/>
<style>
/* Suppress custom element until styles are loaded */
bx-form-item:not(:defined) {
bx-inline-loading:not(:defined) {
display: none;
}
</style>
<script type="module" src="https://1.www.s81c.com/common/carbon/web-components/tag/latest/form.min.js"></script>
<script type="module" src="https://1.www.s81c.com/common/carbon/web-components/tag/latest/input.min.js"></script>
<script type="module" src="https://1.www.s81c.com/common/carbon/web-components/tag/latest/inline-loading.min.js"></script>
</head>
<body>
<bx-form-item>
<bx-input>
<span slot="label-text">Label text</span>
<span slot="helper-text">Optional helper text</span>
<span slot="validity-message">Something isn't right</span>
</bx-input>
</bx-form-item>
<bx-inline-loading status="active">Loading data...</bx-inline-loading>
</body>
</html>
12 changes: 9 additions & 3 deletions examples/codesandbox/basic/components/input/cdn.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@
href="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/plex.css"/>
<style>
/* Suppress custom element until styles are loaded */
bx-inline-loading:not(:defined) {
bx-form-item:not(:defined) {
display: none;
}
</style>
<script type="module" src="https://1.www.s81c.com/common/carbon/web-components/tag/latest/inline-loading.min.js"></script>
<script type="module" src="https://1.www.s81c.com/common/carbon/web-components/tag/latest/input.min.js"></script>
</head>
<body>
<bx-inline-loading status="active">Loading data...</bx-inline-loading>
<bx-form-item>
<bx-input>
<span slot="label-text">Label text</span>
<span slot="helper-text">Optional helper text</span>
<span slot="validity-message">Something isn't right</span>
</bx-input>
</bx-form-item>
</body>
</html>
22 changes: 22 additions & 0 deletions examples/codesandbox/basic/components/skip-to-content/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": false,
"targets": [
"last 1 version",
"Firefox ESR",
"not opera > 0",
"not op_mini > 0",
"not op_mob > 0",
"not android > 0",
"not edge > 0",
"not ie > 0",
"not ie_mob > 0"
]
}
]
],
"plugins": [["@babel/plugin-transform-runtime", { "version": "7.3.0" }]]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# production
/build

# misc
.DS_Store
.cache
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
35 changes: 35 additions & 0 deletions examples/codesandbox/basic/components/skip-to-content/cdn.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--
@license

Copyright IBM Corp. 2020

This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->

<html>
<head>
<title>@carbon/ibmdotcom-web-components example</title>
<meta charset="UTF-8"/>
<link rel="stylesheet"
href="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/plex.css"/>
<style>
/* Suppress custom element until styles are loaded */
bx-skip-to-content:not(:defined) {
display: none;
}
</style>
<script type="module" src="https://1.www.s81c.com/common/carbon/web-components/tag/latest/skip-to-content.min.js"></script>
<script type="module" src="https://1.www.s81c.com/common/carbon/web-components/tag/latest/button.min.js"></script>
</head>
<body>
<bx-skip-to-content href="#main-content"></bx-skip-to-content>
<div
id="main-content"
name="main-content">
<bx-btn href="https://www.ibm.com">
Button
</bx-btn>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
@license

Copyright IBM Corp. 2020

This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->

<html>
<head>
<title>carbon-web-components example</title>
<meta charset="UTF-8" />
<link rel="stylesheet"
href="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/plex.css"/>
<style>
/* Suppress custom element until styles are loaded */
bx-skip-to-content:not(:defined) {
display: none;
}
</style>
<script type="module" src="src/index.js"></script>
</head>
<body>
<bx-skip-to-content href="#main-content"></bx-skip-to-content>
<div
id="main-content"
name="main-content">
<bx-btn href="https://www.ibm.com">
Button
</bx-btn>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "carbon-web-components-skip-to-content-example",
"version": "0.1.0",
"private": true,
"description": "Sample project for getting started with the Web Components from Carbon.",
"license": "Apache-2",
"main": "index.html",
"scripts": {
"build": "parcel build *.html --no-minify --public-url ./",
"clean": "rimraf node_modules dist .cache",
"start": "parcel index.html --port=9000 --no-hmr"
},
"dependencies": {
"carbon-web-components": "latest"
},
"devDependencies": {
"@babel/core": "^7.0.0-0",
"parcel-bundler": "1.12.3",
"rimraf": "^3.0.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"template": "node"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @license
*
* Copyright IBM Corp. 2020, 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import 'carbon-web-components/es/components/skip-to-content/index.js';
import 'carbon-web-components/es/components/button/index.js';