@seamapi/react 0.26.1 → 0.28.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 (84) hide show
  1. package/index.css +166 -3
  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/icons/Close.d.ts +2 -0
  12. package/lib/icons/Close.js +5 -0
  13. package/lib/icons/Close.js.map +1 -0
  14. package/lib/icons/Search.d.ts +2 -0
  15. package/lib/icons/Search.js +5 -0
  16. package/lib/icons/Search.js.map +1 -0
  17. package/lib/ui/Button.d.ts +4 -3
  18. package/lib/ui/Button.js +2 -2
  19. package/lib/ui/Button.js.map +1 -1
  20. package/lib/ui/DeviceTable/DeviceTable.js +9 -1
  21. package/lib/ui/DeviceTable/DeviceTable.js.map +1 -1
  22. package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.d.ts +21 -0
  23. package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.js +20 -0
  24. package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.js.map +1 -0
  25. package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.d.ts +4 -0
  26. package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js +53 -0
  27. package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -0
  28. package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +11 -0
  29. package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js +50 -0
  30. package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +1 -0
  31. package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.d.ts +1 -0
  32. package/lib/ui/{SupportedDevices/SupportedDevicesHeader.js → SupportedDeviceTable/SupportedDeviceHeader.js} +2 -2
  33. package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.js.map +1 -0
  34. package/lib/ui/{SupportedDevices → SupportedDeviceTable}/SupportedDeviceRow.d.ts +1 -1
  35. package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.js.map +1 -0
  36. package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.d.ts +3 -0
  37. package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js +8 -0
  38. package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -0
  39. package/lib/ui/{SupportedDevices → SupportedDeviceTable}/types.d.ts +5 -0
  40. package/lib/ui/SupportedDeviceTable/types.js.map +1 -0
  41. package/lib/ui/Table/TableHeader.js +1 -1
  42. package/lib/ui/Table/TableHeader.js.map +1 -1
  43. package/lib/ui/TextField/SearchTextField.d.ts +1 -1
  44. package/lib/ui/TextField/SearchTextField.js +52 -2
  45. package/lib/ui/TextField/SearchTextField.js.map +1 -1
  46. package/lib/ui/TextField/TextField.d.ts +11 -4
  47. package/lib/ui/TextField/TextField.js +5 -3
  48. package/lib/ui/TextField/TextField.js.map +1 -1
  49. package/lib/ui/index.d.ts +1 -1
  50. package/lib/ui/index.js +1 -1
  51. package/lib/ui/index.js.map +1 -1
  52. package/package.json +1 -1
  53. package/src/lib/capitalize.ts +3 -0
  54. package/src/lib/icons/ChevronDown.tsx +19 -0
  55. package/src/lib/icons/Close.tsx +30 -0
  56. package/src/lib/icons/Search.tsx +30 -0
  57. package/src/lib/ui/Button.tsx +12 -6
  58. package/src/lib/ui/DeviceTable/DeviceTable.tsx +16 -1
  59. package/src/lib/ui/SupportedDeviceTable/FilterCategoryMenu.tsx +65 -0
  60. package/src/lib/ui/SupportedDeviceTable/SupportedDeviceContent.tsx +147 -0
  61. package/src/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +131 -0
  62. package/src/lib/ui/{SupportedDevices/SupportedDevicesHeader.tsx → SupportedDeviceTable/SupportedDeviceHeader.tsx} +1 -1
  63. package/src/lib/ui/{SupportedDevices → SupportedDeviceTable}/SupportedDeviceRow.tsx +1 -1
  64. package/src/lib/ui/SupportedDeviceTable/SupportedDeviceTable.tsx +16 -0
  65. package/src/lib/ui/{SupportedDevices → SupportedDeviceTable}/types.ts +6 -0
  66. package/src/lib/ui/Table/TableHeader.tsx +5 -1
  67. package/src/lib/ui/TextField/SearchTextField.tsx +79 -0
  68. package/src/lib/ui/TextField/TextField.tsx +43 -12
  69. package/src/lib/ui/index.ts +1 -1
  70. package/src/styles/_colors.scss +1 -0
  71. package/src/styles/_device-table.scss +4 -0
  72. package/src/styles/_inputs.scss +74 -2
  73. package/src/styles/_supported-devices.scss +114 -0
  74. package/src/styles/_tables.scss +8 -1
  75. package/lib/ui/SupportedDevices/SupportedDeviceRow.js.map +0 -1
  76. package/lib/ui/SupportedDevices/SupportedDevices.d.ts +0 -1
  77. package/lib/ui/SupportedDevices/SupportedDevices.js +0 -21
  78. package/lib/ui/SupportedDevices/SupportedDevices.js.map +0 -1
  79. package/lib/ui/SupportedDevices/SupportedDevicesHeader.d.ts +0 -1
  80. package/lib/ui/SupportedDevices/SupportedDevicesHeader.js.map +0 -1
  81. package/lib/ui/SupportedDevices/types.js.map +0 -1
  82. package/src/lib/ui/SupportedDevices/SupportedDevices.tsx +0 -65
  83. /package/lib/ui/{SupportedDevices → SupportedDeviceTable}/SupportedDeviceRow.js +0 -0
  84. /package/lib/ui/{SupportedDevices → SupportedDeviceTable}/types.js +0 -0
