@bitrise/bitkit-v2 0.3.324 → 0.3.325

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.
@@ -3,10 +3,19 @@ import { BUTTON_COLORS_MAP, ICON_COMPONENTS_MAP } from "../common/notificationMa
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { Alert } from "@chakra-ui/react/alert";
5
5
  //#region lib/components/BitkitAlert/BitkitAlert.tsx
6
+ var ROLE_MAP = {
7
+ ai: "status",
8
+ critical: "alert",
9
+ info: "status",
10
+ progress: "status",
11
+ success: "status",
12
+ warning: "status"
13
+ };
6
14
  var BitkitAlert = (props) => {
7
15
  const { action, dismissible, messageText, onClose, titleText, variant, ...rest } = props;
8
16
  const IconComponent = ICON_COMPONENTS_MAP[variant];
9
17
  return /* @__PURE__ */ jsxs(Alert.Root, {
18
+ role: ROLE_MAP[variant],
10
19
  variant,
11
20
  ...rest,
12
21
  children: [/* @__PURE__ */ jsx(Alert.Indicator, {
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitAlert.js","names":[],"sources":["../../../lib/components/BitkitAlert/BitkitAlert.tsx"],"sourcesContent":["import { Alert, type AlertRootProps } from '@chakra-ui/react/alert';\nimport { type ReactNode } from 'react';\n\nimport { type NotificationVariant } from '../../theme/common/AlertAndToast.common';\nimport { NotificationContent } from '../common/NotificationContent';\nimport { BUTTON_COLORS_MAP, ICON_COMPONENTS_MAP, type NotificationAction } from '../common/notificationMaps';\n\nexport type AlertVariants = NotificationVariant;\nexport type ActionProps = NotificationAction;\n\nexport interface BitkitAlertProps extends AlertRootProps {\n action?: ActionProps;\n dismissible?: boolean;\n messageText: ReactNode;\n onClose?: () => void;\n titleText?: ReactNode;\n variant: AlertVariants;\n}\n\nconst BitkitAlert = (props: BitkitAlertProps) => {\n const { action, dismissible, messageText, onClose, titleText, variant, ...rest } = props;\n const IconComponent = ICON_COMPONENTS_MAP[variant];\n\n return (\n <Alert.Root variant={variant} {...rest}>\n <Alert.Indicator asChild={variant !== 'progress'}>\n <IconComponent />\n </Alert.Indicator>\n <NotificationContent\n action={action}\n colorVariant={BUTTON_COLORS_MAP[variant]}\n dismissible={dismissible}\n messageText={messageText}\n onClose={onClose}\n titleText={titleText}\n />\n </Alert.Root>\n );\n};\n\nexport default BitkitAlert;\n"],"mappings":";;;;;AAmBA,IAAM,eAAe,UAA4B;CAC/C,MAAM,EAAE,QAAQ,aAAa,aAAa,SAAS,WAAW,SAAS,GAAG,SAAS;CACnF,MAAM,gBAAgB,oBAAoB;CAE1C,OACE,qBAAC,MAAM,MAAP;EAAqB;EAAS,GAAI;YAAlC,CACE,oBAAC,MAAM,WAAP;GAAiB,SAAS,YAAY;aACpC,oBAAC,eAAD,CAAgB,CAAA;EACD,CAAA,GACjB,oBAAC,qBAAD;GACU;GACR,cAAc,kBAAkB;GACnB;GACA;GACJ;GACE;EACZ,CAAA,CACS;;AAEhB"}
1
+ {"version":3,"file":"BitkitAlert.js","names":[],"sources":["../../../lib/components/BitkitAlert/BitkitAlert.tsx"],"sourcesContent":["import { Alert, type AlertRootProps } from '@chakra-ui/react/alert';\nimport { type ReactNode } from 'react';\n\nimport { type NotificationVariant } from '../../theme/common/AlertAndToast.common';\nimport { NotificationContent } from '../common/NotificationContent';\nimport { BUTTON_COLORS_MAP, ICON_COMPONENTS_MAP, type NotificationAction } from '../common/notificationMaps';\n\nexport type AlertVariants = NotificationVariant;\nexport type ActionProps = NotificationAction;\n\n// Chakra v3's Alert.Root is a plain <div> with no ARIA semantics (v2's implicit role=\"alert\" was\n// dropped), so a dynamically shown alert wouldn't be announced. Default a live-region role by\n// severity — only `critical` is assertive (interrupts); the rest are polite `status`. A live region\n// only announces on dynamic insertion/change, so this is inert for alerts already present at load.\n// Consumers override `role` (or any aria-* attribute) via `...rest`, which is spread last.\nconst ROLE_MAP: Record<NotificationVariant, 'alert' | 'status'> = {\n ai: 'status',\n critical: 'alert',\n info: 'status',\n progress: 'status',\n success: 'status',\n warning: 'status',\n};\n\nexport interface BitkitAlertProps extends AlertRootProps {\n action?: ActionProps;\n dismissible?: boolean;\n messageText: ReactNode;\n onClose?: () => void;\n titleText?: ReactNode;\n variant: AlertVariants;\n}\n\nconst BitkitAlert = (props: BitkitAlertProps) => {\n const { action, dismissible, messageText, onClose, titleText, variant, ...rest } = props;\n const IconComponent = ICON_COMPONENTS_MAP[variant];\n\n return (\n <Alert.Root role={ROLE_MAP[variant]} variant={variant} {...rest}>\n <Alert.Indicator asChild={variant !== 'progress'}>\n <IconComponent />\n </Alert.Indicator>\n <NotificationContent\n action={action}\n colorVariant={BUTTON_COLORS_MAP[variant]}\n dismissible={dismissible}\n messageText={messageText}\n onClose={onClose}\n titleText={titleText}\n />\n </Alert.Root>\n );\n};\n\nexport default BitkitAlert;\n"],"mappings":";;;;;AAeA,IAAM,WAA4D;CAChE,IAAI;CACJ,UAAU;CACV,MAAM;CACN,UAAU;CACV,SAAS;CACT,SAAS;AACX;AAWA,IAAM,eAAe,UAA4B;CAC/C,MAAM,EAAE,QAAQ,aAAa,aAAa,SAAS,WAAW,SAAS,GAAG,SAAS;CACnF,MAAM,gBAAgB,oBAAoB;CAE1C,OACE,qBAAC,MAAM,MAAP;EAAY,MAAM,SAAS;EAAmB;EAAS,GAAI;YAA3D,CACE,oBAAC,MAAM,WAAP;GAAiB,SAAS,YAAY;aACpC,oBAAC,eAAD,CAAgB,CAAA;EACD,CAAA,GACjB,oBAAC,qBAAD;GACU;GACR,cAAc,kBAAkB;GACnB;GACA;GACJ;GACE;EACZ,CAAA,CACS;;AAEhB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit-v2",
3
3
  "private": false,
4
- "version": "0.3.324",
4
+ "version": "0.3.325",
5
5
  "description": "Bitrise Design System Components built with Chakra UI V3",
6
6
  "keywords": [
7
7
  "react",