@seamapi/react 1.5.1 → 1.7.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.
- package/README.md +7 -5
- package/dist/elements.js +25020 -0
- package/dist/elements.js.map +1 -0
- package/hooks.d.ts +1 -0
- package/hooks.js +2 -0
- package/hooks.js.map +1 -0
- package/index.css +6 -0
- package/index.css.map +1 -1
- package/index.min.css +1 -1
- package/index.min.css.map +1 -1
- package/lib/{sort-by.d.ts → dates.d.ts} +1 -1
- package/lib/{sort-by.js → dates.js} +2 -2
- package/lib/dates.js.map +1 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/{SeamProvider.d.ts → seam/SeamProvider.d.ts} +9 -6
- package/lib/{SeamProvider.js → seam/SeamProvider.js} +29 -30
- package/lib/seam/SeamProvider.js.map +1 -0
- package/lib/seam/access-codes/use-access-codes.js +2 -2
- package/lib/seam/access-codes/use-access-codes.js.map +1 -1
- package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.js +5 -5
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js.map +1 -0
- package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.js +7 -7
- package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js.map +1 -0
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +77 -0
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -0
- package/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.js +3 -3
- package/lib/seam/components/AccessCodeTable/CodeDetails.js.map +1 -0
- package/lib/{ui → seam/components}/DeviceDetails/DeviceDetails.js +14 -14
- package/lib/seam/components/DeviceDetails/DeviceDetails.js.map +1 -0
- package/lib/seam/components/DeviceDetails/DeviceModel.js.map +1 -0
- package/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.d.ts +3 -2
- package/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.js +4 -4
- package/lib/seam/components/DeviceTable/DeviceHealthBar.js.map +1 -0
- package/lib/{ui → seam/components}/DeviceTable/DeviceRow.d.ts +1 -1
- package/lib/{ui → seam/components}/DeviceTable/DeviceRow.js +9 -9
- package/lib/seam/components/DeviceTable/DeviceRow.js.map +1 -0
- package/lib/{ui → seam/components}/DeviceTable/DeviceTable.d.ts +1 -1
- package/lib/{ui → seam/components}/DeviceTable/DeviceTable.js +11 -11
- package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +20 -0
- package/lib/{ui → seam/components}/SupportedDeviceTable/FilterCategoryMenu.js +8 -5
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +9 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +39 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +9 -0
- package/lib/{ui → seam/components}/SupportedDeviceTable/SupportedDeviceFilterArea.js +33 -28
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.d.ts +2 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.js +12 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +6 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js +19 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +5 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +16 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +7 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +18 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +1 -0
- package/lib/seam/components/index.js.map +1 -0
- package/lib/seam/device-models/use-device-models.d.ts +5 -0
- package/lib/seam/device-models/use-device-models.js +17 -0
- package/lib/seam/device-models/use-device-models.js.map +1 -0
- package/lib/seam/devices/use-devices.js +3 -3
- package/lib/seam/devices/use-devices.js.map +1 -1
- package/lib/seam/devices/use-toggle-lock.js +1 -1
- package/lib/seam/devices/use-toggle-lock.js.map +1 -1
- package/lib/seam/index.d.ts +1 -0
- package/lib/seam/index.js +1 -0
- package/lib/seam/index.js.map +1 -1
- package/lib/seam/use-seam-client.js +1 -1
- package/lib/seam/use-seam-client.js.map +1 -1
- package/lib/seam/use-seam-font.d.ts +1 -1
- package/lib/seam/use-seam-font.js +1 -1
- package/lib/seam/use-seam-font.js.map +1 -1
- package/lib/seam/use-seam-styles.js.map +1 -1
- package/lib/{capitalize.js → strings.js} +1 -1
- package/lib/strings.js.map +1 -0
- package/lib/ui/Menu/Menu.d.ts +1 -1
- package/lib/ui/Menu/Menu.js.map +1 -1
- package/lib/ui/Menu/MenuItem.d.ts +1 -1
- package/lib/ui/Menu/MoreActionsMenu.d.ts +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterBar.d.ts +2 -1
- package/lib/ui/Table/TableFilterBar/TableFilterItem.d.ts +2 -1
- package/lib/ui/TextField/SearchTextField.js.map +1 -1
- package/lib/{copy-to-clipboard.js → ui/clipboard.js} +1 -1
- package/lib/ui/clipboard.js.map +1 -0
- package/lib/ui/use-interval.js.map +1 -0
- package/lib/{use-is-date-in-past.js → ui/use-is-date-in-past.js} +1 -1
- package/lib/ui/use-is-date-in-past.js.map +1 -0
- package/lib/ui/use-toggle.js.map +1 -0
- package/lib/version.d.ts +2 -2
- package/lib/version.js +3 -1
- package/lib/version.js.map +1 -1
- package/package.json +21 -8
- package/src/elements.ts +27 -0
- package/src/hooks.ts +1 -0
- package/src/lib/{sort-by.ts → dates.ts} +1 -1
- package/src/lib/element.tsx +86 -0
- package/src/lib/index.ts +2 -2
- package/src/lib/{SeamProvider.tsx → seam/SeamProvider.tsx} +53 -46
- package/src/lib/seam/access-codes/use-access-codes.ts +2 -2
- package/src/lib/seam/components/AccessCodeDetails/AccessCodeDetails.element.ts +12 -0
- package/src/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.tsx +4 -5
- package/src/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.tsx +2 -2
- package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.element.ts +12 -0
- package/src/lib/{ui → seam/components}/AccessCodeTable/AccessCodeTable.tsx +20 -5
- package/src/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.tsx +2 -3
- package/src/lib/seam/components/DeviceDetails/DeviceDetails.element.ts +12 -0
- package/src/lib/{ui → seam/components}/DeviceDetails/DeviceDetails.tsx +8 -6
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.tsx +1 -1
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceRow.tsx +1 -1
- package/src/lib/seam/components/DeviceTable/DeviceTable.element.ts +11 -0
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceTable.tsx +7 -7
- package/src/lib/{ui → seam/components}/SupportedDeviceTable/FilterCategoryMenu.tsx +26 -13
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +120 -0
- package/src/lib/{ui → seam/components}/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +43 -39
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.tsx +22 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx +48 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.element.ts +11 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +40 -0
- package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +35 -0
- package/src/lib/seam/components/elements.ts +5 -0
- package/src/lib/seam/device-models/use-device-models.ts +34 -0
- package/src/lib/seam/devices/use-devices.ts +3 -3
- package/src/lib/seam/devices/use-toggle-lock.ts +1 -2
- package/src/lib/seam/index.ts +1 -0
- package/src/lib/seam/use-seam-client.ts +1 -1
- package/src/lib/seam/use-seam-font.ts +5 -1
- package/src/lib/seam/use-seam-styles.ts +1 -1
- package/src/lib/ui/Menu/Menu.tsx +4 -4
- package/src/lib/ui/Menu/MenuItem.tsx +1 -1
- package/src/lib/ui/Menu/MoreActionsMenu.tsx +1 -1
- package/src/lib/ui/Table/TableFilterBar/TableFilterBar.tsx +2 -2
- package/src/lib/ui/Table/TableFilterBar/TableFilterItem.tsx +1 -1
- package/src/lib/ui/TextField/SearchTextField.tsx +3 -3
- package/src/lib/ui/clipboard.ts +3 -0
- package/src/lib/{use-interval.ts → ui/use-interval.ts} +1 -1
- package/src/lib/{use-is-date-in-past.ts → ui/use-is-date-in-past.ts} +1 -1
- package/src/lib/version.ts +3 -1
- package/src/styles/_access-code-table.scss +7 -0
- package/lib/SeamProvider.js.map +0 -1
- package/lib/capitalize.js.map +0 -1
- package/lib/copy-to-clipboard.js.map +0 -1
- package/lib/sort-by.js.map +0 -1
- package/lib/ui/AccessCodeDetails/AccessCodeDetails.js.map +0 -1
- package/lib/ui/AccessCodeDetails/AccessCodeDevice.js.map +0 -1
- package/lib/ui/AccessCodeTable/AccessCodeTable.js +0 -69
- package/lib/ui/AccessCodeTable/AccessCodeTable.js.map +0 -1
- package/lib/ui/AccessCodeTable/CodeDetails.js.map +0 -1
- package/lib/ui/DeviceDetails/DeviceDetails.js.map +0 -1
- package/lib/ui/DeviceDetails/DeviceModel.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceHealthBar.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceRow.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceTable.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.d.ts +0 -15
- package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.d.ts +0 -4
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js +0 -46
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +0 -11
- package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.d.ts +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.js +0 -5
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.d.ts +0 -5
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.js +0 -12
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.d.ts +0 -3
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js +0 -8
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/types.d.ts +0 -15
- package/lib/ui/SupportedDeviceTable/types.js +0 -2
- package/lib/ui/SupportedDeviceTable/types.js.map +0 -1
- package/lib/ui/index.js.map +0 -1
- package/lib/use-interval.js.map +0 -1
- package/lib/use-is-date-in-past.js.map +0 -1
- package/lib/use-toggle.js.map +0 -1
- package/src/lib/copy-to-clipboard.ts +0 -3
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceContent.tsx +0 -135
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.tsx +0 -14
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceRow.tsx +0 -35
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceTable.tsx +0 -16
- package/src/lib/ui/SupportedDeviceTable/types.ts +0 -16
- /package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.d.ts +0 -0
- /package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.d.ts +0 -0
- /package/lib/{ui → seam/components}/AccessCodeTable/AccessCodeTable.d.ts +0 -0
- /package/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.d.ts +0 -0
- /package/lib/{ui → seam/components}/DeviceDetails/DeviceDetails.d.ts +0 -0
- /package/lib/{ui → seam/components}/DeviceDetails/DeviceModel.d.ts +0 -0
- /package/lib/{ui → seam/components}/DeviceDetails/DeviceModel.js +0 -0
- /package/lib/{ui → seam/components}/index.d.ts +0 -0
- /package/lib/{ui → seam/components}/index.js +0 -0
- /package/lib/{capitalize.d.ts → strings.d.ts} +0 -0
- /package/lib/{copy-to-clipboard.d.ts → ui/clipboard.d.ts} +0 -0
- /package/lib/{use-interval.d.ts → ui/use-interval.d.ts} +0 -0
- /package/lib/{use-interval.js → ui/use-interval.js} +0 -0
- /package/lib/{use-is-date-in-past.d.ts → ui/use-is-date-in-past.d.ts} +0 -0
- /package/lib/{use-toggle.d.ts → ui/use-toggle.d.ts} +0 -0
- /package/lib/{use-toggle.js → ui/use-toggle.js} +0 -0
- /package/src/lib/{ui → seam/components}/DeviceDetails/DeviceModel.tsx +0 -0
- /package/src/lib/{ui → seam/components}/index.ts +0 -0
- /package/src/lib/{capitalize.ts → strings.ts} +0 -0
- /package/src/lib/{use-toggle.ts → ui/use-toggle.ts} +0 -0
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery } from '@tanstack/react-query';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { Button } from '../../../lib/ui/Button.js';
|
|
5
|
-
import { SupportedDeviceFilterArea } from '../../../lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js';
|
|
6
|
-
import { SupportedDeviceHeader } from './SupportedDeviceHeader.js';
|
|
7
|
-
import { SupportedDeviceRow } from './SupportedDeviceRow.js';
|
|
8
|
-
export function SupportedDeviceContent({ cannotFilter = false, }) {
|
|
9
|
-
const [filterValue, setFilterValue] = useState('');
|
|
10
|
-
const [filters, setFilters] = useState({
|
|
11
|
-
supportedOnly: false,
|
|
12
|
-
category: null,
|
|
13
|
-
brand: null,
|
|
14
|
-
});
|
|
15
|
-
const { data: deviceModels, isLoading, isError, refetch, } = useQuery({
|
|
16
|
-
queryKey: ['supported_devices', filterValue, filters],
|
|
17
|
-
queryFn: async () => {
|
|
18
|
-
const url = new URL('https://devicedb.seam.co/api/device_models/list');
|
|
19
|
-
if (filterValue.trim() !== '') {
|
|
20
|
-
url.searchParams.set('text_search', filterValue.trim());
|
|
21
|
-
}
|
|
22
|
-
if (filters.supportedOnly) {
|
|
23
|
-
url.searchParams.set('support_level', 'live');
|
|
24
|
-
}
|
|
25
|
-
if (filters.category !== null) {
|
|
26
|
-
url.searchParams.set('main_category', filters.category);
|
|
27
|
-
}
|
|
28
|
-
if (filters.brand !== null) {
|
|
29
|
-
url.searchParams.set('brand', filters.brand);
|
|
30
|
-
}
|
|
31
|
-
const res = await fetch(url);
|
|
32
|
-
if (!res.ok) {
|
|
33
|
-
throw new Error('Failed to load device models');
|
|
34
|
-
}
|
|
35
|
-
const data = await res.json();
|
|
36
|
-
return data?.device_models ?? [];
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
return (_jsxs("div", { className: 'seam-supported-device-table-content-wrap', children: [!cannotFilter && (_jsx(SupportedDeviceFilterArea, { deviceModels: deviceModels ?? [], filterValue: filterValue, setFilterValue: setFilterValue, filters: filters, setFilters: setFilters })), isLoading && (_jsx("div", { className: 'seam-supported-device-table-content-state-block', children: _jsx("p", { children: "Loading device models..." }) })), isError && (_jsxs("div", { className: 'seam-supported-device-table-content-state-block', children: [_jsx("p", { children: "There was an error fetching device models." }), _jsx(Button, { variant: 'solid', size: 'small', onClick: () => {
|
|
40
|
-
void refetch();
|
|
41
|
-
}, children: "Retry" })] })), !isLoading && !isError && deviceModels !== null && (_jsxs("table", { className: 'seam-supported-device-table-content', children: [_jsx(SupportedDeviceHeader, {}), _jsxs("tbody", { children: [deviceModels.length !== 0 &&
|
|
42
|
-
deviceModels.map((deviceModel, index) => (_jsx(SupportedDeviceRow, { deviceModel: deviceModel }, `${index}:${deviceModel.manufacturer_model_id}`))), deviceModels.length === 0 && (_jsx("tr", { className: 'seam-supported-device-table-content-message-row', children: _jsx("td", { colSpan: 6, children: _jsx("div", { className: 'seam-supported-device-table-content-message', children: filterValue.length === 0 ? (_jsx("p", { children: "No device models found." })) : (_jsxs(_Fragment, { children: [_jsx("p", { children: "No device models matched your search." }), _jsx(Button, { variant: 'outline', size: 'small', onClick: () => {
|
|
43
|
-
setFilterValue('');
|
|
44
|
-
}, className: 'seam-supported-device-table-content-message-clear-search', children: "Clear search terms" })] })) }) }) }))] })] }))] }));
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=SupportedDeviceContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SupportedDeviceContent.js","sourceRoot":"","sources":["../../../src/lib/ui/SupportedDeviceTable/SupportedDeviceContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0DAA0D,CAAA;AAGpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAM5D,MAAM,UAAU,sBAAsB,CAAC,EACrC,YAAY,GAAG,KAAK,GACQ;IAC5B,MAAM,CAAC,WAAW,EAAE,c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AM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE;wDACZ,cAAc,CAAC,EAAE,CAAC,CAAA;oDACpB,CAAC,EACD,SAAS,EAAC,0DAA0D,mCAG7D,IACR,CACJ,GACG,GACH,GACF,CACN,IACK,IACF,CACT,IACG,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import type { DeviceModel, Filters } from '../../../lib/ui/SupportedDeviceTable/types.js';
|
|
3
|
-
interface SupportedDeviceFilterAreaProps {
|
|
4
|
-
deviceModels: DeviceModel[];
|
|
5
|
-
filterValue: string;
|
|
6
|
-
setFilterValue: (filter: string) => void;
|
|
7
|
-
filters: Filters;
|
|
8
|
-
setFilters: Dispatch<SetStateAction<Filters>>;
|
|
9
|
-
}
|
|
10
|
-
export declare function SupportedDeviceFilterArea({ deviceModels, filterValue, setFilterValue, filters, setFilters, }: SupportedDeviceFilterAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SupportedDeviceFilterArea.js","sourceRoot":"","sources":["../../../src/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAA;AAEtF,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAUrE,MAAM,UAAU,yBAAyB,CAAC,EACxC,YAAY,EACZ,WAAW,EACX,cAAc,EACd,OAAO,EACP,UAAU,GACqB;IAC/B,MAAM,cAAc,GAAG,MAAM,CAAC,I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4BACvB,CAAC,EACD,SAAS,EAAC,oDAAoD,GAC9D,GACE,IACF,IACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function SupportedDeviceHeader(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export function SupportedDeviceHeader() {
|
|
3
|
-
return (_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", {}), _jsx("th", { children: "Category" }), _jsx("th", { children: "Model Name" }), _jsx("th", { children: "Manufacturer Model ID" }), _jsx("th", { children: "Connection Type" }), _jsx("th", { children: "Status" })] }) }));
|
|
4
|
-
}
|
|
5
|
-
//# sourceMappingURL=SupportedDeviceHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SupportedDeviceHeader.js","sourceRoot":"","sources":["../../../src/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.tsx"],"names":[],"mappings":";AAAA,MAAM,UAAU,qBAAqB;IACnC,OAAO,CACL,0BACE,yBACE,cAAM,EACN,oCAAiB,EACjB,sCAAmB,EACnB,iDAA8B,EAC9B,2CAAwB,EACxB,kCAAe,IACZ,GACC,CACT,CAAA;AACH,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { DeviceModel } from '../../../lib/ui/SupportedDeviceTable/types.js';
|
|
2
|
-
export interface SupportedDeviceRowProps {
|
|
3
|
-
deviceModel: DeviceModel;
|
|
4
|
-
}
|
|
5
|
-
export declare function SupportedDeviceRow({ deviceModel }: SupportedDeviceRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
export function SupportedDeviceRow({ deviceModel }) {
|
|
4
|
-
const statusColor = supportLevelColors[deviceModel.support_level] ?? 'gray';
|
|
5
|
-
return (_jsxs("tr", { children: [_jsx("td", { children: _jsx("img", { width: 40, src: deviceModel.icon_url }) }), _jsx("td", { children: deviceModel.main_category }), _jsx("td", { children: deviceModel.model_name }), _jsx("td", { children: deviceModel.manufacturer_model_id }), _jsx("td", { children: deviceModel.connection_type }), _jsx("td", { children: _jsx("div", { className: classNames('seam-status-pill', `status-${statusColor}`), children: _jsx("span", { children: deviceModel.support_level }) }) })] }));
|
|
6
|
-
}
|
|
7
|
-
const supportLevelColors = {
|
|
8
|
-
Live: 'green',
|
|
9
|
-
Beta: 'blue',
|
|
10
|
-
Unsupported: 'orange',
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=SupportedDeviceRow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SupportedDeviceRow.js","sourceRoot":"","sources":["../../../src/lib/ui/SupportedDeviceTable/SupportedDeviceRow.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AAQnC,MAAM,UAAU,kBAAkB,CAAC,EAAE,WAAW,EAA2B;IACzE,MAAM,WAAW,GAAG,kBAAkB,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,MAAM,CAAA;IAC3E,OAAO,CACL,yBACE,uBACE,cAAK,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,QAAQ,GAAI,GAC1C,EACL,uBAAK,WAAW,CAAC,aAAa,GAAM,EACpC,uBAAK,WAAW,CAAC,UAAU,GAAM,EACjC,uBAAK,WAAW,CAAC,qBAAqB,GAAM,EAC5C,uBAAK,WAAW,CAAC,eAAe,GAAM,EACtC,uBACE,cACE,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE,UAAU,WAAW,EAAE,CAAC,YAElE,yBAAO,WAAW,CAAC,aAAa,GAAQ,GACpC,GACH,IACF,CACN,CAAA;AACH,CAAC;AAED,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,QAAQ;CACtB,CAAA"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { SupportedDeviceContentProps } from '../../../lib/ui/SupportedDeviceTable/SupportedDeviceContent.js';
|
|
2
|
-
export type SupportedDeviceTableProps = SupportedDeviceContentProps;
|
|
3
|
-
export declare function SupportedDeviceTable(props: SupportedDeviceContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
3
|
-
import { SupportedDeviceContent } from '../../../lib/ui/SupportedDeviceTable/SupportedDeviceContent.js';
|
|
4
|
-
const client = new QueryClient();
|
|
5
|
-
export function SupportedDeviceTable(props) {
|
|
6
|
-
return (_jsx(QueryClientProvider, { client: client, children: _jsx(SupportedDeviceContent, { ...props }) }));
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=SupportedDeviceTable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SupportedDeviceTable.js","sourceRoot":"","sources":["../../../src/lib/ui/SupportedDeviceTable/SupportedDeviceTable.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAGxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAA;AAE9F,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;AAIhC,MAAM,UAAU,oBAAoB,CAAC,KAAkC;IACrE,OAAO,CACL,KAAC,mBAAmB,IAAC,MAAM,EAAE,MAAM,YACjC,KAAC,sBAAsB,OAAK,KAAK,GAAI,GACjB,CACvB,CAAA;AACH,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface DeviceModel {
|
|
2
|
-
main_category: string;
|
|
3
|
-
model_name: string;
|
|
4
|
-
manufacturer_model_id: string;
|
|
5
|
-
connection_type: string;
|
|
6
|
-
support_level: 'Live' | 'Beta' | 'Unsupported';
|
|
7
|
-
brand: string;
|
|
8
|
-
icon_url: string;
|
|
9
|
-
seam_device_model_page_url: string;
|
|
10
|
-
}
|
|
11
|
-
export interface Filters {
|
|
12
|
-
supportedOnly: boolean;
|
|
13
|
-
category: string | null;
|
|
14
|
-
brand: string | null;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/ui/SupportedDeviceTable/types.ts"],"names":[],"mappings":""}
|
package/lib/ui/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAA;AACxD,cAAc,sCAAsC,CAAA;AACpD,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gDAAgD,CAAA"}
|
package/lib/use-interval.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-interval.js","sourceRoot":"","sources":["../src/lib/use-interval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE9C,MAAM,YAAY,GAAG,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAA;AAE3E,MAAM,UAAU,WAAW,CACzB,QAAoB,EACpB,QAAgB,YAAY;IAE5B,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,QAAQ,EAAE,CAAA;IACZ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEd,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,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1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-toggle.js","sourceRoot":"","sources":["../src/lib/use-toggle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,eAAwB,KAAK,EACN,EAAE;IACzB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAA;IAElD,uEAAuE;IAEvE,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAA;IAChC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IAEf,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACzB,CAAC,CAAA"}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query'
|
|
2
|
-
import { useState } from 'react'
|
|
3
|
-
|
|
4
|
-
import { Button } from 'lib/ui/Button.js'
|
|
5
|
-
import { SupportedDeviceFilterArea } from 'lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js'
|
|
6
|
-
import type { DeviceModel, Filters } from 'lib/ui/SupportedDeviceTable/types.js'
|
|
7
|
-
|
|
8
|
-
import { SupportedDeviceHeader } from './SupportedDeviceHeader.js'
|
|
9
|
-
import { SupportedDeviceRow } from './SupportedDeviceRow.js'
|
|
10
|
-
|
|
11
|
-
export interface SupportedDeviceContentProps {
|
|
12
|
-
cannotFilter?: boolean
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function SupportedDeviceContent({
|
|
16
|
-
cannotFilter = false,
|
|
17
|
-
}: SupportedDeviceContentProps) {
|
|
18
|
-
const [filterValue, setFilterValue] = useState('')
|
|
19
|
-
const [filters, setFilters] = useState<Filters>({
|
|
20
|
-
supportedOnly: false,
|
|
21
|
-
category: null,
|
|
22
|
-
brand: null,
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
data: deviceModels,
|
|
27
|
-
isLoading,
|
|
28
|
-
isError,
|
|
29
|
-
refetch,
|
|
30
|
-
} = useQuery<DeviceModel[]>({
|
|
31
|
-
queryKey: ['supported_devices', filterValue, filters],
|
|
32
|
-
queryFn: async () => {
|
|
33
|
-
const url = new URL('https://devicedb.seam.co/api/device_models/list')
|
|
34
|
-
|
|
35
|
-
if (filterValue.trim() !== '') {
|
|
36
|
-
url.searchParams.set('text_search', filterValue.trim())
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (filters.supportedOnly) {
|
|
40
|
-
url.searchParams.set('support_level', 'live')
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (filters.category !== null) {
|
|
44
|
-
url.searchParams.set('main_category', filters.category)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (filters.brand !== null) {
|
|
48
|
-
url.searchParams.set('brand', filters.brand)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const res = await fetch(url)
|
|
52
|
-
if (!res.ok) {
|
|
53
|
-
throw new Error('Failed to load device models')
|
|
54
|
-
}
|
|
55
|
-
const data = await res.json()
|
|
56
|
-
return data?.device_models ?? []
|
|
57
|
-
},
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<div className='seam-supported-device-table-content-wrap'>
|
|
62
|
-
{!cannotFilter && (
|
|
63
|
-
<SupportedDeviceFilterArea
|
|
64
|
-
deviceModels={deviceModels ?? []}
|
|
65
|
-
filterValue={filterValue}
|
|
66
|
-
setFilterValue={setFilterValue}
|
|
67
|
-
filters={filters}
|
|
68
|
-
setFilters={setFilters}
|
|
69
|
-
/>
|
|
70
|
-
)}
|
|
71
|
-
|
|
72
|
-
{isLoading && (
|
|
73
|
-
<div className='seam-supported-device-table-content-state-block'>
|
|
74
|
-
<p>Loading device models...</p>
|
|
75
|
-
</div>
|
|
76
|
-
)}
|
|
77
|
-
|
|
78
|
-
{isError && (
|
|
79
|
-
<div className='seam-supported-device-table-content-state-block'>
|
|
80
|
-
<p>There was an error fetching device models.</p>
|
|
81
|
-
<Button
|
|
82
|
-
variant='solid'
|
|
83
|
-
size='small'
|
|
84
|
-
onClick={() => {
|
|
85
|
-
void refetch()
|
|
86
|
-
}}
|
|
87
|
-
>
|
|
88
|
-
Retry
|
|
89
|
-
</Button>
|
|
90
|
-
</div>
|
|
91
|
-
)}
|
|
92
|
-
|
|
93
|
-
{!isLoading && !isError && deviceModels !== null && (
|
|
94
|
-
<table className='seam-supported-device-table-content'>
|
|
95
|
-
<SupportedDeviceHeader />
|
|
96
|
-
<tbody>
|
|
97
|
-
{deviceModels.length !== 0 &&
|
|
98
|
-
deviceModels.map((deviceModel, index) => (
|
|
99
|
-
<SupportedDeviceRow
|
|
100
|
-
key={`${index}:${deviceModel.manufacturer_model_id}`}
|
|
101
|
-
deviceModel={deviceModel}
|
|
102
|
-
/>
|
|
103
|
-
))}
|
|
104
|
-
|
|
105
|
-
{deviceModels.length === 0 && (
|
|
106
|
-
<tr className='seam-supported-device-table-content-message-row'>
|
|
107
|
-
<td colSpan={6}>
|
|
108
|
-
<div className='seam-supported-device-table-content-message'>
|
|
109
|
-
{filterValue.length === 0 ? (
|
|
110
|
-
<p>No device models found.</p>
|
|
111
|
-
) : (
|
|
112
|
-
<>
|
|
113
|
-
<p>No device models matched your search.</p>
|
|
114
|
-
<Button
|
|
115
|
-
variant='outline'
|
|
116
|
-
size='small'
|
|
117
|
-
onClick={() => {
|
|
118
|
-
setFilterValue('')
|
|
119
|
-
}}
|
|
120
|
-
className='seam-supported-device-table-content-message-clear-search'
|
|
121
|
-
>
|
|
122
|
-
Clear search terms
|
|
123
|
-
</Button>
|
|
124
|
-
</>
|
|
125
|
-
)}
|
|
126
|
-
</div>
|
|
127
|
-
</td>
|
|
128
|
-
</tr>
|
|
129
|
-
)}
|
|
130
|
-
</tbody>
|
|
131
|
-
</table>
|
|
132
|
-
)}
|
|
133
|
-
</div>
|
|
134
|
-
)
|
|
135
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames'
|
|
2
|
-
|
|
3
|
-
import type { DeviceModel } from 'lib/ui/SupportedDeviceTable/types.js'
|
|
4
|
-
|
|
5
|
-
export interface SupportedDeviceRowProps {
|
|
6
|
-
deviceModel: DeviceModel
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function SupportedDeviceRow({ deviceModel }: SupportedDeviceRowProps) {
|
|
10
|
-
const statusColor = supportLevelColors[deviceModel.support_level] ?? 'gray'
|
|
11
|
-
return (
|
|
12
|
-
<tr>
|
|
13
|
-
<td>
|
|
14
|
-
<img width={40} src={deviceModel.icon_url} />
|
|
15
|
-
</td>
|
|
16
|
-
<td>{deviceModel.main_category}</td>
|
|
17
|
-
<td>{deviceModel.model_name}</td>
|
|
18
|
-
<td>{deviceModel.manufacturer_model_id}</td>
|
|
19
|
-
<td>{deviceModel.connection_type}</td>
|
|
20
|
-
<td>
|
|
21
|
-
<div
|
|
22
|
-
className={classNames('seam-status-pill', `status-${statusColor}`)}
|
|
23
|
-
>
|
|
24
|
-
<span>{deviceModel.support_level}</span>
|
|
25
|
-
</div>
|
|
26
|
-
</td>
|
|
27
|
-
</tr>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const supportLevelColors = {
|
|
32
|
-
Live: 'green',
|
|
33
|
-
Beta: 'blue',
|
|
34
|
-
Unsupported: 'orange',
|
|
35
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
2
|
-
|
|
3
|
-
import type { SupportedDeviceContentProps } from 'lib/ui/SupportedDeviceTable/SupportedDeviceContent.js'
|
|
4
|
-
import { SupportedDeviceContent } from 'lib/ui/SupportedDeviceTable/SupportedDeviceContent.js'
|
|
5
|
-
|
|
6
|
-
const client = new QueryClient()
|
|
7
|
-
|
|
8
|
-
export type SupportedDeviceTableProps = SupportedDeviceContentProps
|
|
9
|
-
|
|
10
|
-
export function SupportedDeviceTable(props: SupportedDeviceContentProps) {
|
|
11
|
-
return (
|
|
12
|
-
<QueryClientProvider client={client}>
|
|
13
|
-
<SupportedDeviceContent {...props} />
|
|
14
|
-
</QueryClientProvider>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface DeviceModel {
|
|
2
|
-
main_category: string
|
|
3
|
-
model_name: string
|
|
4
|
-
manufacturer_model_id: string
|
|
5
|
-
connection_type: string
|
|
6
|
-
support_level: 'Live' | 'Beta' | 'Unsupported'
|
|
7
|
-
brand: string
|
|
8
|
-
icon_url: string
|
|
9
|
-
seam_device_model_page_url: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Filters {
|
|
13
|
-
supportedOnly: boolean
|
|
14
|
-
category: string | null
|
|
15
|
-
brand: string | null
|
|
16
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|