@bitrise/bitkit-v2 0.3.175 → 0.3.176
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/atoms/ImageCropper/ImageCropper.js +32 -0
- package/dist/components/BitkitCodeSnippet/BitkitCodeSnippet.d.ts +12 -4
- package/dist/components/BitkitCodeSnippet/BitkitCodeSnippet.js +59 -54
- package/dist/components/BitkitCollapsible/BitkitCollapsible.d.ts +23 -0
- package/dist/components/BitkitCollapsible/BitkitCollapsible.js +37 -0
- package/dist/components/BitkitCombobox/BitkitCombobox.d.ts +2 -9
- package/dist/components/BitkitCombobox/BitkitCombobox.js +24 -32
- package/dist/components/BitkitField/BitkitField.d.ts +3 -1
- package/dist/components/BitkitField/BitkitField.js +29 -41
- package/dist/components/BitkitFileInput/BitkitFileInput.d.ts +3 -4
- package/dist/components/BitkitFileInput/BitkitFileInput.js +112 -0
- package/dist/components/BitkitGroupHeading/BitkitGroupHeading.d.ts +8 -0
- package/dist/components/BitkitGroupHeading/BitkitGroupHeading.js +27 -0
- package/dist/components/BitkitLabel/BitkitLabel.d.ts +12 -0
- package/dist/components/BitkitLabel/BitkitLabel.js +58 -0
- package/dist/components/BitkitNativeSelect/BitkitNativeSelect.d.ts +2 -9
- package/dist/components/BitkitNativeSelect/BitkitNativeSelect.js +14 -22
- package/dist/components/BitkitNumberInput/BitkitNumberInput.d.ts +1 -8
- package/dist/components/BitkitNumberInput/BitkitNumberInput.js +15 -23
- package/dist/components/BitkitPaginationLoadMore/BitkitPaginationLoadMore.d.ts +11 -0
- package/dist/components/BitkitPaginationLoadMore/BitkitPaginationLoadMore.js +41 -0
- package/dist/components/BitkitSectionHeading/BitkitSectionHeading.d.ts +12 -0
- package/dist/components/BitkitSectionHeading/BitkitSectionHeading.js +48 -0
- package/dist/components/BitkitSelect/BitkitSelect.d.ts +1 -8
- package/dist/components/BitkitSelect/BitkitSelect.js +22 -30
- package/dist/components/BitkitSelectableTag/BitkitSelectableTag.d.ts +17 -0
- package/dist/components/BitkitSelectableTag/BitkitSelectableTag.js +38 -0
- package/dist/components/BitkitTagsInput/BitkitTagsInput.d.ts +1 -8
- package/dist/components/BitkitTagsInput/BitkitTagsInput.js +24 -32
- package/dist/components/BitkitTextInput/BitkitTextInput.d.ts +1 -8
- package/dist/components/BitkitTextInput/BitkitTextInput.js +14 -22
- package/dist/components/BitkitToggle/components/BitkitToggleLabel.js +4 -4
- package/dist/components/index.d.ts +7 -0
- package/dist/main.js +44 -37
- package/dist/theme/recipes/Button.recipe.js +42 -42
- package/dist/theme/recipes/ControlButton.recipe.d.ts +16 -16
- package/dist/theme/recipes/ControlButton.recipe.js +16 -16
- package/dist/theme/recipes/SelectableTag.recipe.d.ts +2 -0
- package/dist/theme/recipes/SelectableTag.recipe.js +53 -0
- package/dist/theme/recipes/index.d.ts +17 -16
- package/dist/theme/recipes/index.js +14 -12
- package/dist/theme/semantic-tokens/semanticColors.js +20 -0
- package/dist/theme/slot-recipes/CodeSnippet.recipe.d.ts +4 -8
- package/dist/theme/slot-recipes/CodeSnippet.recipe.js +16 -5
- package/dist/theme/slot-recipes/Collapsible.recipe.d.ts +2 -0
- package/dist/theme/slot-recipes/Collapsible.recipe.js +56 -0
- package/dist/theme/slot-recipes/ExpandableCard.recipe.d.ts +1 -1
- package/dist/theme/slot-recipes/Field.recipe.js +2 -2
- package/dist/theme/slot-recipes/FileUpload.recipe.d.ts +1 -1
- package/dist/theme/slot-recipes/GroupHeading.recipe.d.ts +2 -0
- package/dist/theme/slot-recipes/GroupHeading.recipe.js +41 -0
- package/dist/theme/slot-recipes/InlineLoading.recipe.d.ts +3 -3
- package/dist/theme/slot-recipes/InlineLoading.recipe.js +3 -3
- package/dist/theme/slot-recipes/PaginationLoadMore.recipe.d.ts +41 -0
- package/dist/theme/slot-recipes/PaginationLoadMore.recipe.js +59 -0
- package/dist/theme/slot-recipes/SectionHeading.recipe.d.ts +2 -0
- package/dist/theme/slot-recipes/SectionHeading.recipe.js +52 -0
- package/dist/theme/slot-recipes/TagsInput.recipe.d.ts +1 -1
- package/dist/theme/slot-recipes/Tooltip.recipe.js +4 -1
- package/dist/theme/slot-recipes/index.d.ts +53 -14
- package/dist/theme/slot-recipes/index.js +60 -52
- package/dist/theme/tokens/sizesAndSpacing.js +3 -4
- package/package.json +5 -5
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import e from "../../icons/IconInfoCircle.js";
|
|
2
|
+
import t from "../BitkitTooltip/BitkitTooltip.js";
|
|
3
|
+
import { chakra as n, useSlotRecipe as r } from "@chakra-ui/react/styled-system";
|
|
4
|
+
import { Text as i } from "@chakra-ui/react/text";
|
|
5
|
+
import { cloneElement as a, forwardRef as o, isValidElement as s } from "react";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
import { useFieldContext as u } from "@chakra-ui/react/field";
|
|
8
|
+
import { Flex as d } from "@chakra-ui/react/flex";
|
|
9
|
+
//#region lib/components/BitkitLabel/BitkitLabel.tsx
|
|
10
|
+
var f = {
|
|
11
|
+
color: "text/disabled",
|
|
12
|
+
"& > span": { color: "text/disabled" }
|
|
13
|
+
}, p = o((o, p) => {
|
|
14
|
+
let { badge: m, counterText: h, css: g, disabled: _, children: v, optional: y, tooltip: b, ...x } = o, S = u(), C = r({ key: "field" })(), w = _ ?? S?.disabled, T = y ?? (S ? !S.required : void 0), E = w ? {
|
|
15
|
+
colorPalette: "neutral",
|
|
16
|
+
size: "xxs"
|
|
17
|
+
} : { size: "xxs" }, D = s(m) ? a(m, E) : m;
|
|
18
|
+
return /* @__PURE__ */ l(n.label, {
|
|
19
|
+
ref: p,
|
|
20
|
+
css: [
|
|
21
|
+
C.label,
|
|
22
|
+
w && f,
|
|
23
|
+
g
|
|
24
|
+
],
|
|
25
|
+
"data-disabled": w || void 0,
|
|
26
|
+
...x,
|
|
27
|
+
children: [
|
|
28
|
+
v,
|
|
29
|
+
" ",
|
|
30
|
+
T && /* @__PURE__ */ c(i, {
|
|
31
|
+
as: "span",
|
|
32
|
+
textStyle: "body/md/regular",
|
|
33
|
+
children: "(optional)"
|
|
34
|
+
}),
|
|
35
|
+
!!b && /* @__PURE__ */ c(t, {
|
|
36
|
+
text: b,
|
|
37
|
+
children: /* @__PURE__ */ c(e, {
|
|
38
|
+
size: "16",
|
|
39
|
+
color: "icon/tertiary"
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
(!!h || !!m) && /* @__PURE__ */ l(d, {
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
gap: "4",
|
|
45
|
+
marginInlineStart: "auto",
|
|
46
|
+
children: [!!h && /* @__PURE__ */ c(i, {
|
|
47
|
+
as: "span",
|
|
48
|
+
color: w ? "text/disabled" : "input/text/helper",
|
|
49
|
+
textStyle: "comp/input/helperText",
|
|
50
|
+
children: h
|
|
51
|
+
}), D]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
p.displayName = "BitkitLabel";
|
|
57
|
+
//#endregion
|
|
58
|
+
export { p as default };
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import { FieldRootProps } from '@chakra-ui/react/field';
|
|
2
1
|
import { NativeSelectRootProps } from '@chakra-ui/react/native-select';
|
|
3
2
|
import { ReactNode } from 'react';
|
|
4
3
|
import { BitkitFieldProps } from '../BitkitField/BitkitField.tsx';
|
|
5
|
-
export interface BitkitNativeSelectProps extends
|
|
6
|
-
|
|
7
|
-
helperText?: BitkitFieldProps['helperText'];
|
|
8
|
-
label?: BitkitFieldProps['label'];
|
|
9
|
-
optional?: BitkitFieldProps['optional'];
|
|
4
|
+
export interface BitkitNativeSelectProps extends Omit<BitkitFieldProps, 'children' | 'disabled' | 'invalid' | 'readOnly'> {
|
|
5
|
+
children: ReactNode;
|
|
10
6
|
placeholder?: string;
|
|
11
7
|
selectProps?: NativeSelectRootProps;
|
|
12
8
|
size?: 'md' | 'lg';
|
|
13
9
|
state?: 'disabled' | 'error' | 'readOnly' | 'warning';
|
|
14
|
-
tooltip?: BitkitFieldProps['tooltip'];
|
|
15
|
-
warningText?: BitkitFieldProps['warningText'];
|
|
16
|
-
children: ReactNode;
|
|
17
10
|
}
|
|
18
11
|
declare const BitkitNativeSelect: import('react').ForwardRefExoticComponent<BitkitNativeSelectProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
19
12
|
export default BitkitNativeSelect;
|
|
@@ -8,37 +8,29 @@ import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
|
8
8
|
import { NativeSelect as c } from "@chakra-ui/react/native-select";
|
|
9
9
|
//#region lib/components/BitkitNativeSelect/BitkitNativeSelect.tsx
|
|
10
10
|
var l = a((a, l) => {
|
|
11
|
-
let {
|
|
12
|
-
return
|
|
13
|
-
size:
|
|
14
|
-
css:
|
|
11
|
+
let { children: u, placeholder: d, selectProps: f, size: p = "md", state: m, ...h } = a, g = i({ key: "nativeSelect" })(), _ = m === "warning" || !!h.warningText, v = m === "error" || !!h.errorText, y;
|
|
12
|
+
return v ? y = /* @__PURE__ */ o(t, {
|
|
13
|
+
size: p === "lg" ? "24" : "16",
|
|
14
|
+
css: g.statusIcon,
|
|
15
15
|
color: "icon/negative"
|
|
16
|
-
}) :
|
|
17
|
-
size:
|
|
18
|
-
css:
|
|
16
|
+
}) : _ && (y = /* @__PURE__ */ o(n, {
|
|
17
|
+
size: p === "lg" ? "24" : "16",
|
|
18
|
+
css: g.statusIcon,
|
|
19
19
|
color: "icon/warning"
|
|
20
20
|
})), /* @__PURE__ */ o(r, {
|
|
21
|
-
disabled: _ === "disabled",
|
|
22
|
-
errorText: u,
|
|
23
|
-
helperText: d,
|
|
24
|
-
invalid: w,
|
|
25
|
-
label: f,
|
|
26
|
-
optional: p,
|
|
27
|
-
readOnly: _ === "readOnly",
|
|
28
21
|
ref: l,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
...x,
|
|
22
|
+
state: m,
|
|
23
|
+
...h,
|
|
32
24
|
children: /* @__PURE__ */ s(c.Root, {
|
|
33
|
-
size:
|
|
34
|
-
...
|
|
25
|
+
size: p,
|
|
26
|
+
...f,
|
|
35
27
|
className: "group",
|
|
36
28
|
children: [
|
|
37
29
|
/* @__PURE__ */ o(c.Field, {
|
|
38
|
-
placeholder:
|
|
39
|
-
children:
|
|
30
|
+
placeholder: d,
|
|
31
|
+
children: u
|
|
40
32
|
}),
|
|
41
|
-
|
|
33
|
+
y,
|
|
42
34
|
/* @__PURE__ */ o(c.Indicator, {
|
|
43
35
|
asChild: !0,
|
|
44
36
|
children: /* @__PURE__ */ o(e, {})
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import { FieldRootProps } from '@chakra-ui/react/field';
|
|
2
1
|
import { NumberInputRootProps } from '@chakra-ui/react/number-input';
|
|
3
2
|
import { BitkitFieldProps } from '../BitkitField/BitkitField';
|
|
4
|
-
export interface BitkitNumberInputProps extends
|
|
3
|
+
export interface BitkitNumberInputProps extends Omit<BitkitFieldProps, 'children' | 'disabled' | 'invalid' | 'readOnly'> {
|
|
5
4
|
defaultValue?: string;
|
|
6
|
-
errorText?: BitkitFieldProps['errorText'];
|
|
7
|
-
helperText?: BitkitFieldProps['helperText'];
|
|
8
5
|
inputProps?: NumberInputRootProps;
|
|
9
|
-
label?: BitkitFieldProps['label'];
|
|
10
|
-
optional?: BitkitFieldProps['optional'];
|
|
11
6
|
size?: 'md' | 'lg';
|
|
12
7
|
state?: 'disabled' | 'error' | 'readOnly' | 'warning';
|
|
13
|
-
tooltip?: BitkitFieldProps['tooltip'];
|
|
14
|
-
warningText?: BitkitFieldProps['warningText'];
|
|
15
8
|
}
|
|
16
9
|
declare const BitkitNumberInput: import('react').ForwardRefExoticComponent<BitkitNumberInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
17
10
|
export default BitkitNumberInput;
|
|
@@ -11,43 +11,35 @@ import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
|
11
11
|
import { NumberInput as d } from "@chakra-ui/react/number-input";
|
|
12
12
|
//#region lib/components/BitkitNumberInput/BitkitNumberInput.tsx
|
|
13
13
|
var f = c((c, f) => {
|
|
14
|
-
let { defaultValue: p,
|
|
15
|
-
return
|
|
16
|
-
size:
|
|
14
|
+
let { defaultValue: p, inputProps: m, size: h, state: g, ..._ } = c, v = g === "warning" || !!_.warningText, y = g === "error" || !!_.errorText, b;
|
|
15
|
+
return y ? b = /* @__PURE__ */ l(e, {
|
|
16
|
+
size: h === "lg" ? "24" : "16",
|
|
17
17
|
color: "icon/negative"
|
|
18
|
-
}) :
|
|
19
|
-
size:
|
|
18
|
+
}) : v && (b = /* @__PURE__ */ l(r, {
|
|
19
|
+
size: h === "lg" ? "24" : "16",
|
|
20
20
|
color: "icon/warning"
|
|
21
21
|
})), /* @__PURE__ */ l(a, {
|
|
22
|
-
disabled: b === "disabled",
|
|
23
|
-
errorText: m,
|
|
24
|
-
helperText: h,
|
|
25
|
-
invalid: T,
|
|
26
|
-
label: _,
|
|
27
|
-
optional: v,
|
|
28
|
-
readOnly: b === "readOnly",
|
|
29
22
|
ref: f,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
...C,
|
|
23
|
+
state: g,
|
|
24
|
+
..._,
|
|
33
25
|
children: /* @__PURE__ */ u(d.Root, {
|
|
34
|
-
css:
|
|
26
|
+
css: b ? { "--control-width": i(150) } : void 0,
|
|
35
27
|
defaultValue: p,
|
|
36
|
-
size:
|
|
37
|
-
...
|
|
28
|
+
size: h,
|
|
29
|
+
...m,
|
|
38
30
|
children: [/* @__PURE__ */ u(d.Control, { children: [
|
|
39
|
-
|
|
31
|
+
b && /* @__PURE__ */ l(s, {
|
|
40
32
|
paddingInline: "12",
|
|
41
33
|
display: "flex",
|
|
42
34
|
alignItems: "center",
|
|
43
35
|
justifyContent: "center",
|
|
44
|
-
children:
|
|
36
|
+
children: b
|
|
45
37
|
}),
|
|
46
38
|
/* @__PURE__ */ l(d.DecrementTrigger, {
|
|
47
|
-
_before:
|
|
48
|
-
children: /* @__PURE__ */ l(t, { size:
|
|
39
|
+
_before: b ? o : void 0,
|
|
40
|
+
children: /* @__PURE__ */ l(t, { size: h === "lg" ? "24" : "16" })
|
|
49
41
|
}),
|
|
50
|
-
/* @__PURE__ */ l(d.IncrementTrigger, { children: /* @__PURE__ */ l(n, { size:
|
|
42
|
+
/* @__PURE__ */ l(d.IncrementTrigger, { children: /* @__PURE__ */ l(n, { size: h === "lg" ? "24" : "16" }) })
|
|
51
43
|
] }), /* @__PURE__ */ l(d.Input, {})]
|
|
52
44
|
})
|
|
53
45
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BoxProps } from '@chakra-ui/react/box';
|
|
2
|
+
export interface BitkitPaginationLoadMoreProps extends Omit<BoxProps, 'page' | 'size'> {
|
|
3
|
+
loadingMore?: boolean;
|
|
4
|
+
onLoadMore: () => void;
|
|
5
|
+
page: number;
|
|
6
|
+
pageItemsCount: number;
|
|
7
|
+
size?: 'md' | 'sm' | 'xs';
|
|
8
|
+
totalCount: number;
|
|
9
|
+
}
|
|
10
|
+
declare const BitkitPaginationLoadMore: import('react').ForwardRefExoticComponent<BitkitPaginationLoadMoreProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export default BitkitPaginationLoadMore;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import e from "../BitkitButton/BitkitButton.js";
|
|
2
|
+
import t from "../BitkitInlineLoading/BitkitInlineLoading.js";
|
|
3
|
+
import n from "../BitkitLinkButton/BitkitLinkButton.js";
|
|
4
|
+
import { Box as r } from "@chakra-ui/react/box";
|
|
5
|
+
import { chakra as i, useSlotRecipe as a } from "@chakra-ui/react/styled-system";
|
|
6
|
+
import { forwardRef as o } from "react";
|
|
7
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
//#region lib/components/BitkitPaginationLoadMore/BitkitPaginationLoadMore.tsx
|
|
9
|
+
var u = o((o, u) => {
|
|
10
|
+
let { loadingMore: d = !1, onLoadMore: f, page: p, pageItemsCount: m, size: h = "md", totalCount: g, ..._ } = o, v = a({ key: "paginationLoadMore" })({ size: h }), y = Math.max(1, p), b = Math.max(1, m), x = Math.min(y * b, g), S = x >= g, C = Math.min(b, g - x), w = h === "md" ? "md" : "sm";
|
|
11
|
+
return /* @__PURE__ */ l(r, {
|
|
12
|
+
css: v.root,
|
|
13
|
+
ref: u,
|
|
14
|
+
..._,
|
|
15
|
+
children: [/* @__PURE__ */ l(i.span, {
|
|
16
|
+
css: v.counter,
|
|
17
|
+
children: [
|
|
18
|
+
"Showing ",
|
|
19
|
+
x,
|
|
20
|
+
" of ",
|
|
21
|
+
g
|
|
22
|
+
]
|
|
23
|
+
}), !S && /* @__PURE__ */ c(s, { children: d ? /* @__PURE__ */ c(t, {
|
|
24
|
+
color: "text/tertiary",
|
|
25
|
+
label: "Loading more...",
|
|
26
|
+
size: w
|
|
27
|
+
}) : h === "xs" ? /* @__PURE__ */ c(n, {
|
|
28
|
+
onClick: f,
|
|
29
|
+
size: "sm",
|
|
30
|
+
children: `Load ${C} more`
|
|
31
|
+
}) : /* @__PURE__ */ c(e, {
|
|
32
|
+
onClick: f,
|
|
33
|
+
size: h === "md" ? "md" : "sm",
|
|
34
|
+
variant: "tertiary",
|
|
35
|
+
children: `Load ${C} more`
|
|
36
|
+
}) })]
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
u.displayName = "BitkitPaginationLoadMore";
|
|
40
|
+
//#endregion
|
|
41
|
+
export { u as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BoxProps } from '@chakra-ui/react/box';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BitkitIconComponent } from '../../icons';
|
|
4
|
+
export interface BitkitSectionHeadingProps extends Omit<BoxProps, 'icon'> {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
helperText?: string | string[];
|
|
7
|
+
helperTooltip?: string;
|
|
8
|
+
icon?: BitkitIconComponent;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
declare const BitkitSectionHeading: import('react').ForwardRefExoticComponent<BitkitSectionHeadingProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export default BitkitSectionHeading;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import e from "../../icons/IconInfoCircle.js";
|
|
2
|
+
import t from "../BitkitTooltip/BitkitTooltip.js";
|
|
3
|
+
import { Box as n } from "@chakra-ui/react/box";
|
|
4
|
+
import { chakra as r, useSlotRecipe as i } from "@chakra-ui/react/styled-system";
|
|
5
|
+
import { Fragment as a, forwardRef as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
//#region lib/components/BitkitSectionHeading/BitkitSectionHeading.tsx
|
|
8
|
+
var l = "•", u = o((o, u) => {
|
|
9
|
+
let { children: d, helperText: f, helperTooltip: p, icon: m, label: h, ...g } = o, _ = i({ key: "sectionHeading" })(), v = Array.isArray(f) ? f : f ? [f] : [], y = v.length > 0 || !!p;
|
|
10
|
+
return /* @__PURE__ */ c(n, {
|
|
11
|
+
css: _.root,
|
|
12
|
+
ref: u,
|
|
13
|
+
...g,
|
|
14
|
+
children: [/* @__PURE__ */ c(r.div, {
|
|
15
|
+
css: _.contentBlock,
|
|
16
|
+
children: [/* @__PURE__ */ c(r.div, {
|
|
17
|
+
css: _.titleBlock,
|
|
18
|
+
children: [m && /* @__PURE__ */ s(m, {
|
|
19
|
+
css: _.icon,
|
|
20
|
+
size: "24"
|
|
21
|
+
}), /* @__PURE__ */ s(r.h3, {
|
|
22
|
+
css: _.label,
|
|
23
|
+
children: h
|
|
24
|
+
})]
|
|
25
|
+
}), y && /* @__PURE__ */ c(r.div, {
|
|
26
|
+
css: _.helperBlock,
|
|
27
|
+
children: [v.map((e, t) => /* @__PURE__ */ c(a, { children: [t > 0 && /* @__PURE__ */ s(r.span, {
|
|
28
|
+
color: "text/tertiary",
|
|
29
|
+
flexShrink: 0,
|
|
30
|
+
textStyle: "body/md/regular",
|
|
31
|
+
children: l
|
|
32
|
+
}), /* @__PURE__ */ s(r.span, {
|
|
33
|
+
css: _.helperText,
|
|
34
|
+
children: e
|
|
35
|
+
})] }, t)), p && /* @__PURE__ */ s(t, {
|
|
36
|
+
text: p,
|
|
37
|
+
children: /* @__PURE__ */ s(e, {
|
|
38
|
+
color: "icon/secondary",
|
|
39
|
+
size: "16"
|
|
40
|
+
})
|
|
41
|
+
})]
|
|
42
|
+
})]
|
|
43
|
+
}), d]
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
u.displayName = "BitkitSectionHeading";
|
|
47
|
+
//#endregion
|
|
48
|
+
export { u as default };
|
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
import { FieldRootProps } from '@chakra-ui/react/field';
|
|
2
1
|
import { SelectRootProps, SelectTriggerProps } from '@chakra-ui/react/select';
|
|
3
2
|
import { BitkitFieldProps } from '../BitkitField/BitkitField.tsx';
|
|
4
3
|
import { BitkitSelectContentProps, BitkitSelectMenuCreateItemProps, BitkitSelectMenuItemProps, BitkitSelectMenuSearchProps } from '../BitkitSelectMenu/BitkitSelectMenu.tsx';
|
|
5
4
|
export type BitkitSelectTriggerProps = SelectTriggerProps;
|
|
6
|
-
export type BitkitSelectProps =
|
|
5
|
+
export type BitkitSelectProps = Omit<BitkitFieldProps, 'children' | 'state'> & {
|
|
7
6
|
contentProps?: BitkitSelectContentProps;
|
|
8
7
|
defaultValue?: string;
|
|
9
|
-
errorText?: BitkitFieldProps['errorText'];
|
|
10
|
-
helperText?: BitkitFieldProps['helperText'];
|
|
11
8
|
isLoading?: boolean;
|
|
12
9
|
items: Array<BitkitSelectMenuItemProps>;
|
|
13
|
-
label?: BitkitFieldProps['label'];
|
|
14
10
|
onValueChange?: (newVal: string) => void;
|
|
15
|
-
optional?: BitkitFieldProps['optional'];
|
|
16
11
|
placeholder?: string;
|
|
17
12
|
selectProps?: Omit<SelectRootProps, 'collection' | 'defaultValue' | 'onValueChange' | 'value'>;
|
|
18
13
|
size?: 'md' | 'lg';
|
|
19
14
|
state?: 'disabled' | 'error' | 'readOnly' | 'warning';
|
|
20
|
-
tooltip?: BitkitFieldProps['tooltip'];
|
|
21
15
|
triggerProps?: BitkitSelectTriggerProps;
|
|
22
16
|
value?: string;
|
|
23
|
-
warningText?: BitkitFieldProps['warningText'];
|
|
24
17
|
} & BitkitSelectMenuCreateItemProps & BitkitSelectMenuSearchProps;
|
|
25
18
|
declare const BitkitSelect: import('react').ForwardRefExoticComponent<BitkitSelectProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
26
19
|
export default BitkitSelect;
|
|
@@ -22,46 +22,38 @@ var p = ({ placeholder: e, state: t, size: n }) => {
|
|
|
22
22
|
})
|
|
23
23
|
}) : /* @__PURE__ */ s(d.ValueText, { placeholder: e ?? (t === "readOnly" ? "(not selected)" : "Select an option") });
|
|
24
24
|
}, m = o((a, o) => {
|
|
25
|
-
let { contentProps: f, createItemHref: m, createItemLabel: h, createItemProps: g, defaultValue: _,
|
|
26
|
-
items:
|
|
25
|
+
let { contentProps: f, createItemHref: m, createItemLabel: h, createItemProps: g, defaultValue: _, hasSearch: v, isLoading: y, items: b, onCreateItem: x, onSearchChange: S, onValueChange: C, placeholder: w, selectProps: T, size: E = "md", state: D, triggerProps: O, value: k, ...A } = a, j = u({
|
|
26
|
+
items: b,
|
|
27
27
|
groupBy: (e) => e.group || ""
|
|
28
28
|
});
|
|
29
29
|
return /* @__PURE__ */ s(i, {
|
|
30
|
-
disabled: j === "disabled",
|
|
31
|
-
errorText: v,
|
|
32
|
-
helperText: b,
|
|
33
|
-
invalid: L,
|
|
34
|
-
label: C,
|
|
35
|
-
optional: D,
|
|
36
|
-
readOnly: j === "readOnly",
|
|
37
30
|
ref: o,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
...I,
|
|
31
|
+
state: D,
|
|
32
|
+
...A,
|
|
41
33
|
children: /* @__PURE__ */ c(d.Root, {
|
|
42
|
-
collection:
|
|
43
|
-
size:
|
|
44
|
-
...
|
|
34
|
+
collection: j,
|
|
35
|
+
size: E,
|
|
36
|
+
...T,
|
|
45
37
|
defaultValue: _ ? [_] : void 0,
|
|
46
|
-
onValueChange: (e) =>
|
|
47
|
-
value:
|
|
38
|
+
onValueChange: (e) => C?.(e.value[0]),
|
|
39
|
+
value: k ? [k] : void 0,
|
|
48
40
|
children: [
|
|
49
41
|
/* @__PURE__ */ s(d.HiddenSelect, {}),
|
|
50
42
|
/* @__PURE__ */ c(d.Control, {
|
|
51
43
|
className: "group",
|
|
52
44
|
children: [/* @__PURE__ */ s(d.Trigger, {
|
|
53
|
-
...
|
|
45
|
+
...O,
|
|
54
46
|
children: /* @__PURE__ */ s(p, {
|
|
55
|
-
placeholder:
|
|
56
|
-
size:
|
|
57
|
-
state:
|
|
47
|
+
placeholder: w,
|
|
48
|
+
size: E,
|
|
49
|
+
state: D
|
|
58
50
|
})
|
|
59
51
|
}), /* @__PURE__ */ c(d.IndicatorGroup, { children: [
|
|
60
|
-
|
|
61
|
-
size:
|
|
52
|
+
D === "error" && /* @__PURE__ */ s(d.Indicator, { children: /* @__PURE__ */ s(t, {
|
|
53
|
+
size: E === "lg" ? "24" : "16",
|
|
62
54
|
color: "icon/negative"
|
|
63
55
|
}) }),
|
|
64
|
-
|
|
56
|
+
D === "warning" && /* @__PURE__ */ s(d.Indicator, { children: /* @__PURE__ */ s(n, { size: E === "lg" ? "24" : "16" }) }),
|
|
65
57
|
/* @__PURE__ */ s(d.Indicator, {
|
|
66
58
|
asChild: !0,
|
|
67
59
|
children: /* @__PURE__ */ s(e, {})
|
|
@@ -69,18 +61,18 @@ var p = ({ placeholder: e, state: t, size: n }) => {
|
|
|
69
61
|
] })]
|
|
70
62
|
}),
|
|
71
63
|
/* @__PURE__ */ s(l, { children: /* @__PURE__ */ s(d.Positioner, { children: /* @__PURE__ */ s(r, {
|
|
72
|
-
collection:
|
|
64
|
+
collection: j,
|
|
73
65
|
createItemHref: m,
|
|
74
66
|
createItemLabel: h,
|
|
75
67
|
createItemProps: g,
|
|
76
68
|
contentProps: f,
|
|
77
|
-
isLoading:
|
|
78
|
-
onCreateItem:
|
|
79
|
-
...
|
|
69
|
+
isLoading: y,
|
|
70
|
+
onCreateItem: x,
|
|
71
|
+
...v ? {
|
|
80
72
|
hasSearch: !0,
|
|
81
|
-
onSearchChange:
|
|
73
|
+
onSearchChange: S
|
|
82
74
|
} : { hasSearch: !1 },
|
|
83
|
-
size:
|
|
75
|
+
size: E
|
|
84
76
|
}) }) })
|
|
85
77
|
]
|
|
86
78
|
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CheckboxCheckedChangeDetails, CheckboxGroupProps } from '@chakra-ui/react/checkbox';
|
|
2
|
+
import { BitkitIconComponent } from '../../icons';
|
|
3
|
+
export interface BitkitSelectableTagProps extends Omit<CheckboxGroupProps, 'disabled'> {
|
|
4
|
+
state?: 'disabled';
|
|
5
|
+
}
|
|
6
|
+
export interface BitkitSelectableTagItemProps {
|
|
7
|
+
children: string;
|
|
8
|
+
defaultChecked?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
icon?: BitkitIconComponent;
|
|
11
|
+
onCheckedChange?: (details: CheckboxCheckedChangeDetails) => void;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: import('react').ForwardRefExoticComponent<BitkitSelectableTagProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
15
|
+
Item: import('react').ForwardRefExoticComponent<BitkitSelectableTagItemProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useRecipe as e } from "@chakra-ui/react/styled-system";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { Checkbox as i } from "@chakra-ui/react/checkbox";
|
|
5
|
+
//#region lib/components/BitkitSelectableTag/BitkitSelectableTag.tsx
|
|
6
|
+
var a = t((e, t) => {
|
|
7
|
+
let { children: r, state: a, ...o } = e, s = a === "disabled";
|
|
8
|
+
return /* @__PURE__ */ n(i.Group, {
|
|
9
|
+
ref: t,
|
|
10
|
+
disabled: s,
|
|
11
|
+
gap: "8",
|
|
12
|
+
flexDirection: "row",
|
|
13
|
+
flexWrap: "wrap",
|
|
14
|
+
...o,
|
|
15
|
+
children: r
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
a.displayName = "BitkitSelectableTag";
|
|
19
|
+
var o = t((t, a) => {
|
|
20
|
+
let { children: o, defaultChecked: s, disabled: c, icon: l, onCheckedChange: u, value: d } = t, f = e({ key: "selectableTag" })();
|
|
21
|
+
return /* @__PURE__ */ r(i.Root, {
|
|
22
|
+
css: f,
|
|
23
|
+
defaultChecked: s,
|
|
24
|
+
disabled: c,
|
|
25
|
+
onCheckedChange: u,
|
|
26
|
+
unstyled: !0,
|
|
27
|
+
value: d,
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ n(i.HiddenInput, { ref: a }),
|
|
30
|
+
!!l && /* @__PURE__ */ n(l, { size: "16" }),
|
|
31
|
+
o
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
o.displayName = "BitkitSelectableTagItem";
|
|
36
|
+
var s = Object.assign(a, { Item: o });
|
|
37
|
+
//#endregion
|
|
38
|
+
export { s as default };
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import { FieldRootProps } from '@chakra-ui/react/field';
|
|
2
1
|
import { TagsInput } from '@chakra-ui/react/tags-input';
|
|
3
2
|
import { BitkitFieldProps } from '../BitkitField/BitkitField';
|
|
4
|
-
export interface BitkitTagsInputProps extends Omit<
|
|
3
|
+
export interface BitkitTagsInputProps extends Omit<BitkitFieldProps, 'children' | 'state'> {
|
|
5
4
|
addOnPaste?: TagsInput.RootProps['addOnPaste'];
|
|
6
5
|
defaultValue?: string[];
|
|
7
6
|
delimiter?: TagsInput.RootProps['delimiter'];
|
|
8
|
-
errorText?: BitkitFieldProps['errorText'];
|
|
9
|
-
helperText?: BitkitFieldProps['helperText'];
|
|
10
|
-
label?: BitkitFieldProps['label'];
|
|
11
7
|
max?: number;
|
|
12
8
|
onValueChange?: TagsInput.RootProps['onValueChange'];
|
|
13
|
-
optional?: BitkitFieldProps['optional'];
|
|
14
9
|
placeholder?: string;
|
|
15
10
|
size?: 'md' | 'lg';
|
|
16
11
|
state?: 'disabled' | 'error' | 'readOnly' | 'warning';
|
|
17
|
-
tooltip?: BitkitFieldProps['tooltip'];
|
|
18
12
|
validate?: TagsInput.RootProps['validate'];
|
|
19
13
|
value?: string[];
|
|
20
|
-
warningText?: BitkitFieldProps['warningText'];
|
|
21
14
|
}
|
|
22
15
|
declare const BitkitTagsInput: import('react').ForwardRefExoticComponent<BitkitTagsInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
16
|
export default BitkitTagsInput;
|
|
@@ -8,50 +8,42 @@ import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
|
8
8
|
import { TagsInput as l } from "@chakra-ui/react/tags-input";
|
|
9
9
|
//#region lib/components/BitkitTagsInput/BitkitTagsInput.tsx
|
|
10
10
|
var u = o((o, u) => {
|
|
11
|
-
let { addOnPaste: d, defaultValue: f, delimiter: p = " ",
|
|
12
|
-
return
|
|
11
|
+
let { addOnPaste: d, defaultValue: f, delimiter: p = " ", max: m, onValueChange: h, placeholder: g, size: _ = "lg", state: v, validate: y, value: b, ...x } = o, S = a({ key: "tagsInput" })({ size: _ }), C = v === "warning" || !!x.warningText, w = v === "error" || !!x.errorText, T = v === "disabled", E = v === "readOnly", D;
|
|
12
|
+
return w ? D = /* @__PURE__ */ s(t, {
|
|
13
13
|
color: "icon/negative",
|
|
14
|
-
size:
|
|
15
|
-
}) :
|
|
14
|
+
size: _ === "lg" ? "24" : "16"
|
|
15
|
+
}) : C && (D = /* @__PURE__ */ s(n, {
|
|
16
16
|
color: "icon/warning",
|
|
17
|
-
size:
|
|
17
|
+
size: _ === "lg" ? "24" : "16"
|
|
18
18
|
})), /* @__PURE__ */ s(l.Root, {
|
|
19
19
|
addOnPaste: d,
|
|
20
20
|
defaultValue: f,
|
|
21
21
|
delimiter: p,
|
|
22
|
-
disabled:
|
|
23
|
-
invalid:
|
|
24
|
-
max:
|
|
25
|
-
onValueChange:
|
|
26
|
-
readOnly:
|
|
27
|
-
size:
|
|
28
|
-
validate:
|
|
29
|
-
value:
|
|
22
|
+
disabled: T,
|
|
23
|
+
invalid: w,
|
|
24
|
+
max: m,
|
|
25
|
+
onValueChange: h,
|
|
26
|
+
readOnly: E,
|
|
27
|
+
size: _,
|
|
28
|
+
validate: y,
|
|
29
|
+
value: b,
|
|
30
30
|
children: /* @__PURE__ */ s(l.Context, { children: ({ value: t }) => /* @__PURE__ */ c(r, {
|
|
31
|
-
counterText:
|
|
32
|
-
disabled: j,
|
|
33
|
-
errorText: m,
|
|
34
|
-
helperText: h,
|
|
35
|
-
invalid: A,
|
|
36
|
-
label: g,
|
|
37
|
-
optional: y,
|
|
38
|
-
readOnly: M,
|
|
31
|
+
counterText: m === void 0 ? void 0 : `${t.length}/${m}`,
|
|
39
32
|
ref: u,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
...D,
|
|
33
|
+
state: v,
|
|
34
|
+
...x,
|
|
43
35
|
children: [/* @__PURE__ */ c(l.Control, { children: [/* @__PURE__ */ c(i.div, {
|
|
44
|
-
css:
|
|
36
|
+
css: S.tagsBlock,
|
|
45
37
|
children: [t.map((t, n) => /* @__PURE__ */ c(l.Item, {
|
|
46
38
|
index: n,
|
|
47
39
|
value: t,
|
|
48
|
-
children: [/* @__PURE__ */ c(l.ItemPreview, { children: [/* @__PURE__ */ s(l.ItemText, { children: t }), !
|
|
49
|
-
}, t)), /* @__PURE__ */ s(l.Input, { placeholder:
|
|
50
|
-
}), (
|
|
51
|
-
css:
|
|
52
|
-
children: [
|
|
53
|
-
css:
|
|
54
|
-
children: /* @__PURE__ */ s(e, { size:
|
|
40
|
+
children: [/* @__PURE__ */ c(l.ItemPreview, { children: [/* @__PURE__ */ s(l.ItemText, { children: t }), !E && /* @__PURE__ */ s(l.ItemDeleteTrigger, { children: /* @__PURE__ */ s(e, { size: "16" }) })] }), /* @__PURE__ */ s(l.ItemInput, {})]
|
|
41
|
+
}, t)), /* @__PURE__ */ s(l.Input, { placeholder: g })]
|
|
42
|
+
}), (D || t.length > 0 && !T && !E) && /* @__PURE__ */ c(i.div, {
|
|
43
|
+
css: S.suffixBlock,
|
|
44
|
+
children: [D, t.length > 0 && !T && !E && /* @__PURE__ */ s(l.ClearTrigger, {
|
|
45
|
+
css: S.clearTrigger,
|
|
46
|
+
children: /* @__PURE__ */ s(e, { size: _ === "lg" ? "24" : "16" })
|
|
55
47
|
})]
|
|
56
48
|
})] }), /* @__PURE__ */ s(l.HiddenInput, {})]
|
|
57
49
|
}) })
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import { FieldRootProps } from '@chakra-ui/react/field';
|
|
2
1
|
import { InputProps } from '@chakra-ui/react/input';
|
|
3
2
|
import { BitkitFieldProps } from '../BitkitField/BitkitField';
|
|
4
|
-
export interface BitkitTextInputProps extends
|
|
3
|
+
export interface BitkitTextInputProps extends Omit<BitkitFieldProps, 'children' | 'state'> {
|
|
5
4
|
counter?: boolean;
|
|
6
|
-
errorText?: BitkitFieldProps['errorText'];
|
|
7
|
-
helperText?: BitkitFieldProps['helperText'];
|
|
8
5
|
inputProps?: InputProps;
|
|
9
|
-
label?: BitkitFieldProps['label'];
|
|
10
6
|
maxLength?: HTMLInputElement['maxLength'];
|
|
11
|
-
optional?: BitkitFieldProps['optional'];
|
|
12
7
|
placeholder?: string;
|
|
13
8
|
size?: 'md' | 'lg';
|
|
14
9
|
state?: 'disabled' | 'error' | 'readOnly' | 'warning';
|
|
15
|
-
tooltip?: BitkitFieldProps['tooltip'];
|
|
16
|
-
warningText?: BitkitFieldProps['warningText'];
|
|
17
10
|
}
|
|
18
11
|
declare const BitkitTextInput: import('react').ForwardRefExoticComponent<BitkitTextInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
19
12
|
export default BitkitTextInput;
|