@bitrise/bitkit-v2 0.3.74 → 0.3.75

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,19 @@
1
+ import { FieldRootProps } from '@chakra-ui/react/field';
2
+ import { NativeSelectRootProps } from '@chakra-ui/react/native-select';
3
+ import { ReactNode } from 'react';
4
+ import { BitkitFieldProps } from '../BitkitField/BitkitField';
5
+ export interface BitkitSelectProps extends FieldRootProps {
6
+ errorText?: BitkitFieldProps['errorText'];
7
+ helperText?: BitkitFieldProps['helperText'];
8
+ label?: BitkitFieldProps['label'];
9
+ optional?: BitkitFieldProps['optional'];
10
+ placeholder?: string;
11
+ selectProps?: NativeSelectRootProps;
12
+ size?: 'md' | 'lg';
13
+ state?: 'disabled' | 'error' | 'readOnly' | 'warning';
14
+ tooltip?: BitkitFieldProps['tooltip'];
15
+ warningText?: BitkitFieldProps['warningText'];
16
+ children: ReactNode;
17
+ }
18
+ declare const BitkitSelect: import('react').ForwardRefExoticComponent<BitkitSelectProps & import('react').RefAttributes<HTMLDivElement>>;
19
+ export default BitkitSelect;
@@ -0,0 +1,52 @@
1
+ import { jsx as o, jsxs as x } from "react/jsx-runtime";
2
+ import { NativeSelect as n } from "@chakra-ui/react/native-select";
3
+ import { useSlotRecipe as S } from "@chakra-ui/react/styled-system";
4
+ import { forwardRef as y } from "react";
5
+ import k from "../../icons/16x16/IconErrorCircleFilled16.js";
6
+ import F from "../../icons/16x16/IconWarningYellow16.js";
7
+ import b from "../../icons/24x24/IconErrorCircleFilled24.js";
8
+ import B from "../../icons/24x24/IconSelectChevron24.js";
9
+ import C from "../../icons/24x24/IconWarningYellow24.js";
10
+ import N from "../BitkitField/BitkitField.js";
11
+ const R = y((a, d) => {
12
+ const {
13
+ errorText: l,
14
+ helperText: m,
15
+ label: p,
16
+ optional: f,
17
+ placeholder: g,
18
+ selectProps: I,
19
+ size: t = "md",
20
+ state: e,
21
+ tooltip: u,
22
+ warningText: c,
23
+ children: h,
24
+ ...v
25
+ } = a, r = S({ key: "nativeSelect" })(), w = e === "warning" || !!c, s = e === "error" || !!l;
26
+ let i;
27
+ return s ? i = t === "lg" ? /* @__PURE__ */ o(b, { css: r.statusIcon, color: "icon/negative" }) : /* @__PURE__ */ o(k, { css: r.statusIcon, color: "icon/negative" }) : w && (i = t === "lg" ? /* @__PURE__ */ o(C, { css: r.statusIcon, color: "icon/warning" }) : /* @__PURE__ */ o(F, { css: r.statusIcon, color: "icon/warning" })), /* @__PURE__ */ o(
28
+ N,
29
+ {
30
+ disabled: e === "disabled",
31
+ errorText: l,
32
+ helperText: m,
33
+ invalid: s,
34
+ label: p,
35
+ optional: f,
36
+ readOnly: e === "readOnly",
37
+ ref: d,
38
+ tooltip: u,
39
+ warningText: c,
40
+ ...v,
41
+ children: /* @__PURE__ */ x(n.Root, { size: t, ...I, className: "group", children: [
42
+ /* @__PURE__ */ o(n.Field, { placeholder: g, children: h }),
43
+ i,
44
+ /* @__PURE__ */ o(n.Indicator, { children: /* @__PURE__ */ o(B, {}) })
45
+ ] })
46
+ }
47
+ );
48
+ });
49
+ R.displayName = "BitkitSelect";
50
+ export {
51
+ R as default
52
+ };
@@ -3,6 +3,7 @@ export { default as BitkitCloseButton, type BitkitCloseButtonProps } from './Bit
3
3
  export { default as BitkitEmptyState, type BitkitEmptyStateProps } from './BitkitEmptyState/BitkitEmptyState';
4
4
  export { default as BitkitField, type BitkitFieldProps } from './BitkitField/BitkitField';
5
5
  export { default as BitkitNumberInput, type BitkitNumberInputProps } from './BitkitNumberInput/BitkitNumberInput';
6
+ export { default as BitkitSelect, type BitkitSelectProps } from './BitkitSelect/BitkitSelect';
6
7
  export { default as BitkitTextField, type BitkitTextFieldProps } from './BitkitTextField/BitkitTextField';
7
8
  export { default as BitkitToggle, type BitkitToggleProps } from './BitkitToggle';
8
9
  export { default as BitkitTooltip, type BitkitTooltipProps } from './BitkitTooltip/BitkitTooltip';