Change BBUI to single bundle export and clean up some form components

This commit is contained in:
Andrew Kingston 2021-04-15 19:28:08 +01:00
parent d779fbbea4
commit 591d1c0fc5
13 changed files with 13 additions and 52 deletions

View File

@ -9,14 +9,10 @@
".": { ".": {
"import": "./dist/bbui.es.js" "import": "./dist/bbui.es.js"
}, },
"./internal": {
"import": "./dist/internal.es.js"
},
"./package.json": "./package.json", "./package.json": "./package.json",
"./dist/style.css": "./dist/style.css" "./dist/style.css": "./dist/style.css"
}, },
"scripts": { "scripts": {
"dev:builder": "rollup -cw",
"build": "rollup -c" "build": "rollup -c"
}, },
"devDependencies": { "devDependencies": {

View File

@ -5,12 +5,12 @@ import json from "@rollup/plugin-json"
import { terser } from "rollup-plugin-terser" import { terser } from "rollup-plugin-terser"
import postcss from "rollup-plugin-postcss" import postcss from "rollup-plugin-postcss"
const makeConfig = ({ input, name }) => ({ export default {
input, input: "src/index.js",
output: { output: {
sourcemap: true, sourcemap: true,
format: "esm", format: "esm",
file: `dist/${name}.es.js`, file: "dist/bbui.es.js",
}, },
plugins: [ plugins: [
resolve(), resolve(),
@ -22,9 +22,4 @@ const makeConfig = ({ input, name }) => ({
terser(), terser(),
json(), json(),
], ],
}) }
export default [
makeConfig({ input: "src/index.js", name: "bbui" }),
makeConfig({ input: "src/Form/internal/index.js", name: "internal" }),
]

View File

@ -0,0 +1,3 @@
export { default as CoreTextField } from "./TextField.svelte"
export { default as CoreSelect } from "./Select.svelte"
export { default as CoreMultiselect } from "./Multiselect.svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import Field from "./Field.svelte" import Field from "./Field.svelte"
import TextField from "./internal/TextField.svelte" import TextField from "./Core/TextField.svelte"
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
export let value = null export let value = null

View File

@ -1,6 +1,6 @@
<script> <script>
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
import Multiselect from "./internal/Multiselect.svelte" import Multiselect from "./Core/Multiselect.svelte"
import Field from "./Field.svelte" import Field from "./Field.svelte"
export let value = null export let value = null

View File

@ -1,6 +1,6 @@
<script> <script>
import Field from "./Field.svelte" import Field from "./Field.svelte"
import Select from "./internal/Select.svelte" import Select from "./Core/Select.svelte"
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
export let value = null export let value = null

View File

@ -1,3 +0,0 @@
export { default as TextField } from "./TextField.svelte"
export { default as Select } from "./Select.svelte"
export { default as Multiselect } from "./Multiselect.svelte"

View File

@ -40,6 +40,9 @@ export { default as Slider } from "./Form/Slider.svelte"
export { default as Context } from "./context" export { default as Context } from "./context"
export { default as Table } from "./Table/Table.svelte" export { default as Table } from "./Table/Table.svelte"
// Core form components to be used elsewhere (standard components)
export * from "./Form/Core"
// Actions // Actions
export { default as autoResizeTextArea } from "./Actions/autoresize_textarea" export { default as autoResizeTextArea } from "./Actions/autoresize_textarea"
export { default as positionDropdown } from "./Actions/position_dropdown" export { default as positionDropdown } from "./Actions/position_dropdown"

View File

@ -1,33 +0,0 @@
<script>
import { Input } from "@budibase/bbui"
export let validationErrors
let blurred = { api: false }
</script>
<h2>Set up your API Key</h2>
<div class="container">
<Input
on:input={() => (blurred.api = true)}
label="API Key"
name="apiKey"
placeholder="Use command-V to paste your API Key"
type="password"
error={blurred.api && validationErrors.apiKey} />
<a target="_blank" href="https://portal.budi.live/">Get API Key</a>
</div>
<style>
.container {
display: grid;
grid-gap: 40px;
}
a {
color: var(--grey-7);
font-weight: 500;
font-size: var(--font-size-s);
}
a:hover {
color: var(--ink);
}
</style>