willba-component-library 0.0.42 → 0.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ :root {
2
+ --primary-color: #3498db;
3
+ --font-size: 16px;
4
+ --box-shadow: 0px 6px 11px 0px #a7a4a480
5
+ }
6
+
7
+ * {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ html {
12
+ background-color: aqua;
13
+ }
@@ -0,0 +1,3 @@
1
+ html {
2
+ background-color: blue;
3
+ }
@@ -0,0 +1,3 @@
1
+ html {
2
+ background-color: red;
3
+ }
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
1
  type ThemeProps = {
3
2
  vendor?: string;
4
3
  };
5
- export default function MyComponent({ vendor }: ThemeProps): React.JSX.Element;
4
+ export default function useTheme({ vendor }: ThemeProps): void;
6
5
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "description": "A stroybook 6 with TypeScript demo",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
package/rollup.config.mjs CHANGED
@@ -41,7 +41,6 @@ export default [
41
41
  format: 'umd',
42
42
  sourcemap: true,
43
43
  globals,
44
- inlineDynamicImports: true,
45
44
  },
46
45
  ],
47
46
  plugins: [
@@ -21,7 +21,7 @@ type FilterBarProps = {
21
21
  }
22
22
 
23
23
  export default function FilterBar({ vendor, language }: FilterBarProps) {
24
- const cssLoaded = useTheme({ vendor })
24
+ useTheme({ vendor })
25
25
 
26
26
  const [rerenderKey, setRerenderKey] = useState(0)
27
27
 
@@ -49,7 +49,7 @@ export default function FilterBar({ vendor, language }: FilterBarProps) {
49
49
  } = useFilterBar()
50
50
 
51
51
  return (
52
- <div className={`filter-bar ${cssLoaded ? 'dynamic-theme-class' : ''}`}>
52
+ <div className={`filter-bar `}>
53
53
  <div className="filter-bar-header">
54
54
  <SelectButton
55
55
  label={t('calendar.startDate')}
@@ -1,54 +1,27 @@
1
- // import React, { useEffect, useState } from 'react'
1
+ import { useEffect } from 'react'
2
2
 
3
- // type ThemeProps = {
4
- // vendor?: string
5
- // }
6
-
7
- // export default function useTheme({ vendor }: ThemeProps) {
8
- // const [cssLoaded, setCssLoaded] = useState(false)
9
-
10
- // useEffect(() => {
11
- // async function loadThemeCSS() {
12
- // try {
13
- // let cssUrl = ''
14
-
15
- // if (vendor === 'Kisakallio') {
16
- // cssUrl = './Kisakallio.css'
17
- // } else if (vendor === 'Pajulahti') {
18
- // cssUrl = './Pajulahti.css'
19
- // } else {
20
- // cssUrl = './Default.css'
21
- // }
22
-
23
- // await loadCSS(cssUrl)
24
- // setCssLoaded(true)
25
- // } catch (error) {
26
- // console.error('Error loading CSS:', error)
27
- // }
28
- // }
29
-
30
- // loadThemeCSS()
31
- // }, [vendor])
32
-
33
- // return cssLoaded
34
- // }
35
-
36
- import React, { useEffect } from 'react'
37
3
  type ThemeProps = {
38
4
  vendor?: string
39
5
  }
40
6
 
41
- export default function MyComponent({ vendor }: ThemeProps) {
7
+ export default function useTheme({ vendor }: ThemeProps) {
42
8
  useEffect(() => {
43
9
  if (vendor === 'Kisakallio') {
44
- addCSSFile('./Kisakallio.css')
10
+ addCSSFile(
11
+ 'https://cdn.jsdelivr.net/npm/willba-component-library@0.0.43/lib/themes/Kisakallio.css'
12
+ )
13
+ } else if (vendor === 'Pajulahti') {
14
+ addCSSFile(
15
+ 'https://cdn.jsdelivr.net/npm/willba-component-library@0.0.43/lib/themes/Pajulahti.css'
16
+ )
45
17
  } else {
46
- addCSSFile('./Default.css')
18
+ addCSSFile(
19
+ 'https://cdn.jsdelivr.net/npm/willba-component-library@0.0.43/lib/themes/Default.css'
20
+ )
47
21
  }
48
22
  }, [vendor])
49
23
 
50
- // Rest of your component code
51
- return <div>My Component</div>
24
+ return
52
25
  }
53
26
 
54
27
  const addCSSFile = (href: string) => {