@seamapi/react 0.26.0 → 0.26.1
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 +5 -4
- package/index.css.map +1 -1
- package/index.min.css.map +1 -1
- package/lib/copy-to-clipboard.d.ts +1 -0
- package/lib/copy-to-clipboard.js +4 -0
- package/lib/copy-to-clipboard.js.map +1 -0
- package/lib/ui/AccessCodeTable/AccessCodeTable.js +4 -4
- package/lib/ui/AccessCodeTable/AccessCodeTable.js.map +1 -1
- package/lib/ui/Alert/Alert.d.ts +6 -4
- package/lib/ui/Alert/Alert.js +7 -4
- package/lib/ui/Alert/Alert.js.map +1 -1
- package/lib/ui/Alert/Alerts.d.ts +4 -4
- package/lib/ui/Alert/Alerts.js +4 -2
- package/lib/ui/Alert/Alerts.js.map +1 -1
- package/lib/ui/DeviceDetails/DeviceDetails.js +2 -3
- package/lib/ui/DeviceDetails/DeviceDetails.js.map +1 -1
- package/lib/ui/DeviceTable/DeviceRow.d.ts +2 -2
- package/lib/ui/DeviceTable/DeviceRow.js +0 -1
- package/lib/ui/DeviceTable/DeviceRow.js.map +1 -1
- package/lib/ui/Menu/Menu.d.ts +9 -10
- package/lib/ui/Menu/Menu.js +23 -21
- package/lib/ui/Menu/Menu.js.map +1 -1
- package/lib/ui/Menu/MenuItem.d.ts +4 -4
- package/lib/ui/Menu/MenuItem.js +1 -1
- package/lib/ui/Menu/MenuItem.js.map +1 -1
- package/lib/ui/Menu/MoreActionsMenu.d.ts +5 -4
- package/lib/ui/Menu/MoreActionsMenu.js +6 -6
- package/lib/ui/Menu/MoreActionsMenu.js.map +1 -1
- package/lib/ui/SupportedDevices/SupportedDeviceRow.d.ts +1 -1
- package/lib/ui/SupportedDevices/SupportedDeviceRow.js +8 -14
- package/lib/ui/SupportedDevices/SupportedDeviceRow.js.map +1 -1
- package/lib/ui/SupportedDevices/SupportedDevices.js +2 -2
- package/lib/ui/SupportedDevices/SupportedDevices.js.map +1 -1
- package/lib/ui/SupportedDevices/SupportedDevicesHeader.d.ts +1 -1
- package/lib/ui/SupportedDevices/SupportedDevicesHeader.js +1 -1
- package/lib/ui/SupportedDevices/SupportedDevicesHeader.js.map +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterBar.d.ts +3 -2
- package/lib/ui/Table/TableFilterBar/TableFilterBar.js +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterBar.js.map +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterItem.d.ts +2 -1
- package/lib/ui/Table/TableFilterBar/TableFilterItem.js +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterItem.js.map +1 -1
- package/lib/ui/TextField/TextField.d.ts +1 -1
- package/lib/ui/TextField/TextField.js +2 -2
- package/lib/ui/TextField/TextField.js.map +1 -1
- package/lib/ui/device/BatteryStatus.d.ts +2 -1
- package/lib/ui/device/LockStatus.d.ts +2 -1
- package/lib/ui/device/OnlineStatus.d.ts +2 -1
- package/lib/use-toggle.d.ts +1 -2
- package/lib/use-toggle.js +1 -2
- package/lib/use-toggle.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/copy-to-clipboard.ts +3 -0
- package/src/lib/ui/AccessCodeTable/AccessCodeTable.tsx +4 -4
- package/src/lib/ui/Alert/Alert.tsx +21 -18
- package/src/lib/ui/Alert/Alerts.tsx +7 -5
- package/src/lib/ui/DeviceDetails/DeviceDetails.tsx +3 -6
- package/src/lib/ui/DeviceTable/DeviceRow.tsx +4 -4
- package/src/lib/ui/Menu/Menu.tsx +34 -34
- package/src/lib/ui/Menu/MenuItem.tsx +6 -4
- package/src/lib/ui/Menu/MoreActionsMenu.tsx +15 -10
- package/src/lib/ui/SupportedDevices/SupportedDeviceRow.tsx +9 -20
- package/src/lib/ui/SupportedDevices/SupportedDevices.tsx +2 -2
- package/src/lib/ui/SupportedDevices/SupportedDevicesHeader.tsx +1 -1
- package/src/lib/ui/Table/TableFilterBar/TableFilterBar.tsx +5 -3
- package/src/lib/ui/Table/TableFilterBar/TableFilterItem.tsx +2 -2
- package/src/lib/ui/TextField/TextField.tsx +2 -2
- package/src/lib/ui/device/BatteryStatus.tsx +1 -1
- package/src/lib/ui/device/LockStatus.tsx +1 -1
- package/src/lib/ui/device/OnlineStatus.tsx +1 -1
- package/src/lib/use-toggle.ts +3 -3
- package/src/styles/_supported-devices.scss +0 -1
- package/lib/copy.d.ts +0 -1
- package/lib/copy.js +0 -4
- package/lib/copy.js.map +0 -1
- package/src/lib/copy.ts +0 -3
|
@@ -2,7 +2,7 @@ import { ArrowRestartIcon } from 'lib/icons/ArrowRestart.js'
|
|
|
2
2
|
import { IconButton } from 'lib/ui/IconButton.js'
|
|
3
3
|
import type { ButtonProps, DivProps } from 'lib/ui/types.js'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface TableFilterBarProps extends DivProps {
|
|
6
6
|
isFilterCleared?: boolean
|
|
7
7
|
onFilterClear?: () => void
|
|
8
8
|
}
|
|
@@ -12,12 +12,14 @@ export function TableFilterBar({
|
|
|
12
12
|
onFilterClear,
|
|
13
13
|
children,
|
|
14
14
|
...props
|
|
15
|
-
}:
|
|
15
|
+
}: TableFilterBarProps) {
|
|
16
16
|
const showClearFilterButton = isFilterCleared === false
|
|
17
17
|
return (
|
|
18
18
|
<div className='seam-table-filter-bar' {...props}>
|
|
19
19
|
{children}{' '}
|
|
20
|
-
{showClearFilterButton
|
|
20
|
+
{showClearFilterButton ? (
|
|
21
|
+
<ClearFiltersButton onClick={onFilterClear} />
|
|
22
|
+
) : null}
|
|
21
23
|
</div>
|
|
22
24
|
)
|
|
23
25
|
}
|
|
@@ -2,7 +2,7 @@ import classNames from 'classnames'
|
|
|
2
2
|
|
|
3
3
|
import type { DivProps } from 'lib/ui/types.js'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface TableFilterItemProps extends DivProps {
|
|
6
6
|
selected?: boolean
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@ export function TableFilterItem({
|
|
|
15
15
|
<div
|
|
16
16
|
onClick={onClick}
|
|
17
17
|
className={classNames('seam-table-filter-item', {
|
|
18
|
-
'seam-clickable': onClick
|
|
18
|
+
'seam-clickable': onClick != null,
|
|
19
19
|
'seam-selected': selected,
|
|
20
20
|
})}
|
|
21
21
|
{...props}
|
|
@@ -21,6 +21,6 @@ export function TextField(props: TextFieldProps): JSX.Element {
|
|
|
21
21
|
|
|
22
22
|
export const handleString =
|
|
23
23
|
(setter: (v: string) => void) =>
|
|
24
|
-
(
|
|
25
|
-
setter(
|
|
24
|
+
(event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>): void => {
|
|
25
|
+
setter(event.currentTarget.value)
|
|
26
26
|
}
|
|
@@ -5,7 +5,7 @@ import { BatteryLevelFullIcon } from 'lib/icons/BatteryLevelFull.js'
|
|
|
5
5
|
import { BatteryLevelHighIcon } from 'lib/icons/BatteryLevelHigh.js'
|
|
6
6
|
import { BatteryLevelLowIcon } from 'lib/icons/BatteryLevelLow.js'
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface BatteryStatusProps {
|
|
9
9
|
device: LockDevice
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -3,7 +3,7 @@ import type { LockDevice } from 'seamapi'
|
|
|
3
3
|
import { OnlineStatusDeviceOfflineIcon } from 'lib/icons/OnlineStatusDeviceOffline.js'
|
|
4
4
|
import { OnlineStatusOnlineIcon } from 'lib/icons/OnlineStatusOnline.js'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
interface OnlineStatusProps {
|
|
7
7
|
device: LockDevice
|
|
8
8
|
}
|
|
9
9
|
|
package/src/lib/use-toggle.ts
CHANGED
|
@@ -3,7 +3,9 @@ import { useCallback, useState } from 'react'
|
|
|
3
3
|
/**
|
|
4
4
|
* Simple util to quickly handle on/off states.
|
|
5
5
|
*/
|
|
6
|
-
const useToggle = (
|
|
6
|
+
export const useToggle = (
|
|
7
|
+
initialState: boolean = false
|
|
8
|
+
): [boolean, () => void] => {
|
|
7
9
|
const [isTrue, setIsTrue] = useState(initialState)
|
|
8
10
|
|
|
9
11
|
// use callback otherwise it would yield unexpected results in promises
|
|
@@ -14,5 +16,3 @@ const useToggle = (initialState: boolean = false): [boolean, () => void] => {
|
|
|
14
16
|
|
|
15
17
|
return [isTrue, toggle]
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
export default useToggle
|
package/lib/copy.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function copy(value: string): Promise<void>;
|
package/lib/copy.js
DELETED
package/lib/copy.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../src/lib/copy.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,KAAa;IACtC,MAAM,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AACnD,CAAC"}
|
package/src/lib/copy.ts
DELETED