@teamturing/react-kit 2.56.4 → 2.58.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.
@@ -8,6 +8,7 @@ type Props = {
8
8
  size?: ResponsiveValue<OverlaySizeType>;
9
9
  ignoreOutsideClickRefs?: RefObject<HTMLElement>[];
10
10
  dismissFocusRef?: RefObject<HTMLElement>;
11
+ initialFocusRef?: RefObject<HTMLElement>;
11
12
  } & MaxHeightProps & SxProp & HTMLAttributes<HTMLElement>;
12
13
  declare const _default: import("react").ForwardRefExoticComponent<{
13
14
  isOpen?: boolean | undefined;
@@ -15,6 +16,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
15
16
  size?: ResponsiveValue<OverlaySizeType> | undefined;
16
17
  ignoreOutsideClickRefs?: RefObject<HTMLElement>[] | undefined;
17
18
  dismissFocusRef?: RefObject<HTMLElement> | undefined;
19
+ initialFocusRef?: RefObject<HTMLElement> | undefined;
18
20
  } & MaxHeightProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxHeight<import("styled-system").TLengthStyledSystem>> & SxProp & HTMLAttributes<HTMLElement> & {
19
21
  children?: import("react").ReactNode;
20
22
  } & import("react").RefAttributes<HTMLDivElement>>;
package/dist/index.js CHANGED
@@ -1250,10 +1250,12 @@ var Grid$1 = Object.assign(Grid, {
1250
1250
  const StyledIcon = /*#__PURE__*/React.forwardRef(({
1251
1251
  icon: Icon,
1252
1252
  sx,
1253
+ className,
1253
1254
  ...props
1254
1255
  }, ref) => /*#__PURE__*/jsxRuntime.jsx(View, {
1255
1256
  ref: ref,
1256
1257
  ...props,
1258
+ className: `trk-styled_icon__wrapper ${className}`,
1257
1259
  color: props.color,
1258
1260
  sx: {
1259
1261
  '& svg': {
@@ -1876,6 +1878,7 @@ const Overlay = ({
1876
1878
  size = 'm',
1877
1879
  ignoreOutsideClickRefs = [],
1878
1880
  dismissFocusRef,
1881
+ initialFocusRef,
1879
1882
  maxHeight = utils.forcePixelValue(600),
1880
1883
  ...props
1881
1884
  }, ref) => {
@@ -1903,6 +1906,10 @@ const Overlay = ({
1903
1906
  }
1904
1907
  }, [handleDismiss]);
1905
1908
  React.useEffect(() => {
1909
+ if (initialFocusRef && initialFocusRef.current) {
1910
+ initialFocusRef.current.focus();
1911
+ return;
1912
+ }
1906
1913
  if (overlayRef.current) {
1907
1914
  const firstItem = utils$1.iterateFocusableElements(overlayRef.current).next().value;
1908
1915
  firstItem?.focus();
@@ -14,6 +14,7 @@ const Overlay = ({
14
14
  size = 'm',
15
15
  ignoreOutsideClickRefs = [],
16
16
  dismissFocusRef,
17
+ initialFocusRef,
17
18
  maxHeight = forcePixelValue(600),
18
19
  ...props
19
20
  }, ref) => {
@@ -41,6 +42,10 @@ const Overlay = ({
41
42
  }
42
43
  }, [handleDismiss]);
43
44
  useEffect(() => {
45
+ if (initialFocusRef && initialFocusRef.current) {
46
+ initialFocusRef.current.focus();
47
+ return;
48
+ }
44
49
  if (overlayRef.current) {
45
50
  const firstItem = iterateFocusableElements(overlayRef.current).next().value;
46
51
  firstItem?.focus();
@@ -5,10 +5,12 @@ import { jsx } from 'react/jsx-runtime';
5
5
  const StyledIcon = /*#__PURE__*/forwardRef(({
6
6
  icon: Icon,
7
7
  sx,
8
+ className,
8
9
  ...props
9
10
  }, ref) => /*#__PURE__*/jsx(View, {
10
11
  ref: ref,
11
12
  ...props,
13
+ className: `trk-styled_icon__wrapper ${className}`,
12
14
  color: props.color,
13
15
  sx: {
14
16
  '& svg': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.56.4",
3
+ "version": "2.58.0",
4
4
  "description": "React components, hooks for create teamturing web application",
5
5
  "author": "Sungchang Park <psch300@gmail.com> (https://github.com/psch300)",
6
6
  "homepage": "https://github.com/weareteamturing/bombe#readme",
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "@floating-ui/react": "^0.27.16",
57
57
  "@primer/behaviors": "^1.3.6",
58
- "@teamturing/icons": "^1.58.1",
58
+ "@teamturing/icons": "^1.59.0",
59
59
  "@teamturing/token-studio": "^1.16.2",
60
60
  "@teamturing/utils": "^1.5.0",
61
61
  "framer-motion": "^10.16.4",
@@ -66,5 +66,5 @@
66
66
  "react-textarea-autosize": "^8.5.3",
67
67
  "styled-system": "^5.1.5"
68
68
  },
69
- "gitHead": "7b0bbc8a30f3c0e177603c66c8c9a045e8026883"
69
+ "gitHead": "e841f08c6f9e085849f873896a2cdda34696e665"
70
70
  }