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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.2.45",
3
+ "version": "0.2.47",
4
4
  "description": "A custom UI component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -75,6 +75,7 @@ export const Primary: Story = {
75
75
  },
76
76
  },
77
77
  ],
78
+ isLoading: true,
78
79
  },
79
80
  render: (args) => (
80
81
  <div style={{ background: 'white', padding: '30px', height: '100vh' }}>
@@ -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
 
@@ -12,6 +12,7 @@ export type FilterBarProps = {
12
12
  mode?: string
13
13
  defaultTab?: string
14
14
  tabs?: Tab[]
15
+ isLoading?: boolean
15
16
  }
16
17
 
17
18
  export type AgeCategoryCount = {
@@ -41,7 +41,7 @@
41
41
 
42
42
  .will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {
43
43
  display: flex;
44
- min-height: 17.50px;
44
+ min-height: 20.5px;
45
45
  }
46
46
 
47
47
  .will-root .will-calendar-wrapper .will-calendar-footer-actions {
@@ -31,3 +31,10 @@ button.will-filter-bar-submit-button:disabled {
31
31
 
32
32
  }
33
33
  }
34
+
35
+ /* --- */
36
+
37
+ @keyframes spin {
38
+ 0% { transform: rotate(0deg); }
39
+ 100% { transform: rotate(360deg); }
40
+ }
@@ -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
- {startIcon && <span>{startIcon}</span>}
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
  )
@@ -9,7 +9,7 @@ export type ThemeProps = {
9
9
  palette?: Palette
10
10
  }
11
11
 
12
- interface CustomPaletteTypes extends CSSProperties {
12
+ export interface CustomPaletteTypes extends CSSProperties {
13
13
  '--will-primary'?: string
14
14
  '--will-secondary'?: string
15
15
  }