willba-component-library 0.2.45 → 0.2.47
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/components/FilterBar/FilterBar.d.ts +1 -1
- package/lib/components/FilterBar/FilterBarTypes.d.ts +1 -0
- package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +2 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.esm.js +9 -7
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +9 -7
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +9 -7
- package/lib/index.umd.js.map +1 -1
- package/lib/themes/useTheme.d.ts +1 -2
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBar.stories.tsx +1 -0
- package/src/components/FilterBar/FilterBar.tsx +2 -0
- package/src/components/FilterBar/FilterBarTypes.ts +1 -0
- package/src/components/FilterCalendar/FilterCalendar.css +1 -1
- package/src/core/components/buttons/submit-button/SubmitButton.css +7 -0
- package/src/core/components/buttons/submit-button/SubmitButton.tsx +14 -2
- package/src/themes/useTheme.tsx +1 -1
package/lib/themes/useTheme.d.ts
CHANGED
|
@@ -6,9 +6,8 @@ export type Palette = {
|
|
|
6
6
|
export type ThemeProps = {
|
|
7
7
|
palette?: Palette;
|
|
8
8
|
};
|
|
9
|
-
interface CustomPaletteTypes extends CSSProperties {
|
|
9
|
+
export interface CustomPaletteTypes extends CSSProperties {
|
|
10
10
|
'--will-primary'?: string;
|
|
11
11
|
'--will-secondary'?: string;
|
|
12
12
|
}
|
|
13
13
|
export default function useTheme({ palette }: ThemeProps): CustomPaletteTypes;
|
|
14
|
-
export {};
|
package/package.json
CHANGED
|
@@ -35,6 +35,7 @@ export default function FilterBar({
|
|
|
35
35
|
disableCalendarDates,
|
|
36
36
|
mode,
|
|
37
37
|
tabs,
|
|
38
|
+
isLoading,
|
|
38
39
|
}: FilterBarProps) {
|
|
39
40
|
const themePalette = useTheme({ palette })
|
|
40
41
|
|
|
@@ -143,6 +144,7 @@ export default function FilterBar({
|
|
|
143
144
|
onClick={handleSubmit}
|
|
144
145
|
startIcon={<FaSearch />}
|
|
145
146
|
label={t('common:search')}
|
|
147
|
+
isLoading={isLoading}
|
|
146
148
|
/>
|
|
147
149
|
</div>
|
|
148
150
|
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react'
|
|
2
2
|
|
|
3
|
+
import { SpinnerSVG } from '../../../../assets/SpinnerSvg'
|
|
4
|
+
import { Palette } from '../../../../themes/useTheme'
|
|
5
|
+
|
|
3
6
|
import './SubmitButton.css'
|
|
7
|
+
import { FaSpinner } from 'react-icons/fa'
|
|
4
8
|
|
|
5
9
|
type Props = {
|
|
6
10
|
onClick?: () => void
|
|
7
11
|
startIcon?: ReactNode
|
|
8
12
|
label?: string
|
|
9
13
|
disabled?: boolean
|
|
14
|
+
isLoading?: boolean
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
export const SubmitButton = ({
|
|
@@ -14,14 +19,21 @@ export const SubmitButton = ({
|
|
|
14
19
|
startIcon,
|
|
15
20
|
label,
|
|
16
21
|
disabled,
|
|
22
|
+
isLoading,
|
|
17
23
|
}: Props) => {
|
|
18
24
|
return (
|
|
19
25
|
<button
|
|
20
26
|
className="will-filter-bar-submit-button"
|
|
21
27
|
onClick={onClick}
|
|
22
|
-
disabled={disabled}
|
|
28
|
+
disabled={disabled || isLoading}
|
|
23
29
|
>
|
|
24
|
-
{
|
|
30
|
+
{isLoading ? (
|
|
31
|
+
<span>
|
|
32
|
+
{<FaSpinner style={{ animation: 'spin 1s linear infinite' }} />}
|
|
33
|
+
</span>
|
|
34
|
+
) : (
|
|
35
|
+
startIcon && <span>{startIcon}</span>
|
|
36
|
+
)}
|
|
25
37
|
{label || 'Label'}
|
|
26
38
|
</button>
|
|
27
39
|
)
|
package/src/themes/useTheme.tsx
CHANGED