@seamapi/react 0.27.0 → 1.1.0

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 (58) hide show
  1. package/index.css +97 -0
  2. package/index.css.map +1 -1
  3. package/index.min.css +1 -1
  4. package/index.min.css.map +1 -1
  5. package/lib/capitalize.d.ts +1 -0
  6. package/lib/capitalize.js +4 -0
  7. package/lib/capitalize.js.map +1 -0
  8. package/lib/icons/ChevronDown.d.ts +2 -0
  9. package/lib/icons/ChevronDown.js +3 -0
  10. package/lib/icons/ChevronDown.js.map +1 -0
  11. package/lib/ui/Button.d.ts +4 -3
  12. package/lib/ui/Button.js +2 -2
  13. package/lib/ui/Button.js.map +1 -1
  14. package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.d.ts +21 -0
  15. package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.js +20 -0
  16. package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.js.map +1 -0
  17. package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.d.ts +4 -0
  18. package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js +53 -0
  19. package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -0
  20. package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +11 -0
  21. package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js +50 -0
  22. package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +1 -0
  23. package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.d.ts +1 -0
  24. package/lib/ui/{SupportedDevices/SupportedDevicesHeader.js → SupportedDeviceTable/SupportedDeviceHeader.js} +2 -2
  25. package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.js.map +1 -0
  26. package/lib/ui/{SupportedDevices → SupportedDeviceTable}/SupportedDeviceRow.d.ts +1 -1
  27. package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.js.map +1 -0
  28. package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.d.ts +3 -0
  29. package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js +8 -0
  30. package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -0
  31. package/lib/ui/{SupportedDevices → SupportedDeviceTable}/types.d.ts +5 -0
  32. package/lib/ui/SupportedDeviceTable/types.js.map +1 -0
  33. package/lib/ui/index.d.ts +1 -1
  34. package/lib/ui/index.js +1 -1
  35. package/lib/ui/index.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/lib/capitalize.ts +3 -0
  38. package/src/lib/icons/ChevronDown.tsx +19 -0
  39. package/src/lib/ui/Button.tsx +12 -6
  40. package/src/lib/ui/SupportedDeviceTable/FilterCategoryMenu.tsx +65 -0
  41. package/src/lib/ui/SupportedDeviceTable/SupportedDeviceContent.tsx +147 -0
  42. package/src/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +131 -0
  43. package/src/lib/ui/{SupportedDevices/SupportedDevicesHeader.tsx → SupportedDeviceTable/SupportedDeviceHeader.tsx} +1 -1
  44. package/src/lib/ui/{SupportedDevices → SupportedDeviceTable}/SupportedDeviceRow.tsx +1 -1
  45. package/src/lib/ui/SupportedDeviceTable/SupportedDeviceTable.tsx +16 -0
  46. package/src/lib/ui/{SupportedDevices → SupportedDeviceTable}/types.ts +6 -0
  47. package/src/lib/ui/index.ts +1 -1
  48. package/src/styles/_supported-devices.scss +114 -0
  49. package/lib/ui/SupportedDevices/SupportedDeviceRow.js.map +0 -1
  50. package/lib/ui/SupportedDevices/SupportedDevices.d.ts +0 -1
  51. package/lib/ui/SupportedDevices/SupportedDevices.js +0 -21
  52. package/lib/ui/SupportedDevices/SupportedDevices.js.map +0 -1
  53. package/lib/ui/SupportedDevices/SupportedDevicesHeader.d.ts +0 -1
  54. package/lib/ui/SupportedDevices/SupportedDevicesHeader.js.map +0 -1
  55. package/lib/ui/SupportedDevices/types.js.map +0 -1
  56. package/src/lib/ui/SupportedDevices/SupportedDevices.tsx +0 -65
  57. /package/lib/ui/{SupportedDevices → SupportedDeviceTable}/SupportedDeviceRow.js +0 -0
  58. /package/lib/ui/{SupportedDevices → SupportedDeviceTable}/types.js +0 -0
@@ -1,65 +0,0 @@
1
- import { useQuery } from '@tanstack/react-query'
2
- import axios from 'axios'
3
-
4
- import { Button } from 'lib/ui/Button.js'
5
- import type { DeviceModel } from 'lib/ui/SupportedDevices/types.js'
6
-
7
- import { SupportedDeviceRow } from './SupportedDeviceRow.js'
8
- import { SupportedDevicesHeader } from './SupportedDevicesHeader.js'
9
-
10
- export function SupportedDevices() {
11
- const { data, isLoading, isError, refetch } = useQuery<{
12
- data: {
13
- device_models?: DeviceModel[]
14
- }
15
- }>({
16
- queryKey: ['supported_devices'],
17
- queryFn: async () => {
18
- return await axios.get('https://devicedb.seam.co/api/device_models/list')
19
- },
20
- })
21
-
22
- return (
23
- <>
24
- <div className='seam-supported-devices-table-wrap'>
25
- {isLoading && (
26
- <div className='seam-supported-devices-table-state-block'>
27
- <p>Loading device models...</p>
28
- </div>
29
- )}
30
-
31
- {isError && (
32
- <div className='seam-supported-devices-table-state-block'>
33
- <p>There was an error fetching device models.</p>
34
- <Button
35
- variant='solid'
36
- size='small'
37
- onClick={() => {
38
- void refetch()
39
- }}
40
- >
41
- Retry
42
- </Button>
43
- </div>
44
- )}
45
-
46
- {!isLoading &&
47
- !isError &&
48
- data?.data?.device_models !== null &&
49
- Array.isArray(data?.data?.device_models) && (
50
- <table className='seam-supported-devices-table'>
51
- <SupportedDevicesHeader />
52
- <tbody>
53
- {data.data.device_models.map((deviceModel) => (
54
- <SupportedDeviceRow
55
- key={deviceModel.manufacturer_model_id}
56
- deviceModel={deviceModel}
57
- />
58
- ))}
59
- </tbody>
60
- </table>
61
- )}
62
- </div>
63
- </>
64
- )
65
- }