From 30aed16951569f5114e0bbb15f099f499c9181c0 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Fri, 14 Aug 2020 11:21:52 +0100 Subject: [PATCH 1/2] remove references to material design components --- .../userInterface/temporaryPanelStructure.js | 43 ------------------- .../new/appDirectoryTemplate/package.json | 3 +- .../appDirectoryTemplate/pages/main/page.json | 2 +- .../pages/unauthenticated/page.json | 2 +- .../cli/src/commands/new/page.template.json | 2 +- .../server/src/api/controllers/application.js | 5 +-- .../appDirectoryTemplate/package.json | 3 +- .../appDirectoryTemplate/pages/main/page.json | 2 +- .../pages/unauthenticated/page.json | 5 +-- .../server/src/utilities/builder/buildPage.js | 5 +-- .../server/src/utilities/createAppPackage.js | 2 +- 11 files changed, 10 insertions(+), 64 deletions(-) diff --git a/packages/builder/src/components/userInterface/temporaryPanelStructure.js b/packages/builder/src/components/userInterface/temporaryPanelStructure.js index 8bc39974c6..5b016dcc84 100644 --- a/packages/builder/src/components/userInterface/temporaryPanelStructure.js +++ b/packages/builder/src/components/userInterface/temporaryPanelStructure.js @@ -478,44 +478,6 @@ export default { }, ], }, - - { - _component: "@budibase/materialdesign-components/BasicCard", - name: "Card", - description: - "A basic card component that can contain content and actions.", - icon: "ri-layout-bottom-line", - children: [], - properties: { - design: { ...all }, - settings: [ - { - label: "Heading", - key: "heading", - control: Input, - placeholder: "text", - }, - { - label: "Subheading", - key: "subheading", - control: Input, - placeholder: "text", - }, - { - label: "Content", - key: "content", - control: Input, - placeholder: "text", - }, - { - label: "Image", - key: "imageUrl", - control: Input, - placeholder: "src", - }, - ], - }, - }, { name: "Table", _component: "@budibase/standard-components/datatable", @@ -564,11 +526,6 @@ export default { }, ], }, - template: { - component: "@budibase/materialdesign-components/Form", - description: "Form for saving a record", - name: "@budibase/materialdesign-components/recordForm", - }, }, { _component: "@budibase/standard-components/dataformwide", diff --git a/packages/cli/src/commands/new/appDirectoryTemplate/package.json b/packages/cli/src/commands/new/appDirectoryTemplate/package.json index f49e35d23f..e04b9debc8 100644 --- a/packages/cli/src/commands/new/appDirectoryTemplate/package.json +++ b/packages/cli/src/commands/new/appDirectoryTemplate/package.json @@ -5,7 +5,6 @@ "author": "", "license": "ISC", "dependencies": { - "@budibase/standard-components": "0.x", - "@budibase/materialdesign-components": "0.x" + "@budibase/standard-components": "0.x" } } diff --git a/packages/cli/src/commands/new/appDirectoryTemplate/pages/main/page.json b/packages/cli/src/commands/new/appDirectoryTemplate/pages/main/page.json index 2deddd1c74..2a106fbb3d 100644 --- a/packages/cli/src/commands/new/appDirectoryTemplate/pages/main/page.json +++ b/packages/cli/src/commands/new/appDirectoryTemplate/pages/main/page.json @@ -2,7 +2,7 @@ "title": "Test App", "favicon": "./_shared/favicon.png", "stylesheets": [], - "componentLibraries": ["@budibase/standard-components", "@budibase/materialdesign-components"], + "componentLibraries": ["@budibase/standard-components"], "props" : { "_component": "@budibase/standard-components/container", "_children": [], diff --git a/packages/cli/src/commands/new/appDirectoryTemplate/pages/unauthenticated/page.json b/packages/cli/src/commands/new/appDirectoryTemplate/pages/unauthenticated/page.json index 95941e2ea5..335f9cd343 100644 --- a/packages/cli/src/commands/new/appDirectoryTemplate/pages/unauthenticated/page.json +++ b/packages/cli/src/commands/new/appDirectoryTemplate/pages/unauthenticated/page.json @@ -2,7 +2,7 @@ "title": "Test App", "favicon": "./_shared/favicon.png", "stylesheets": [], - "componentLibraries": ["@budibase/standard-components", "@budibase/materialdesign-components"], + "componentLibraries": ["@budibase/standard-components"], "props" : { "_component": "@budibase/standard-components/container", "_children": [], diff --git a/packages/cli/src/commands/new/page.template.json b/packages/cli/src/commands/new/page.template.json index 9467289535..d6aaa5a7f3 100644 --- a/packages/cli/src/commands/new/page.template.json +++ b/packages/cli/src/commands/new/page.template.json @@ -2,7 +2,7 @@ "title": "Test App", "favicon": "./_shared/favicon.png", "stylesheets": [], - "componentLibraries": ["@budibase/standard-components", "@budibase/materialdesign-components"], + "componentLibraries": ["@budibase/standard-components" ], "props" : { "_component": "@budibase/standard-components/container", "_children": [], diff --git a/packages/server/src/api/controllers/application.js b/packages/server/src/api/controllers/application.js index d6200a0a20..eb5ca5ee95 100644 --- a/packages/server/src/api/controllers/application.js +++ b/packages/server/src/api/controllers/application.js @@ -64,10 +64,7 @@ exports.create = async function(ctx) { type: "app", instances: [], userInstanceMap: {}, - componentLibraries: [ - "@budibase/standard-components", - "@budibase/materialdesign-components", - ], + componentLibraries: ["@budibase/standard-components"], name: ctx.request.body.name, } diff --git a/packages/server/src/utilities/appDirectoryTemplate/package.json b/packages/server/src/utilities/appDirectoryTemplate/package.json index e67d5e0c17..0510fb124e 100644 --- a/packages/server/src/utilities/appDirectoryTemplate/package.json +++ b/packages/server/src/utilities/appDirectoryTemplate/package.json @@ -5,7 +5,6 @@ "author": "", "license": "ISC", "dependencies": { - "@budibase/standard-components": "0.x", - "@budibase/materialdesign-components": "0.x" + "@budibase/standard-components": "0.x" } } diff --git a/packages/server/src/utilities/appDirectoryTemplate/pages/main/page.json b/packages/server/src/utilities/appDirectoryTemplate/pages/main/page.json index 7f301e8e5f..9e2c3c8e64 100644 --- a/packages/server/src/utilities/appDirectoryTemplate/pages/main/page.json +++ b/packages/server/src/utilities/appDirectoryTemplate/pages/main/page.json @@ -2,7 +2,7 @@ "title": "{{ name }}", "favicon": "./_shared/favicon.png", "stylesheets": [], - "componentLibraries": ["@budibase/standard-components", "@budibase/materialdesign-components"], + "componentLibraries": ["@budibase/standard-components"], "props": { "_id": "private-master-root", "_component": "@budibase/standard-components/container", diff --git a/packages/server/src/utilities/appDirectoryTemplate/pages/unauthenticated/page.json b/packages/server/src/utilities/appDirectoryTemplate/pages/unauthenticated/page.json index fb010023b9..483b20cf44 100644 --- a/packages/server/src/utilities/appDirectoryTemplate/pages/unauthenticated/page.json +++ b/packages/server/src/utilities/appDirectoryTemplate/pages/unauthenticated/page.json @@ -1,8 +1,5 @@ { - "componentLibraries": [ - "@budibase/standard-components", - "@budibase/materialdesign-components" - ], + "componentLibraries": ["@budibase/standard-components"], "title": "{{ name }}", "favicon": "./_shared/favicon.png", "stylesheets": [], diff --git a/packages/server/src/utilities/builder/buildPage.js b/packages/server/src/utilities/builder/buildPage.js index ab5c65e619..1f9929ab05 100644 --- a/packages/server/src/utilities/builder/buildPage.js +++ b/packages/server/src/utilities/builder/buildPage.js @@ -96,10 +96,7 @@ const buildFrontendAppDefinition = async (config, appId, pageName, pkg) => { const clientUiDefinition = JSON.stringify({ page: pkg.page, screens: pkg.screens, - libraries: [ - "@budibase/materialdesign-components", - "@budibase/standard-components", - ], + libraries: ["@budibase/standard-components"], }) await writeFile( diff --git a/packages/server/src/utilities/createAppPackage.js b/packages/server/src/utilities/createAppPackage.js index ec47901671..6b699a2f32 100644 --- a/packages/server/src/utilities/createAppPackage.js +++ b/packages/server/src/utilities/createAppPackage.js @@ -13,7 +13,7 @@ exports.appPackageFolder = (config, appname) => resolve(cwd(), config.latestPackagesFolder, appname) exports.downloadExtractComponentLibraries = async appFolder => { - const LIBRARIES = ["materialdesign-components", "standard-components"] + const LIBRARIES = ["standard-components"] // Need to download tarballs directly from NPM as our users may not have node on their machine for (let lib of LIBRARIES) { From 035fafc9638e14d4e8627f2951f4e722b8047a15 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Fri, 14 Aug 2020 11:33:40 +0100 Subject: [PATCH 2/2] removed material design library --- packages/materialdesign-components/.gitignore | 6 - packages/materialdesign-components/.npmignore | 3 - packages/materialdesign-components/README.md | 33 -- .../materialdesign-components/components.json | 458 ------------------ .../materialdesign-components/package.json | 59 --- .../public/index.html | 16 - .../rollup.config.js | 50 -- .../rollup.testconfig.js | 166 ------- .../src/Button/Button.svelte | 74 --- .../src/Button/_index.scss | 5 - .../src/Button/_mixins.scss | 39 -- .../src/Button/index.js | 2 - .../src/Card/BasicCard.svelte | 67 --- .../src/Card/Card.svelte | 39 -- .../src/Card/CardBody.svelte | 12 - .../src/Card/CardFooter.svelte | 31 -- .../src/Card/CardHeader.svelte | 44 -- .../src/Card/CardImage.svelte | 62 --- .../src/Card/_styles.scss | 1 - .../src/Card/index.js | 7 - .../src/Checkbox/Checkbox.svelte | 146 ------ .../src/Checkbox/CheckboxGroup.svelte | 69 --- .../src/Checkbox/_style.scss | 2 - .../src/Checkbox/index.js | 3 - .../src/ClassBuilder.js | 74 --- .../src/Common/FloatingLabel.svelte | 7 - .../src/Common/Formfield.svelte | 42 -- .../src/Common/FormfieldStore.js | 19 - .../src/Common/Icon.svelte | 8 - .../src/Common/ItemStore.js | 54 --- .../src/Common/Label.svelte | 12 - .../src/Common/NotchedOutline.svelte | 14 - .../src/Common/Ripple.js | 28 -- .../src/Datatable/Datatable.svelte | 48 -- .../src/Datatable/DatatableBody.svelte | 13 - .../src/Datatable/DatatableCell.svelte | 27 -- .../src/Datatable/DatatableHead.svelte | 11 - .../src/Datatable/DatatableRow.svelte | 30 -- .../src/Datatable/_style.scss | 1 - .../src/Datatable/index.js | 6 - .../src/DatePicker/DatePicker.svelte | 189 -------- .../src/DatePicker/_style.scss | 15 - .../src/DatePicker/index.js | 2 - .../src/Dialog/Dialog.svelte | 44 -- .../src/Dialog/DialogActions.svelte | 13 - .../src/Dialog/DialogContent.svelte | 11 - .../src/Dialog/DialogHeader.svelte | 5 - .../src/Dialog/_style.scss | 1 - .../src/Dialog/index.js | 5 - .../src/IconButton/IconButton.svelte | 75 --- .../src/IconButton/_style.scss | 18 - .../src/IconButton/index.js | 2 - .../src/List/List.svelte | 70 --- .../src/List/ListItem.svelte | 130 ----- .../src/List/_style.scss | 1 - .../src/List/index.js | 3 - .../src/Menu/Menu.svelte | 69 --- .../src/Menu/_styles.scss | 3 - .../src/Menu/index.js | 2 - .../src/Radiobutton/Radiobutton.svelte | 116 ----- .../src/Radiobutton/RadiobuttonGroup.svelte | 83 ---- .../src/Radiobutton/_style.scss | 2 - .../src/Radiobutton/index.js | 3 - .../src/Select/HelperText.svelte | 31 -- .../src/Select/Select.svelte | 106 ---- .../src/Select/_style.scss | 4 - .../src/Select/index.js | 3 - .../src/Slider/Slider.svelte | 77 --- .../src/Slider/_style.scss | 1 - .../src/Slider/index.js | 2 - .../src/Switch/Switch.svelte | 44 -- .../src/Switch/_style.scss | 1 - .../src/Switch/index.js | 2 - .../src/Test/TestApp.svelte | 73 --- .../src/Test/createApp.js | 19 - .../src/Test/props.js | 320 ------------ .../src/Test/rootComponent.js | 15 - .../src/Test/testComponents.js | 3 - .../src/Test/testMain.js | 7 - .../src/Textfield/CharacterCounter.svelte | 1 - .../src/Textfield/HelperText.svelte | 24 - .../src/Textfield/Textfield.svelte | 195 -------- .../src/Textfield/_index.scss | 5 - .../src/Textfield/_mixins.scss | 46 -- .../src/Textfield/index.js | 2 - .../src/Typography/Body1.svelte | 11 - .../src/Typography/Body2.svelte | 11 - .../src/Typography/Caption.svelte | 11 - .../src/Typography/H1.svelte | 11 - .../src/Typography/H2.svelte | 11 - .../src/Typography/H3.svelte | 11 - .../src/Typography/H4.svelte | 11 - .../src/Typography/H5.svelte | 11 - .../src/Typography/H6.svelte | 11 - .../src/Typography/Overline.svelte | 11 - .../src/Typography/Sub1.svelte | 11 - .../src/Typography/Sub2.svelte | 11 - .../src/Typography/_style.scss | 1 - .../src/Typography/index.js | 13 - .../src/_material-fonts.scss | 2 - .../src/buildStyle.js | 9 - .../materialdesign-components/src/index.js | 33 -- 102 files changed, 3821 deletions(-) delete mode 100644 packages/materialdesign-components/.gitignore delete mode 100644 packages/materialdesign-components/.npmignore delete mode 100644 packages/materialdesign-components/README.md delete mode 100644 packages/materialdesign-components/components.json delete mode 100644 packages/materialdesign-components/package.json delete mode 100644 packages/materialdesign-components/public/index.html delete mode 100644 packages/materialdesign-components/rollup.config.js delete mode 100644 packages/materialdesign-components/rollup.testconfig.js delete mode 100644 packages/materialdesign-components/src/Button/Button.svelte delete mode 100644 packages/materialdesign-components/src/Button/_index.scss delete mode 100644 packages/materialdesign-components/src/Button/_mixins.scss delete mode 100644 packages/materialdesign-components/src/Button/index.js delete mode 100644 packages/materialdesign-components/src/Card/BasicCard.svelte delete mode 100644 packages/materialdesign-components/src/Card/Card.svelte delete mode 100644 packages/materialdesign-components/src/Card/CardBody.svelte delete mode 100644 packages/materialdesign-components/src/Card/CardFooter.svelte delete mode 100644 packages/materialdesign-components/src/Card/CardHeader.svelte delete mode 100644 packages/materialdesign-components/src/Card/CardImage.svelte delete mode 100644 packages/materialdesign-components/src/Card/_styles.scss delete mode 100644 packages/materialdesign-components/src/Card/index.js delete mode 100644 packages/materialdesign-components/src/Checkbox/Checkbox.svelte delete mode 100644 packages/materialdesign-components/src/Checkbox/CheckboxGroup.svelte delete mode 100644 packages/materialdesign-components/src/Checkbox/_style.scss delete mode 100644 packages/materialdesign-components/src/Checkbox/index.js delete mode 100644 packages/materialdesign-components/src/ClassBuilder.js delete mode 100644 packages/materialdesign-components/src/Common/FloatingLabel.svelte delete mode 100644 packages/materialdesign-components/src/Common/Formfield.svelte delete mode 100644 packages/materialdesign-components/src/Common/FormfieldStore.js delete mode 100644 packages/materialdesign-components/src/Common/Icon.svelte delete mode 100644 packages/materialdesign-components/src/Common/ItemStore.js delete mode 100644 packages/materialdesign-components/src/Common/Label.svelte delete mode 100644 packages/materialdesign-components/src/Common/NotchedOutline.svelte delete mode 100644 packages/materialdesign-components/src/Common/Ripple.js delete mode 100644 packages/materialdesign-components/src/Datatable/Datatable.svelte delete mode 100644 packages/materialdesign-components/src/Datatable/DatatableBody.svelte delete mode 100644 packages/materialdesign-components/src/Datatable/DatatableCell.svelte delete mode 100644 packages/materialdesign-components/src/Datatable/DatatableHead.svelte delete mode 100644 packages/materialdesign-components/src/Datatable/DatatableRow.svelte delete mode 100644 packages/materialdesign-components/src/Datatable/_style.scss delete mode 100644 packages/materialdesign-components/src/Datatable/index.js delete mode 100644 packages/materialdesign-components/src/DatePicker/DatePicker.svelte delete mode 100644 packages/materialdesign-components/src/DatePicker/_style.scss delete mode 100644 packages/materialdesign-components/src/DatePicker/index.js delete mode 100644 packages/materialdesign-components/src/Dialog/Dialog.svelte delete mode 100644 packages/materialdesign-components/src/Dialog/DialogActions.svelte delete mode 100644 packages/materialdesign-components/src/Dialog/DialogContent.svelte delete mode 100644 packages/materialdesign-components/src/Dialog/DialogHeader.svelte delete mode 100644 packages/materialdesign-components/src/Dialog/_style.scss delete mode 100644 packages/materialdesign-components/src/Dialog/index.js delete mode 100644 packages/materialdesign-components/src/IconButton/IconButton.svelte delete mode 100644 packages/materialdesign-components/src/IconButton/_style.scss delete mode 100644 packages/materialdesign-components/src/IconButton/index.js delete mode 100644 packages/materialdesign-components/src/List/List.svelte delete mode 100644 packages/materialdesign-components/src/List/ListItem.svelte delete mode 100644 packages/materialdesign-components/src/List/_style.scss delete mode 100644 packages/materialdesign-components/src/List/index.js delete mode 100644 packages/materialdesign-components/src/Menu/Menu.svelte delete mode 100644 packages/materialdesign-components/src/Menu/_styles.scss delete mode 100644 packages/materialdesign-components/src/Menu/index.js delete mode 100644 packages/materialdesign-components/src/Radiobutton/Radiobutton.svelte delete mode 100644 packages/materialdesign-components/src/Radiobutton/RadiobuttonGroup.svelte delete mode 100644 packages/materialdesign-components/src/Radiobutton/_style.scss delete mode 100644 packages/materialdesign-components/src/Radiobutton/index.js delete mode 100644 packages/materialdesign-components/src/Select/HelperText.svelte delete mode 100644 packages/materialdesign-components/src/Select/Select.svelte delete mode 100644 packages/materialdesign-components/src/Select/_style.scss delete mode 100644 packages/materialdesign-components/src/Select/index.js delete mode 100644 packages/materialdesign-components/src/Slider/Slider.svelte delete mode 100644 packages/materialdesign-components/src/Slider/_style.scss delete mode 100644 packages/materialdesign-components/src/Slider/index.js delete mode 100644 packages/materialdesign-components/src/Switch/Switch.svelte delete mode 100644 packages/materialdesign-components/src/Switch/_style.scss delete mode 100644 packages/materialdesign-components/src/Switch/index.js delete mode 100644 packages/materialdesign-components/src/Test/TestApp.svelte delete mode 100644 packages/materialdesign-components/src/Test/createApp.js delete mode 100644 packages/materialdesign-components/src/Test/props.js delete mode 100644 packages/materialdesign-components/src/Test/rootComponent.js delete mode 100644 packages/materialdesign-components/src/Test/testComponents.js delete mode 100644 packages/materialdesign-components/src/Test/testMain.js delete mode 100644 packages/materialdesign-components/src/Textfield/CharacterCounter.svelte delete mode 100644 packages/materialdesign-components/src/Textfield/HelperText.svelte delete mode 100644 packages/materialdesign-components/src/Textfield/Textfield.svelte delete mode 100644 packages/materialdesign-components/src/Textfield/_index.scss delete mode 100644 packages/materialdesign-components/src/Textfield/_mixins.scss delete mode 100644 packages/materialdesign-components/src/Textfield/index.js delete mode 100644 packages/materialdesign-components/src/Typography/Body1.svelte delete mode 100644 packages/materialdesign-components/src/Typography/Body2.svelte delete mode 100644 packages/materialdesign-components/src/Typography/Caption.svelte delete mode 100644 packages/materialdesign-components/src/Typography/H1.svelte delete mode 100644 packages/materialdesign-components/src/Typography/H2.svelte delete mode 100644 packages/materialdesign-components/src/Typography/H3.svelte delete mode 100644 packages/materialdesign-components/src/Typography/H4.svelte delete mode 100644 packages/materialdesign-components/src/Typography/H5.svelte delete mode 100644 packages/materialdesign-components/src/Typography/H6.svelte delete mode 100644 packages/materialdesign-components/src/Typography/Overline.svelte delete mode 100644 packages/materialdesign-components/src/Typography/Sub1.svelte delete mode 100644 packages/materialdesign-components/src/Typography/Sub2.svelte delete mode 100644 packages/materialdesign-components/src/Typography/_style.scss delete mode 100644 packages/materialdesign-components/src/Typography/index.js delete mode 100644 packages/materialdesign-components/src/_material-fonts.scss delete mode 100644 packages/materialdesign-components/src/buildStyle.js delete mode 100644 packages/materialdesign-components/src/index.js diff --git a/packages/materialdesign-components/.gitignore b/packages/materialdesign-components/.gitignore deleted file mode 100644 index 3693c6588b..0000000000 --- a/packages/materialdesign-components/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.DS_Store -node_modules -yarn.lock -package-lock.json -dist/* -public/build \ No newline at end of file diff --git a/packages/materialdesign-components/.npmignore b/packages/materialdesign-components/.npmignore deleted file mode 100644 index 81c5644598..0000000000 --- a/packages/materialdesign-components/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!dist/* -!components.json \ No newline at end of file diff --git a/packages/materialdesign-components/README.md b/packages/materialdesign-components/README.md deleted file mode 100644 index 71e531fc9d..0000000000 --- a/packages/materialdesign-components/README.md +++ /dev/null @@ -1,33 +0,0 @@ -*Psst — looking for an app template? Go here --> [sveltejs/template](https://github.com/sveltejs/template)* - ---- - -# component-template - -A base for building shareable Svelte components. Clone it with [degit](https://github.com/Rich-Harris/degit): - -```bash -npx degit sveltejs/component-template my-new-component -cd my-new-component -npm install # or yarn -``` - -Your component's source code lives in `src/index.html`. - -TODO - -* [ ] some firm opinions about the best way to test components -* [ ] update `degit` so that it automates some of the setup work - - -## Setting up - -* Run `npm init` (or `yarn init`) -* Replace this README with your own - - -## Consuming components - -Your package.json has a `"svelte"` field pointing to `src/index.html`, which allows Svelte apps to import the source code directly, if they are using a bundler plugin like [rollup-plugin-svelte](https://github.com/rollup/rollup-plugin-svelte) or [svelte-loader](https://github.com/sveltejs/svelte-loader) (where [`resolve.mainFields`](https://webpack.js.org/configuration/resolve/#resolve-mainfields) in your webpack config includes `"svelte"`). **This is recommended.** - -For everyone else, `npm run build` will bundle your component's source code into a plain JavaScript module (`index.mjs`) and a UMD script (`index.js`). This will happen automatically when you publish your component to npm, courtesy of the `prepublishOnly` hook in package.json. diff --git a/packages/materialdesign-components/components.json b/packages/materialdesign-components/components.json deleted file mode 100644 index f0750e6446..0000000000 --- a/packages/materialdesign-components/components.json +++ /dev/null @@ -1,458 +0,0 @@ -{ - "_lib": "./dist/index.js", - "_templates": { - "indexDatatable": { - "description": "Datatable based on an Index", - "component": "Datatable" - }, - "recordForm": { - "description": "Form for saving a record", - "component": "Form" - } - }, - "Body1": { - "name": "Body1", - "description": "Sets the font properties as Roboto Body 1", - "props": { - "text": "string" - }, - "tags": [] - }, - "Body2": { - "name": "Body2", - "description": "Sets the font properties as Roboto Body 2", - "props": { - "text": "string" - }, - "tags": [] - }, - "Select": { - "name": "Select", - "description": "A material design select (aka Dropdown, aka Combobox)", - "props": { - "onSelect": "event", - "value": "string", - "width": "string", - "variant": { - "type": "options", - "options": [ - "filled", "outlined" - ] - }, - "disabled": "bool", - "required": "bool", - "label": "string", - "helperText": "string", - "persistent": "bool" - } - }, - "List": { - "name": "List", - "description": "A Material Design List Component.", - "props": { - "onSelect": "event", - "singleSelection": "bool", - "variant": { - "type": "options", - "options": ["one-line", "two-line"], - "default": "one-line" - }, - "inputElement": { - "type": "options", - "options": ["None", "Radiobutton", "Checkbox"], - "default": "None" - } - } - }, - "ListItem": { - "name": "ListItem", - "description": "Use as item in a 'List' or 'Select' component", - "props": { - "value": "string", - "text": "string", - "secondaryText": "string", - "leadingIcon": "string", - "trailingIcon": "string", - "disabled": "bool", - "dividerAfter": "bool" - } - }, - "Button": { - "name": "Button", - "children": false, - "description": "A Material Design button with different variations. It renders as an anchor if href is passed to it.", - "props": { - "onClick": "event", - "variant": { - "type": "options", - "options": ["text", "raised", "unelevated", "outlined"], - "default": "text" - }, - "colour": { - "type": "options", - "options": ["primary", "secondary"], - "default": "primary" - }, - "size": { - "type": "options", - "options": ["small", "medium", "large"], - "default": "medium" - }, - "href": "string", - "icon": "string", - "trailingIcon": "bool", - "fullwidth": "bool", - "text": "string", - "disabled": "bool" - }, - "tags": [] - }, - "Caption": { - "name": "Caption", - "description": "Sets the font properties as Roboto Caption", - "props": { - "text": "string" - }, - "tags": [] - }, - "BasicCard": { - "name": "BasicCard", - "description": "This is a basic card", - "props": { - "heading": "string", - "subheading": "string", - "content": "string", - "imageUrl": "string", - "button1Text": "string", - "button2Text": "string", - "cardClick": "event", - "button1Click": "event", - "button2Click": "event" - } - }, - "Card": { - "name": "Card", - "description": "A Material Card container. Accepts CardHeader, CardBody and CardFooter as possible children", - "props": { - "width": {"type": "string", "default": "350px"}, - "height": "string", - "variant": { - "type": "options", - "options": ["standard", "outlined"], - "default": "outlined" - } - } - }, - "CardBody": { - "name": "CardBody", - "description": "A Material CardBody component. Contains the main content of a Material Card component", - "props": { - "onClick": "event" - } - }, - "CardImage": { - "name": "CardImage", - "description": "An image component for the Material Card component", - "props": { - "displayHorizontal": "bool", - "url": "string", - "title": "string", - "subtitle": "string" - } - }, - "CardHeader": { - "name": "CardHeader", - "description": "Displays a icon, title and subtitle above main body of the Material Card component", - "props": { - "title": "string", - "subtitle": "string", - "icon": "string" - } - }, - "CardFooter": { - "name": "CardFooter", - "description": "Displays buttons / icon buttons as actions for the Material Card component", - "props": { - "padding": "string" - } - }, - "Checkbox": { - "name": "Checkbox", - "description": "A Material Design checkbox. Supports aligning label before or after checkbox.", - "props": { - "onClick": "event", - "id": "string", - "label": "string", - "disabled": "bool", - "alignEnd": "bool", - "indeterminate": "bool", - "checked": "bool" - }, - "tags": [] - }, - "Checkboxgroup": { - "name": "Checkboxgroup", - "description": "A group of material design checkboxes. Supports row and column orientation.", - "props": { - "onChange": "event", - "label":"string", - "orientation": { - "type": "options", - "options": ["row", "column"], - "default": "row" - }, - "disabled": "bool", - "alignEnd": "bool" - } - }, - "Datatable": { - "name": "Datatable", - "description": "A Material Design component to represent tabular data.", - "props": { - "onLoad":"event" - }, - "tags": [] - }, - "DatatableHead": { - "name": "DatatableHead", - "description": "Material Design .", - "props": {} - }, - "DatatableCell": { - "name": "DatatableCell", - "description": "Material Design .", - "props": {} - }, - "DatatableBody": { - "name": "DatatableBody", - "description": "Material Design .", - "props": {} - }, - "DatatableRow": { - "name": "DatatableRow", - "description": "Material Design .", - "props": {} - }, - "DatePicker": { - "name": "DatePicker", - "description": "Material Design DatePicker", - "props": { - "date": "string", - "label": "string", - "onSelect": "event" - }, - "tags": [] - }, - "H1": { - "name": "H1", - "description": "Sets the font properties as Roboto Headline1", - "props": { - "text": "string" - }, - "tags": [] - }, - "H2": { - "name": "H2", - "description": "Sets the font properties as Roboto Headline2", - "props": { - "text": "string" - }, - "tags": [] - }, - "H3": { - "name": "H3", - "description": "Sets the font properties as Roboto Headline3", - "props": { - "text": "string" - }, - "tags": [] - }, - "H4": { - "name": "H4", - "description": "Sets the font properties as Roboto Headline4", - "props": { - "text": "string" - }, - "tags": [] - }, - "H5": { - "name": "H5", - "description": "Sets the font properties as Roboto Headline5", - "props": { - "text": "string" - }, - "tags": [] - }, - "H6": { - "name": "H6", - "description": "Sets the font properties as Roboto Headline6", - "props": { - "text": "string" - }, - "tags": [] - }, - "IconButton": { - "name": "IconButton", - "description": "An icon button component", - "props": { - "onClick": "event", - "disabled": "bool", - "href": "string", - "icon": "string", - "size": { - "type":"options", - "options": ["small", "medium", "large"], - "default": "medium" - } - }, - "tags": [] - }, - "Label": { - "name": "Label", - "description": "A simple label component that displays its text in the standard Roboto Material Design font", - "props": { - "text": "string", - "bold": "bool" - }, - "tags": [] - }, - "Menu": { - "name": "Menu", - "description": "A Material Design menu component. Anchor to other components to create a pop-out menu.", - "props": { - "onSelect": "event", - "width": "string", - "open": "bool", - "useFixedPosition": "bool", - "absolutePositionX": "number", - "absolutePositionY": "number" - } - }, - "Overline": { - "name": "Overline", - "description": "Sets the font properties as Roboto Overline", - "props": { - "text": "string" - }, - "tags": [] - }, - "Radiobutton": { - "name": "Radiobutton", - "description": "A Material Design radiobutton. Supports aligning label before or after radiobutton.", - "props": { - "onClick": "event", - "id": "string", - "label": "string", - "name": "string", - "disabled": "bool", - "alignEnd": "bool" - }, - "tags": [] - }, - "Radiobuttongroup": { - "name": "Radiobuttongroup", - "description": "A Material Design Radiobutton group. Supports row and column orientation.", - "props": { - "onChange": "event", - "label": "string", - "name": "string", - "orientation": { - "type": "options", - "options": ["row", "column"], - "default": "row" - }, - "fullwidth": "bool", - "alignEnd": "bool", - "disabled": "bool" - } - }, - "Sub1": { - "name": "Sub1", - "description": "Sets the font properties as Roboto Subtitle1", - "props": { - "text": "string" - }, - "tags": [] - }, - "Sub2": { - "name": "Sub2", - "description": "Sets the font properties as Roboto Subtitle2", - "props": { - "text": "string" - }, - "tags": [] - }, - "Textfield": { - "name": "Textfield", - "description": "A Material Design textfield with multiple variants. Can also be converted to a text area / multine text field.", - "props": { - "onChange": "event", - "value": "string", - "label": "string", - "variant": { - "type": "options", - "options": ["standard", "outlined", "filled"], - "default": "standard" - }, - "disabled": "bool", - "fullwidth": "bool", - "colour": { - "type": "options", - "options": ["primary", "secondary"], - "default": "primary" - }, - "size":{ - "type": "options", - "options": ["small", "medium", "large"], - "default": "medium" - }, - "type": { - "type": "options", - "options": ["text", "password"], - "default": "text" - }, - "required": "bool", - "minLength": "number", - "maxLength": "number", - "helperText": "string", - "placeholder": "string", - "icon": "string", - "trailingIcon": "bool", - "textarea": "bool", - "persistent": "bool" - }, - "tags": [] - }, - "Switch": { - "name": "Switch", - "description": "A material design switch component", - "props": { - "alignEnd": "bool", - "disabled": "bool", - "checked": "bool", - "label": "string", - "id": "string" - }, - "tags": [] - }, - "Slider": { - "name": "Slider", - "description": "A material design slider component", - "props": { - "variant": { - "type": "options", - "options": ["continuous", "discrete"], - "default": "continuous" - }, - "showTicks": "bool", - "min": "number", - "max": "number", - "value": "number", - "step": "number", - "label": "string", - "disabled": "bool" - }, - "tags": [] - } -} - diff --git a/packages/materialdesign-components/package.json b/packages/materialdesign-components/package.json deleted file mode 100644 index 4c79ae5ac9..0000000000 --- a/packages/materialdesign-components/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "@budibase/materialdesign-components", - "svelte": "src/index.svelte", - "main": "dist/index.js", - "module": "dist/index.js", - "scripts": { - "build": "rollup -c", - "prepublishOnly": "npm run build", - "testbuild": "rollup -w -c rollup.testconfig.js", - "dev": "run-p start:dev testbuild", - "start:dev": "sirv public --single --dev", - "dev:builder": "rollup -cw" - }, - "devDependencies": { - "@budibase/client": "^0.1.17", - "@budibase/standard-components": "^0.1.17", - "@material/button": "^4.0.0", - "@material/checkbox": "^4.0.0", - "@material/data-table": "4.0.0", - "@material/dialog": "4.0.0", - "@material/form-field": "^4.0.0", - "@material/icon-button": "4.0.0", - "@material/list": "4.0.0", - "@material/menu": "4.0.0", - "@material/radio": "^4.0.0", - "@material/select": "4.0.0", - "@material/slider": "4.0.0", - "@material/switch": "4.0.0", - "@material/textfield": "^4.0.0", - "@nx-js/compiler-util": "^2.0.0", - "bcryptjs": "^2.4.3", - "date-fns": "^2.10.0", - "fs-extra": "^8.1.0", - "lodash": "^4.17.15", - "npm-run-all": "^4.1.5", - "rollup": "^1.11.0", - "rollup-plugin-alias": "^2.2.0", - "rollup-plugin-commonjs": "^10.0.2", - "rollup-plugin-json": "^4.0.0", - "rollup-plugin-livereload": "^1.0.1", - "rollup-plugin-node-resolve": "^5.0.0", - "rollup-plugin-postcss": "^2.0.5", - "rollup-plugin-svelte": "^5.0.0", - "rollup-plugin-terser": "^5.1.1", - "sass": "^1.25.1-test.1", - "shortid": "^2.2.15", - "sirv-cli": "^0.4.4", - "svelte": "^3.12.1" - }, - "keywords": [ - "svelte" - ], - "version": "0.1.17", - "license": "MIT", - "gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691", - "dependencies": { - "@material/card": "4.0.0" - } -} diff --git a/packages/materialdesign-components/public/index.html b/packages/materialdesign-components/public/index.html deleted file mode 100644 index 186f9ba2b4..0000000000 --- a/packages/materialdesign-components/public/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - Budibase-Material Design - - - - - - - - - \ No newline at end of file diff --git a/packages/materialdesign-components/rollup.config.js b/packages/materialdesign-components/rollup.config.js deleted file mode 100644 index df89ae0ddd..0000000000 --- a/packages/materialdesign-components/rollup.config.js +++ /dev/null @@ -1,50 +0,0 @@ -import svelte from "rollup-plugin-svelte" -import postcss from "rollup-plugin-postcss" -import resolve from "rollup-plugin-node-resolve" -import commonjs from "rollup-plugin-commonjs" - -const postcssOptions = () => ({ - extensions: [".scss", ".sass"], - extract: false, - minimize: true, - use: [ - [ - "sass", - { - includePaths: ["./node_modules"], - }, - ], - ], -}) - -const coreExternal = ["shortid"] - -export default { - input: "src/index.js", - output: [ - { - file: "dist/index.js", - format: "esm", - name: "budibaseStandardComponents", - sourcemap: true, - }, - ], - plugins: [ - svelte({ - hydratable: true, - }), - resolve({ - preferBuiltins: true, - browser: true, - dedupe: importee => { - return coreExternal.includes(importee) - }, - }), - commonjs({ - namedExports: { - shortid: ["generate"], - }, - }), - postcss(postcssOptions()), - ], -} diff --git a/packages/materialdesign-components/rollup.testconfig.js b/packages/materialdesign-components/rollup.testconfig.js deleted file mode 100644 index 8358d3ac7a..0000000000 --- a/packages/materialdesign-components/rollup.testconfig.js +++ /dev/null @@ -1,166 +0,0 @@ -import svelte from "rollup-plugin-svelte" -import resolve from "rollup-plugin-node-resolve" -import commonjs from "rollup-plugin-commonjs" -import livereload from "rollup-plugin-livereload" -import { terser } from "rollup-plugin-terser" -import json from "rollup-plugin-json" -import alias from "rollup-plugin-alias" -import postcss from "rollup-plugin-postcss" -import path from "path" - -const aliases = { - resolve: [".js", ".svelte"], - entries: [ - // { find: "@BBMD", replacement: path.resolve(__dirname, "dist/index.js") }, - { find: "@BBMD", replacement: path.resolve(__dirname, "src/index.js") }, - ], -} - -const postcssOptions = () => ({ - extensions: [".scss", ".sass"], - extract: false, - minimize: true, - use: [ - [ - "sass", - { - includePaths: ["./node_modules"], - }, - ], - ], -}) - -const production = !process.env.ROLLUP_WATCH - -const lodash_fp_exports = [ - "find", - "isUndefined", - "split", - "max", - "last", - "union", - "reduce", - "isObject", - "cloneDeep", - "some", - "isArray", - "map", - "filter", - "keys", - "isFunction", - "isEmpty", - "countBy", - "join", - "includes", - "flatten", - "constant", - "first", - "intersection", - "take", - "has", - "mapValues", - "isString", - "isBoolean", - "isNull", - "isNumber", - "isObjectLike", - "isDate", - "clone", - "values", - "keyBy", - "isNaN", - "isInteger", - "toNumber", -] - -const lodash_exports = [ - "flow", - "head", - "find", - "each", - "tail", - "findIndex", - "startsWith", - "dropRight", - "takeRight", - "trim", - "split", - "replace", - "merge", - "assign", -] - -const coreExternal = [ - "lodash", - "lodash/fp", - "date-fns", - "lunr", - "safe-buffer", - "shortid", - "@nx-js/compiler-util", - "bcryptjs", -] - -export default { - input: "src/Test/testMain.js", - output: { - sourcemap: true, - format: "iife", - name: "app", - file: "public/build/bundle.js", - globals: { - crypto: "crypto", - }, - }, - plugins: [ - alias(aliases), - svelte({ - // enable run-time checks when not in production - dev: !production, - // we'll extract any component CSS out into - // a separate file — better for performance - css: css => { - css.write("public/build/bundle.css") - }, - - hydratable: true, - }), - - // If you have external dependencies installed from - // npm, you'll most likely need these plugins. In - // some cases you'll need additional configuration — - // consult the documentation for details: - // https://github.com/rollup/rollup-plugin-commonjs - resolve({ - browser: true, - dedupe: importee => { - return ( - importee === "svelte" || - importee.startsWith("svelte/") || - coreExternal.includes(importee) - ) - }, - preferBuiltins: true, - }), - commonjs({ - namedExports: { - "lodash/fp": lodash_fp_exports, - lodash: lodash_exports, - shortid: ["generate"], - }, - }), - json(), - - // Watch the `public` directory and refresh the - // browser on changes when not in production - !production && livereload("public"), - - // If we're building for production (npm run build - // instead of npm run dev), minify - production && terser(), - postcss(postcssOptions()), - ], - watch: { - clearScreen: false, - }, -} diff --git a/packages/materialdesign-components/src/Button/Button.svelte b/packages/materialdesign-components/src/Button/Button.svelte deleted file mode 100644 index 3bc101e8f0..0000000000 --- a/packages/materialdesign-components/src/Button/Button.svelte +++ /dev/null @@ -1,74 +0,0 @@ - - -{#if href} - - {text} - -{:else} - -{/if} - - diff --git a/packages/materialdesign-components/src/Button/_index.scss b/packages/materialdesign-components/src/Button/_index.scss deleted file mode 100644 index db3072f016..0000000000 --- a/packages/materialdesign-components/src/Button/_index.scss +++ /dev/null @@ -1,5 +0,0 @@ -@import "@material/button/mdc-button.scss"; -@import "@material/ripple/mdc-ripple.scss"; -@import "./mixins.scss"; - -@include bbmd-button-styles(); diff --git a/packages/materialdesign-components/src/Button/_mixins.scss b/packages/materialdesign-components/src/Button/_mixins.scss deleted file mode 100644 index 909be472f7..0000000000 --- a/packages/materialdesign-components/src/Button/_mixins.scss +++ /dev/null @@ -1,39 +0,0 @@ -@import "@material/feature-targeting/functions"; -@import "@material/feature-targeting/mixins"; - -@mixin bbmd-button-styles($query: mdc-feature-all()) { - $feat-structure: mdc-feature-create-target($query, structure); - - .bbmd-mdc-button--size-large { - @include button-sizing($feat-structure, 21px, 40px, 15px); - } - - .bbmd-mdc-button--size-small { - @include button-sizing($feat-structure, 9px, 32px, 13px); - } - - .bbmd-mdc-button--colour-secondary { - //no feature target as relying on theme variable custom property - @include mdc-button-ink-color(secondary); - - &.mdc-button--raised, - &.mdc-button--unelevated { - @include mdc-button-container-fill-color(secondary); - @include mdc-button-ink-color(on-secondary); - } - - &.mdc-button--outlined { - @include mdc-button-outline-color(secondary); - } - } -} - -@mixin button-sizing($feat, $padding, $height, $fontSize) { - @include mdc-feature-targets($feat) { - padding: 0px $padding; - height: $height; - } - > .mdc-button__label { - font-size: $fontSize; - } -} diff --git a/packages/materialdesign-components/src/Button/index.js b/packages/materialdesign-components/src/Button/index.js deleted file mode 100644 index 981d756d80..0000000000 --- a/packages/materialdesign-components/src/Button/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import "./_index.scss" -export { default as Button } from "./Button.svelte" diff --git a/packages/materialdesign-components/src/Card/BasicCard.svelte b/packages/materialdesign-components/src/Card/BasicCard.svelte deleted file mode 100644 index cb377b7737..0000000000 --- a/packages/materialdesign-components/src/Card/BasicCard.svelte +++ /dev/null @@ -1,67 +0,0 @@ - - -
-
- {#if showImage} -
- {/if} -
-
-

- {heading} -

-

- {subheading} -

-
-
- {content} -
- -
-
- {#if showButtons} -
-
- {#if showButton1} - - {/if} - {#if showButton2} - - {/if} -
-
- {/if} -
- - diff --git a/packages/materialdesign-components/src/Card/Card.svelte b/packages/materialdesign-components/src/Card/Card.svelte deleted file mode 100644 index 6829e937c8..0000000000 --- a/packages/materialdesign-components/src/Card/Card.svelte +++ /dev/null @@ -1,39 +0,0 @@ - - -
- - diff --git a/packages/materialdesign-components/src/Card/CardBody.svelte b/packages/materialdesign-components/src/Card/CardBody.svelte deleted file mode 100644 index 6be83a319e..0000000000 --- a/packages/materialdesign-components/src/Card/CardBody.svelte +++ /dev/null @@ -1,12 +0,0 @@ - - -
diff --git a/packages/materialdesign-components/src/Card/CardFooter.svelte b/packages/materialdesign-components/src/Card/CardFooter.svelte deleted file mode 100644 index b3702ee47f..0000000000 --- a/packages/materialdesign-components/src/Card/CardFooter.svelte +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - diff --git a/packages/materialdesign-components/src/Card/CardHeader.svelte b/packages/materialdesign-components/src/Card/CardHeader.svelte deleted file mode 100644 index 72f1bc4ace..0000000000 --- a/packages/materialdesign-components/src/Card/CardHeader.svelte +++ /dev/null @@ -1,44 +0,0 @@ - - -
- {#if useIcon} -
- -
- {/if} -
-
- {#if useSubtitle} - - {/if} -
-
- - diff --git a/packages/materialdesign-components/src/Card/CardImage.svelte b/packages/materialdesign-components/src/Card/CardImage.svelte deleted file mode 100644 index e7207271a0..0000000000 --- a/packages/materialdesign-components/src/Card/CardImage.svelte +++ /dev/null @@ -1,62 +0,0 @@ - - -{#if !displayHorizontal} -
-
- {#if useTitle} -
- {#if useSubTitle} - - {/if} - {/if} -
-
-{:else} -
-
-
- {#if useTitle} -
- {#if useSubTitle} - - {/if} - {/if} -
-
-{/if} - - diff --git a/packages/materialdesign-components/src/Card/_styles.scss b/packages/materialdesign-components/src/Card/_styles.scss deleted file mode 100644 index 67be710d6f..0000000000 --- a/packages/materialdesign-components/src/Card/_styles.scss +++ /dev/null @@ -1 +0,0 @@ -@import "@material/card/mdc-card.scss" diff --git a/packages/materialdesign-components/src/Card/index.js b/packages/materialdesign-components/src/Card/index.js deleted file mode 100644 index cc918b935f..0000000000 --- a/packages/materialdesign-components/src/Card/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import "./_styles.scss" -export { default as Card } from "./Card.svelte" -export { default as BasicCard } from "./BasicCard.svelte" -export { default as CardBody } from "./CardBody.svelte" -export { default as CardFooter } from "./CardFooter.svelte" -export { default as CardHeader } from "./CardHeader.svelte" -export { default as CardImage } from "./CardImage.svelte" diff --git a/packages/materialdesign-components/src/Checkbox/Checkbox.svelte b/packages/materialdesign-components/src/Checkbox/Checkbox.svelte deleted file mode 100644 index ad0a117376..0000000000 --- a/packages/materialdesign-components/src/Checkbox/Checkbox.svelte +++ /dev/null @@ -1,146 +0,0 @@ - - - - -{#if context !== 'list-item'} -
- -
- -
- - - -
-
-
-
- -
-{:else} -
- -
- - - -
-
-
-
-{/if} - - diff --git a/packages/materialdesign-components/src/Checkbox/CheckboxGroup.svelte b/packages/materialdesign-components/src/Checkbox/CheckboxGroup.svelte deleted file mode 100644 index 4dce91a40d..0000000000 --- a/packages/materialdesign-components/src/Checkbox/CheckboxGroup.svelte +++ /dev/null @@ -1,69 +0,0 @@ - - -
-
-
-
-
- - diff --git a/packages/materialdesign-components/src/Checkbox/_style.scss b/packages/materialdesign-components/src/Checkbox/_style.scss deleted file mode 100644 index 666f84c426..0000000000 --- a/packages/materialdesign-components/src/Checkbox/_style.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import "@material/form-field/mdc-form-field"; -@import "@material/checkbox/mdc-checkbox.scss"; diff --git a/packages/materialdesign-components/src/Checkbox/index.js b/packages/materialdesign-components/src/Checkbox/index.js deleted file mode 100644 index f03873ba09..0000000000 --- a/packages/materialdesign-components/src/Checkbox/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import "./_style.scss" -export { default as Checkbox } from "./Checkbox.svelte" -export { default as Checkboxgroup } from "./CheckboxGroup.svelte" diff --git a/packages/materialdesign-components/src/ClassBuilder.js b/packages/materialdesign-components/src/ClassBuilder.js deleted file mode 100644 index a3aaef49a9..0000000000 --- a/packages/materialdesign-components/src/ClassBuilder.js +++ /dev/null @@ -1,74 +0,0 @@ -export default class ClassBuilder { - constructor(block, defaultIgnoreList) { - this.block = `mdc-${block}` - this.defaultIgnoreList = defaultIgnoreList //will be ignored when building custom classes - } - - /* - handles both blocks and elementss (BEM MD Notation) - params = {elementName: string, props: {modifiers{}, customs:{}, extras: []}} - All are optional - */ - build(params) { - if (!params) return this.block //return block if nothing passed - const { props, elementName } = params - let base = elementName ? `${this.block}__${elementName}` : this.block - if (!props) return base - return this._handleProps(base, props) - } - - //Easily grab a simple element class - elem(elementName) { - return this.build({ elementName }) - } - - //use if a different base is needed than whats defined by this.block - debase(base, elementProps) { - if (!elementProps) return base - return this._handleProps(base, elementProps) - } - - //proxies bindProps and checks for which elementProps exist before binding - _handleProps(base, elementProps) { - let cls = base - const { modifiers, customs, extras } = elementProps - if (modifiers) cls += this._bindProps(modifiers, base) - if (customs) cls += this._bindProps(customs, base, true) - if (extras) cls += ` ${extras.join(" ")}` - return cls.trim() - } - - /* - Handles both modifiers and customs. Use property, value or both depending - on whether it is passsed props for custom or modifiers - if custom uses the following convention for scss mixins: - bbmd-{this.block}--{property}-{value} - bbmd-mdc-button--size-large - */ - _bindProps(elementProps, base, isCustom = false) { - return Object.entries(elementProps) - .map(([property, value]) => { - //disregard falsy and values set by defaultIgnoreList constructor param - if ( - !!value && - (!this.defaultIgnoreList || !this.defaultIgnoreList.includes(value)) - ) { - let classBase = isCustom ? `bbmd-${base}` : `${base}` - let valueType = typeof value - - if (valueType == "string" || valueType == "number") { - return isCustom - ? ` ${classBase}--${this._convertCamel(property)}-${value}` - : ` ${classBase}--${value}` - } else if (valueType == "boolean") { - return ` ${classBase}--${this._convertCamel(property)}` - } - } - }) - .join("") - } - - _convertCamel(str) { - return str.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`) - } -} diff --git a/packages/materialdesign-components/src/Common/FloatingLabel.svelte b/packages/materialdesign-components/src/Common/FloatingLabel.svelte deleted file mode 100644 index 3f49a27801..0000000000 --- a/packages/materialdesign-components/src/Common/FloatingLabel.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/packages/materialdesign-components/src/Common/Formfield.svelte b/packages/materialdesign-components/src/Common/Formfield.svelte deleted file mode 100644 index 855e59ac88..0000000000 --- a/packages/materialdesign-components/src/Common/Formfield.svelte +++ /dev/null @@ -1,42 +0,0 @@ - - -
- - -
- - diff --git a/packages/materialdesign-components/src/Common/FormfieldStore.js b/packages/materialdesign-components/src/Common/FormfieldStore.js deleted file mode 100644 index 658f61b6b6..0000000000 --- a/packages/materialdesign-components/src/Common/FormfieldStore.js +++ /dev/null @@ -1,19 +0,0 @@ -import { writable } from "svelte/store" - -function store() { - const { set, update, subscribe } = writable({}) - - function setInput(inp) { - update(n => { - n.input = inp - }) - } - - return { - subscribe, - set, - setInput, - } -} - -export const fieldStore = store() diff --git a/packages/materialdesign-components/src/Common/Icon.svelte b/packages/materialdesign-components/src/Common/Icon.svelte deleted file mode 100644 index 39dc1f58ab..0000000000 --- a/packages/materialdesign-components/src/Common/Icon.svelte +++ /dev/null @@ -1,8 +0,0 @@ - - -{icon} diff --git a/packages/materialdesign-components/src/Common/ItemStore.js b/packages/materialdesign-components/src/Common/ItemStore.js deleted file mode 100644 index f6e3c8f4ac..0000000000 --- a/packages/materialdesign-components/src/Common/ItemStore.js +++ /dev/null @@ -1,54 +0,0 @@ -import { writable } from "svelte/store" - -function createItemsStore(componentOnSelect, initialState = []) { - const { subscribe, set, update } = writable(initialState) - - function addItem(item) { - update(items => { - return [...items, item] - }) - if (componentOnSelect) { - componentOnSelect() - } - } - - function addSingleItem(item) { - set([item]) - if (componentOnSelect) { - componentOnSelect() - } - } - - function removeItem(itemId) { - update(items => { - let index = getItemIdx(items, itemId) - items.splice(index, 1) - return items - }) - if (componentOnSelect) { - componentOnSelect() - } - } - - function clearItems() { - set([]) - if (componentOnSelect) { - componentOnSelect() - } - } - - function getItemIdx(items, itemId) { - return items.findIndex(i => i && i._id === itemId) - } - - return { - subscribe, - addItem, - addSingleItem, - removeItem, - clearItems, - getItemIdx, - } -} - -export default createItemsStore diff --git a/packages/materialdesign-components/src/Common/Label.svelte b/packages/materialdesign-components/src/Common/Label.svelte deleted file mode 100644 index e6ad51e3b7..0000000000 --- a/packages/materialdesign-components/src/Common/Label.svelte +++ /dev/null @@ -1,12 +0,0 @@ - - -{text} - - diff --git a/packages/materialdesign-components/src/Common/NotchedOutline.svelte b/packages/materialdesign-components/src/Common/NotchedOutline.svelte deleted file mode 100644 index 2b0d5fa51c..0000000000 --- a/packages/materialdesign-components/src/Common/NotchedOutline.svelte +++ /dev/null @@ -1,14 +0,0 @@ - - -
-
- {#if useLabel} -
- -
- {/if} -
-
diff --git a/packages/materialdesign-components/src/Common/Ripple.js b/packages/materialdesign-components/src/Common/Ripple.js deleted file mode 100644 index 6a19dac3ea..0000000000 --- a/packages/materialdesign-components/src/Common/Ripple.js +++ /dev/null @@ -1,28 +0,0 @@ -import { MDCRipple } from "@material/ripple" - -export default function ripple( - node, - props = { colour: "primary", unbounded: true } -) { - node.classList.add("mdc-ripple-surface") - let component = new MDCRipple(node) - component.unbounded = props.unbounded - - if (props.colour === "secondary") { - node.classList.remove("mdc-ripple-surface--primary") - node.classList.add("mdc-ripple-surface--accent") - } else { - node.classList.add("mdc-ripple-surface--primary") - node.classList.remove("mdc-ripple-surface--accent") - } - - return { - destroy() { - component.destroy() - node.classList.remove("mdc-ripple-surface") - node.classList.remove("mdc-ripple-surface--primary") - node.classList.remove("mdc-ripple-surface--accent") - component = null - }, - } -} diff --git a/packages/materialdesign-components/src/Datatable/Datatable.svelte b/packages/materialdesign-components/src/Datatable/Datatable.svelte deleted file mode 100644 index 61239a97cf..0000000000 --- a/packages/materialdesign-components/src/Datatable/Datatable.svelte +++ /dev/null @@ -1,48 +0,0 @@ - - -
- - diff --git a/packages/materialdesign-components/src/Datatable/DatatableBody.svelte b/packages/materialdesign-components/src/Datatable/DatatableBody.svelte deleted file mode 100644 index a98d277e61..0000000000 --- a/packages/materialdesign-components/src/Datatable/DatatableBody.svelte +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/packages/materialdesign-components/src/Datatable/DatatableCell.svelte b/packages/materialdesign-components/src/Datatable/DatatableCell.svelte deleted file mode 100644 index 2ced576a65..0000000000 --- a/packages/materialdesign-components/src/Datatable/DatatableCell.svelte +++ /dev/null @@ -1,27 +0,0 @@ - - -{#if isHeader} - -{:else} - -{/if} diff --git a/packages/materialdesign-components/src/Datatable/DatatableHead.svelte b/packages/materialdesign-components/src/Datatable/DatatableHead.svelte deleted file mode 100644 index 1c05921c2e..0000000000 --- a/packages/materialdesign-components/src/Datatable/DatatableHead.svelte +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/packages/materialdesign-components/src/Datatable/DatatableRow.svelte b/packages/materialdesign-components/src/Datatable/DatatableRow.svelte deleted file mode 100644 index f0f424b857..0000000000 --- a/packages/materialdesign-components/src/Datatable/DatatableRow.svelte +++ /dev/null @@ -1,30 +0,0 @@ - - - - - diff --git a/packages/materialdesign-components/src/Datatable/_style.scss b/packages/materialdesign-components/src/Datatable/_style.scss deleted file mode 100644 index 3304e1e603..0000000000 --- a/packages/materialdesign-components/src/Datatable/_style.scss +++ /dev/null @@ -1 +0,0 @@ -@import "@material/data-table/mdc-data-table"; diff --git a/packages/materialdesign-components/src/Datatable/index.js b/packages/materialdesign-components/src/Datatable/index.js deleted file mode 100644 index 69dd1e759e..0000000000 --- a/packages/materialdesign-components/src/Datatable/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import "./_style.scss" -export { default as Datatable } from "./Datatable.svelte" -export { default as DatatableCell } from "./DatatableCell.svelte" -export { default as DatatableHead } from "./DatatableHead.svelte" -export { default as DatatableBody } from "./DatatableBody.svelte" -export { default as DatatableRow } from "./DatatableRow.svelte" diff --git a/packages/materialdesign-components/src/DatePicker/DatePicker.svelte b/packages/materialdesign-components/src/DatePicker/DatePicker.svelte deleted file mode 100644 index 6a2c452f59..0000000000 --- a/packages/materialdesign-components/src/DatePicker/DatePicker.svelte +++ /dev/null @@ -1,189 +0,0 @@ - - -
- - -
-
-
-
- -
-
- -
-
- -
-
-
- {#each weekdayMap as day, i} -
-
- - - -
- - {/each} - -
- {#each daysArr as day, i} -
selectDate(day)} - class={`bbmd-day ${dayOfSelectedDate === day && sameMonthAndYear ? 'selected' : ''}`}> - -
- {/each} -
- - - -