@bitrise/bitkit-v2 0.3.534 → 0.3.535
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/BitkitCombobox/BitkitCombobox.d.ts +1 -1
- package/dist/components/BitkitMultiselect/BitkitMultiselect.d.ts +1 -2
- package/dist/components/BitkitSelect/BitkitSelect.d.ts +1 -1
- package/dist/components/BitkitSelectMenu/BitkitSelectMenuAction.d.ts +2 -2
- package/dist/components/BitkitSelectMenu/BitkitSelectMenuAction.js.map +1 -1
- package/dist/components/BitkitSwitch/components/BitkitSwitchReadOnly.d.ts +1 -1
- package/dist/components/BitkitSwitch/components/BitkitSwitchReadOnly.js +2 -2
- package/dist/components/BitkitSwitch/components/BitkitSwitchReadOnly.js.map +1 -1
- package/package.json +1 -1
|
@@ -57,7 +57,7 @@ declare const _default: import('react').ForwardRefExoticComponent<Omit<BitkitFie
|
|
|
57
57
|
value?: string;
|
|
58
58
|
} & BitkitSelectMenuScrollProps & BitkitSelectMenuEmptyStateProps & BitkitSelectMenuErrorStateProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
59
59
|
Action: {
|
|
60
|
-
(props: import('..').BitkitSelectMenuActionProps):
|
|
60
|
+
(props: import('..').BitkitSelectMenuActionProps): import('react').JSX.Element;
|
|
61
61
|
displayName: string;
|
|
62
62
|
};
|
|
63
63
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SelectRootProps, SelectTriggerProps } from '@chakra-ui/react/select';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
2
|
import { BitkitFieldProps } from '../BitkitField/BitkitField';
|
|
4
3
|
import { BitkitMultiselectMenuItemProps } from '../BitkitMultiselectMenu/BitkitMultiselectMenu';
|
|
5
4
|
import { BitkitSelectMenuEmptyStateProps, BitkitSelectMenuErrorStateProps, BitkitSelectMenuScrollProps, BitkitSelectMenuSearchProps } from '../BitkitSelectMenu/BitkitSelectMenu';
|
|
@@ -40,7 +39,7 @@ declare const _default: import('react').ForwardRefExoticComponent<Omit<BitkitFie
|
|
|
40
39
|
value?: Array<string>;
|
|
41
40
|
} & BitkitSelectMenuSearchProps & BitkitSelectMenuScrollProps & BitkitSelectMenuEmptyStateProps & BitkitSelectMenuErrorStateProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
42
41
|
Action: {
|
|
43
|
-
(props: import('..').BitkitSelectMenuActionProps):
|
|
42
|
+
(props: import('..').BitkitSelectMenuActionProps): import('react').JSX.Element;
|
|
44
43
|
displayName: string;
|
|
45
44
|
};
|
|
46
45
|
};
|
|
@@ -32,7 +32,7 @@ declare const _default: import('react').ForwardRefExoticComponent<Omit<BitkitFie
|
|
|
32
32
|
value?: string;
|
|
33
33
|
} & BitkitSelectMenuSearchProps & BitkitSelectMenuScrollProps & BitkitSelectMenuEmptyStateProps & BitkitSelectMenuErrorStateProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
34
34
|
Action: {
|
|
35
|
-
(props: import('../index.ts').BitkitSelectMenuActionProps):
|
|
35
|
+
(props: import('../index.ts').BitkitSelectMenuActionProps): import('react').JSX.Element;
|
|
36
36
|
displayName: string;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ListCollection } from '@chakra-ui/react/collection';
|
|
2
2
|
import { SystemStyleObject } from '@chakra-ui/react/styled-system';
|
|
3
|
-
import { ReactElement
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
4
|
import { BitkitIconComponent } from '../../icons';
|
|
5
5
|
type BitkitSelectMenuActionCommonProps = {
|
|
6
6
|
/** `ai` colors the icon for an AI action. A disabled action keeps the disabled icon color. */
|
|
@@ -51,7 +51,7 @@ type SelectMenuShellContext = {
|
|
|
51
51
|
declare const SelectMenuShellContextProvider: import('react').Provider<SelectMenuShellContext>;
|
|
52
52
|
export { SelectMenuShellContextProvider };
|
|
53
53
|
declare const BitkitSelectMenuAction: {
|
|
54
|
-
(props: BitkitSelectMenuActionProps):
|
|
54
|
+
(props: BitkitSelectMenuActionProps): import('react').JSX.Element;
|
|
55
55
|
displayName: string;
|
|
56
56
|
};
|
|
57
57
|
export default BitkitSelectMenuAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitSelectMenuAction.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitSelectMenu/BitkitSelectMenuAction.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { type ListCollection } from '@chakra-ui/react/collection';\nimport { chakra, type SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { type KeyboardEvent as ReactKeyboardEvent, type ReactElement
|
|
1
|
+
{"version":3,"file":"BitkitSelectMenuAction.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitSelectMenu/BitkitSelectMenuAction.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { type ListCollection } from '@chakra-ui/react/collection';\nimport { chakra, type SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { type KeyboardEvent as ReactKeyboardEvent, type ReactElement } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport BitkitTooltip from '../BitkitTooltip/BitkitTooltip';\n\ntype BitkitSelectMenuActionCommonProps = {\n /** `ai` colors the icon for an AI action. A disabled action keeps the disabled icon color. */\n colorVariant?: 'ai';\n icon: BitkitIconComponent;\n label: string;\n /**\n * A disabled action stays focusable and keeps taking pointer events (`aria-disabled`, not the\n * native attribute), so the `tooltip` saying why it is unavailable is still reachable. Natively\n * disabled it would be neither hoverable nor tabbable, hiding the explanation in the one state\n * that needs it.\n *\n * This is the only disabled affordance in the menus: an option a user cannot pick is left out\n * of the collection instead, never dimmed.\n */\n state?: 'disabled';\n /** Hover and focus tooltip on the row. On a disabled action, say why it is unavailable. */\n tooltip?: string;\n};\n\nexport type BitkitSelectMenuActionAsButtonProps = BitkitSelectMenuActionCommonProps & {\n href?: undefined;\n isExternal?: undefined;\n onClick: () => void;\n};\n\nexport type BitkitSelectMenuActionAsAnchorProps = BitkitSelectMenuActionCommonProps & {\n href: string;\n isExternal?: boolean;\n onClick?: () => void;\n rel?: string;\n target?: string;\n};\n\nexport type BitkitSelectMenuActionProps = BitkitSelectMenuActionAsButtonProps | BitkitSelectMenuActionAsAnchorProps;\n\nexport type BitkitSelectMenuActionChild = ReactElement<BitkitSelectMenuActionProps> | false | null;\n\nexport type BitkitSelectMenuActionChildren = BitkitSelectMenuActionChild | BitkitSelectMenuActionChild[];\n\nexport type SelectMenuApi = {\n clearHighlightValue: () => void;\n collection: Pick<ListCollection<{ value: string }>, 'firstValue' | 'lastValue'>;\n setHighlightValue: (value: string) => void;\n setOpen: (open: boolean) => void;\n};\n\ntype SelectMenuShellContext = {\n api: SelectMenuApi;\n iconSize: '16' | '24';\n styles: Record<string, SystemStyleObject>;\n};\n\nconst [SelectMenuShellContextProvider, useSelectMenuShellContext] = createContext<SelectMenuShellContext>({\n name: 'SelectMenuShellContext',\n hookName: 'useSelectMenuShellContext',\n providerName:\n '<BitkitSelectMenu />, <BitkitMultiselectMenu />, <BitkitSelect />, <BitkitMultiselect />, or <BitkitCombobox />',\n});\n\nexport { SelectMenuShellContextProvider };\n\nconst listEdgeKeys: Record<string, 'firstValue' | 'lastValue' | undefined> = {\n ArrowDown: 'firstValue',\n ArrowUp: 'lastValue',\n End: 'lastValue',\n Home: 'firstValue',\n};\n\nconst actionStepKeys: Record<string, 1 | -1 | undefined> = {\n ArrowDown: 1,\n ArrowUp: -1,\n};\n\nconst BitkitSelectMenuAction = (props: BitkitSelectMenuActionProps) => {\n const { colorVariant, href, icon: Icon, label, onClick, state, tooltip } = props;\n const { api, iconSize, styles } = useSelectMenuShellContext();\n\n const rowProps = {\n 'data-color-variant': colorVariant,\n 'data-select-menu-action': '',\n onFocus: api.clearHighlightValue,\n onKeyDown: (event: ReactKeyboardEvent) => {\n if (event.key === 'Tab' || event.key === 'Escape') return;\n event.stopPropagation();\n\n // Up and Down step between the actions first, and leave them for the list only past the first\n // or the last one.\n const step = actionStepKeys[event.key];\n if (step) {\n const actions = Array.from(\n event.currentTarget\n .closest('[data-select-menu-actions]')\n ?.querySelectorAll<HTMLElement>('[data-select-menu-action]') ?? [],\n );\n const next = actions[actions.indexOf(event.currentTarget as HTMLElement) + step];\n if (next) {\n event.preventDefault();\n next.focus();\n return;\n }\n }\n\n const edge = listEdgeKeys[event.key];\n const value = edge && api.collection[edge];\n if (!value) return;\n\n event.preventDefault();\n const content = event.currentTarget.closest<HTMLElement>('[data-part=\"content\"]');\n (content?.querySelector<HTMLElement>('input') ?? content)?.focus();\n api.setHighlightValue(value);\n },\n };\n\n const content = (\n <>\n <Icon size={iconSize} />\n {label}\n </>\n );\n\n const asRow = (row: ReactElement) => (tooltip ? <BitkitTooltip text={tooltip}>{row}</BitkitTooltip> : row);\n\n if (state === 'disabled') {\n return asRow(\n // A button even for an `href` action: dropping the attribute is the only thing that stops a\n // middle click or \"open link in new tab\" from navigating anyway, and an anchor without one\n // leaves the tab order, taking the tooltip with it.\n <chakra.button\n type=\"button\"\n aria-disabled=\"true\"\n css={styles.action}\n // `_disabled` matches `[aria-disabled=true]` by itself, but `_hover`/`_active` only\n // exclude `:disabled` and `[data-disabled]`, so without this the row still lights up.\n data-disabled=\"\"\n {...rowProps}\n >\n {content}\n </chakra.button>,\n );\n }\n\n if (href !== undefined) {\n const { isExternal, rel, target } = props;\n const effectiveTarget = isExternal ? '_blank' : target;\n const effectiveRel = isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel;\n\n return asRow(\n <chakra.a\n href={href}\n target={effectiveTarget}\n rel={effectiveRel}\n css={styles.action}\n onClick={onClick}\n {...rowProps}\n >\n {content}\n </chakra.a>,\n );\n }\n\n return asRow(\n <chakra.button type=\"button\" css={styles.action} onClick={onClick} {...rowProps}>\n {content}\n </chakra.button>,\n );\n};\n\nBitkitSelectMenuAction.displayName = 'BitkitSelectMenu.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,MAAM;EAAU,UAAA;CAAmB,CAAA,IAAI;CAEtG,IAAI,UAAU,YACZ,OAAO,MAIL,oBAAC,OAAO,QAAR;EACE,MAAK;EACL,iBAAc;EACd,KAAK,OAAO;EAGZ,iBAAc;EACd,GAAI;EAEH,UAAA;CACY,CAAA,CACjB;CAGF,IAAI,SAAS,KAAA,GAAW;EACtB,MAAM,EAAE,YAAY,KAAK,WAAW;EACpC,MAAM,kBAAkB,aAAa,WAAW;EAChD,MAAM,eAAe,aAAc,MAAM,GAAG,IAAI,wBAAwB,wBAAyB;EAEjG,OAAO,MACL,oBAAC,OAAO,GAAR;GACQ;GACN,QAAQ;GACR,KAAK;GACL,KAAK,OAAO;GACH;GACT,GAAI;GAEH,UAAA;EACO,CAAA,CACZ;CACF;CAEA,OAAO,MACL,oBAAC,OAAO,QAAR;EAAe,MAAK;EAAS,KAAK,OAAO;EAAiB;EAAS,GAAI;EACpE,UAAA;CACY,CAAA,CACjB;AACF;AAEA,uBAAuB,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BitkitSwitchProps } from '../BitkitSwitch.types';
|
|
2
2
|
type Props = Pick<BitkitSwitchProps, 'state' | 'children'>;
|
|
3
|
-
declare const BitkitSwitchReadOnly: ({ state, children }: Props) =>
|
|
3
|
+
declare const BitkitSwitchReadOnly: ({ state, children }: Props) => import('react').JSX.Element;
|
|
4
4
|
export default BitkitSwitchReadOnly;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BitkitBadge from "../../BitkitBadge/BitkitBadge.js";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useSwitchContext } from "@chakra-ui/react/switch";
|
|
4
4
|
// lib/components/BitkitSwitch/components/BitkitSwitchReadOnly.tsx
|
|
5
5
|
var BitkitSwitchReadOnly = ({ state, children }) => {
|
|
@@ -14,7 +14,7 @@ var BitkitSwitchReadOnly = ({ state, children }) => {
|
|
|
14
14
|
variant: "subtle",
|
|
15
15
|
children: "OFF"
|
|
16
16
|
});
|
|
17
|
-
return children;
|
|
17
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
18
18
|
};
|
|
19
19
|
export { BitkitSwitchReadOnly as default };
|
|
20
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitSwitchReadOnly.js","names":[],"sources":["../../../../lib/components/BitkitSwitch/components/BitkitSwitchReadOnly.tsx"],"sourcesContent":["import { useSwitchContext } from '@chakra-ui/react/switch';\n\nimport BitkitBadge from '../../BitkitBadge/BitkitBadge';\nimport { type BitkitSwitchProps } from '../BitkitSwitch.types';\n\ntype Props = Pick<BitkitSwitchProps, 'state' | 'children'>;\n\nconst BitkitSwitchReadOnly = ({ state, children }: Props) => {\n const { checked } = useSwitchContext();\n\n if (state === 'readOnly' && checked) {\n return (\n <BitkitBadge colorVariant=\"green\" variant=\"subtle\">\n ON\n </BitkitBadge>\n );\n }\n\n if (state === 'readOnly' && !checked) {\n return (\n <BitkitBadge colorVariant=\"neutral\" variant=\"subtle\">\n OFF\n </BitkitBadge>\n );\n }\n\n return children
|
|
1
|
+
{"version":3,"file":"BitkitSwitchReadOnly.js","names":["_Fragment"],"sources":["../../../../lib/components/BitkitSwitch/components/BitkitSwitchReadOnly.tsx"],"sourcesContent":["import { useSwitchContext } from '@chakra-ui/react/switch';\n\nimport BitkitBadge from '../../BitkitBadge/BitkitBadge';\nimport { type BitkitSwitchProps } from '../BitkitSwitch.types';\n\ntype Props = Pick<BitkitSwitchProps, 'state' | 'children'>;\n\nconst BitkitSwitchReadOnly = ({ state, children }: Props) => {\n const { checked } = useSwitchContext();\n\n if (state === 'readOnly' && checked) {\n return (\n <BitkitBadge colorVariant=\"green\" variant=\"subtle\">\n ON\n </BitkitBadge>\n );\n }\n\n if (state === 'readOnly' && !checked) {\n return (\n <BitkitBadge colorVariant=\"neutral\" variant=\"subtle\">\n OFF\n </BitkitBadge>\n );\n }\n\n return <>{children}</>;\n};\n\nexport default BitkitSwitchReadOnly;\n"],"mappings":";;;;AAOA,IAAM,wBAAwB,EAAE,OAAO,eAAsB;CAC3D,MAAM,EAAE,YAAY,iBAAiB;CAErC,IAAI,UAAU,cAAc,SAC1B,OACE,oBAAC,aAAD;EAAa,cAAa;EAAQ,SAAQ;EAAS,UAAA;CAEtC,CAAA;CAIjB,IAAI,UAAU,cAAc,CAAC,SAC3B,OACE,oBAAC,aAAD;EAAa,cAAa;EAAU,SAAQ;EAAS,UAAA;CAExC,CAAA;CAIjB,OAAO,oBAAAA,UAAA,EAAG,SAAW,CAAA;AACvB"}
|