@fibery/ui-kit 1.34.4 → 1.34.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/ui-kit",
3
- "version": "1.34.4",
3
+ "version": "1.34.6",
4
4
  "private": false,
5
5
  "files": [
6
6
  "src/antd/styles.ts",
@@ -28,10 +28,13 @@
28
28
  "src/a11y-color.ts",
29
29
  "src/integration-compact-info-button.tsx",
30
30
  "src/dropdown-menu",
31
- "src/shortcut-badge",
32
- "src/tsfixme",
31
+ "src/shortcut-badge.tsx",
32
+ "src/tsfixme.ts",
33
33
  "src/toggle.tsx",
34
- "src/toggle-on-off.tsx"
34
+ "src/toggle-on-off.tsx",
35
+ "src/use-is-support-hardware-keyboard.ts",
36
+ "src/use-is-phone.ts",
37
+ "src/use-is-media-query-matched.ts"
35
38
  ],
36
39
  "license": "UNLICENSED",
37
40
  "dependencies": {
@@ -74,9 +77,9 @@
74
77
  "screenfull": "6.0.1",
75
78
  "tabbable": "5.2.1",
76
79
  "ua-parser-js": "1.0.39",
77
- "@fibery/react": "1.4.0",
78
80
  "@fibery/emoji-data": "2.6.0",
79
- "@fibery/helpers": "1.3.0"
81
+ "@fibery/helpers": "1.3.0",
82
+ "@fibery/react": "1.4.0"
80
83
  },
81
84
  "peerDependencies": {
82
85
  "react": "^18.2.0",
@@ -0,0 +1,8 @@
1
+
2
+ // This icon file is generated automatically.
3
+
4
+ import { IconDefinition } from '../types';
5
+
6
+ const UserGroup: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M4.5 2A2.5 2.5 0 0 0 2 4.5v11A2.5 2.5 0 0 0 4.5 18h11a2.5 2.5 0 0 0 2.5-2.5v-11A2.5 2.5 0 0 0 15.5 2h-11Zm0 1.5c-.552 0-1 .557-1 1.11V15.5a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-11Zm3.917 4.083a1.583 1.583 0 1 1 3.167 0 1.583 1.583 0 0 1-3.167 0ZM10 11.667c-.982 0-1.64.563-1.772 1.097a.75.75 0 1 1-1.456-.362c.34-1.367 1.742-2.235 3.228-2.235 1.486 0 2.888.868 3.228 2.235a.75.75 0 1 1-1.456.362c-.133-.534-.79-1.097-1.772-1.097Z"},"children":[]}],"metadata":""}]},"name":"user-group"};
7
+
8
+ export default UserGroup;
@@ -317,6 +317,7 @@ export { default as UnlockFilled } from './UnlockFilled';
317
317
  export { default as UnlockOutline } from './UnlockOutline';
318
318
  export { default as Upgrade } from './Upgrade';
319
319
  export { default as UsbFlashDrive } from './UsbFlashDrive';
320
+ export { default as UserGroup } from './UserGroup';
320
321
  export { default as UserRole } from './UserRole';
321
322
  export { default as ViewBoard } from './ViewBoard';
322
323
  export { default as ViewCalendar } from './ViewCalendar';
@@ -0,0 +1,13 @@
1
+ // This icon file is generated automatically.
2
+
3
+ import {forwardRef} from 'react';
4
+ import UserGroupSvg from '../ast/UserGroup';
5
+ import { Icon } from '../Icon';
6
+ import { IconBaseProps } from '../types';
7
+
8
+ const UserGroup = forwardRef<SVGSVGElement, IconBaseProps>(function UserGroup(
9
+ props: IconBaseProps,
10
+ ref: React.Ref<SVGSVGElement>
11
+ ) {return <Icon {...props} className={props.className} ref={ref} icon={UserGroupSvg} />});
12
+
13
+ export default UserGroup;
@@ -317,6 +317,7 @@ export { default as UnlockFilled } from './UnlockFilled';
317
317
  export { default as UnlockOutline } from './UnlockOutline';
318
318
  export { default as Upgrade } from './Upgrade';
319
319
  export { default as UsbFlashDrive } from './UsbFlashDrive';
320
+ export { default as UserGroup } from './UserGroup';
320
321
  export { default as UserRole } from './UserRole';
321
322
  export { default as ViewBoard } from './ViewBoard';
322
323
  export { default as ViewCalendar } from './ViewCalendar';
@@ -0,0 +1,28 @@
1
+ import {css, cx} from "@linaria/core";
2
+ import {textStyles, border, space, lineHeight, themeVars} from "./design-system";
3
+ import {useIsSupportHardwareKeyboard} from "./use-is-support-hardware-keyboard";
4
+
5
+ export const shortcutCss = css`
6
+ ${{
7
+ ...textStyles.small,
8
+ borderRadius: border.radius4,
9
+ border: themeVars.shortcutBorderColor,
10
+ color: themeVars.shortcutTextColor,
11
+ paddingTop: space.s2,
12
+ paddingBottom: space.s2,
13
+ paddingLeft: space.s4,
14
+ paddingRight: space.s4,
15
+ lineHeight: lineHeight.nowrap,
16
+ whiteSpace: "nowrap",
17
+ display: "inline-block",
18
+ userSelect: "none",
19
+ }}
20
+ `;
21
+
22
+ export const ShortcutBadge = ({className, shortcut}: {className?: string; shortcut: string}): JSX.Element | null => {
23
+ const isSupportHardwareKeyboard = useIsSupportHardwareKeyboard();
24
+ if (!isSupportHardwareKeyboard) {
25
+ return null;
26
+ }
27
+ return <div className={cx(shortcutCss, className)}>{shortcut}</div>;
28
+ };
package/src/tsfixme.ts ADDED
@@ -0,0 +1,2 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
+ export type $TSFixMe = any;
@@ -0,0 +1,18 @@
1
+ import {useEffect, useState} from "react";
2
+ import {getMediaQueryList, subscribeOnChange} from "./media-query-utils";
3
+
4
+ export function useIsMediaQueryMatched(mediaQuery: string) {
5
+ const [isMediaQueryMatched, setIsMediaQueryMatched] = useState(() => {
6
+ const mediaQueryList = getMediaQueryList(mediaQuery);
7
+ return mediaQueryList.matches;
8
+ });
9
+ useEffect(() => {
10
+ const unsubscribe = subscribeOnChange(getMediaQueryList(mediaQuery), (evt) => {
11
+ setIsMediaQueryMatched(evt.matches);
12
+ });
13
+ return () => {
14
+ unsubscribe();
15
+ };
16
+ }, [mediaQuery]);
17
+ return isMediaQueryMatched;
18
+ }
@@ -0,0 +1,5 @@
1
+ import {useIsMediaQueryMatched} from "./use-is-media-query-matched";
2
+
3
+ export function useIsPhone() {
4
+ return useIsMediaQueryMatched("(max-width: 420px), (max-height: 420px)");
5
+ }
@@ -0,0 +1,6 @@
1
+ import {useIsPhone} from "./use-is-phone";
2
+
3
+ export function useIsSupportHardwareKeyboard() {
4
+ // now we don't have media query for hardware keyboard support https://github.com/w3c/csswg-drafts/issues/3871
5
+ return !useIsPhone();
6
+ }