@bitrise/bitkit-v2 0.3.489 → 0.3.491
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/BitkitTag/BitkitTag.d.ts +1 -1
- package/dist/components/BitkitTag/BitkitTag.js +5 -2
- package/dist/components/BitkitTag/BitkitTag.js.map +1 -1
- package/dist/theme/recipes/ToggleButton.recipe.d.ts +6 -3
- package/dist/theme/recipes/ToggleButton.recipe.js +13 -3
- package/dist/theme/recipes/ToggleButton.recipe.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,5 +6,5 @@ export interface BitkitTagProps extends TagRootProps {
|
|
|
6
6
|
onRemove?: () => void;
|
|
7
7
|
state?: 'disabled' | 'skeleton';
|
|
8
8
|
}
|
|
9
|
-
declare const BitkitTag: (
|
|
9
|
+
declare const BitkitTag: import('react').ForwardRefExoticComponent<BitkitTagProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
10
10
|
export default BitkitTag;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import BitkitCloseButton from "../BitkitCloseButton/BitkitCloseButton.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { Skeleton } from "@chakra-ui/react/skeleton";
|
|
4
5
|
import { Tag } from "@chakra-ui/react/tag";
|
|
5
6
|
//#region lib/components/BitkitTag/BitkitTag.tsx
|
|
6
|
-
var BitkitTag = (props) => {
|
|
7
|
+
var BitkitTag = forwardRef((props, ref) => {
|
|
7
8
|
const { labelText, icon: Icon, onRemove, state, ...rest } = props;
|
|
8
9
|
const isSkeleton = state === "skeleton";
|
|
9
10
|
const isDisabled = !!rest.disabled || state === "disabled";
|
|
10
11
|
return /* @__PURE__ */ jsxs(Tag.Root, {
|
|
12
|
+
ref,
|
|
11
13
|
...rest,
|
|
12
14
|
disabled: isDisabled,
|
|
13
15
|
children: [
|
|
@@ -35,7 +37,8 @@ var BitkitTag = (props) => {
|
|
|
35
37
|
})
|
|
36
38
|
]
|
|
37
39
|
});
|
|
38
|
-
};
|
|
40
|
+
});
|
|
41
|
+
BitkitTag.displayName = "BitkitTag";
|
|
39
42
|
//#endregion
|
|
40
43
|
export { BitkitTag as default };
|
|
41
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitTag.js","names":[],"sources":["../../../lib/components/BitkitTag/BitkitTag.tsx"],"sourcesContent":["import { Skeleton } from '@chakra-ui/react/skeleton';\nimport { Tag, type TagRootProps } from '@chakra-ui/react/tag';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\n\nexport interface BitkitTagProps extends TagRootProps {\n icon?: BitkitIconComponent;\n labelText: string;\n onRemove?: () => void;\n state?: 'disabled' | 'skeleton';\n}\n\nconst BitkitTag = (props
|
|
1
|
+
{"version":3,"file":"BitkitTag.js","names":[],"sources":["../../../lib/components/BitkitTag/BitkitTag.tsx"],"sourcesContent":["import { Skeleton } from '@chakra-ui/react/skeleton';\nimport { Tag, type TagRootProps } from '@chakra-ui/react/tag';\nimport { forwardRef } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\n\nexport interface BitkitTagProps extends TagRootProps {\n icon?: BitkitIconComponent;\n labelText: string;\n onRemove?: () => void;\n state?: 'disabled' | 'skeleton';\n}\n\nconst BitkitTag = forwardRef<HTMLSpanElement, BitkitTagProps>((props, ref) => {\n const { labelText, icon: Icon, onRemove, state, ...rest } = props;\n const isSkeleton = state === 'skeleton';\n const isDisabled = !!rest.disabled || state === 'disabled';\n return (\n <Tag.Root ref={ref} {...rest} disabled={isDisabled}>\n {!!Icon && (\n <Tag.StartElement asChild>\n <Icon size=\"16\" />\n </Tag.StartElement>\n )}\n {/* minWidth=\"0\" lets this flex child shrink past its text so the label's ellipsis can kick in. */}\n <Skeleton\n loading={isSkeleton}\n height={isSkeleton ? '8' : undefined}\n overflow=\"hidden\"\n borderRadius=\"0\"\n minWidth=\"0\"\n >\n <Tag.Label>{labelText}</Tag.Label>\n </Skeleton>\n {!!onRemove && (\n <Tag.EndElement asChild>\n <BitkitCloseButton\n disabled={isDisabled || isSkeleton}\n size=\"xs\"\n aria-label=\"Remove\"\n colorVariant={rest.colorVariant}\n onClick={onRemove}\n />\n </Tag.EndElement>\n )}\n </Tag.Root>\n );\n});\n\nBitkitTag.displayName = 'BitkitTag';\n\nexport default BitkitTag;\n"],"mappings":";;;;;;AAcA,IAAM,YAAY,YAA6C,OAAO,QAAQ;CAC5E,MAAM,EAAE,WAAW,MAAM,MAAM,UAAU,OAAO,GAAG,SAAS;CAC5D,MAAM,aAAa,UAAU;CAC7B,MAAM,aAAa,CAAC,CAAC,KAAK,YAAY,UAAU;CAChD,OACE,qBAAC,IAAI,MAAL;EAAe;EAAK,GAAI;EAAM,UAAU;EAAxC,UAAA;GACG,CAAC,CAAC,QACD,oBAAC,IAAI,cAAL;IAAkB,SAAA;IAChB,UAAA,oBAAC,MAAD,EAAM,MAAK,KAAM,CAAA;GACD,CAAA;GAGpB,oBAAC,UAAD;IACE,SAAS;IACT,QAAQ,aAAa,MAAM,KAAA;IAC3B,UAAS;IACT,cAAa;IACb,UAAS;IAET,UAAA,oBAAC,IAAI,OAAL,EAAA,UAAY,UAAqB,CAAA;GACzB,CAAA;GACT,CAAC,CAAC,YACD,oBAAC,IAAI,YAAL;IAAgB,SAAA;IACd,UAAA,oBAAC,mBAAD;KACE,UAAU,cAAc;KACxB,MAAK;KACL,cAAW;KACX,cAAc,KAAK;KACnB,SAAS;IACV,CAAA;GACa,CAAA;EAEV;;AAEd,CAAC;AAED,UAAU,cAAc"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
declare const toggleButtonRecipe: import('@chakra-ui/react').RecipeDefinition<{
|
|
2
2
|
size: {
|
|
3
3
|
sm: {
|
|
4
|
-
|
|
4
|
+
minWidth: "32";
|
|
5
|
+
height: "32";
|
|
5
6
|
};
|
|
6
7
|
md: {
|
|
7
|
-
|
|
8
|
+
minWidth: "40";
|
|
9
|
+
height: "40";
|
|
8
10
|
};
|
|
9
11
|
lg: {
|
|
10
|
-
|
|
12
|
+
minWidth: "48";
|
|
13
|
+
height: "48";
|
|
11
14
|
};
|
|
12
15
|
};
|
|
13
16
|
}>;
|
|
@@ -33,6 +33,7 @@ var toggleButtonRecipe = defineRecipe({
|
|
|
33
33
|
justifyContent: "center",
|
|
34
34
|
borderRadius: "4",
|
|
35
35
|
cursor: "pointer",
|
|
36
|
+
padding: 0,
|
|
36
37
|
borderWidth: "1",
|
|
37
38
|
background: "button/secondary/bg",
|
|
38
39
|
borderColor: "button/secondary/border",
|
|
@@ -58,9 +59,18 @@ var toggleButtonRecipe = defineRecipe({
|
|
|
58
59
|
}
|
|
59
60
|
},
|
|
60
61
|
variants: { size: {
|
|
61
|
-
sm: {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
sm: {
|
|
63
|
+
minWidth: "32",
|
|
64
|
+
height: "32"
|
|
65
|
+
},
|
|
66
|
+
md: {
|
|
67
|
+
minWidth: "40",
|
|
68
|
+
height: "40"
|
|
69
|
+
},
|
|
70
|
+
lg: {
|
|
71
|
+
minWidth: "48",
|
|
72
|
+
height: "48"
|
|
73
|
+
}
|
|
64
74
|
} },
|
|
65
75
|
defaultVariants: { size: "md" }
|
|
66
76
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleButton.recipe.js","names":[],"sources":["../../../lib/theme/recipes/ToggleButton.recipe.ts"],"sourcesContent":["import { defineRecipe, type SystemStyleObject } from '@chakra-ui/react/styled-system';\n\nconst selected: SystemStyleObject = {\n background: 'background/selected',\n borderColor: 'border/selected',\n color: 'icon/interactive',\n};\n\nconst selectedHover: SystemStyleObject = {\n background: 'background/selected-hover',\n borderColor: 'border/selected',\n color: 'icon/interactive-hover',\n};\n\nconst selectedActive: SystemStyleObject = {\n background: 'background/selected-active',\n borderColor: 'border/selected',\n color: 'icon/interactive-hover',\n};\n\nconst active: SystemStyleObject = {\n background: 'button/secondary/bg-active',\n borderColor: 'button/secondary/border-active',\n color: 'button/secondary/icon-active',\n};\n\nconst disabled: SystemStyleObject = {\n background: 'button/secondary/bg-disabled',\n borderColor: 'button/secondary/border-disabled',\n color: 'button/secondary/icon-disabled',\n};\n\nconst toggleButtonRecipe = defineRecipe({\n className: 'toggle-button',\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: '4',\n cursor: 'pointer',\n borderWidth: '1',\n background: 'button/secondary/bg',\n borderColor: 'button/secondary/border',\n color: 'button/secondary/icon',\n _hover: {\n background: 'button/secondary/bg-hover',\n borderColor: 'button/secondary/border-hover',\n _active: active,\n _pressed: {\n ...selectedHover,\n _active: selectedActive,\n },\n },\n _active: active,\n _pressed: {\n ...selected,\n _active: selectedActive,\n },\n _disabled: {\n cursor: 'not-allowed',\n ...disabled,\n _pressed: disabled,\n },\n },\n variants: {\n size: {\n sm: {
|
|
1
|
+
{"version":3,"file":"ToggleButton.recipe.js","names":[],"sources":["../../../lib/theme/recipes/ToggleButton.recipe.ts"],"sourcesContent":["import { defineRecipe, type SystemStyleObject } from '@chakra-ui/react/styled-system';\n\nconst selected: SystemStyleObject = {\n background: 'background/selected',\n borderColor: 'border/selected',\n color: 'icon/interactive',\n};\n\nconst selectedHover: SystemStyleObject = {\n background: 'background/selected-hover',\n borderColor: 'border/selected',\n color: 'icon/interactive-hover',\n};\n\nconst selectedActive: SystemStyleObject = {\n background: 'background/selected-active',\n borderColor: 'border/selected',\n color: 'icon/interactive-hover',\n};\n\nconst active: SystemStyleObject = {\n background: 'button/secondary/bg-active',\n borderColor: 'button/secondary/border-active',\n color: 'button/secondary/icon-active',\n};\n\nconst disabled: SystemStyleObject = {\n background: 'button/secondary/bg-disabled',\n borderColor: 'button/secondary/border-disabled',\n color: 'button/secondary/icon-disabled',\n};\n\nconst toggleButtonRecipe = defineRecipe({\n className: 'toggle-button',\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: '4',\n cursor: 'pointer',\n padding: 0,\n borderWidth: '1',\n background: 'button/secondary/bg',\n borderColor: 'button/secondary/border',\n color: 'button/secondary/icon',\n _hover: {\n background: 'button/secondary/bg-hover',\n borderColor: 'button/secondary/border-hover',\n _active: active,\n _pressed: {\n ...selectedHover,\n _active: selectedActive,\n },\n },\n _active: active,\n _pressed: {\n ...selected,\n _active: selectedActive,\n },\n _disabled: {\n cursor: 'not-allowed',\n ...disabled,\n _pressed: disabled,\n },\n },\n variants: {\n // Same heights as the button recipe, so a toggle lines up with a BitkitButton /\n // BitkitIconButton or a text field of the same size.\n size: {\n sm: { minWidth: '32', height: '32' },\n md: { minWidth: '40', height: '40' },\n lg: { minWidth: '48', height: '48' },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nexport default toggleButtonRecipe;\n"],"mappings":";;AAEA,IAAM,WAA8B;CAClC,YAAY;CACZ,aAAa;CACb,OAAO;AACT;AAEA,IAAM,gBAAmC;CACvC,YAAY;CACZ,aAAa;CACb,OAAO;AACT;AAEA,IAAM,iBAAoC;CACxC,YAAY;CACZ,aAAa;CACb,OAAO;AACT;AAEA,IAAM,SAA4B;CAChC,YAAY;CACZ,aAAa;CACb,OAAO;AACT;AAEA,IAAM,WAA8B;CAClC,YAAY;CACZ,aAAa;CACb,OAAO;AACT;AAEA,IAAM,qBAAqB,aAAa;CACtC,WAAW;CACX,MAAM;EACJ,SAAS;EACT,YAAY;EACZ,gBAAgB;EAChB,cAAc;EACd,QAAQ;EACR,SAAS;EACT,aAAa;EACb,YAAY;EACZ,aAAa;EACb,OAAO;EACP,QAAQ;GACN,YAAY;GACZ,aAAa;GACb,SAAS;GACT,UAAU;IACR,GAAG;IACH,SAAS;GACX;EACF;EACA,SAAS;EACT,UAAU;GACR,GAAG;GACH,SAAS;EACX;EACA,WAAW;GACT,QAAQ;GACR,GAAG;GACH,UAAU;EACZ;CACF;CACA,UAAU,EAGR,MAAM;EACJ,IAAI;GAAE,UAAU;GAAM,QAAQ;EAAK;EACnC,IAAI;GAAE,UAAU;GAAM,QAAQ;EAAK;EACnC,IAAI;GAAE,UAAU;GAAM,QAAQ;EAAK;CACrC,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC"}
|