willba-component-library 0.3.12 → 0.3.14

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.
Files changed (51) hide show
  1. package/README.md +6 -18
  2. package/lib/assets/IconsSvg.d.ts +2 -1
  3. package/lib/components/Button/Button.d.ts +2 -2
  4. package/lib/components/FilterBar/FilterBar.d.ts +2 -1
  5. package/lib/components/FilterBar/components/buttons/select-button/SelectButton.d.ts +2 -1
  6. package/lib/components/FilterBar/components/buttons/tab-button/TabButton.d.ts +2 -1
  7. package/lib/components/FilterBar/components/cards/image-card/ImageCard.d.ts +2 -1
  8. package/lib/components/FilterBar/components/categories/Categories.d.ts +2 -1
  9. package/lib/components/FilterBar/components/common/FilterSectionHeader.d.ts +2 -2
  10. package/lib/components/FilterBar/components/dates/Dates.d.ts +2 -2
  11. package/lib/components/FilterBar/components/divider/Divider.d.ts +2 -1
  12. package/lib/components/FilterBar/components/guests/Guests.d.ts +2 -1
  13. package/lib/components/FilterBar/components/locations/Locations.d.ts +2 -1
  14. package/lib/components/FilterCalendar/FilterCalendar.d.ts +2 -1
  15. package/lib/components/FilterCalendar/components/Footer.d.ts +2 -1
  16. package/lib/core/components/buttons/close-button/CloseButton.d.ts +2 -1
  17. package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +2 -1
  18. package/lib/core/components/calendar/Calendar.d.ts +2 -1
  19. package/lib/index.d.ts +4 -5
  20. package/lib/index.esm.js +289 -213
  21. package/lib/index.esm.js.map +1 -1
  22. package/lib/index.js +376 -300
  23. package/lib/index.js.map +1 -1
  24. package/lib/index.umd.js +379 -302
  25. package/lib/index.umd.js.map +1 -1
  26. package/package.json +1 -1
  27. package/rollup.config.mjs +1 -1
  28. package/src/assets/IconsSvg.tsx +2 -0
  29. package/src/components/Button/Button.stories.tsx +1 -0
  30. package/src/components/Button/Button.tsx +1 -1
  31. package/src/components/FilterBar/FilterBar.stories.tsx +1 -0
  32. package/src/components/FilterBar/FilterBar.tsx +1 -1
  33. package/src/components/FilterBar/components/buttons/select-button/SelectButton.tsx +1 -1
  34. package/src/components/FilterBar/components/buttons/tab-button/TabButton.tsx +2 -0
  35. package/src/components/FilterBar/components/cards/image-card/ImageCard.tsx +1 -1
  36. package/src/components/FilterBar/components/categories/Categories.tsx +1 -2
  37. package/src/components/FilterBar/components/common/FilterSectionHeader.tsx +1 -1
  38. package/src/components/FilterBar/components/dates/Dates.tsx +1 -1
  39. package/src/components/FilterBar/components/divider/Divider.tsx +2 -0
  40. package/src/components/FilterBar/components/guests/GuestCount/GuestCount.tsx +1 -1
  41. package/src/components/FilterBar/components/guests/Guests.tsx +1 -1
  42. package/src/components/FilterBar/components/locations/Locations.tsx +1 -1
  43. package/src/components/FilterBar/utils/calculateDropdownPosition.tsx +0 -10
  44. package/src/components/FilterCalendar/FilterCalendar.tsx +1 -0
  45. package/src/components/FilterCalendar/components/Footer.tsx +1 -0
  46. package/src/core/components/buttons/close-button/CloseButton.tsx +1 -0
  47. package/src/core/components/buttons/submit-button/SubmitButton.tsx +1 -0
  48. package/src/core/components/calendar/Calendar.tsx +1 -1
  49. package/stories/Button.tsx +2 -0
  50. package/stories/Header.tsx +1 -0
  51. package/stories/Page.tsx +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
