Skip to content

Commit

Permalink
Utilizes svelte's DOM event delegation shorthand e.g. on:click on:foc…
Browse files Browse the repository at this point in the history
…us on:blur etc. Refactors Buttons to use. Finishes Input / InputAddonItem for Svelte (I think)
  • Loading branch information
roblevintennis committed Oct 14, 2020
1 parent 0c7e4a4 commit f43299e
Show file tree
Hide file tree
Showing 17 changed files with 1,471 additions and 159 deletions.
2 changes: 1 addition & 1 deletion agnosticui-svelte/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const parameters = {
docs: {
theme: yourTheme,
},
actions: { argTypesRegex: "^on[A-Z].*" },
actions: { argTypesRegex: "^on.*" },
};

require('!style-loader!css-loader!../src/css/common.min.css')
14 changes: 14 additions & 0 deletions agnosticui-svelte/copystyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ const headerNavItemSvelte = fs.readFileSync('./src/stories/HeaderNavItem.svelte'
const headerNavItemSynchronized = headerNavItemSvelte.replace(styleRegex, `<style>\n${css}\n</style>`);
fs.writeFileSync('./src/stories/HeaderNavItem.svelte', headerNavItemSynchronized, 'utf8');


/**
* Inputs
*/
css = fs.readFileSync('../agnosticui-css/input.css', 'utf8');
const inputSvelte = fs.readFileSync('./src/stories/Input.svelte', 'utf8');
const inputSynchronized = inputSvelte.replace(styleRegex, `<style>\n${css}\n</style>`);
fs.writeFileSync('./src/stories/Input.svelte', inputSynchronized, 'utf8');

css = fs.readFileSync('../agnosticui-css/inputaddonitem.css', 'utf8');
const inputAddonItemSvelte = fs.readFileSync('./src/stories/InputAddonItem.svelte', 'utf8');
const inputAddonItemSynchronized = inputAddonItemSvelte.replace(styleRegex, `<style>\n${css}\n</style>`);
fs.writeFileSync('./src/stories/InputAddonItem.svelte', inputAddonItemSynchronized, 'utf8');

/**
* FlexGrid (grid, row, col all copied over. Svelte SFC requires this so that each
* component gets it's own CSS <style>...</style> stuff copied over)
Expand Down
5 changes: 3 additions & 2 deletions agnosticui-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"rollup-plugin-svelte": "^6.0.0",
"rollup-plugin-terser": "^7.0.0",
"svelte": "^3.24.1",
"svelte-jester": "^1.1.5",
"svelte-loader": "^2.13.6"
},
"dependencies": {
Expand All @@ -49,7 +50,7 @@
"jest": {
"transform": {
"^.+\\.js$": "babel-jest",
"^.+\\.svelte$": "jest-transform-svelte"
"^.+\\.svelte$": "svelte-jester"
},
"moduleFileExtensions": [
"js",
Expand All @@ -69,4 +70,4 @@
"/storybook-static/"
]
}
}
}
Loading

0 comments on commit f43299e

Please sign in to comment.