diff --git a/.assets/powered-by-vercel.svg b/.assets/powered-by-vercel.svg new file mode 100644 index 00000000..a7528066 --- /dev/null +++ b/.assets/powered-by-vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index c776e6c5..2b2fe759 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -3022,23 +3022,24 @@ import { Pagination } from "carbon-components-svelte"; ### Props -| Prop name | Type | Default value | -| :---------------- | :--------------------------------------------------------------- | :---------------- | -| page | number | 1 | -| totalItems | number | 0 | -| disabled | boolean | false | -| forwardText | string | "Next page" | -| backwardText | string | "Previous page" | -| itemsPerPageText | string | "Items per page:" | -| itemText | (min: number, max: number) => string | -- | -| itemRangeText | (min: number, max: number, total: number) => string | -- | -| pageInputDisabled | boolean | false | -| pageSize | number | 10 | -| pageSizes | number[] | -- | -| pagesUnknown | boolean | false | -| pageText | (page: number) => string | -- | -| pageRangeText | (current: number, total: number) => string | -- | -| id | string | -- | +| Prop name | Type | Default value | +| :-------------------- | :--------------------------------------------------------------- | :---------------- | +| page | number | 1 | +| totalItems | number | 0 | +| disabled | boolean | false | +| forwardText | string | "Next page" | +| backwardText | string | "Previous page" | +| itemsPerPageText | string | "Items per page:" | +| itemText | (min: number, max: number) => string | -- | +| itemRangeText | (min: number, max: number, total: number) => string | -- | +| pageInputDisabled | boolean | false | +| pageSizeInputDisabled | boolean | false | +| pageSize | number | 10 | +| pageSizes | number[] | -- | +| pagesUnknown | boolean | false | +| pageText | (page: number) => string | -- | +| pageRangeText | (current: number, total: number) => string | -- | +| id | string | -- | ### Slots diff --git a/README.md b/README.md index 7928fd41..9d250359 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@ # carbon-components-svelte +> `carbon-components-svelte` is a Svelte component library that implements the [Carbon Design System](https://github.com/carbon-design-system), an open source design system by IBM. + +> A design system can facilitate frontend development and prototyping because it is encourages reuse, consistency, and extensibility. + [![NPM][npm]][npm-url] [![Build][build]][build-badge] - -> Svelte implementation of the [Carbon Design System](https://github.com/carbon-design-system) - -`carbon-components-svelte` is a Svelte component library that implements the Carbon Design System, an open source design system by IBM. - -A design system can facilitate frontend development and prototyping because it is encourages reuse, consistency, and extensibility. + +Deploys by Vercel + ## [Documentation](http://ibm.biz/carbon-svelte) diff --git a/docs/.cfignore b/docs/.cfignore deleted file mode 100644 index 572f1972..00000000 --- a/docs/.cfignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!Staticfile -!dist \ No newline at end of file diff --git a/docs/Staticfile b/docs/Staticfile deleted file mode 100644 index fdb9a387..00000000 --- a/docs/Staticfile +++ /dev/null @@ -1,2 +0,0 @@ -root: dist -force_https: true \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 98e9585d..3f177e40 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,6 +5,10 @@ Carbon Components Svelte +
diff --git a/docs/manifest.yml b/docs/manifest.yml deleted file mode 100644 index 7eec0187..00000000 --- a/docs/manifest.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -applications: - - name: carbon-components-svelte - memory: 64M - disk_quota: 64M - buildpacks: - - https://github.com/cloudfoundry/staticfile-buildpack.git diff --git a/docs/package.json b/docs/package.json index b2b9cb42..94eb08e7 100644 --- a/docs/package.json +++ b/docs/package.json @@ -6,9 +6,8 @@ "dev:svite": "svite", "build": "run-s build:*", "build:routify": "routify run -b", - "build:svite": "svite build --assetsDir=assets", - "postbuild": "node scripts/postbuild", - "deploy": "npx gh-pages -d dist" + "build:svite": "svite build", + "postbuild": "node scripts/postbuild" }, "devDependencies": { "@sveltech/routify": "^1.9.9", @@ -16,11 +15,9 @@ "clipboard-copy": "^3.1.0", "fs-extra": "^9.0.1", "mdsvex": "^0.8.8", - "node-sass": "^4.14.1", "npm-run-all": "^4.1.5", "playwright": "^1.4.2", "polka": "^0.5.2", - "posthtml": "^0.13.3", "prettier": "^2.1.2", "prettier-plugin-svelte": "^1.4.0", "prism-svelte": "^0.4.7", diff --git a/docs/public/powered-by-vercel.svg b/docs/public/powered-by-vercel.svg new file mode 100644 index 00000000..a7528066 --- /dev/null +++ b/docs/public/powered-by-vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/scripts/postbuild.js b/docs/scripts/postbuild.js index b496b7f0..b6b49b45 100644 --- a/docs/scripts/postbuild.js +++ b/docs/scripts/postbuild.js @@ -2,7 +2,6 @@ const sirv = require("sirv"); const polka = require("polka"); const { chromium } = require("playwright"); const fs = require("fs-extra"); -const posthtml = require("posthtml"); const path = require("path"); const PORT = process.env.PORT || 3000; @@ -17,58 +16,25 @@ async function scrape(page, url = "") { return html; } -function relativePaths(depth = 0) { - const asset_extension = new RegExp(/.(js|css|ico)$/); - let relative_path = - depth > 0 - ? Array.from({ length: depth }, (_, i) => "../") - .join("") - .slice(0, -1) - : "."; - - return (tree) => { - tree.match( - [ - { attrs: { href: asset_extension } }, - { attrs: { src: asset_extension } }, - ], - (node) => { - if ("href" in node.attrs) { - node.attrs.href = relative_path + node.attrs.href; - } - - if ("src" in node.attrs) { - node.attrs.src = relative_path + node.attrs.src; - } - - return node; - } - ); - - tree.match({ attrs: { id: "__routify_iframes" } }, (node) => {}); - }; -} - -async function processHtml(html, { dir, outfilePath, depth }) { - const processed = await posthtml().use(relativePaths(depth)).process(html); +async function processHtml(html, { dir, outfilePath }) { if (dir) { await fs.ensureDir(outfilePath); await fs.writeFile( path.join(outfilePath, "index.html"), - await `${processed.html}` + await `${html}` ); } else { await fs.writeFile( path.join(outfilePath), - await `${processed.html}` + await `${html}` ); } - console.log("Prerendered:", outfilePath); + console.log("Prerendered path:", outfilePath); } const app = polka() - .use(sirv("dist", { single: true })) + .use(sirv(OUT_DIR, { single: true })) .listen(PORT, async (error) => { if (error) { console.log(error); @@ -89,12 +55,10 @@ const app = polka() await processHtml(result, { dir: true, outfilePath: `${OUT_DIR}/${filePath}`, - depth: 2, }); } await fs.ensureDir(`${OUT_DIR}/framed/`); - await fs.ensureDir(`${OUT_DIR}/framed/Grid`); const framed = [ { @@ -128,7 +92,6 @@ const app = polka() await processHtml(result, { dir: true, outfilePath: `${OUT_DIR}/${filePath}`, - depth: 3, }); } } diff --git a/docs/src/App.svelte b/docs/src/App.svelte index 40bf738e..e2d19ce3 100644 --- a/docs/src/App.svelte +++ b/docs/src/App.svelte @@ -3,8 +3,4 @@ import { routes } from "../.routify/routes"; - - diff --git a/docs/src/components/Footer.svelte b/docs/src/components/Footer.svelte new file mode 100644 index 00000000..c74fe3b7 --- /dev/null +++ b/docs/src/components/Footer.svelte @@ -0,0 +1,24 @@ + + + + + diff --git a/docs/src/components/Preview.svelte b/docs/src/components/Preview.svelte index cbde3957..acbef287 100644 --- a/docs/src/components/Preview.svelte +++ b/docs/src/components/Preview.svelte @@ -143,7 +143,7 @@ kind="ghost" target="_blank" size="field" - href="{src}" + href="{$url(src)}" icon="{Launch16}" > Open in new tab diff --git a/docs/src/pages/_layout.svelte b/docs/src/pages/_layout.svelte index 9928e608..7e602393 100644 --- a/docs/src/pages/_layout.svelte +++ b/docs/src/pages/_layout.svelte @@ -17,10 +17,10 @@ SideNavItems, SideNavMenu, SideNavMenuItem, - SideNavLink, } from "carbon-components-svelte"; import LogoGithub20 from "carbon-icons-svelte/lib/LogoGithub20"; import Theme from "../components/Theme.svelte"; + import Footer from "../components/Footer.svelte"; let isOpen = false; let isSideNavOpen = true; @@ -164,7 +164,6 @@ @@ -240,4 +239,5 @@ +