@bitrise/bitkit-v2 0.3.441 → 0.3.443
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/dist/components/BitkitMarkdown/BitkitMarkdown.js +2 -8
- package/dist/components/BitkitMarkdown/BitkitMarkdown.js.map +1 -1
- package/dist/components/BitkitTabs/BitkitTabs.d.ts +22 -0
- package/dist/components/BitkitTabs/BitkitTabs.js +66 -40
- package/dist/components/BitkitTabs/BitkitTabs.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/theme/slot-recipes/SettingsCard.recipe.d.ts +1 -1
- package/dist/theme/slot-recipes/SettingsCard.recipe.js +1 -1
- package/dist/theme/slot-recipes/SettingsCard.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/Tabs.recipe.d.ts +94 -6
- package/dist/theme/slot-recipes/Tabs.recipe.js +214 -131
- package/dist/theme/slot-recipes/Tabs.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/index.d.ts +95 -7
- package/dist/utilities/getTextContent.d.ts +3 -0
- package/dist/utilities/getTextContent.js +14 -0
- package/dist/utilities/getTextContent.js.map +1 -0
- package/docs/v1-to-v2-migration-guide.md +20 -0
- package/package.json +1 -1
|
@@ -2292,7 +2292,7 @@ declare const slotRecipes: {
|
|
|
2292
2292
|
};
|
|
2293
2293
|
'in-progress': {
|
|
2294
2294
|
statusIcon: {
|
|
2295
|
-
color: "
|
|
2295
|
+
color: "icon/warning";
|
|
2296
2296
|
};
|
|
2297
2297
|
};
|
|
2298
2298
|
neutral: {
|
|
@@ -2705,24 +2705,38 @@ declare const slotRecipes: {
|
|
|
2705
2705
|
list: {
|
|
2706
2706
|
borderBlockEnd: "1px solid";
|
|
2707
2707
|
borderColor: "border/regular";
|
|
2708
|
+
'&:not([data-overflowing]) > .chakra-tabs__list > .chakra-tabs__trigger': {
|
|
2709
|
+
flex: {
|
|
2710
|
+
baseOnly: "1";
|
|
2711
|
+
};
|
|
2712
|
+
justifyContent: {
|
|
2713
|
+
baseOnly: "center";
|
|
2714
|
+
};
|
|
2715
|
+
};
|
|
2708
2716
|
};
|
|
2709
2717
|
trigger: {
|
|
2710
2718
|
bottom: "-1px";
|
|
2711
2719
|
display: "flex";
|
|
2712
2720
|
alignItems: "center";
|
|
2713
|
-
gap: "
|
|
2721
|
+
gap: "12";
|
|
2714
2722
|
paddingBlockStart: "12";
|
|
2715
2723
|
paddingBlockEnd: `${number}rem`;
|
|
2716
2724
|
borderBlockEnd: "2px solid transparent";
|
|
2717
2725
|
_selected: {
|
|
2718
2726
|
color: "text/primary";
|
|
2727
|
+
_hover: {
|
|
2728
|
+
'--tabs-icon-color': string;
|
|
2729
|
+
};
|
|
2730
|
+
'--tabs-icon-color': string;
|
|
2719
2731
|
};
|
|
2720
2732
|
_hover: {
|
|
2721
2733
|
borderColor: "border/hover";
|
|
2722
2734
|
color: "text/primary";
|
|
2735
|
+
'--tabs-icon-color': string;
|
|
2723
2736
|
};
|
|
2724
2737
|
_disabled: {
|
|
2725
2738
|
color: "text/disabled";
|
|
2739
|
+
'--tabs-icon-color': string;
|
|
2726
2740
|
};
|
|
2727
2741
|
};
|
|
2728
2742
|
moreTrigger: {
|
|
@@ -2734,7 +2748,6 @@ declare const slotRecipes: {
|
|
|
2734
2748
|
borderBlockEnd: "2px solid transparent";
|
|
2735
2749
|
_hover: {
|
|
2736
2750
|
backgroundColor: "background/hover";
|
|
2737
|
-
color: "text/primary";
|
|
2738
2751
|
};
|
|
2739
2752
|
_open: {
|
|
2740
2753
|
backgroundColor: "background/active";
|
|
@@ -2744,23 +2757,85 @@ declare const slotRecipes: {
|
|
|
2744
2757
|
};
|
|
2745
2758
|
contained: {
|
|
2746
2759
|
trigger: {
|
|
2760
|
+
display: "flex";
|
|
2761
|
+
alignItems: "flex-start";
|
|
2762
|
+
gap: "16";
|
|
2747
2763
|
paddingBlockStart: `${number}rem`;
|
|
2748
2764
|
paddingBlockEnd: "12";
|
|
2749
2765
|
backgroundColor: "background/tertiary";
|
|
2750
2766
|
borderBlockStart: "2px solid transparent";
|
|
2767
|
+
_after: {
|
|
2768
|
+
content: "\"\"";
|
|
2769
|
+
position: "absolute";
|
|
2770
|
+
insetBlock: number;
|
|
2771
|
+
insetInlineEnd: number;
|
|
2772
|
+
width: "1";
|
|
2773
|
+
backgroundColor: "border/regular";
|
|
2774
|
+
};
|
|
2775
|
+
'&:last-of-type': {
|
|
2776
|
+
_after: {
|
|
2777
|
+
display: "none";
|
|
2778
|
+
};
|
|
2779
|
+
};
|
|
2751
2780
|
_hover: {
|
|
2752
2781
|
backgroundColor: "background/active";
|
|
2782
|
+
_after: {
|
|
2783
|
+
backgroundColor: "border/strong";
|
|
2784
|
+
};
|
|
2785
|
+
_active: {
|
|
2786
|
+
backgroundColor: string;
|
|
2787
|
+
color: string;
|
|
2788
|
+
_after: {
|
|
2789
|
+
backgroundColor: string;
|
|
2790
|
+
};
|
|
2791
|
+
'--tabs-icon-color': string;
|
|
2792
|
+
};
|
|
2793
|
+
'--tabs-icon-color': string;
|
|
2794
|
+
};
|
|
2795
|
+
_active: {
|
|
2796
|
+
backgroundColor: string;
|
|
2797
|
+
color: string;
|
|
2798
|
+
_after: {
|
|
2799
|
+
backgroundColor: string;
|
|
2800
|
+
};
|
|
2801
|
+
'--tabs-icon-color': string;
|
|
2753
2802
|
};
|
|
2754
2803
|
_disabled: {
|
|
2755
2804
|
backgroundColor: "color/neutral/moderate";
|
|
2756
2805
|
color: "text/on-disabled";
|
|
2806
|
+
_after: {
|
|
2807
|
+
backgroundColor: "border/strong";
|
|
2808
|
+
};
|
|
2809
|
+
'--tabs-icon-color': string;
|
|
2757
2810
|
};
|
|
2758
2811
|
_selected: {
|
|
2759
|
-
|
|
2760
|
-
|
|
2812
|
+
_after: {
|
|
2813
|
+
display: "none";
|
|
2814
|
+
};
|
|
2761
2815
|
_hover: {
|
|
2762
|
-
|
|
2816
|
+
_active: {
|
|
2817
|
+
backgroundColor: string;
|
|
2818
|
+
color: string;
|
|
2819
|
+
'--tabs-icon-color': string;
|
|
2820
|
+
};
|
|
2821
|
+
backgroundColor: string;
|
|
2822
|
+
color: string;
|
|
2823
|
+
'--tabs-icon-color': string;
|
|
2824
|
+
};
|
|
2825
|
+
_active: {
|
|
2826
|
+
backgroundColor: string;
|
|
2827
|
+
color: string;
|
|
2828
|
+
'--tabs-icon-color': string;
|
|
2763
2829
|
};
|
|
2830
|
+
_focusVisible: {
|
|
2831
|
+
_after: {
|
|
2832
|
+
display: "block";
|
|
2833
|
+
backgroundColor: "border/strong";
|
|
2834
|
+
};
|
|
2835
|
+
};
|
|
2836
|
+
backgroundColor: string;
|
|
2837
|
+
color: string;
|
|
2838
|
+
'--tabs-icon-color': string;
|
|
2764
2839
|
};
|
|
2765
2840
|
};
|
|
2766
2841
|
moreTrigger: {
|
|
@@ -2777,6 +2852,11 @@ declare const slotRecipes: {
|
|
|
2777
2852
|
color: "text/primary";
|
|
2778
2853
|
};
|
|
2779
2854
|
};
|
|
2855
|
+
contentGroup: {
|
|
2856
|
+
backgroundColor: "background/primary";
|
|
2857
|
+
borderRadius: "4";
|
|
2858
|
+
borderStartStartRadius: number;
|
|
2859
|
+
};
|
|
2780
2860
|
};
|
|
2781
2861
|
canvas: {
|
|
2782
2862
|
list: {
|
|
@@ -2788,7 +2868,7 @@ declare const slotRecipes: {
|
|
|
2788
2868
|
height: "40";
|
|
2789
2869
|
display: "flex";
|
|
2790
2870
|
alignItems: "center";
|
|
2791
|
-
gap: "
|
|
2871
|
+
gap: "4";
|
|
2792
2872
|
textStyle: "body/md/regular";
|
|
2793
2873
|
backgroundColor: "background/secondary";
|
|
2794
2874
|
paddingInline: "12";
|
|
@@ -2832,6 +2912,7 @@ declare const slotRecipes: {
|
|
|
2832
2912
|
backgroundColor: "color/neutral/moderate";
|
|
2833
2913
|
color: "text/on-disabled";
|
|
2834
2914
|
};
|
|
2915
|
+
'--tabs-icon-color': string;
|
|
2835
2916
|
};
|
|
2836
2917
|
};
|
|
2837
2918
|
moreTrigger: {
|
|
@@ -2855,8 +2936,15 @@ declare const slotRecipes: {
|
|
|
2855
2936
|
boxShadow: "inset 0 0 0 var(--focus-ring-width) var(--focus-ring-color)";
|
|
2856
2937
|
};
|
|
2857
2938
|
};
|
|
2939
|
+
contentGroup: {
|
|
2940
|
+
backgroundColor: "background/primary";
|
|
2941
|
+
};
|
|
2858
2942
|
};
|
|
2859
2943
|
};
|
|
2944
|
+
size: {
|
|
2945
|
+
lg: {};
|
|
2946
|
+
md: {};
|
|
2947
|
+
};
|
|
2860
2948
|
}>;
|
|
2861
2949
|
tag: import('@chakra-ui/react').SlotRecipeDefinition<"label" | "root" | "closeTrigger" | "startElement" | "endElement", {
|
|
2862
2950
|
colorVariant: {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isValidElement } from "react";
|
|
2
|
+
//#region lib/utilities/getTextContent.ts
|
|
3
|
+
/** The text a node renders, read from its elements' children. `String()` gives "[object Object]" for an element. */
|
|
4
|
+
var getTextContent = (node) => {
|
|
5
|
+
if (typeof node === "string") return node;
|
|
6
|
+
if (typeof node === "number") return String(node);
|
|
7
|
+
if (Array.isArray(node)) return node.map(getTextContent).join("");
|
|
8
|
+
if (isValidElement(node)) return getTextContent(node.props.children);
|
|
9
|
+
return "";
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { getTextContent };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=getTextContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTextContent.js","names":[],"sources":["../../lib/utilities/getTextContent.ts"],"sourcesContent":["import { isValidElement, type ReactNode } from 'react';\n\n/** The text a node renders, read from its elements' children. `String()` gives \"[object Object]\" for an element. */\nexport const getTextContent = (node: ReactNode): string => {\n if (typeof node === 'string') return node;\n if (typeof node === 'number') return String(node);\n if (Array.isArray(node)) return node.map(getTextContent).join('');\n if (isValidElement(node)) return getTextContent((node.props as { children?: ReactNode }).children);\n return '';\n};\n"],"mappings":";;;AAGA,IAAa,kBAAkB,SAA4B;CACzD,IAAI,OAAO,SAAS,UAAU,OAAO;CACrC,IAAI,OAAO,SAAS,UAAU,OAAO,OAAO,IAAI;CAChD,IAAI,MAAM,QAAQ,IAAI,GAAG,OAAO,KAAK,IAAI,cAAc,CAAC,CAAC,KAAK,EAAE;CAChE,IAAI,eAAe,IAAI,GAAG,OAAO,eAAgB,KAAK,MAAmC,QAAQ;CACjG,OAAO;AACT"}
|
|
@@ -225,6 +225,26 @@ The API changed fundamentally — from index-based to value-based:
|
|
|
225
225
|
|
|
226
226
|
This is one of the more involved migrations — every tab needs an explicit `value`.
|
|
227
227
|
|
|
228
|
+
| v1 | v2 |
|
|
229
|
+
|----|----|
|
|
230
|
+
| `ContainedTab` | `BitkitTabs.Trigger`, with `variant="contained"` on the root |
|
|
231
|
+
| `leftIconName` / `iconName` | `icon` |
|
|
232
|
+
| `iconColor` | `iconColor`, `contained` only, and only an `icon/*` token |
|
|
233
|
+
| `isWarning` | `icon={IconWarningYellow}` |
|
|
234
|
+
| `badge={{ children: '3' }}` | `badge={<BitkitBadge>3</BitkitBadge>}` |
|
|
235
|
+
| `isDisabled` | `disabled` |
|
|
236
|
+
| `isLazy` | `lazyMount` **and** `unmountOnExit` |
|
|
237
|
+
| `onChange(index)` | `onValueChange({ value })` |
|
|
238
|
+
| `TabPanels` / `TabPanel` | `BitkitTabs.ContentGroup` / `BitkitTabs.Content` |
|
|
239
|
+
|
|
240
|
+
Things that behave differently:
|
|
241
|
+
- **An uncontrolled root needs `defaultValue`.** v1 fell back to index 0; without `defaultValue`, v2 selects nothing and shows no panel. The same happens when `value` matches no trigger, e.g. a stale query parameter for a tab that is hidden.
|
|
242
|
+
- **`isLazy` alone is `lazyMount`, not the whole thing.** v1's `isLazy` unmounts a panel when you leave it; `lazyMount` on its own keeps every visited panel mounted.
|
|
243
|
+
- **`List` renders only its direct `Trigger` children** (fragments are unwrapped). A component that wraps a trigger compiles and then disappears. `Content` has no such filter.
|
|
244
|
+
- **`Trigger` children are a `string`.** `Attachments {count}` is two children; write one template string, or move the count to `badge`.
|
|
245
|
+
- **Tabs that do not fit collapse into a "N more…" menu** instead of v1's horizontal scroll.
|
|
246
|
+
- **Don't stretch line tabs yourself.** On mobile they share the row on their own while all of them fit, so drop per-trigger `flex` / `width`.
|
|
247
|
+
|
|
228
248
|
### Table
|
|
229
249
|
|
|
230
250
|
```tsx
|