4
4
  "description": "A custom UI component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
package/rollup.config.mjs CHANGED
@@ -46,7 +46,7 @@ export default [
46
46
  resolve(),
47
47
  commonjs(),
48
48
  typescript({
49
- jsx: 'react-jsx',
49
+ jsx: 'react',
50
50
  }),
51
51
  postcss({
52
52
  extensions: ['.css'],
@@ -1,3 +1,5 @@
1
+ import React from 'react'
2
+
1
3
  type Icon = 'spinner' | 'warning'
2
4
 
3
5
  type Props = {
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import type { Meta, StoryObj } from '@storybook/react'
2
3
  import Button from './Button'
3
4
 
@@ -1,4 +1,4 @@
1
- import { useState, MouseEvent } from 'react'
1
+ import React, { useState, MouseEvent } from 'react'
2
2
  import classNames from 'classnames'
3
3
  import './button.css'
4
4
 
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import type { Meta, StoryObj } from '@storybook/react'
2
3
 
3
4
  import FilterBar from './FilterBar'
@@ -1,4 +1,4 @@
1
- import {
1
+ import React, {
2
2
  CSSProperties,
3
3
  MutableRefObject,
4
4
  useEffect,
@@ -1,4 +1,4 @@
1
- import { forwardRef } from 'react'
1
+ import React, { forwardRef } from 'react'
2
2
 
3
3
  import './SelectButton.css'
4
4
 
@@ -1,3 +1,5 @@
1
+ import React from 'react'
2
+
1
3
  import './TabButton.css'
2
4
 
3
5
  type Props = {
@@ -1,4 +1,4 @@
1
- import { forwardRef } from 'react'
1
+ import React, { forwardRef } from 'react'
2
2
 
3
3
  import './ImageCard.css'
4
4
 
@@ -1,5 +1,4 @@
1
- import { useState } from 'react'
2
-
1
+ import React, { useState } from 'react'
3
2
  import { useTranslation } from 'react-i18next'
4
3
 
5
4
  import './Categories.css'
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react'
1
+ import React, { ReactNode } from 'react'
2
2
 
3
3
  import './FilterSectionHeader.css'
4
4
 
@@ -1,4 +1,4 @@
1
- import { RefObject, forwardRef } from 'react'
1
+ import React, { RefObject, forwardRef } from 'react'
2
2
 
3
3
  import { DateRange } from 'react-day-picker'
4
4
  import { Calendar } from '../../../../core/components'
@@ -1,3 +1,5 @@
1
+ import React from 'react'
2
+
1
3
  import './Divider.css'
2
4
 
3
5
  export const Divider = () => {
@@ -1,4 +1,4 @@
1
- import { FC, useEffect } from 'react'
1
+ import React, { FC, useEffect } from 'react'
2
2
 
3
3
  import { GuestsCountPropsType } from '../../../FilterBarTypes'
4
4
 
@@ -1,4 +1,4 @@
1
- import { forwardRef } from 'react'
1
+ import React, { forwardRef } from 'react'
2
2
  import { useTranslation } from 'react-i18next'
3
3
 
4
4
  import { useAutoFocus } from '../../../../core/hooks'
@@ -1,4 +1,4 @@
1
- import { forwardRef, useEffect, useRef } from 'react'
1
+ import React, { forwardRef, useEffect, useRef } from 'react'
2
2
  import { useTranslation } from 'react-i18next'
3
3
 
4
4
  import './Locations.css'
@@ -18,8 +18,6 @@ export const calculateDropdownPosition = ({
18
18
  guestsButtonRef,
19
19
  isMobile,
20
20
  }: CalculateDropdownPositionParams): CSSProperties => {
21
- // On mobile, don't apply any positioning - let CSS handle it naturally
22
- // Dropdowns will start from leftmost point with position: relative
23
21
  if (isMobile) {
24
22
  return {}
25
23
  }
@@ -31,7 +29,6 @@ export const calculateDropdownPosition = ({
31
29
 
32
30
  switch (filterSection) {
33
31
  case FilterSections.LOCATIONS:
34
- // Locations: Start from beginning, hug content
35
32
  if (locationsButtonRef.current) {
36
33
  const buttonRect = locationsButtonRef.current.getBoundingClientRect()
37
34
  const relativeLeft = buttonRect.left - containerRect.left
@@ -44,8 +41,6 @@ export const calculateDropdownPosition = ({
44
41
  break
45
42
 
46
43
  case FilterSections.CALENDAR:
47
- // Calendar: Two months side-by-side, needs ~650-700px
48
- // Start from dates button, but push left if not enough space
49
44
  if (datesButtonRef.current) {
50
45
  const buttonRect = datesButtonRef.current.getBoundingClientRect()
51
46
  const relativeLeft = buttonRect.left - containerRect.left
@@ -53,7 +48,6 @@ export const calculateDropdownPosition = ({
53
48
  const calendarMinWidth = 650
54
49
 
55
50
  if (availableWidth < calendarMinWidth) {
56
- // Not enough space, align to the right edge
57
51
  return {
58
52
  left: 'auto',
59
53
  right: containerLeft,
@@ -61,7 +55,6 @@ export const calculateDropdownPosition = ({
61
55
  maxWidth: `${containerRect.width}px`,
62
56
  }
63
57
  } else {
64
- // Enough space, start from dates button
65
58
  return {
66
59
  left: relativeLeft,
67
60
  right: 'auto',
@@ -72,7 +65,6 @@ export const calculateDropdownPosition = ({
72
65
  break
73
66
 
74
67
  case FilterSections.GUESTS:
75
- // Guests: Start from guests button, push left if not enough space
76
68
  if (guestsButtonRef.current) {
77
69
  const buttonRect = guestsButtonRef.current.getBoundingClientRect()
78
70
  const relativeLeft = buttonRect.left - containerRect.left
@@ -80,7 +72,6 @@ export const calculateDropdownPosition = ({
80
72
  const dropdownMinWidth = 350
81
73
 
82
74
  if (availableWidth < dropdownMinWidth) {
83
- // Not enough space, align to the right
84
75
  return {
85
76
  left: 'auto',
86
77
  right: containerLeft,
@@ -88,7 +79,6 @@ export const calculateDropdownPosition = ({
88
79
  maxWidth: `${containerRect.width}px`,
89
80
  }
90
81
  } else {
91
- // Enough space, start from button
92
82
  return {
93
83
  left: relativeLeft,
94
84
  right: 'auto',
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { useTranslation } from 'react-i18next'
2
3
 
3
4
  import useTheme from '../../themes/useTheme'
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { useTranslation } from 'react-i18next'
2
3
  import { useMediaQuery } from 'react-responsive'
3
4
  import { DateRange } from 'react-day-picker'
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { IoIosCloseCircleOutline } from 'react-icons/io'
2
3
 
3
4
  import './CloseButton.css'
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { FaSpinner } from 'react-icons/fa'
2
3
  import { ReactNode } from 'react'
3
4
 
@@ -1,4 +1,4 @@
1
- import { forwardRef } from 'react'
1
+ import React, { forwardRef } from 'react'
2
2
  import { addDays, startOfDay } from 'date-fns'
3
3
  import { fi, enUS } from 'date-fns/locale'
4
4
  import { useTranslation } from 'react-i18next'
@@ -1,3 +1,5 @@
1
+ import React from 'react'
2
+
1
3
  import './button.css'
2
4
 
3
5
  interface ButtonProps {
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { Button } from './Button'
2
3
  import './header.css'
3
4
 
package/stories/Page.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { FC, useState } from 'react'
1
+ import React, { FC, useState } from 'react'
2
2
 
3
3
  import { Header } from './Header'
4
4
  import './page.css'