@bitrise/bitkit-v2 0.3.143 → 0.3.145

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.
@@ -0,0 +1,28 @@
1
+ import { MenuItemGroupProps, MenuItemProps, MenuRootProps } from '@chakra-ui/react/menu';
2
+ import { ReactNode } from 'react';
3
+ import { BitkitIconComponent } from '../../icons';
4
+ interface BitkitMenuRootProps extends Omit<MenuRootProps, 'children'> {
5
+ trigger: ReactNode;
6
+ children?: ReactNode;
7
+ }
8
+ interface BitkitMenuItemProps extends MenuItemProps {
9
+ danger?: boolean;
10
+ secondaryText?: ReactNode;
11
+ icon?: BitkitIconComponent;
12
+ }
13
+ interface BitkitMenuGroupProps extends MenuItemGroupProps {
14
+ label: ReactNode;
15
+ }
16
+ declare const BitkitActionMenu: {
17
+ Root: {
18
+ ({ trigger, children, ...props }: BitkitMenuRootProps): import("react/jsx-runtime").JSX.Element;
19
+ displayName: string;
20
+ };
21
+ Separator: {
22
+ (): import("react/jsx-runtime").JSX.Element;
23
+ displayName: string;
24
+ };
25
+ Item: import('react').ForwardRefExoticComponent<BitkitMenuItemProps & import('react').RefAttributes<HTMLDivElement>>;
26
+ Group: import('react').ForwardRefExoticComponent<BitkitMenuGroupProps & import('react').RefAttributes<HTMLDivElement>>;
27
+ };
28
+ export default BitkitActionMenu;
@@ -6,7 +6,7 @@ const i = {
6
6
  borderColor: "border/minimal",
7
7
  zIndex: "select",
8
8
  overflowY: "auto",
9
- boxShadow: "large",
9
+ boxShadow: "elevation/lg",
10
10
  _open: {
11
11
  animationStyle: "slide-fade-in",
12
12
  animationDuration: "fast"
@@ -8,7 +8,7 @@ const e = {
8
8
  color: "input/text/inputValue",
9
9
  textStyle: "body/lg/regular",
10
10
  width: "100%",
11
- boxShadow: "inner",
11
+ boxShadow: "inset/field",
12
12
  transition: "border 200ms",
13
13
  _placeholder: {
14
14
  color: "input/text/placeholder"
@@ -1,46 +1,5 @@
1
1
  declare const semanticTokens: {
2
2
  colors: Record<string, any>;
3
- shadows: {
4
- formFocus: {
5
- value: {
6
- _light: string;
7
- };
8
- };
9
- inner: {
10
- value: {
11
- _light: string;
12
- };
13
- };
14
- innerSmall: {
15
- value: {
16
- _light: string;
17
- };
18
- };
19
- large: {
20
- value: {
21
- _light: string;
22
- };
23
- };
24
- medium: {
25
- value: {
26
- _light: string;
27
- };
28
- };
29
- outline: {
30
- value: {
31
- _light: string;
32
- };
33
- };
34
- small: {
35
- value: {
36
- _light: string;
37
- };
38
- };
39
- tooltip: {
40
- value: {
41
- _light: string;
42
- };
43
- };
44
- };
3
+ shadows: Record<string, any>;
45
4
  };
46
5
  export default semanticTokens;
@@ -1,43 +1,2 @@
1
- declare const shadows: {
2
- formFocus: {
3
- value: {
4
- _light: string;
5
- };
6
- };
7
- inner: {
8
- value: {
9
- _light: string;
10
- };
11
- };
12
- innerSmall: {
13
- value: {
14
- _light: string;
15
- };
16
- };
17
- large: {
18
- value: {
19
- _light: string;
20
- };
21
- };
22
- medium: {
23
- value: {
24
- _light: string;
25
- };
26
- };
27
- outline: {
28
- value: {
29
- _light: string;
30
- };
31
- };
32
- small: {
33
- value: {
34
- _light: string;
35
- };
36
- };
37
- tooltip: {
38
- value: {
39
- _light: string;
40
- };
41
- };
42
- };
1
+ declare const shadows: Record<string, any>;
43
2
  export default shadows;
@@ -1,46 +1,38 @@
1
1
  import { defineSemanticTokens as e } from "@chakra-ui/react/styled-system";
2
- const l = e.shadows({
3
- formFocus: {
4
- value: {
5
- _light: "0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset, 0 0 0 3px var(--colors-purple-70)"
6
- }
7
- },
8
- inner: {
9
- value: {
10
- _light: "0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset"
11
- }
12
- },
13
- innerSmall: {
14
- value: {
15
- _light: "0 0.0625rem 0.125rem 0 rgba(0, 0, 0, 0.1) inset"
16
- }
17
- },
18
- large: {
19
- value: {
20
- _light: "0 0.125rem 1.5rem 0 rgba(0, 0, 0, 0.08)"
21
- }
22
- },
23
- medium: {
24
- value: {
25
- _light: "0 0.125rem 0.75rem 0 rgba(0, 0, 0, 0.06)"
26
- }
27
- },
28
- outline: {
29
- value: {
30
- _light: "0 0 0 3px var(--colors-purple-70)"
31
- }
32
- },
33
- small: {
34
- value: {
35
- _light: "0 0.125rem 0.25rem 0 rgba(0, 0, 0, 0.06)"
36
- }
37
- },
38
- tooltip: {
39
- value: {
40
- _light: "0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.2)"
41
- }
42
- }
43
- });
2
+ import { withSlashes as r } from "../themeUtils.js";
3
+ const t = e.shadows(
4
+ r({
5
+ elevation: {
6
+ lg: {
7
+ value: {
8
+ _light: "0 0.125rem 1.5rem 0 rgba(0, 0, 0, 0.08)"
9
+ }
10
+ },
11
+ md: {
12
+ value: {
13
+ _light: "0 0.125rem 0.75rem 0 rgba(0, 0, 0, 0.06)"
14
+ }
15
+ },
16
+ sm: {
17
+ value: {
18
+ _light: "0 0.125rem 0.25rem 0 rgba(0, 0, 0, 0.06)"
19
+ }
20
+ },
21
+ tooltip: {
22
+ value: {
23
+ _light: "0 0.0625rem 0.1875rem 0 rgba(0, 0, 0, 0.2)"
24
+ }
25
+ }
26
+ },
27
+ inset: {
28
+ field: {
29
+ value: {
30
+ _light: "0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset"
31
+ }
32
+ }
33
+ }
34
+ })
35
+ );
44
36
  export {
45
- l as default
37
+ t as default
46
38
  };
@@ -1,6 +1,6 @@
1
1
  import { actionBarAnatomy as t } from "@chakra-ui/react/anatomy";
2
- import { defineSlotRecipe as a } from "@chakra-ui/react/styled-system";
3
- const o = a({
2
+ import { defineSlotRecipe as n } from "@chakra-ui/react/styled-system";
3
+ const o = n({
4
4
  slots: t.keys(),
5
5
  className: "action-bar",
6
6
  base: {
@@ -16,7 +16,7 @@ const o = a({
16
16
  content: {
17
17
  display: "flex",
18
18
  alignItems: "center",
19
- boxShadow: "large",
19
+ boxShadow: "elevation/lg",
20
20
  pointerEvents: "auto",
21
21
  border: "1px solid",
22
22
  borderColor: "border/minimal",
@@ -30,7 +30,7 @@ const o = t({
30
30
  },
31
31
  badgeContainer: {
32
32
  display: "flex",
33
- boxShadow: "small",
33
+ boxShadow: "elevation/sm",
34
34
  position: "absolute",
35
35
  alignItems: "center",
36
36
  justifyContent: "center",
@@ -58,7 +58,7 @@ const o = {
58
58
  border: "1px solid",
59
59
  borderColor: "border/minimal",
60
60
  borderRadius: "4",
61
- boxShadow: "large",
61
+ boxShadow: "elevation/lg",
62
62
  outline: "none"
63
63
  },
64
64
  overflowMenuItem: {
@@ -3,7 +3,7 @@ declare const cardSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"b
3
3
  true: {
4
4
  root: {
5
5
  borderColor: "border/minimal";
6
- boxShadow: "small";
6
+ boxShadow: "elevation/sm";
7
7
  };
8
8
  };
9
9
  false: {
@@ -15,7 +15,7 @@ const e = r({
15
15
  true: {
16
16
  root: {
17
17
  borderColor: "border/minimal",
18
- boxShadow: "small"
18
+ boxShadow: "elevation/sm"
19
19
  }
20
20
  },
21
21
  false: {
@@ -26,7 +26,7 @@ const i = a({
26
26
  content: {
27
27
  backgroundColor: "background/primary",
28
28
  borderRadius: "8",
29
- boxShadow: "large",
29
+ boxShadow: "elevation/lg",
30
30
  minWidth: r(312),
31
31
  paddingBlock: "24",
32
32
  paddingInline: "16"
@@ -0,0 +1,20 @@
1
+ declare const menuSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "separator" | "item" | "itemIndicator" | "trigger" | "arrow" | "arrowTip" | "positioner" | "indicator" | "itemText" | "itemGroup" | "itemGroupLabel" | "contextTrigger" | "triggerItem" | "itemCommand" | "itemHelper", {
2
+ size: {
3
+ lg: {
4
+ item: {
5
+ paddingY: "12";
6
+ textStyle: "body/lg/regular";
7
+ };
8
+ };
9
+ md: {
10
+ item: {
11
+ _icon: {
12
+ marginTop: "2";
13
+ };
14
+ paddingY: "8";
15
+ textStyle: "body/md/regular";
16
+ };
17
+ };
18
+ };
19
+ }>;
20
+ export default menuSlotRecipe;
@@ -0,0 +1,115 @@
1
+ import { menuAnatomy as t } from "@chakra-ui/react/anatomy";
2
+ import { defineSlotRecipe as a } from "@chakra-ui/react/styled-system";
3
+ const e = {
4
+ background: "button/secondary/bg-active",
5
+ _icon: {
6
+ color: "icon/primary"
7
+ }
8
+ }, o = {
9
+ background: "button/danger-secondary/bg-active",
10
+ color: "button/danger-secondary/fg-active",
11
+ _icon: {
12
+ color: "button/danger-secondary/fg-active"
13
+ }
14
+ }, r = a({
15
+ className: "menu",
16
+ slots: [...t.keys(), "itemHelper"],
17
+ variants: {
18
+ size: {
19
+ lg: {
20
+ item: {
21
+ paddingY: "12",
22
+ textStyle: "body/lg/regular"
23
+ }
24
+ },
25
+ md: {
26
+ item: {
27
+ _icon: {
28
+ marginTop: "2"
29
+ },
30
+ paddingY: "8",
31
+ textStyle: "body/md/regular"
32
+ }
33
+ }
34
+ }
35
+ },
36
+ base: {
37
+ content: {
38
+ paddingY: "8",
39
+ border: "1px solid",
40
+ borderColor: "border/minimal",
41
+ _focusVisible: { outline: "none" },
42
+ boxShadow: "elevation/lg",
43
+ background: "background/primary",
44
+ maxHeight: "var(--available-height)",
45
+ _open: {
46
+ animationStyle: "slide-fade-in",
47
+ animationDuration: "fast"
48
+ },
49
+ _closed: {
50
+ animationStyle: "slide-fade-out",
51
+ animationDuration: "faster"
52
+ }
53
+ },
54
+ itemHelper: {
55
+ textStyle: "body/sm/regular",
56
+ color: "text/secondary"
57
+ },
58
+ item: {
59
+ _icon: {
60
+ color: "icon/secondary",
61
+ _active: {
62
+ color: "icon/primary"
63
+ }
64
+ },
65
+ display: "flex",
66
+ gap: "12",
67
+ userSelect: "none",
68
+ flexDirection: "row",
69
+ paddingLeft: "16",
70
+ paddingRight: "24",
71
+ "&[data-danger]": {
72
+ color: "button/danger-secondary/fg",
73
+ _icon: {
74
+ color: "button/danger-secondary/fg"
75
+ },
76
+ _active: o,
77
+ _highlighted: {
78
+ background: "button/danger-secondary/bg-hover",
79
+ color: "button/danger-secondary/fg-hover",
80
+ _active: o,
81
+ _icon: {
82
+ color: "button/danger-secondary/fg-hover"
83
+ }
84
+ }
85
+ },
86
+ _active: e,
87
+ _highlighted: {
88
+ background: "button/secondary/bg-hover",
89
+ _active: e
90
+ }
91
+ },
92
+ itemGroupLabel: {
93
+ textStyle: "heading/h6",
94
+ color: "text/tertiary",
95
+ paddingTop: "12",
96
+ paddingLeft: "16",
97
+ paddingRight: "24",
98
+ paddingBottom: "6",
99
+ display: "flex",
100
+ gap: "12",
101
+ flexDirection: "row",
102
+ alignItems: "center"
103
+ },
104
+ separator: {
105
+ color: "border/minimal",
106
+ marginY: "8"
107
+ }
108
+ },
109
+ defaultVariants: {
110
+ size: "lg"
111
+ }
112
+ });
113
+ export {
114
+ r as default
115
+ };
@@ -1,7 +1,7 @@
1
1
  import { switchAnatomy as i } from "@chakra-ui/react/anatomy";
2
2
  import { defineSlotRecipe as e } from "@chakra-ui/react/styled-system";
3
3
  import { rem as t } from "../themeUtils.js";
4
- const o = e({
4
+ const r = e({
5
5
  slots: i.keys(),
6
6
  className: "switch",
7
7
  base: {
@@ -60,7 +60,7 @@ const o = e({
60
60
  width: "var(--switch-height)",
61
61
  height: "var(--switch-height)",
62
62
  bg: "input/toggle/slideOff",
63
- boxShadow: "small",
63
+ boxShadow: "elevation/sm",
64
64
  scale: "0.8",
65
65
  borderRadius: "inherit",
66
66
  transitionProperty: "translate",
@@ -112,5 +112,5 @@ const o = e({
112
112
  }
113
113
  });
114
114
  export {
115
- o as default
115
+ r as default
116
116
  };
@@ -1,7 +1,7 @@
1
1
  import { tooltipAnatomy as t } from "@chakra-ui/react/anatomy";
2
- import { defineSlotRecipe as r } from "@chakra-ui/react/styled-system";
2
+ import { defineSlotRecipe as a } from "@chakra-ui/react/styled-system";
3
3
  import { rem as o } from "../themeUtils.js";
4
- const e = r({
4
+ const e = a({
5
5
  className: "tooltip",
6
6
  slots: t.keys(),
7
7
  base: {
@@ -12,7 +12,7 @@ const e = r({
12
12
  "--tooltip-bg": "colors.background.contrast",
13
13
  backgroundColor: "var(--tooltip-bg)",
14
14
  color: "text/on-contrast",
15
- boxShadow: "tooltip",
15
+ boxShadow: "elevation/tooltip",
16
16
  maxWidth: o(320),
17
17
  zIndex: "tooltip",
18
18
  transformOrigin: "var(--transform-origin)",
@@ -190,7 +190,7 @@ declare const slotRecipes: {
190
190
  true: {
191
191
  root: {
192
192
  borderColor: "border/minimal";
193
- boxShadow: "small";
193
+ boxShadow: "elevation/sm";
194
194
  };
195
195
  };
196
196
  false: {
@@ -673,5 +673,24 @@ declare const slotRecipes: {
673
673
  };
674
674
  }>;
675
675
  accordion: import('@chakra-ui/react').SlotRecipeDefinition<"icon" | "suffix" | "root" | "item" | "itemTrigger" | "itemContent" | "itemIndicator" | "itemBody" | "secdText", import('@chakra-ui/react').SlotRecipeVariantRecord<"icon" | "suffix" | "root" | "item" | "itemTrigger" | "itemContent" | "itemIndicator" | "itemBody" | "secdText">>;
676
+ menu: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "separator" | "item" | "itemIndicator" | "trigger" | "arrow" | "arrowTip" | "positioner" | "indicator" | "itemText" | "itemGroup" | "itemGroupLabel" | "contextTrigger" | "triggerItem" | "itemCommand" | "itemHelper", {
677
+ size: {
678
+ lg: {
679
+ item: {
680
+ paddingY: "12";
681
+ textStyle: "body/lg/regular";
682
+ };
683
+ };
684
+ md: {
685
+ item: {
686
+ _icon: {
687
+ marginTop: "2";
688
+ };
689
+ paddingY: "8";
690
+ textStyle: "body/md/regular";
691
+ };
692
+ };
693
+ };
694
+ }>;
676
695
  };
677
696
  export default slotRecipes;
@@ -12,16 +12,17 @@ import S from "./EmptyState.recipe.js";
12
12
  import f from "./ExpandableCard.recipe.js";
13
13
  import R from "./Field.recipe.js";
14
14
  import d from "./Fieldset.recipe.js";
15
- import b from "./NativeSelect.recipe.js";
16
- import n from "./NumberInput.recipe.js";
17
- import s from "./RadioGroup.recipe.js";
18
- import { selectSlotRecipe as u } from "./Select.recipe.js";
19
- import x from "./Switch.recipe.js";
20
- import k from "./Table.recipe.js";
21
- import h from "./Tabs.recipe.js";
22
- import v from "./Tag.recipe.js";
23
- import P from "./Tooltip.recipe.js";
24
- const U = {
15
+ import b from "./Menu.recipe.js";
16
+ import n from "./NativeSelect.recipe.js";
17
+ import s from "./NumberInput.recipe.js";
18
+ import u from "./RadioGroup.recipe.js";
19
+ import { selectSlotRecipe as x } from "./Select.recipe.js";
20
+ import k from "./Switch.recipe.js";
21
+ import h from "./Table.recipe.js";
22
+ import v from "./Tabs.recipe.js";
23
+ import P from "./Tag.recipe.js";
24
+ import g from "./Tooltip.recipe.js";
25
+ const W = {
25
26
  actionBar: o,
26
27
  avatar: r,
27
28
  breadcrumb: i,
@@ -34,18 +35,19 @@ const U = {
34
35
  expandableCard: f,
35
36
  field: R,
36
37
  fieldset: d,
37
- nativeSelect: b,
38
+ nativeSelect: n,
38
39
  alert: t,
39
- numberInput: n,
40
- radioGroup: s,
41
- select: u,
42
- switch: x,
43
- table: k,
44
- tabs: h,
45
- tag: v,
46
- tooltip: P,
47
- accordion: e
40
+ numberInput: s,
41
+ radioGroup: u,
42
+ select: x,
43
+ switch: k,
44
+ table: h,
45
+ tabs: v,
46
+ tag: P,
47
+ tooltip: g,
48
+ accordion: e,
49
+ menu: b
48
50
  };
49
51
  export {
50
- U as default
52
+ W as default
51
53
  };
@@ -1,5 +1,5 @@
1
1
  import { TextProps } from '@chakra-ui/react/text';
2
- export declare const flattenColorTokens: (object: object, prefix?: string) => Record<string, any>;
2
+ export declare const flattenTokens: (object: object, prefix?: string) => Record<string, any>;
3
3
  export declare function withSlashes(object: Record<string, any>): Record<string, any>;
4
4
  /**
5
5
  *
@@ -1,25 +1,25 @@
1
1
  import { isPlainObject as u } from "es-toolkit";
2
- const i = (e, r = "") => {
3
- const n = {}, c = Object.keys(e);
4
- for (let s = 0; s < c.length; s++) {
5
- const o = c[s], t = e[o], l = r ? `${r}/${o}` : o;
2
+ const l = (e, c = "") => {
3
+ const n = {}, o = Object.keys(e);
4
+ for (let s = 0; s < o.length; s++) {
5
+ const r = o[s], t = e[r], i = c ? `${c}/${r}` : r;
6
6
  if (u(t) && Object.keys(t).length > 0 && Object.keys(t)[0] !== "value") {
7
- Object.assign(n, i(t, l));
7
+ Object.assign(n, l(t, i));
8
8
  continue;
9
9
  }
10
- n[l] = t;
10
+ n[i] = t;
11
11
  }
12
12
  return n;
13
13
  };
14
14
  function k(e) {
15
15
  return {
16
16
  ...e,
17
- ...i(e)
17
+ ...l(e)
18
18
  };
19
19
  }
20
20
  const y = (e) => `${e / 16}rem`;
21
21
  export {
22
- i as flattenColorTokens,
22
+ l as flattenTokens,
23
23
  y as rem,
24
24
  k as withSlashes
25
25
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit-v2",
3
3
  "private": false,
4
- "version": "0.3.143",
4
+ "version": "0.3.145",
5
5
  "description": "Bitrise Design System Components built with Chakra UI V3",
6
6
  "keywords": [
7
7
  "react",
@@ -60,8 +60,8 @@
60
60
  "@figma-export/output-components-as-svg": "^6.4.0",
61
61
  "@figma-export/transform-svg-with-svgo": "^6.4.0",
62
62
  "@google-cloud/storage": "^7.19.0",
63
- "@storybook/addon-docs": "10.2.16",
64
- "@storybook/react-vite": "10.2.16",
63
+ "@storybook/addon-docs": "10.2.17",
64
+ "@storybook/react-vite": "10.2.17",
65
65
  "@svgr/plugin-jsx": "^8.1.0",
66
66
  "@types/node": "^24.12.0",
67
67
  "@types/react": "^19.2.14",
@@ -72,7 +72,7 @@
72
72
  "react": "^19.2.4",
73
73
  "react-dom": "^19.2.4",
74
74
  "release-it": "^19.2.4",
75
- "storybook": "10.2.16",
75
+ "storybook": "10.2.17",
76
76
  "tsx": "^4.21.0",
77
77
  "typescript": "^5.9.3",
78
78
  "vite": "^7.3.1",