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.
- package/lib/index.css +480 -0
- package/lib/index.esm.css +480 -0
- package/lib/index.esm.js +9 -34
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +9 -34
- package/lib/index.js.map +1 -1
- package/lib/index.umd.css +480 -0
- package/lib/index.umd.js +9 -34
- package/lib/index.umd.js.map +1 -1
- package/lib/themes/Default.css +13 -0
- package/lib/themes/Kisakallio.css +3 -0
- package/lib/themes/Pajulahti.css +3 -0
- package/lib/themes/useTheme.d.ts +1 -2
- package/package.json +1 -1
- package/rollup.config.mjs +0 -1
- package/src/components/FilterBar/FilterBar.tsx +2 -2
- package/src/themes/useTheme.tsx +13 -40
package/lib/themes/useTheme.d.ts
CHANGED
package/package.json
CHANGED
package/rollup.config.mjs
CHANGED
|
@@ -21,7 +21,7 @@ type FilterBarProps = {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export default function FilterBar({ vendor, language }: FilterBarProps) {
|
|
24
|
-
|
|
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
|
|
52
|
+
<div className={`filter-bar `}>
|
|
53
53
|
<div className="filter-bar-header">
|
|
54
54
|
<SelectButton
|
|
55
55
|
label={t('calendar.startDate')}
|
package/src/themes/useTheme.tsx
CHANGED
|
@@ -1,54 +1,27 @@
|
|
|
1
|
-
|
|
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
|
|
7
|
+
export default function useTheme({ vendor }: ThemeProps) {
|
|
42
8
|
useEffect(() => {
|
|
43
9
|
if (vendor === 'Kisakallio') {
|
|
44
|
-
addCSSFile(
|
|
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(
|
|
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
|
-
|
|
51
|
-
return <div>My Component</div>
|
|
24
|
+
return
|
|
52
25
|
}
|
|
53
26
|
|
|
54
27
|
const addCSSFile = (href: string) => {
|