@teamturing/react-kit 2.41.1 → 2.42.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.
@@ -1,4 +1,4 @@
1
- import { ElementType, PropsWithChildren, ReactNode, MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyboardEvent } from 'react';
1
+ import { ElementType, PropsWithChildren, ReactNode, MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyboardEvent, LiHTMLAttributes } from 'react';
2
2
  import { SxProp } from '../../utils/styled-system';
3
3
  type Props = {
4
4
  variant?: 'neutral' | 'danger';
@@ -9,7 +9,7 @@ type Props = {
9
9
  disabled?: boolean;
10
10
  selected?: boolean;
11
11
  onSelect?: (event: ReactMouseEvent<HTMLLIElement> | ReactKeyboardEvent<HTMLLIElement>) => void;
12
- } & SxProp;
13
- declare const ActionListItem: ({ variant, leadingVisual: LeadingVisual, trailingVisual: TrailingVisual, description, descriptionLayout, disabled, selected, onSelect: propOnSelect, children, sx, }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
12
+ } & Pick<LiHTMLAttributes<HTMLLIElement>, 'onFocus' | 'onBlur'> & SxProp;
13
+ declare const ActionListItem: ({ variant, leadingVisual: LeadingVisual, trailingVisual: TrailingVisual, description, descriptionLayout, disabled, selected, onSelect: propOnSelect, children, onFocus, onBlur, sx, }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
14
14
  export default ActionListItem;
15
15
  export type { Props as ActionListItemProps };
@@ -16,7 +16,7 @@ type Props = {
16
16
  type ActionListContextValue = {} & Pick<Props, 'selectionVariant' | 'onSelect'>;
17
17
  declare const ActionListContext: import("react").Context<Pick<Props, "onSelect" | "selectionVariant">>;
18
18
  declare const _default: (({ selectionVariant, onSelect, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element) & {
19
- Item: ({ variant, leadingVisual: LeadingVisual, trailingVisual: TrailingVisual, description, descriptionLayout, disabled, selected, onSelect: propOnSelect, children, sx, }: PropsWithChildren<ActionListItemProps>) => import("react/jsx-runtime").JSX.Element;
19
+ Item: ({ variant, leadingVisual: LeadingVisual, trailingVisual: TrailingVisual, description, descriptionLayout, disabled, selected, onSelect: propOnSelect, children, onFocus, onBlur, sx, }: PropsWithChildren<ActionListItemProps>) => import("react/jsx-runtime").JSX.Element;
20
20
  SectionDivider: ({ color, variant, width, sx }: ActionListSectionDividerProps) => import("react/jsx-runtime").JSX.Element;
21
21
  SectionHeader: ({ ...props }: PropsWithChildren<SxProp>) => import("react/jsx-runtime").JSX.Element;
22
22
  };
@@ -9,10 +9,16 @@ type Props = {
9
9
  * 반응형 디자인이 적용됩니다.
10
10
  */
11
11
  size?: ResponsiveValue<'l' | 'm' | 's'>;
12
+ /**
13
+ * 모양을 정의합니다.
14
+ * 반응형 디자인이 적용됩니다.
15
+ */
16
+ shape?: 'circle' | 'rounded';
12
17
  /**
13
18
  * 색을 정의합니다.
19
+ * 반응형 디자인이 적용됩니다.
14
20
  */
15
- variant?: 'primary' | 'plain' | 'plain-neutral';
21
+ variant?: 'primary' | 'plain' | 'blue' | 'plain-neutral';
16
22
  /**
17
23
  * 활성화 상태를 정의합니다.
18
24
  * `true`일 경우, 활성화된 상태를 그립니다.
@@ -30,10 +36,16 @@ declare const _default: import("react").ForwardRefExoticComponent<{
30
36
  * 반응형 디자인이 적용됩니다.
31
37
  */
32
38
  size?: ResponsiveValue<"m" | "s" | "l"> | undefined;
39
+ /**
40
+ * 모양을 정의합니다.
41
+ * 반응형 디자인이 적용됩니다.
42
+ */
43
+ shape?: "circle" | "rounded" | undefined;
33
44
  /**
34
45
  * 색을 정의합니다.
46
+ * 반응형 디자인이 적용됩니다.
35
47
  */
36
- variant?: "primary" | "plain" | "plain-neutral" | undefined;
48
+ variant?: "blue" | "primary" | "plain" | "plain-neutral" | undefined;
37
49
  /**
38
50
  * 활성화 상태를 정의합니다.
39
51
  * `true`일 경우, 활성화된 상태를 그립니다.
package/dist/index.js CHANGED
@@ -6925,6 +6925,8 @@ const ActionListItem = ({
6925
6925
  selected = false,
6926
6926
  onSelect: propOnSelect,
6927
6927
  children,
6928
+ onFocus,
6929
+ onBlur,
6928
6930
  sx
6929
6931
  }) => {
6930
6932
  const {
@@ -6958,6 +6960,8 @@ const ActionListItem = ({
6958
6960
  sx: sx,
6959
6961
  onClick: handleClick,
6960
6962
  onKeyDown: handleKeyDown,
6963
+ onFocus: onFocus,
6964
+ onBlur: onBlur,
6961
6965
  children: [!isNullable(selectionVariant) ? /*#__PURE__*/jsxRuntimeExports.jsx(View, {
6962
6966
  display: 'inline-flex',
6963
6967
  minWidth: 20,
@@ -37356,6 +37360,7 @@ const GradientText = styled__default.default(Text)`
37356
37360
  const IconToggleButton = ({
37357
37361
  icon: Icon,
37358
37362
  size = 'm',
37363
+ shape = 'circle',
37359
37364
  variant = 'primary',
37360
37365
  selected = false,
37361
37366
  disabled = false,
@@ -37365,6 +37370,7 @@ const IconToggleButton = ({
37365
37370
  ref: ref,
37366
37371
  icon: Icon,
37367
37372
  size: size,
37373
+ shape: shape,
37368
37374
  variant: variant,
37369
37375
  selected: selected,
37370
37376
  type: 'button',
@@ -37379,7 +37385,6 @@ const BaseIconToggleButton = styled__default.default(UnstyledButton)(({
37379
37385
  theme
37380
37386
  }) => ({
37381
37387
  'position': 'relative',
37382
- 'borderRadius': theme.radii.full,
37383
37388
  'transition': 'background-color 100ms, color 100ms',
37384
37389
  '& svg': {
37385
37390
  display: 'block'
@@ -37416,6 +37421,18 @@ const BaseIconToggleButton = styled__default.default(UnstyledButton)(({
37416
37421
  }
37417
37422
  }
37418
37423
  }
37424
+ }), ({
37425
+ theme
37426
+ }) => variant({
37427
+ prop: 'shape',
37428
+ variants: {
37429
+ circle: {
37430
+ borderRadius: theme.radii.full
37431
+ },
37432
+ rounded: {
37433
+ borderRadius: theme.radii.xs
37434
+ }
37435
+ }
37419
37436
  }), ({
37420
37437
  selected,
37421
37438
  $disabled,
@@ -37448,6 +37465,19 @@ const BaseIconToggleButton = styled__default.default(UnstyledButton)(({
37448
37465
  color: theme.colors['icon/disabled/subtler']
37449
37466
  } : {})
37450
37467
  },
37468
+ 'blue': {
37469
+ ...(selected ? {
37470
+ backgroundColor: theme.colors['bg/accent/blue/subtlest'],
37471
+ color: theme.colors['icon/accent/blue']
37472
+ } : {
37473
+ backgroundColor: theme.colors['bg/neutral'],
37474
+ color: theme.colors['icon/neutral']
37475
+ }),
37476
+ ...($disabled ? {
37477
+ backgroundColor: theme.colors['bg/disabled'],
37478
+ color: theme.colors['icon/disabled']
37479
+ } : {})
37480
+ },
37451
37481
  'plain-neutral': {
37452
37482
  backgroundColor: theme.colors['bg/neutral/subtler'],
37453
37483
  ...(selected ? {
@@ -25,6 +25,8 @@ const ActionListItem = ({
25
25
  selected = false,
26
26
  onSelect: propOnSelect,
27
27
  children,
28
+ onFocus,
29
+ onBlur,
28
30
  sx
29
31
  }) => {
30
32
  const {
@@ -58,6 +60,8 @@ const ActionListItem = ({
58
60
  sx: sx,
59
61
  onClick: handleClick,
60
62
  onKeyDown: handleKeyDown,
63
+ onFocus: onFocus,
64
+ onBlur: onBlur,
61
65
  children: [!isNullable(selectionVariant) ? /*#__PURE__*/jsxRuntimeExports.jsx(View, {
62
66
  display: 'inline-flex',
63
67
  minWidth: 20,
@@ -9,6 +9,7 @@ import { variant } from '../../node_modules/@styled-system/variant/dist/index.es
9
9
  const IconToggleButton = ({
10
10
  icon: Icon,
11
11
  size = 'm',
12
+ shape = 'circle',
12
13
  variant = 'primary',
13
14
  selected = false,
14
15
  disabled = false,
@@ -18,6 +19,7 @@ const IconToggleButton = ({
18
19
  ref: ref,
19
20
  icon: Icon,
20
21
  size: size,
22
+ shape: shape,
21
23
  variant: variant,
22
24
  selected: selected,
23
25
  type: 'button',
@@ -32,7 +34,6 @@ const BaseIconToggleButton = styled(UnstyledButton)(({
32
34
  theme
33
35
  }) => ({
34
36
  'position': 'relative',
35
- 'borderRadius': theme.radii.full,
36
37
  'transition': 'background-color 100ms, color 100ms',
37
38
  '& svg': {
38
39
  display: 'block'
@@ -69,6 +70,18 @@ const BaseIconToggleButton = styled(UnstyledButton)(({
69
70
  }
70
71
  }
71
72
  }
73
+ }), ({
74
+ theme
75
+ }) => variant({
76
+ prop: 'shape',
77
+ variants: {
78
+ circle: {
79
+ borderRadius: theme.radii.full
80
+ },
81
+ rounded: {
82
+ borderRadius: theme.radii.xs
83
+ }
84
+ }
72
85
  }), ({
73
86
  selected,
74
87
  $disabled,
@@ -101,6 +114,19 @@ const BaseIconToggleButton = styled(UnstyledButton)(({
101
114
  color: theme.colors['icon/disabled/subtler']
102
115
  } : {})
103
116
  },
117
+ 'blue': {
118
+ ...(selected ? {
119
+ backgroundColor: theme.colors['bg/accent/blue/subtlest'],
120
+ color: theme.colors['icon/accent/blue']
121
+ } : {
122
+ backgroundColor: theme.colors['bg/neutral'],
123
+ color: theme.colors['icon/neutral']
124
+ }),
125
+ ...($disabled ? {
126
+ backgroundColor: theme.colors['bg/disabled'],
127
+ color: theme.colors['icon/disabled']
128
+ } : {})
129
+ },
104
130
  'plain-neutral': {
105
131
  backgroundColor: theme.colors['bg/neutral/subtler'],
106
132
  ...(selected ? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.41.1",
3
+ "version": "2.42.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",
@@ -66,5 +66,5 @@
66
66
  "react-textarea-autosize": "^8.5.3",
67
67
  "styled-system": "^5.1.5"
68
68
  },
69
- "gitHead": "1d8867136d2359ec9825bc1fa1ef2c31c0f933c3"
69
+ "gitHead": "94a3c71c241b43a1946205576082a33047abff02"
70
70
  }