@@ -3,6 +3,95 @@
3
3
  $row-padding: 8px;
4
4
 
5
5
  @mixin all {
6
+ .seam-supported-devices-filter-area {
7
+ width: 100%;
8
+ display: flex;
9
+ justify-content: space-between;
10
+ align-items: center;
11
+ flex-direction: row;
12
+ padding: 16px;
13
+
14
+ .seam-filters-wrap {
15
+ display: flex;
16
+ justify-content: flex-start;
17
+ align-items: center;
18
+ flex-direction: row;
19
+ gap: 8px;
20
+ }
21
+
22
+ .seam-supported-devices-filter-area-search-bar-wrap {
23
+ position: relative;
24
+ display: flex;
25
+ justify-content: center;
26
+ align-items: center;
27
+ flex-direction: row;
28
+ }
29
+ }
30
+
31
+ .seam-supported-devices-filter-menu {
32
+ width: 100%;
33
+ padding: 8px 16px;
34
+
35
+ .seam-filter-menu-row {
36
+ width: 100%;
37
+ display: flex;
38
+ justify-content: space-between;
39
+ align-items: center;
40
+ flex-direction: row;
41
+
42
+ &:not(:last-of-type) {
43
+ margin-bottom: 8px;
44
+ }
45
+
46
+ .seam-filter-checkbox-label {
47
+ width: 100%;
48
+ display: flex;
49
+ justify-content: space-between;
50
+ align-items: center;
51
+ flex-direction: row;
52
+ }
53
+
54
+ .seam-filter-checkbox {
55
+ appearance: checkbox;
56
+ }
57
+ }
58
+
59
+ .seam-supported-devices-filter-menu-wrap {
60
+ width: 100%;
61
+ display: flex;
62
+ justify-content: space-between;
63
+ align-items: center;
64
+ flex-direction: row;
65
+
66
+ & button {
67
+ appearance: none;
68
+ padding: 4px 8px;
69
+ padding-right: 24px;
70
+ margin: 0;
71
+ border: 0;
72
+ box-shadow: none;
73
+ border-radius: 4px;
74
+ background-color: colors.$bg-b;
75
+ position: relative;
76
+ cursor: pointer;
77
+
78
+ &:hover {
79
+ background-color: colors.$bg-c;
80
+ }
81
+
82
+ & span {
83
+ font-size: 14px;
84
+ font-weight: 500;
85
+ }
86
+
87
+ & svg {
88
+ position: absolute;
89
+ top: 2px;
90
+ }
91
+ }
92
+ }
93
+ }
94
+
6
95
  .seam-supported-devices-table-state-block {
7
96
  width: 100%;
8
97
  background-color: colors.$bg-a;
@@ -14,6 +103,31 @@ $row-padding: 8px;
14
103
  gap: 8px;
15
104
  }
16
105
 
106
+ .seam-supported-devices-table-message-row {
107
+ height: auto !important;
108
+ }
109
+
110
+ .seam-supported-devices-table-message {
111
+ width: 100%;
112
+ padding: 32px 0;
113
+ display: flex;
114
+ justify-content: center;
115
+ align-items: center;
116
+ flex-direction: column;
117
+ text-align: center;
118
+ gap: 4px;
119
+
120
+ & p {
121
+ line-height: 1;
122
+ margin: 0;
123
+ }
124
+
125
+ & button {
126
+ cursor: pointer;
127
+ margin-top: 8px;
128
+ }
129
+ }
130
+
17
131
  .seam-supported-devices-table {
18
132
  width: 100%;
19
133
  overflow-x: auto;
@@ -4,9 +4,16 @@
4
4
  .seam-table-header {
5
5
  display: flex;
6
6
  justify-content: space-between;
7
- align-items: center;
7
+ align-items: flex-start;
8
8
  height: 56px;
9
9
  padding: 0 16px;
10
+
11
+ .seam-body {
12
+ display: flex;
13
+ justify-content: space-between;
14
+ align-items: center;
15
+ width: 100%;
16
+ }
10
17
  }
11
18
 
12
19
  .seam-table-title {
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedDeviceRow.js","sourceRoot":"","sources":["../../../src/lib/ui/SupportedDevices/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,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,QAAQ,GAAI,GACrD,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 +0,0 @@
1
- export declare function SupportedDevices(): import("react/jsx-runtime").JSX.Element;
@@ -1,21 +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 axios from 'axios';
4
- import { Button } from '../../../lib/ui/Button.js';
5
- import { SupportedDeviceRow } from './SupportedDeviceRow.js';
6
- import { SupportedDevicesHeader } from './SupportedDevicesHeader.js';
7
- export function SupportedDevices() {
8
- const { data, isLoading, isError, refetch } = useQuery({
9
- queryKey: ['supported_devices'],
10
- queryFn: async () => {
11
- return await axios.get('https://devicedb.seam.co/api/device_models/list');
12
- },
13
- });
14
- return (_jsx(_Fragment, { children: _jsxs("div", { className: 'seam-supported-devices-table-wrap', children: [isLoading && (_jsx("div", { className: 'seam-supported-devices-table-state-block', children: _jsx("p", { children: "Loading device models..." }) })), isError && (_jsxs("div", { className: 'seam-supported-devices-table-state-block', children: [_jsx("p", { children: "There was an error fetching device models." }), _jsx(Button, { variant: 'solid', size: 'small', onClick: () => {
15
- void refetch();
16
- }, children: "Retry" })] })), !isLoading &&
17
- !isError &&
18
- data?.data?.device_models !== null &&
19
- Array.isArray(data?.data?.device_models) && (_jsxs("table", { className: 'seam-supported-devices-table', children: [_jsx(SupportedDevicesHeader, {}), _jsx("tbody", { children: data.data.device_models.map((deviceModel) => (_jsx(SupportedDeviceRow, { deviceModel: deviceModel }, deviceModel.manufacturer_model_id))) })] }))] }) }));
20
- }
21
- //# sourceMappingURL=SupportedDevices.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedDevices.js","sourceRoot":"","sources":["../../../src/lib/ui/SupportedDevices/SupportedDevices.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE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0,0 @@
1
- export declare function SupportedDevicesHeader(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedDevicesHeader.js","sourceRoot":"","sources":["../../../src/lib/ui/SupportedDevices/SupportedDevicesHeader.tsx"],"names":[],"mappings":";AAAA,MAAM,UAAU,sBAAsB;IACpC,OAAO,CACL,0BACE,yBACE,cAAM,EACN,oCAAiB,EACjB,sCAAmB,EACnB,iDAA8B,EAC9B,2CAAwB,EACxB,kCAAe,IACZ,GACC,CACT,CAAA;AACH,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/ui/SupportedDevices/types.ts"],"names":[],"mappings":""}
@@ -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
- }