@bitrise/bitkit-v2 0.3.174 → 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/BitkitLink/BitkitLink.d.ts +3 -1
- package/dist/components/BitkitLink/BitkitLink.js +8 -5
- 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 +8 -8
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createSlotRecipeContext as e } from "@chakra-ui/react/styled-system";
|
|
2
|
+
import { ImageCropper as t, useImageCropperContext as n } from "@ark-ui/react/image-cropper";
|
|
3
|
+
//#region lib/atoms/ImageCropper/ImageCropper.tsx
|
|
4
|
+
var { withProvider: r, withContext: i, useStyles: a } = e({ key: "imageCropper" }), o = r(i(t.Root, "root", {
|
|
5
|
+
forwardAsChild: !0,
|
|
6
|
+
forwardProps: [
|
|
7
|
+
"aspectRatio",
|
|
8
|
+
"minWidth",
|
|
9
|
+
"minHeight",
|
|
10
|
+
"maxWidth",
|
|
11
|
+
"maxHeight"
|
|
12
|
+
]
|
|
13
|
+
}), "root", { forwardProps: [
|
|
14
|
+
"aspectRatio",
|
|
15
|
+
"minWidth",
|
|
16
|
+
"minHeight",
|
|
17
|
+
"maxWidth",
|
|
18
|
+
"maxHeight"
|
|
19
|
+
] }), s = i(t.Viewport, "viewport", { forwardAsChild: !0 }), c = i(t.Image, "image", { forwardAsChild: !0 }), l = i(t.Selection, "selection", { forwardAsChild: !0 }), u = i(t.Handle, "handle", {
|
|
20
|
+
forwardAsChild: !0,
|
|
21
|
+
forwardProps: ["position"]
|
|
22
|
+
}), d = i(t.Grid, "grid", { forwardAsChild: !0 }), f = {
|
|
23
|
+
handles: t.handles,
|
|
24
|
+
Root: o,
|
|
25
|
+
Viewport: s,
|
|
26
|
+
Image: c,
|
|
27
|
+
Selection: l,
|
|
28
|
+
Handle: u,
|
|
29
|
+
Grid: d
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { f as default, n as useImageCropperContext };
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
interface BaseProps {
|
|
2
2
|
children: string;
|
|
3
|
-
disableTooltip?: boolean;
|
|
4
3
|
size?: 'md' | 'lg';
|
|
5
|
-
startingHeight?: number;
|
|
6
4
|
textToCopy?: string;
|
|
7
|
-
variant: 'inline' | 'multi' | 'single';
|
|
8
5
|
}
|
|
6
|
+
interface InlineProps extends BaseProps {
|
|
7
|
+
interactive?: boolean;
|
|
8
|
+
startingHeight?: never;
|
|
9
|
+
variant: 'inline';
|
|
10
|
+
}
|
|
11
|
+
interface BlockProps extends BaseProps {
|
|
12
|
+
interactive?: never;
|
|
13
|
+
startingHeight?: number;
|
|
14
|
+
variant: 'multi' | 'single';
|
|
15
|
+
}
|
|
16
|
+
export type BitkitCodeSnippetProps = InlineProps | BlockProps;
|
|
9
17
|
declare const BitkitCodeSnippet: import('react').ForwardRefExoticComponent<BitkitCodeSnippetProps & import('react').RefAttributes<HTMLElement>>;
|
|
10
18
|
export default BitkitCodeSnippet;
|
|
@@ -3,80 +3,85 @@ import t from "../../icons/IconCheck.js";
|
|
|
3
3
|
import n from "../../icons/IconCopy.js";
|
|
4
4
|
import r from "../BitkitTooltip/BitkitTooltip.js";
|
|
5
5
|
import { chakra as i, useSlotRecipe as a } from "@chakra-ui/react/styled-system";
|
|
6
|
-
import { forwardRef as o,
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { useClipboard as
|
|
6
|
+
import { forwardRef as o, useState as s } from "react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import { useClipboard as u } from "@ark-ui/react/clipboard";
|
|
9
9
|
//#region lib/components/BitkitCodeSnippet/BitkitCodeSnippet.tsx
|
|
10
|
-
var
|
|
11
|
-
let { children:
|
|
10
|
+
var d = "Copy to clipboard", f = o((o, f) => {
|
|
11
|
+
let { children: p, interactive: m, size: h = "lg", startingHeight: g, textToCopy: _, variant: v } = o, y = g !== void 0, [b, x] = s(!1), { copied: S, copy: C } = u({
|
|
12
12
|
timeout: 2e3,
|
|
13
|
-
value:
|
|
14
|
-
}),
|
|
15
|
-
size:
|
|
16
|
-
variant:
|
|
17
|
-
hasShowMore:
|
|
18
|
-
isExpanded:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
value: _ ?? p
|
|
14
|
+
}), w = a({ key: "codeSnippet" })({
|
|
15
|
+
size: h,
|
|
16
|
+
variant: v,
|
|
17
|
+
hasShowMore: y,
|
|
18
|
+
isExpanded: b,
|
|
19
|
+
interactive: m
|
|
20
|
+
}), T = () => {
|
|
21
|
+
x((e) => !e);
|
|
22
|
+
}, E = (e) => {
|
|
23
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), C());
|
|
24
|
+
}, D = /* @__PURE__ */ c(i.button, {
|
|
25
|
+
"aria-label": d,
|
|
26
|
+
css: w.copyButton,
|
|
27
|
+
onClick: C,
|
|
28
|
+
type: "button",
|
|
29
|
+
children: c(S ? t : n, { size: "16" })
|
|
26
30
|
});
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
onKeyDown: (e) => {
|
|
35
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), w());
|
|
36
|
-
},
|
|
31
|
+
if (v === "inline") return m ? /* @__PURE__ */ c(r, {
|
|
32
|
+
text: d,
|
|
33
|
+
children: /* @__PURE__ */ c(i.code, {
|
|
34
|
+
ref: f,
|
|
35
|
+
css: w.root,
|
|
36
|
+
onClick: C,
|
|
37
|
+
onKeyDown: E,
|
|
37
38
|
role: "button",
|
|
38
39
|
tabIndex: 0,
|
|
39
|
-
children:
|
|
40
|
+
children: p
|
|
40
41
|
})
|
|
42
|
+
}) : /* @__PURE__ */ c(i.code, {
|
|
43
|
+
ref: f,
|
|
44
|
+
css: w.root,
|
|
45
|
+
children: p
|
|
41
46
|
});
|
|
42
|
-
if (
|
|
43
|
-
ref:
|
|
44
|
-
css:
|
|
45
|
-
children: [/* @__PURE__ */
|
|
46
|
-
css:
|
|
47
|
+
if (v === "single") return /* @__PURE__ */ l(i.div, {
|
|
48
|
+
ref: f,
|
|
49
|
+
css: w.root,
|
|
50
|
+
children: [/* @__PURE__ */ c(i.code, {
|
|
51
|
+
css: w.content,
|
|
47
52
|
tabIndex: -1,
|
|
48
|
-
children:
|
|
49
|
-
}), /* @__PURE__ */
|
|
50
|
-
text:
|
|
53
|
+
children: p
|
|
54
|
+
}), /* @__PURE__ */ c(r, {
|
|
55
|
+
text: d,
|
|
51
56
|
children: D
|
|
52
57
|
})]
|
|
53
58
|
});
|
|
54
|
-
let O =
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
ref:
|
|
57
|
-
css:
|
|
59
|
+
let O = y && !b ? g : void 0;
|
|
60
|
+
return /* @__PURE__ */ l(i.div, {
|
|
61
|
+
ref: f,
|
|
62
|
+
css: w.root,
|
|
58
63
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
css:
|
|
64
|
+
/* @__PURE__ */ c(i.code, {
|
|
65
|
+
css: w.content,
|
|
61
66
|
maxHeight: O,
|
|
62
67
|
tabIndex: -1,
|
|
63
|
-
children:
|
|
68
|
+
children: p
|
|
64
69
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
text:
|
|
70
|
+
/* @__PURE__ */ c(r, {
|
|
71
|
+
text: d,
|
|
67
72
|
children: D
|
|
68
73
|
}),
|
|
69
|
-
|
|
70
|
-
css:
|
|
71
|
-
children: [!
|
|
72
|
-
onClick:
|
|
73
|
-
css:
|
|
74
|
-
children: [
|
|
74
|
+
y && /* @__PURE__ */ l(i.div, {
|
|
75
|
+
css: w.showMoreContainer,
|
|
76
|
+
children: [!b && /* @__PURE__ */ c(i.div, { css: w.showMoreGradient }), /* @__PURE__ */ l(i.button, {
|
|
77
|
+
onClick: T,
|
|
78
|
+
css: w.showMoreButton,
|
|
79
|
+
children: [b ? "Show less" : "Show more", /* @__PURE__ */ c(e, { "data-state": b ? "open" : "closed" })]
|
|
75
80
|
})]
|
|
76
81
|
})
|
|
77
82
|
]
|
|
78
83
|
});
|
|
79
84
|
});
|
|
80
|
-
|
|
85
|
+
f.displayName = "BitkitCodeSnippet";
|
|
81
86
|
//#endregion
|
|
82
|
-
export {
|
|
87
|
+
export { f as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CollapsibleRootProps } from '@chakra-ui/react/collapsible';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BitkitLabelProps } from '../BitkitLabel/BitkitLabel';
|
|
4
|
+
type UncontrolledProps = {
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
open?: never;
|
|
7
|
+
onOpenChange?: never;
|
|
8
|
+
};
|
|
9
|
+
type ControlledProps = {
|
|
10
|
+
defaultOpen?: never;
|
|
11
|
+
onOpenChange: (open: boolean) => void;
|
|
12
|
+
open: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type BitkitCollapsibleProps = Omit<CollapsibleRootProps, 'collapsedHeight' | 'defaultOpen' | 'onOpenChange' | 'open'> & {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
closedLabel?: string;
|
|
17
|
+
collapsedHeight?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
labelProps?: Omit<BitkitLabelProps, 'children'>;
|
|
20
|
+
openLabel?: string;
|
|
21
|
+
} & (UncontrolledProps | ControlledProps);
|
|
22
|
+
declare const BitkitCollapsible: import('react').ForwardRefExoticComponent<BitkitCollapsibleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export default BitkitCollapsible;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import e from "../../icons/IconChevronDown.js";
|
|
2
|
+
import t from "../../icons/IconChevronUp.js";
|
|
3
|
+
import n from "../BitkitLabel/BitkitLabel.js";
|
|
4
|
+
import { useSlotRecipe as r } from "@chakra-ui/react/styled-system";
|
|
5
|
+
import { forwardRef as i } from "react";
|
|
6
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import { Collapsible as c } from "@chakra-ui/react/collapsible";
|
|
8
|
+
//#region lib/components/BitkitCollapsible/BitkitCollapsible.tsx
|
|
9
|
+
var l = i((i, l) => {
|
|
10
|
+
let { children: u, closedLabel: d = "Show less", collapsedHeight: f = "48px", defaultOpen: p, label: m, labelProps: h, onOpenChange: g, open: _, openLabel: v = "Show more", ...y } = i, b = r({ key: "collapsible" })(), x = g ? (e) => g(e.open) : void 0;
|
|
11
|
+
return /* @__PURE__ */ s(c.Root, {
|
|
12
|
+
ref: l,
|
|
13
|
+
collapsedHeight: f,
|
|
14
|
+
css: b.root,
|
|
15
|
+
defaultOpen: p,
|
|
16
|
+
onOpenChange: x,
|
|
17
|
+
open: _,
|
|
18
|
+
...y,
|
|
19
|
+
children: [
|
|
20
|
+
m && /* @__PURE__ */ o(n, {
|
|
21
|
+
...h,
|
|
22
|
+
children: m
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ o(c.Content, {
|
|
25
|
+
css: b.content,
|
|
26
|
+
children: u
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ o(c.Trigger, {
|
|
29
|
+
css: b.trigger,
|
|
30
|
+
children: /* @__PURE__ */ o(c.Context, { children: (n) => /* @__PURE__ */ s(a, { children: [n.open ? d : v, n.open ? /* @__PURE__ */ o(t, { size: "16" }) : /* @__PURE__ */ o(e, { size: "16" })] }) })
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
l.displayName = "BitkitCollapsible";
|
|
36
|
+
//#endregion
|
|
37
|
+
export { l as default };
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import { ComboboxRootProps } from '@chakra-ui/react/combobox';
|
|
2
|
-
import { FieldRootProps } from '@chakra-ui/react/field';
|
|
3
2
|
import { BitkitFieldProps } from '../BitkitField/BitkitField';
|
|
4
3
|
import { BitkitSelectContentProps, BitkitSelectMenuCreateItemProps, BitkitSelectMenuItemProps, BitkitSelectMenuSearchProps } from '../BitkitSelectMenu/BitkitSelectMenu';
|
|
5
|
-
export type BitkitComboboxProps =
|
|
4
|
+
export type BitkitComboboxProps = Omit<BitkitFieldProps, 'children' | 'state'> & {
|
|
6
5
|
comboboxProps?: ComboboxRootProps;
|
|
7
6
|
contentProps?: BitkitSelectContentProps;
|
|
8
|
-
errorText?: BitkitFieldProps['errorText'];
|
|
9
|
-
helperText?: BitkitFieldProps['helperText'];
|
|
10
7
|
isLoading?: boolean;
|
|
11
8
|
items: Array<BitkitSelectMenuItemProps>;
|
|
12
|
-
label?: BitkitFieldProps['label'];
|
|
13
|
-
optional?: BitkitFieldProps['optional'];
|
|
14
9
|
placeholder?: string;
|
|
15
10
|
size?: 'md' | 'lg';
|
|
16
|
-
state?: '
|
|
17
|
-
tooltip?: BitkitFieldProps['tooltip'];
|
|
18
|
-
warningText?: BitkitFieldProps['warningText'];
|
|
11
|
+
state?: 'disabled' | 'error' | 'readOnly' | 'warning';
|
|
19
12
|
} & BitkitSelectMenuCreateItemProps & BitkitSelectMenuSearchProps;
|
|
20
13
|
declare const BitkitCombobox: import('react').ForwardRefExoticComponent<BitkitComboboxProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
21
14
|
export default BitkitCombobox;
|
|
@@ -14,64 +14,56 @@ import { useListCollection as p } from "@chakra-ui/react/hooks";
|
|
|
14
14
|
import { useFilter as m } from "@chakra-ui/react/locale";
|
|
15
15
|
//#region lib/components/BitkitCombobox/BitkitCombobox.tsx
|
|
16
16
|
var h = c((c, h) => {
|
|
17
|
-
let { comboboxProps: g, contentProps: _, createItemHref: v, createItemLabel: y, createItemProps: b,
|
|
18
|
-
initialItems:
|
|
19
|
-
filter: (e, t, n) =>
|
|
20
|
-
}),
|
|
21
|
-
return
|
|
22
|
-
size:
|
|
17
|
+
let { comboboxProps: g, contentProps: _, createItemHref: v, createItemLabel: y, createItemProps: b, hasSearch: x, isLoading: S, items: C, onCreateItem: w, onSearchChange: T, placeholder: E = "Enter a value or select", size: D, state: O, ...k } = c, { contains: A } = m({ sensitivity: "base" }), { collection: j, filter: M } = p({
|
|
18
|
+
initialItems: C,
|
|
19
|
+
filter: (e, t, n) => A(n.label, t)
|
|
20
|
+
}), N = o({ key: "combobox" })({ size: D }), P = O === "warning" || !!k.warningText, F = O === "error" || !!k.errorText, I = D === "md" ? "16" : "24", L;
|
|
21
|
+
return F ? L = /* @__PURE__ */ l(t, {
|
|
22
|
+
size: I,
|
|
23
23
|
color: "icon/negative"
|
|
24
|
-
}) :
|
|
25
|
-
disabled: M === "disabled",
|
|
26
|
-
errorText: x,
|
|
27
|
-
helperText: C,
|
|
28
|
-
invalid: V,
|
|
29
|
-
label: E,
|
|
30
|
-
optional: k,
|
|
31
|
-
readOnly: M === "readOnly",
|
|
24
|
+
}) : P && (L = /* @__PURE__ */ l(n, { size: I })), /* @__PURE__ */ l(a, {
|
|
32
25
|
ref: h,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...F,
|
|
26
|
+
state: O,
|
|
27
|
+
...k,
|
|
36
28
|
children: /* @__PURE__ */ u(f.Root, {
|
|
37
29
|
...g,
|
|
38
|
-
collection:
|
|
39
|
-
disabled:
|
|
40
|
-
invalid:
|
|
30
|
+
collection: j,
|
|
31
|
+
disabled: O === "disabled",
|
|
32
|
+
invalid: F,
|
|
41
33
|
onInputValueChange: (e) => {
|
|
42
|
-
|
|
34
|
+
M(e.inputValue);
|
|
43
35
|
},
|
|
44
|
-
readOnly:
|
|
45
|
-
size:
|
|
36
|
+
readOnly: O === "readOnly",
|
|
37
|
+
size: D,
|
|
46
38
|
children: [/* @__PURE__ */ u(f.Control, {
|
|
47
39
|
className: "group",
|
|
48
|
-
children: [/* @__PURE__ */ l(f.Input, { placeholder:
|
|
40
|
+
children: [/* @__PURE__ */ l(f.Input, { placeholder: E }), /* @__PURE__ */ u(f.IndicatorGroup, { children: [
|
|
49
41
|
/* @__PURE__ */ l(f.ClearTrigger, {
|
|
50
42
|
asChild: !0,
|
|
51
43
|
children: /* @__PURE__ */ l(r, { size: "sm" })
|
|
52
44
|
}),
|
|
53
|
-
|
|
45
|
+
L,
|
|
54
46
|
/* @__PURE__ */ l(f.Trigger, {
|
|
55
47
|
asChild: !0,
|
|
56
48
|
children: /* @__PURE__ */ l(e, {})
|
|
57
49
|
})
|
|
58
50
|
] })]
|
|
59
51
|
}), /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(f.Positioner, { children: /* @__PURE__ */ u(f.Content, { children: [/* @__PURE__ */ u(f.Empty, { children: ["No items found ", /* @__PURE__ */ l(s, {
|
|
60
|
-
css:
|
|
52
|
+
css: N.emptyHelperText,
|
|
61
53
|
children: "Enter custom value"
|
|
62
54
|
})] }), /* @__PURE__ */ l(i, {
|
|
63
|
-
collection:
|
|
55
|
+
collection: j,
|
|
64
56
|
createItemHref: v,
|
|
65
57
|
createItemLabel: y,
|
|
66
58
|
createItemProps: b,
|
|
67
59
|
contentProps: _,
|
|
68
|
-
isLoading:
|
|
69
|
-
onCreateItem:
|
|
70
|
-
size:
|
|
60
|
+
isLoading: S,
|
|
61
|
+
onCreateItem: w,
|
|
62
|
+
size: D,
|
|
71
63
|
variant: "combobox",
|
|
72
|
-
...
|
|
64
|
+
...x ? {
|
|
73
65
|
hasSearch: !0,
|
|
74
|
-
onSearchChange:
|
|
66
|
+
onSearchChange: T
|
|
75
67
|
} : { hasSearch: !1 }
|
|
76
68
|
})] }) }) })]
|
|
77
69
|
})
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Field } from '@chakra-ui/react/field';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
export interface BitkitFieldProps extends Field.RootProps {
|
|
3
|
+
export interface BitkitFieldProps extends Omit<Field.RootProps, 'disabled' | 'invalid' | 'readOnly'> {
|
|
4
|
+
badge?: ReactNode;
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
counterText?: string;
|
|
6
7
|
errorText?: ReactNode;
|
|
7
8
|
helperText?: ReactNode;
|
|
8
9
|
label?: string;
|
|
9
10
|
optional?: boolean;
|
|
11
|
+
state?: 'disabled' | 'error' | 'readOnly' | 'warning';
|
|
10
12
|
tooltip?: string;
|
|
11
13
|
warningText?: ReactNode;
|
|
12
14
|
}
|
|
@@ -1,50 +1,38 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
import { Field as o } from "@chakra-ui/react/field";
|
|
1
|
+
import e from "../BitkitLabel/BitkitLabel.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { Field as i } from "@chakra-ui/react/field";
|
|
7
5
|
//#region lib/components/BitkitField/BitkitField.tsx
|
|
8
|
-
var
|
|
9
|
-
let {
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
disabled:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
var a = t((t, a) => {
|
|
7
|
+
let { badge: o, counterText: s, children: c, errorText: l, helperText: u, label: d, optional: f, state: p, tooltip: m, warningText: h, ...g } = t, _ = p === "error" || !!l;
|
|
8
|
+
return /* @__PURE__ */ r(i.Root, {
|
|
9
|
+
disabled: p === "disabled",
|
|
10
|
+
invalid: _,
|
|
11
|
+
readOnly: p === "readOnly",
|
|
12
|
+
required: !f,
|
|
13
|
+
ref: a,
|
|
14
|
+
...g,
|
|
15
15
|
children: [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
!!h && /* @__PURE__ */ i(t, {
|
|
25
|
-
text: h ?? "",
|
|
26
|
-
children: /* @__PURE__ */ i(e, {
|
|
27
|
-
size: "16",
|
|
28
|
-
color: "icon/tertiary"
|
|
29
|
-
})
|
|
30
|
-
}),
|
|
31
|
-
c && /* @__PURE__ */ i(n, {
|
|
32
|
-
as: "span",
|
|
33
|
-
marginInlineStart: "auto",
|
|
34
|
-
textStyle: "comp/input/helperText",
|
|
35
|
-
children: c
|
|
16
|
+
d || o || s ? /* @__PURE__ */ n(i.Label, {
|
|
17
|
+
asChild: !0,
|
|
18
|
+
children: /* @__PURE__ */ n(e, {
|
|
19
|
+
badge: o,
|
|
20
|
+
counterText: s,
|
|
21
|
+
optional: f,
|
|
22
|
+
tooltip: m,
|
|
23
|
+
children: d
|
|
36
24
|
})
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
!!
|
|
40
|
-
!!
|
|
25
|
+
}) : null,
|
|
26
|
+
c,
|
|
27
|
+
!!u && !l && !h && /* @__PURE__ */ n(i.HelperText, { children: u }),
|
|
28
|
+
!!h && !l && /* @__PURE__ */ n(i.HelperText, {
|
|
41
29
|
color: "text/body",
|
|
42
|
-
children:
|
|
30
|
+
children: h
|
|
43
31
|
}),
|
|
44
|
-
!!
|
|
32
|
+
!!l && /* @__PURE__ */ n(i.ErrorText, { children: l })
|
|
45
33
|
]
|
|
46
34
|
});
|
|
47
35
|
});
|
|
48
|
-
|
|
36
|
+
a.displayName = "BitkitField";
|
|
49
37
|
//#endregion
|
|
50
|
-
export {
|
|
38
|
+
export { a as default };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { FileUpload } from '@chakra-ui/react/file-upload';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
errorText?: string;
|
|
5
|
-
helperText?: string;
|
|
2
|
+
import { BitkitFieldProps } from '../BitkitField/BitkitField';
|
|
3
|
+
declare const BitkitFileInput: import('react').ForwardRefExoticComponent<Omit<BitkitFieldProps, "children" | "state"> & Omit<FileUpload.RootProps, "disabled" | "invalid"> & {
|
|
6
4
|
aspectRatio?: number;
|
|
7
5
|
onCropChange?: (file: File) => void;
|
|
8
6
|
onFileAccepted?: (file: File) => void;
|
|
7
|
+
state?: "error" | "disabled";
|
|
9
8
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
9
|
export default BitkitFileInput;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import e from "../../icons/IconMinusCircle.js";
|
|
2
|
+
import t from "../../icons/IconUpload.js";
|
|
3
|
+
import n from "../BitkitButton/BitkitButton.js";
|
|
4
|
+
import r from "../BitkitCard/BitkitCard.js";
|
|
5
|
+
import i from "../BitkitField/BitkitField.js";
|
|
6
|
+
import a, { useImageCropperContext as o } from "../../atoms/ImageCropper/ImageCropper.js";
|
|
7
|
+
import { Text as s } from "@chakra-ui/react/text";
|
|
8
|
+
import { forwardRef as c, useEffect as l, useMemo as u } from "react";
|
|
9
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
+
import { FileUpload as m, useFileUploadContext as h } from "@chakra-ui/react/file-upload";
|
|
11
|
+
import { VStack as g } from "@chakra-ui/react/stack";
|
|
12
|
+
import { splitProps as _ } from "@zag-js/file-upload";
|
|
13
|
+
//#region lib/components/BitkitFileInput/BitkitFileInput.tsx
|
|
14
|
+
var v = () => {
|
|
15
|
+
let { disabled: e } = h(), n = e ? "Cannot upload file" : "Drag and drop file here or click to select";
|
|
16
|
+
return /* @__PURE__ */ f(m.Dropzone, { children: /* @__PURE__ */ p(m.DropzoneContent, { children: [/* @__PURE__ */ f(t, {}), /* @__PURE__ */ f(s, {
|
|
17
|
+
as: "span",
|
|
18
|
+
children: n
|
|
19
|
+
})] }) });
|
|
20
|
+
}, y = (e) => {
|
|
21
|
+
let { onCropChange: t } = e, { acceptedFiles: n } = h(), { dragging: r, getCroppedImage: i } = o(), s = n[0], c = u(() => s ? URL.createObjectURL(s) : void 0, [s]);
|
|
22
|
+
return l(() => () => {
|
|
23
|
+
c && URL.revokeObjectURL(c);
|
|
24
|
+
}, [c]), l(() => {
|
|
25
|
+
if (!t || r || !s) return;
|
|
26
|
+
let e = !1;
|
|
27
|
+
return i().then((n) => {
|
|
28
|
+
!e && n instanceof Blob && t(new File([n], s.name, { type: n.type }));
|
|
29
|
+
}), () => {
|
|
30
|
+
e = !0;
|
|
31
|
+
};
|
|
32
|
+
}, [
|
|
33
|
+
i,
|
|
34
|
+
s,
|
|
35
|
+
t,
|
|
36
|
+
r
|
|
37
|
+
]), /* @__PURE__ */ p(a.Viewport, { children: [/* @__PURE__ */ f(a.Image, { src: c }), /* @__PURE__ */ f(a.Selection, { children: a.handles.map((e) => /* @__PURE__ */ f(a.Handle, {
|
|
38
|
+
position: e,
|
|
39
|
+
children: /* @__PURE__ */ f("div", {})
|
|
40
|
+
}, e)) })] });
|
|
41
|
+
}, b = (e) => {
|
|
42
|
+
let { aspectRatio: t, onCropChange: n } = e;
|
|
43
|
+
return /* @__PURE__ */ f(a.Root, {
|
|
44
|
+
aspectRatio: t,
|
|
45
|
+
height: "100%",
|
|
46
|
+
children: /* @__PURE__ */ f(y, { onCropChange: n })
|
|
47
|
+
});
|
|
48
|
+
}, x = () => {
|
|
49
|
+
let t = h(), i = t.acceptedFiles[0];
|
|
50
|
+
return /* @__PURE__ */ p(r, {
|
|
51
|
+
display: "flex",
|
|
52
|
+
elevation: !1,
|
|
53
|
+
paddingBlock: "20",
|
|
54
|
+
paddingInline: "24",
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
flex: "1",
|
|
57
|
+
children: [/* @__PURE__ */ p(g, {
|
|
58
|
+
gap: "4",
|
|
59
|
+
alignItems: "flex-start",
|
|
60
|
+
flex: "1",
|
|
61
|
+
minWidth: "0",
|
|
62
|
+
children: [/* @__PURE__ */ f(s, {
|
|
63
|
+
textStyle: "comp/input/label",
|
|
64
|
+
children: "Selected file"
|
|
65
|
+
}), /* @__PURE__ */ f(s, {
|
|
66
|
+
whiteSpace: "nowrap",
|
|
67
|
+
textOverflow: "ellipsis",
|
|
68
|
+
overflow: "hidden",
|
|
69
|
+
maxWidth: "100%",
|
|
70
|
+
children: i.name
|
|
71
|
+
})]
|
|
72
|
+
}), /* @__PURE__ */ f(n, {
|
|
73
|
+
icon: e,
|
|
74
|
+
variant: "secondary",
|
|
75
|
+
size: "md",
|
|
76
|
+
onClick: t.clearFiles,
|
|
77
|
+
children: "Remove"
|
|
78
|
+
})]
|
|
79
|
+
});
|
|
80
|
+
}, S = (e) => {
|
|
81
|
+
let { variant: t, aspectRatio: n, onCropChange: r } = e, i = h().acceptedFiles[0];
|
|
82
|
+
return /* @__PURE__ */ p(d, { children: [
|
|
83
|
+
!i && /* @__PURE__ */ f(v, {}),
|
|
84
|
+
i && t === "image" && /* @__PURE__ */ f(b, {
|
|
85
|
+
aspectRatio: n,
|
|
86
|
+
onCropChange: r
|
|
87
|
+
}),
|
|
88
|
+
i && t !== "image" && /* @__PURE__ */ f(x, {})
|
|
89
|
+
] });
|
|
90
|
+
}, C = c((e, t) => {
|
|
91
|
+
let { aspectRatio: n, onCropChange: r, onFileAccept: a, onFileAccepted: o, state: s, variant: c, ...l } = e, [u, d] = _(l), h = (e) => {
|
|
92
|
+
a?.(e), o?.(e.files[0]);
|
|
93
|
+
}, g = {
|
|
94
|
+
variant: c,
|
|
95
|
+
aspectRatio: n,
|
|
96
|
+
onCropChange: r
|
|
97
|
+
};
|
|
98
|
+
return /* @__PURE__ */ f(i, {
|
|
99
|
+
ref: t,
|
|
100
|
+
state: s,
|
|
101
|
+
...d,
|
|
102
|
+
children: /* @__PURE__ */ p(m.Root, {
|
|
103
|
+
variant: c,
|
|
104
|
+
onFileAccept: h,
|
|
105
|
+
...u,
|
|
106
|
+
children: [/* @__PURE__ */ f(m.HiddenInput, {}), /* @__PURE__ */ f(S, { ...g })]
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
C.displayName = "BitkitFileInput";
|
|
111
|
+
//#endregion
|
|
112
|
+
export { C as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BoxProps } from '@chakra-ui/react/box';
|
|
2
|
+
import { BitkitIconComponent } from '../../icons';
|
|
3
|
+
export interface BitkitGroupHeadingProps extends Omit<BoxProps, 'icon'> {
|
|
4
|
+
icon?: BitkitIconComponent;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
declare const BitkitGroupHeading: import('react').ForwardRefExoticComponent<BitkitGroupHeadingProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default BitkitGroupHeading;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Box as e } from "@chakra-ui/react/box";
|
|
2
|
+
import { chakra as t, useSlotRecipe as n } from "@chakra-ui/react/styled-system";
|
|
3
|
+
import { forwardRef as r } from "react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { Separator as o } from "@chakra-ui/react/separator";
|
|
6
|
+
//#region lib/components/BitkitGroupHeading/BitkitGroupHeading.tsx
|
|
7
|
+
var s = r((r, s) => {
|
|
8
|
+
let { icon: c, label: l, ...u } = r, d = n({ key: "groupHeading" })();
|
|
9
|
+
return /* @__PURE__ */ a(e, {
|
|
10
|
+
css: d.root,
|
|
11
|
+
ref: s,
|
|
12
|
+
...u,
|
|
13
|
+
children: [/* @__PURE__ */ a(t.div, {
|
|
14
|
+
css: d.titleBlock,
|
|
15
|
+
children: [c && /* @__PURE__ */ i(c, {
|
|
16
|
+
css: d.icon,
|
|
17
|
+
size: "16"
|
|
18
|
+
}), /* @__PURE__ */ i(t.span, {
|
|
19
|
+
css: d.label,
|
|
20
|
+
children: l
|
|
21
|
+
})]
|
|
22
|
+
}), /* @__PURE__ */ i(o, { css: d.separator })]
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
s.displayName = "BitkitGroupHeading";
|
|
26
|
+
//#endregion
|
|
27
|
+
export { s as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLChakraProps } from '@chakra-ui/react/styled-system';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface BitkitLabelProps extends Omit<HTMLChakraProps<'label'>, 'children'> {
|
|
4
|
+
badge?: ReactNode;
|
|
5
|
+
counterText?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
children?: string;
|
|
8
|
+
optional?: boolean;
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const BitkitLabel: import('react').ForwardRefExoticComponent<BitkitLabelProps & import('react').RefAttributes<HTMLLabelElement>>;
|
|
12
|
+
export default BitkitLabel;
|