@bitrise/bitkit-v2 0.3.402-beta.2587 → 0.3.402-beta.2601

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.
Files changed (59) hide show
  1. package/AGENTS.md +1 -1
  2. package/dist/components/BitkitControlButton/BitkitControlButton.js +0 -1
  3. package/dist/components/BitkitControlButton/BitkitControlButton.js.map +1 -1
  4. package/dist/components/BitkitGroupHeading/BitkitGroupHeading.d.ts +0 -2
  5. package/dist/components/BitkitGroupHeading/BitkitGroupHeading.js +11 -15
  6. package/dist/components/BitkitGroupHeading/BitkitGroupHeading.js.map +1 -1
  7. package/dist/components/BitkitList/BitkitList.js +1 -1
  8. package/dist/components/BitkitList/BitkitList.js.map +1 -1
  9. package/dist/components/BitkitSidebar/BitkitSidebar.d.ts +45 -0
  10. package/dist/components/BitkitSidebar/BitkitSidebar.js +147 -0
  11. package/dist/components/BitkitSidebar/BitkitSidebar.js.map +1 -0
  12. package/dist/components/BitkitTable/BitkitBulkActionsRow.d.ts +6 -6
  13. package/dist/components/BitkitTable/BitkitBulkActionsRow.js +7 -7
  14. package/dist/components/BitkitTable/BitkitBulkActionsRow.js.map +1 -1
  15. package/dist/components/BitkitTable/BitkitDefinitionColumnHeader.d.ts +2 -2
  16. package/dist/components/BitkitTable/BitkitDefinitionColumnHeader.js +2 -2
  17. package/dist/components/BitkitTable/BitkitDefinitionColumnHeader.js.map +1 -1
  18. package/dist/components/BitkitTable/BitkitExpandableRow.js +1 -1
  19. package/dist/components/BitkitTable/BitkitExpandableRow.js.map +1 -1
  20. package/dist/components/BitkitTable/BitkitFilterRow.d.ts +7 -7
  21. package/dist/components/BitkitTable/BitkitFilterRow.js +8 -8
  22. package/dist/components/BitkitTable/BitkitFilterRow.js.map +1 -1
  23. package/dist/components/BitkitTable/BitkitLinkedRow.js +11 -11
  24. package/dist/components/BitkitTable/BitkitLinkedRow.js.map +1 -1
  25. package/dist/components/BitkitTable/BitkitRowActionsCell.d.ts +2 -2
  26. package/dist/components/BitkitTable/BitkitRowActionsCell.js +3 -3
  27. package/dist/components/BitkitTable/BitkitRowActionsCell.js.map +1 -1
  28. package/dist/components/BitkitTable/BitkitSortableColumnHeader.js +1 -1
  29. package/dist/components/BitkitTable/BitkitSortableColumnHeader.js.map +1 -1
  30. package/dist/components/BitkitTable/BitkitTable.js +47 -0
  31. package/dist/components/BitkitTable/BitkitTable.js.map +1 -0
  32. package/dist/components/index.d.ts +9 -9
  33. package/dist/main.js +3 -10
  34. package/dist/theme/slot-recipes/GroupHeading.recipe.js +1 -4
  35. package/dist/theme/slot-recipes/GroupHeading.recipe.js.map +1 -1
  36. package/dist/theme/slot-recipes/Sidebar.recipe.d.ts +22 -0
  37. package/dist/theme/slot-recipes/Sidebar.recipe.js +143 -0
  38. package/dist/theme/slot-recipes/Sidebar.recipe.js.map +1 -0
  39. package/dist/theme/slot-recipes/Tour.recipe.d.ts +1 -1
  40. package/dist/theme/slot-recipes/index.d.ts +22 -286
  41. package/dist/theme/slot-recipes/index.js +2 -4
  42. package/dist/theme/slot-recipes/index.js.map +1 -1
  43. package/docs/v1-to-v2-migration-guide.md +6 -9
  44. package/package.json +1 -1
  45. package/dist/components/BitkitPageHeader/BitkitPageHeader.d.ts +0 -112
  46. package/dist/components/BitkitPageHeader/BitkitPageHeader.js +0 -86
  47. package/dist/components/BitkitPageHeader/BitkitPageHeader.js.map +0 -1
  48. package/dist/components/BitkitPageSidebar/BitkitPageSidebar.d.ts +0 -74
  49. package/dist/components/BitkitPageSidebar/BitkitPageSidebar.js +0 -263
  50. package/dist/components/BitkitPageSidebar/BitkitPageSidebar.js.map +0 -1
  51. package/dist/theme/slot-recipes/PageHeader.recipe.d.ts +0 -202
  52. package/dist/theme/slot-recipes/PageHeader.recipe.js +0 -346
  53. package/dist/theme/slot-recipes/PageHeader.recipe.js.map +0 -1
  54. package/dist/theme/slot-recipes/PageSidebar.recipe.d.ts +0 -85
  55. package/dist/theme/slot-recipes/PageSidebar.recipe.js +0 -276
  56. package/dist/theme/slot-recipes/PageSidebar.recipe.js.map +0 -1
  57. package/dist/utilities/useIsTruncated.d.ts +0 -27
  58. package/dist/utilities/useIsTruncated.js +0 -54
  59. package/dist/utilities/useIsTruncated.js.map +0 -1
package/AGENTS.md CHANGED
@@ -95,7 +95,7 @@ Bitkit components use consistent prop names across the library:
95
95
  <BitkitSegmentedControl.Item value="b">Option B</BitkitSegmentedControl.Item>
96
96
  </BitkitSegmentedControl>
97
97
  ```
98
- Two exceptions need an explicit `.Root` because they re-export a whole Chakra namespace: `BitkitDrawer.Root` and `BitkitTabs.Root`. Everything else is `<BitkitFoo>` + `<BitkitFoo.Part>`.
98
+ Three exceptions need an explicit `.Root` because they re-export a whole Chakra namespace: `BitkitDrawer.Root`, `BitkitTable.Root` and `BitkitTabs.Root`. Everything else is `<BitkitFoo>` + `<BitkitFoo.Part>`.
99
99
  - **Slot props for content, not boolean flags** — pass an icon/badge/etc. directly as a prop. Element presence is the toggle:
100
100
  ```tsx
101
101
  <BitkitButton icon={IconCheck}>Save</BitkitButton>
@@ -62,7 +62,6 @@ var BitkitControlButton = forwardRef((props, ref) => {
62
62
  ref,
63
63
  "aria-label": label,
64
64
  disabled: state === "disabled" || state === "skeleton",
65
- type: "button",
66
65
  ...buttonRest,
67
66
  css: recipe({
68
67
  isDanger,
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitControlButton.js","names":[],"sources":["../../../lib/components/BitkitControlButton/BitkitControlButton.tsx"],"sourcesContent":["import { Skeleton } from '@chakra-ui/react/skeleton';\nimport { chakra, type HTMLChakraProps, useRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type KeyboardEvent, type MouseEvent, type Ref } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport opensPopup from '../../utilities/opensPopup';\nimport BitkitLabelTooltip, { type BitkitLabelTooltipProps } from '../BitkitLabelTooltip/BitkitLabelTooltip';\n\ntype ControlButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';\n\ninterface BitkitControlButtonCommonProps {\n icon: BitkitIconComponent;\n isDanger?: boolean;\n label: string;\n size?: ControlButtonSize;\n state?: 'disabled' | 'skeleton';\n /**\n * Overrides for the label tooltip. It is off by default when this control opens a popup — a menu,\n * select or popover trigger — where the panel is the affordance and a tooltip would hover over it.\n * Pass `{ disabled: false }` to bring it back. The accessible name comes from `label` either way.\n */\n tooltipProps?: Partial<Omit<BitkitLabelTooltipProps, 'children' | 'text'>>;\n}\n\n// Exported so dependent declarations can name it: `BitkitTabs.AddButton`'s props derive from\n// `Extract<BitkitControlButtonProps, { href?: undefined }>` (this type), and the .d.ts emit\n// fails with TS4023 (\"cannot be named\") if it isn't exported.\nexport interface BitkitControlButtonAsButtonProps\n extends BitkitControlButtonCommonProps, Omit<HTMLChakraProps<'button'>, 'children' | 'disabled' | 'size'> {\n href?: undefined;\n isExternal?: undefined;\n}\n\nexport interface BitkitControlButtonAsAnchorProps\n extends BitkitControlButtonCommonProps, Omit<HTMLChakraProps<'a'>, 'children' | 'size'> {\n href: string;\n isExternal?: boolean;\n}\n\nexport type BitkitControlButtonProps = BitkitControlButtonAsButtonProps | BitkitControlButtonAsAnchorProps;\n\nconst BitkitControlButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, BitkitControlButtonProps>(\n (props, ref) => {\n const Icon = props.icon;\n const size = props.size ?? 'sm';\n const recipe = useRecipe({ key: 'controlButton' });\n const iconSize = size === 'xxs' || size === 'xs' ? '16' : '24';\n const isDisabled = props.state === 'disabled';\n const isSkeleton = props.state === 'skeleton';\n const isPopupTrigger = opensPopup(props);\n const inertOnClick = isDisabled || isSkeleton;\n\n // --- Anchor mode (href) ---\n if (props.href !== undefined) {\n const {\n href,\n icon: _icon,\n isDanger,\n isExternal,\n label,\n onClick,\n onKeyDown,\n rel,\n size: _size,\n state: _state,\n target,\n tooltipProps,\n ...anchorRest\n } = props;\n const effectiveTarget = isExternal ? '_blank' : target;\n const effectiveRel = isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel;\n const handleClick = inertOnClick\n ? (e: MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n e.stopPropagation();\n }\n : onClick;\n const handleKeyDown = inertOnClick\n ? (e: KeyboardEvent<HTMLAnchorElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n : onKeyDown;\n return (\n <BitkitLabelTooltip text={label} disabled={isPopupTrigger} {...tooltipProps}>\n <chakra.a\n ref={ref as Ref<HTMLAnchorElement>}\n aria-disabled={inertOnClick || undefined}\n aria-label={label}\n {...anchorRest}\n css={recipe({ isDanger, size })}\n href={inertOnClick ? undefined : href}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n rel={effectiveRel}\n target={effectiveTarget}\n >\n <Skeleton loading={isSkeleton}>\n <Icon size={iconSize} />\n </Skeleton>\n </chakra.a>\n </BitkitLabelTooltip>\n );\n }\n\n // --- Button mode (default) ---\n const { icon: _icon, isDanger, label, size: _size, state, tooltipProps, ...buttonRest } = props;\n return (\n <BitkitLabelTooltip text={label} disabled={isPopupTrigger} {...tooltipProps}>\n <chakra.button\n ref={ref as Ref<HTMLButtonElement>}\n aria-label={label}\n disabled={state === 'disabled' || state === 'skeleton'}\n // A control button is an action, not a form submit — without this it would submit any\n // form it happens to sit inside. Before the spread, so a consumer can still opt into\n // `type=\"submit\"`.\n type=\"button\"\n {...buttonRest}\n css={recipe({ isDanger, size })}\n >\n <Skeleton loading={isSkeleton}>\n <Icon size={iconSize} />\n </Skeleton>\n </chakra.button>\n </BitkitLabelTooltip>\n );\n },\n);\n\nBitkitControlButton.displayName = 'BitkitControlButton';\n\nexport default BitkitControlButton;\n"],"mappings":";;;;;;;AAyCA,IAAM,sBAAsB,YACzB,OAAO,QAAQ;CACd,MAAM,OAAO,MAAM;CACnB,MAAM,OAAO,MAAM,QAAQ;CAC3B,MAAM,SAAS,UAAU,EAAE,KAAK,gBAAgB,CAAC;CACjD,M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GAI5C,MAAK;GACL,GAAI;GACJ,KAAK,OAAO;IAAE;IAAU;GAAK,CAAC;GAE9B,UAAA,oBAAC,UAAD;IAAU,SAAS;IACjB,UAAA,oBAAC,MAAD,EAAM,MAAM,SAAW,CAAA;GACf,CAAA;EACG,CAAA;CACG,CAAA;AAExB,CACF;AAEA,oBAAoB,cAAc"}
1
+ {"version":3,"file":"BitkitControlButton.js","names":[],"sources":["../../../lib/components/BitkitControlButton/BitkitControlButton.tsx"],"sourcesContent":["import { Skeleton } from '@chakra-ui/react/skeleton';\nimport { chakra, type HTMLChakraProps, useRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type KeyboardEvent, type MouseEvent, type Ref } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport opensPopup from '../../utilities/opensPopup';\nimport BitkitLabelTooltip, { type BitkitLabelTooltipProps } from '../BitkitLabelTooltip/BitkitLabelTooltip';\n\ntype ControlButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';\n\ninterface BitkitControlButtonCommonProps {\n icon: BitkitIconComponent;\n isDanger?: boolean;\n label: string;\n size?: ControlButtonSize;\n state?: 'disabled' | 'skeleton';\n /**\n * Overrides for the label tooltip. It is off by default when this control opens a popup — a menu,\n * select or popover trigger — where the panel is the affordance and a tooltip would hover over it.\n * Pass `{ disabled: false }` to bring it back. The accessible name comes from `label` either way.\n */\n tooltipProps?: Partial<Omit<BitkitLabelTooltipProps, 'children' | 'text'>>;\n}\n\n// Exported so dependent declarations can name it: `BitkitTabs.AddButton`'s props derive from\n// `Extract<BitkitControlButtonProps, { href?: undefined }>` (this type), and the .d.ts emit\n// fails with TS4023 (\"cannot be named\") if it isn't exported.\nexport interface BitkitControlButtonAsButtonProps\n extends BitkitControlButtonCommonProps, Omit<HTMLChakraProps<'button'>, 'children' | 'disabled' | 'size'> {\n href?: undefined;\n isExternal?: undefined;\n}\n\nexport interface BitkitControlButtonAsAnchorProps\n extends BitkitControlButtonCommonProps, Omit<HTMLChakraProps<'a'>, 'children' | 'size'> {\n href: string;\n isExternal?: boolean;\n}\n\nexport type BitkitControlButtonProps = BitkitControlButtonAsButtonProps | BitkitControlButtonAsAnchorProps;\n\nconst BitkitControlButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, BitkitControlButtonProps>(\n (props, ref) => {\n const Icon = props.icon;\n const size = props.size ?? 'sm';\n const recipe = useRecipe({ key: 'controlButton' });\n const iconSize = size === 'xxs' || size === 'xs' ? '16' : '24';\n const isDisabled = props.state === 'disabled';\n const isSkeleton = props.state === 'skeleton';\n const isPopupTrigger = opensPopup(props);\n const inertOnClick = isDisabled || isSkeleton;\n\n // --- Anchor mode (href) ---\n if (props.href !== undefined) {\n const {\n href,\n icon: _icon,\n isDanger,\n isExternal,\n label,\n onClick,\n onKeyDown,\n rel,\n size: _size,\n state: _state,\n target,\n tooltipProps,\n ...anchorRest\n } = props;\n const effectiveTarget = isExternal ? '_blank' : target;\n const effectiveRel = isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel;\n const handleClick = inertOnClick\n ? (e: MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n e.stopPropagation();\n }\n : onClick;\n const handleKeyDown = inertOnClick\n ? (e: KeyboardEvent<HTMLAnchorElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n : onKeyDown;\n return (\n <BitkitLabelTooltip text={label} disabled={isPopupTrigger} {...tooltipProps}>\n <chakra.a\n ref={ref as Ref<HTMLAnchorElement>}\n aria-disabled={inertOnClick || undefined}\n aria-label={label}\n {...anchorRest}\n css={recipe({ isDanger, size })}\n href={inertOnClick ? undefined : href}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n rel={effectiveRel}\n target={effectiveTarget}\n >\n <Skeleton loading={isSkeleton}>\n <Icon size={iconSize} />\n </Skeleton>\n </chakra.a>\n </BitkitLabelTooltip>\n );\n }\n\n // --- Button mode (default) ---\n const { icon: _icon, isDanger, label, size: _size, state, tooltipProps, ...buttonRest } = props;\n return (\n <BitkitLabelTooltip text={label} disabled={isPopupTrigger} {...tooltipProps}>\n <chakra.button\n ref={ref as Ref<HTMLButtonElement>}\n aria-label={label}\n disabled={state === 'disabled' || state === 'skeleton'}\n {...buttonRest}\n css={recipe({ isDanger, size })}\n >\n <Skeleton loading={isSkeleton}>\n <Icon size={iconSize} />\n </Skeleton>\n </chakra.button>\n </BitkitLabelTooltip>\n );\n },\n);\n\nBitkitControlButton.displayName = 'BitkitControlButton';\n\nexport default BitkitControlButton;\n"],"mappings":";;;;;;;AAyCA,IAAM,sBAAsB,YACzB,OAAO,QAAQ;CACd,MAAM,OAAO,MAAM;CACnB,MAAM,OAAO,MAAM,QAAQ;CAC3B,MAAM,SAAS,UAAU,EAAE,KAAK,gBAAgB,CAAC;CACjD,MAAM,WAAW,SAAS,SAAS,SAAS,OAAO,OAAO;CAC1D,MAAM,aAAa,MAAM,UAAU;CACnC,MAAM,aAAa,MAAM,UAAU;CACnC,MAAM,iBAAiB,WAAW,KAAK;CACvC,MAAM,eAAe,cAAc;CAGnC,IAAI,MAAM,SAAS,KAAA,GAAW;EAC5B,MAAM,EACJ,MACA,MAAM,OACN,UACA,YACA,OACA,SACA,WACA,KACA,MAAM,OACN,OAAO,QACP,QACA,cACA,GAAG,eACD;EACJ,MAAM,kBAAkB,aAAa,WAAW;EAChD,MAAM,eAAe,aAAc,MAAM,GAAG,IAAI,wBAAwB,wBAAyB;EACjG,MAAM,cAAc,gBACf,MAAqC;GACpC,EAAE,eAAe;GACjB,EAAE,gBAAgB;EACpB,IACA;EACJ,MAAM,gBAAgB,gBACjB,MAAwC;GACvC,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;IACtC,EAAE,eAAe;IACjB,EAAE,gBAAgB;GACpB;EACF,IACA;EACJ,OACE,oBAAC,oBAAD;GAAoB,MAAM;GAAO,UAAU;GAAgB,GAAI;GAC7D,UAAA,oBAAC,OAAO,GAAR;IACO;IACL,iBAAe,gBAAgB,KAAA;IAC/B,cAAY;IACZ,GAAI;IACJ,KAAK,OAAO;KAAE;KAAU;IAAK,CAAC;IAC9B,MAAM,eAAe,KAAA,IAAY;IACjC,SAAS;IACT,WAAW;IACX,KAAK;IACL,QAAQ;IAER,UAAA,oBAAC,UAAD;KAAU,SAAS;KACjB,UAAA,oBAAC,MAAD,EAAM,MAAM,SAAW,CAAA;IACf,CAAA;GACF,CAAA;EACQ,CAAA;CAExB;CAGA,MAAM,EAAE,MAAM,OAAO,UAAU,OAAO,MAAM,OAAO,OAAO,cAAc,GAAG,eAAe;CAC1F,OACE,oBAAC,oBAAD;EAAoB,MAAM;EAAO,UAAU;EAAgB,GAAI;EAC7D,UAAA,oBAAC,OAAO,QAAR;GACO;GACL,cAAY;GACZ,UAAU,UAAU,cAAc,UAAU;GAC5C,GAAI;GACJ,KAAK,OAAO;IAAE;IAAU;GAAK,CAAC;GAE9B,UAAA,oBAAC,UAAD;IAAU,SAAS;IACjB,UAAA,oBAAC,MAAD,EAAM,MAAM,SAAW,CAAA;GACf,CAAA;EACG,CAAA;CACG,CAAA;AAExB,CACF;AAEA,oBAAoB,cAAc"}
@@ -1,8 +1,6 @@
1
1
  import { BoxProps } from '@chakra-ui/react/box';
2
- import { ReactNode } from 'react';
3
2
  import { BitkitIconComponent } from '../../icons';
4
3
  export interface BitkitGroupHeadingProps extends Omit<BoxProps, 'icon'> {
5
- badge?: ReactNode;
6
4
  icon?: BitkitIconComponent;
7
5
  label: string;
8
6
  }
@@ -5,26 +5,22 @@ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Separator } from "@chakra-ui/react/separator";
6
6
  //#region lib/components/BitkitGroupHeading/BitkitGroupHeading.tsx
7
7
  var BitkitGroupHeading = forwardRef((props, ref) => {
8
- const { badge, icon: Icon, label, ...rest } = props;
8
+ const { icon: Icon, label, ...rest } = props;
9
9
  const styles = useSlotRecipe({ key: "groupHeading" })();
10
10
  return /* @__PURE__ */ jsxs(Box, {
11
11
  css: styles.root,
12
12
  ref,
13
13
  ...rest,
14
- children: [
15
- /* @__PURE__ */ jsxs(chakra.div, {
16
- css: styles.titleBlock,
17
- children: [Icon && /* @__PURE__ */ jsx(Icon, {
18
- css: styles.icon,
19
- size: "16"
20
- }), /* @__PURE__ */ jsx(chakra.span, {
21
- css: styles.label,
22
- children: label
23
- })]
24
- }),
25
- /* @__PURE__ */ jsx(Separator, { css: styles.separator }),
26
- badge
27
- ]
14
+ children: [/* @__PURE__ */ jsxs(chakra.div, {
15
+ css: styles.titleBlock,
16
+ children: [Icon && /* @__PURE__ */ jsx(Icon, {
17
+ css: styles.icon,
18
+ size: "16"
19
+ }), /* @__PURE__ */ jsx(chakra.span, {
20
+ css: styles.label,
21
+ children: label
22
+ })]
23
+ }), /* @__PURE__ */ jsx(Separator, { css: styles.separator })]
28
24
  });
29
25
  });
30
26
  BitkitGroupHeading.displayName = "BitkitGroupHeading";
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitGroupHeading.js","names":[],"sources":["../../../lib/components/BitkitGroupHeading/BitkitGroupHeading.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { Separator } from '@chakra-ui/react/separator';\nimport { chakra, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\n\nexport interface BitkitGroupHeadingProps extends Omit<BoxProps, 'icon'> {\n badge?: ReactNode;\n icon?: BitkitIconComponent;\n label: string;\n}\n\nconst BitkitGroupHeading = forwardRef<HTMLDivElement, BitkitGroupHeadingProps>((props, ref) => {\n const { badge, icon: Icon, label, ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'groupHeading' });\n const styles = recipe();\n\n return (\n <Box css={styles.root} ref={ref} {...rest}>\n <chakra.div css={styles.titleBlock}>\n {Icon && <Icon css={styles.icon} size=\"16\" />}\n <chakra.span css={styles.label}>{label}</chakra.span>\n </chakra.div>\n <Separator css={styles.separator} />\n {badge}\n </Box>\n );\n});\n\nBitkitGroupHeading.displayName = 'BitkitGroupHeading';\n\nexport default BitkitGroupHeading;\n"],"mappings":";;;;;;AAaA,IAAM,qBAAqB,YAAqD,OAAO,QAAQ;CAC7F,MAAM,EAAE,OAAO,MAAM,MAAM,OAAO,GAAG,SAAS;CAG9C,MAAM,SADS,cAAc,EAAE,KAAK,eAAe,CACpC,CAAA,CAAO;CAEtB,OACE,qBAAC,KAAD;EAAK,KAAK,OAAO;EAAW;EAAK,GAAI;EAArC,UAAA;GACE,qBAAC,OAAO,KAAR;IAAY,KAAK,OAAO;IAAxB,UAAA,CACG,QAAQ,oBAAC,MAAD;KAAM,KAAK,OAAO;KAAM,MAAK;IAAM,CAAA,GAC5C,oBAAC,OAAO,MAAR;KAAa,KAAK,OAAO;KAAQ,UAAA;IAAmB,CAAA,CAC1C;;GACZ,oBAAC,WAAD,EAAW,KAAK,OAAO,UAAY,CAAA;GAClC;EACE;;AAET,CAAC;AAED,mBAAmB,cAAc"}
1
+ {"version":3,"file":"BitkitGroupHeading.js","names":[],"sources":["../../../lib/components/BitkitGroupHeading/BitkitGroupHeading.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { Separator } from '@chakra-ui/react/separator';\nimport { chakra, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\n\nexport interface BitkitGroupHeadingProps extends Omit<BoxProps, 'icon'> {\n icon?: BitkitIconComponent;\n label: string;\n}\n\nconst BitkitGroupHeading = forwardRef<HTMLDivElement, BitkitGroupHeadingProps>((props, ref) => {\n const { icon: Icon, label, ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'groupHeading' });\n const styles = recipe();\n\n return (\n <Box css={styles.root} ref={ref} {...rest}>\n <chakra.div css={styles.titleBlock}>\n {Icon && <Icon css={styles.icon} size=\"16\" />}\n <chakra.span css={styles.label}>{label}</chakra.span>\n </chakra.div>\n <Separator css={styles.separator} />\n </Box>\n );\n});\n\nBitkitGroupHeading.displayName = 'BitkitGroupHeading';\n\nexport default BitkitGroupHeading;\n"],"mappings":";;;;;;AAYA,IAAM,qBAAqB,YAAqD,OAAO,QAAQ;CAC7F,MAAM,EAAE,MAAM,MAAM,OAAO,GAAG,SAAS;CAGvC,MAAM,SADS,cAAc,EAAE,KAAK,eAAe,CACpC,CAAA,CAAO;CAEtB,OACE,qBAAC,KAAD;EAAK,KAAK,OAAO;EAAW;EAAK,GAAI;EAArC,UAAA,CACE,qBAAC,OAAO,KAAR;GAAY,KAAK,OAAO;GAAxB,UAAA,CACG,QAAQ,oBAAC,MAAD;IAAM,KAAK,OAAO;IAAM,MAAK;GAAM,CAAA,GAC5C,oBAAC,OAAO,MAAR;IAAa,KAAK,OAAO;IAAQ,UAAA;GAAmB,CAAA,CAC1C;EACZ,CAAA,GAAA,oBAAC,WAAD,EAAW,KAAK,OAAO,UAAY,CAAA,CAChC;;AAET,CAAC;AAED,mBAAmB,cAAc"}
@@ -100,7 +100,7 @@ var BitkitListItem = forwardRef((props, ref) => {
100
100
  borderRadius: "50%",
101
101
  color: `color/${colorVariant}/strong`,
102
102
  height: helperText ? "24" : "20",
103
- marginBlock: helperText ? void 0 : "2",
103
+ marginBlockEnd: helperText ? void 0 : "4",
104
104
  overflow: "hidden",
105
105
  textStyle: "comp/badge/sm",
106
106
  width: helperText ? "24" : "20"
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitList.js","names":[],"sources":["../../../lib/components/BitkitList/BitkitList.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { List, type ListRootProps } from '@chakra-ui/react/list';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport { withSubComponents } from '../../utilities/withSubComponents';\n\n// ----- Context -----\n\ntype BitkitListVariant = 'explainer' | 'ordered' | 'unordered' | 'unstyled' | 'inline';\ntype BitkitListSize = 'lg' | 'md' | 'sm';\ntype BitkitListTextColor = 'body' | 'secondary';\n\ninterface BitkitListContext {\n colorVariant: 'neutral' | 'purple';\n size: BitkitListSize;\n textColor: BitkitListTextColor;\n variant: BitkitListVariant;\n}\n\nconst [BitkitListProvider, useBitkitListContext] = createContext<BitkitListContext>({\n name: 'BitkitListContext',\n hookName: 'useBitkitListContext',\n providerName: '<BitkitList />',\n});\n\n// ----- BitkitList -----\n\nexport interface BitkitListProps extends Omit<ListRootProps, 'colorPalette' | 'size'> {\n children: ReactNode;\n colorVariant?: 'neutral' | 'purple';\n size?: BitkitListSize;\n textColor?: BitkitListTextColor;\n variant?: BitkitListVariant;\n}\n\nconst BitkitList = forwardRef<HTMLOListElement | HTMLUListElement, BitkitListProps>((props, ref) => {\n const { children, colorVariant = 'neutral', size = 'lg', textColor = 'body', variant = 'unordered', ...rest } = props;\n\n const rootProps =\n variant === 'ordered'\n ? ({ as: 'ol', counterReset: 'bitkit-list' } as const)\n : variant === 'explainer'\n ? ({ as: 'ol', counterReset: 'bitkit-list' } as const)\n : variant === 'inline'\n ? ({ alignItems: 'center', flexDirection: 'row', flexWrap: 'wrap', gap: 0 } as const)\n : {};\n\n return (\n <BitkitListProvider value={{ colorVariant, size, textColor, variant }}>\n <List.Root ref={ref} size={size} {...rootProps} {...rest}>\n {children}\n </List.Root>\n </BitkitListProvider>\n );\n});\n\nBitkitList.displayName = 'BitkitList';\n\n// ----- BitkitList.Item -----\n\nexport interface BitkitListItemProps {\n children: ReactNode;\n helperText?: ReactNode;\n icon?: BitkitIconComponent;\n iconColor?: string;\n}\n\nconst UNORDERED_ICON_SIZE: Record<BitkitListSize, '16' | '24'> = {\n lg: '24',\n md: '16',\n sm: '16',\n};\n\nconst BitkitListItem = forwardRef<HTMLLIElement, BitkitListItemProps>((props, ref) => {\n const { children, helperText, icon: Icon, iconColor } = props;\n const { colorVariant, size, textColor, variant } = useBitkitListContext();\n\n if (variant === 'unstyled') {\n return (\n <List.Item ref={ref} color={textColor === 'secondary' ? 'text/secondary' : 'text/body'}>\n {children}\n </List.Item>\n );\n }\n\n if (variant === 'inline') {\n return (\n <List.Item\n ref={ref}\n alignItems=\"center\"\n color={textColor === 'secondary' ? 'text/secondary' : 'text/body'}\n _notFirst={{\n _before: {\n content: '\"\\\\2022\"',\n color: 'text/tertiary',\n marginInline: '8',\n },\n }}\n >\n {children}\n </List.Item>\n );\n }\n\n const content = helperText ? (\n <Box display=\"flex\" flex=\"1\" flexDirection=\"column\" minWidth=\"0\">\n {children}\n <Text color=\"text/secondary\" textStyle=\"body/md/regular\">\n {helperText}\n </Text>\n </Box>\n ) : (\n children\n );\n\n if (variant === 'ordered') {\n return (\n <List.Item ref={ref} counterIncrement=\"bitkit-list\" gap={helperText ? '12' : undefined}>\n {Icon ? (\n <List.Indicator color={iconColor ?? 'icon/secondary'}>\n <Icon size={UNORDERED_ICON_SIZE[size]} />\n </List.Indicator>\n ) : (\n <List.Indicator _before={{ content: 'counter(bitkit-list) \".\"' }} />\n )}\n {content}\n </List.Item>\n );\n }\n\n if (variant === 'explainer') {\n return (\n <List.Item\n ref={ref}\n counterIncrement=\"bitkit-list\"\n gap={helperText ? '12' : '6'}\n marginBlockEnd={helperText ? '8' : undefined}\n >\n {Icon ? (\n <List.Indicator color={iconColor ?? `color/${colorVariant}/strong`}>\n <Icon size={UNORDERED_ICON_SIZE[size]} />\n </List.Indicator>\n ) : (\n <List.Indicator\n _before={{ content: 'counter(bitkit-list)' }}\n background={`color/${colorVariant}/subtle`}\n borderRadius=\"50%\"\n color={`color/${colorVariant}/strong`}\n height={helperText ? '24' : '20'}\n // Give the smaller 20px circle 2px of block margin on each side so the marker\n // always occupies a 24px vertical slot and its center aligns with the first\n // text line — matches the Figma frame with the 20px circle centered in a 24px\n // marker box.\n marginBlock={helperText ? undefined : '2'}\n overflow=\"hidden\"\n textStyle=\"comp/badge/sm\"\n width={helperText ? '24' : '20'}\n />\n )}\n {content}\n </List.Item>\n );\n }\n\n // unordered (default)\n if (Icon) {\n return (\n <List.Item ref={ref} gap={helperText ? '12' : '8'}>\n <List.Indicator color={iconColor ?? 'icon/secondary'}>\n <Icon size={UNORDERED_ICON_SIZE[size]} />\n </List.Indicator>\n {content}\n </List.Item>\n );\n }\n\n return (\n <List.Item ref={ref} gap={helperText ? '12' : undefined}>\n <List.Indicator aria-hidden>•</List.Indicator>\n {content}\n </List.Item>\n );\n});\n\nBitkitListItem.displayName = 'BitkitListItem';\n\nexport default withSubComponents(BitkitList, { Item: BitkitListItem });\n"],"mappings":";;;;;;;;AAuBA,IAAM,CAAC,oBAAoB,wBAAwB,gBAAiC;CAClF,MAAM;CACN,UAAU;CACV,cAAc;AAChB,CAAC;AAYD,IAAM,aAAa,YAAkE,OAAO,QAAQ;CAClG,MAAM,EAAE,UAAU,eAAe,WAAW,OAAO,MAAM,YAAY,QAAQ,UAAU,aAAa,GAAG,SAAS;CAEhH,MAAM,YACJ,YAAY,YACP;EAAE,IAAI;EAAM,cAAc;CAAc,IACzC,YAAY,cACT;EAAE,IAAI;EAAM,cAAc;CAAc,IACzC,YAAY,WACT;EAAE,YAAY;EAAU,eAAe;EAAO,UAAU;EAAQ,KAAK;CAAE,IACxE,CAAC;CAEX,OACE,oBAAC,oBAAD;EAAoB,OAAO;GAAE;GAAc;GAAM;GAAW;EAAQ;EAClE,UAAA,oBAAC,KAAK,MAAN;GAAgB;GAAW;GAAM,GAAI;GAAW,GAAI;GACjD;EACQ,CAAA;CACO,CAAA;AAExB,CAAC;AAED,WAAW,cAAc;AAWzB,IAAM,sBAA2D;CAC/D,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,IAAM,iBAAiB,YAAgD,OAAO,QAAQ;CACpF,MAAM,EAAE,UAAU,YAAY,MAAM,MAAM,cAAc;CACxD,MAAM,EAAE,cAAc,MAAM,WAAW,YAAY,qBAAqB;CAExE,IAAI,YAAY,YACd,OACE,oBA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V,OAAO,aAAa,OAAO;EAC5B,CAAA,GAEF,OACQ;;CAKf,IAAI,MACF,OACE,qBAAC,KAAK,MAAN;EAAgB;EAAK,KAAK,aAAa,OAAO;EAA9C,UAAA,CACE,oBAAC,KAAK,WAAN;GAAgB,OAAO,aAAa;GAClC,UAAA,oBAAC,MAAD,EAAM,MAAM,oBAAoB,MAAQ,CAAA;EAC1B,CAAA,GACf,OACQ;;CAIf,OACE,qBAAC,KAAK,MAAN;EAAgB;EAAK,KAAK,aAAa,OAAO,KAAA;EAA9C,UAAA,CACE,oBAAC,KAAK,WAAN;GAAgB,eAAA;GAAY,UAAA;EAAiB,CAAA,GAC5C,OACQ;;AAEf,CAAC;AAED,eAAe,cAAc;AAE7B,IAAA,qBAAe,kBAAkB,YAAY,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"BitkitList.js","names":[],"sources":["../../../lib/components/BitkitList/BitkitList.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { List, type ListRootProps } from '@chakra-ui/react/list';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport { withSubComponents } from '../../utilities/withSubComponents';\n\n// ----- Context -----\n\ntype BitkitListVariant = 'explainer' | 'ordered' | 'unordered' | 'unstyled' | 'inline';\ntype BitkitListSize = 'lg' | 'md' | 'sm';\ntype BitkitListTextColor = 'body' | 'secondary';\n\ninterface BitkitListContext {\n colorVariant: 'neutral' | 'purple';\n size: BitkitListSize;\n textColor: BitkitListTextColor;\n variant: BitkitListVariant;\n}\n\nconst [BitkitListProvider, useBitkitListContext] = createContext<BitkitListContext>({\n name: 'BitkitListContext',\n hookName: 'useBitkitListContext',\n providerName: '<BitkitList />',\n});\n\n// ----- BitkitList -----\n\nexport interface BitkitListProps extends Omit<ListRootProps, 'colorPalette' | 'size'> {\n children: ReactNode;\n colorVariant?: 'neutral' | 'purple';\n size?: BitkitListSize;\n textColor?: BitkitListTextColor;\n variant?: BitkitListVariant;\n}\n\nconst BitkitList = forwardRef<HTMLOListElement | HTMLUListElement, BitkitListProps>((props, ref) => {\n const { children, colorVariant = 'neutral', size = 'lg', textColor = 'body', variant = 'unordered', ...rest } = props;\n\n const rootProps =\n variant === 'ordered'\n ? ({ as: 'ol', counterReset: 'bitkit-list' } as const)\n : variant === 'explainer'\n ? ({ as: 'ol', counterReset: 'bitkit-list' } as const)\n : variant === 'inline'\n ? ({ alignItems: 'center', flexDirection: 'row', flexWrap: 'wrap', gap: 0 } as const)\n : {};\n\n return (\n <BitkitListProvider value={{ colorVariant, size, textColor, variant }}>\n <List.Root ref={ref} size={size} {...rootProps} {...rest}>\n {children}\n </List.Root>\n </BitkitListProvider>\n );\n});\n\nBitkitList.displayName = 'BitkitList';\n\n// ----- BitkitList.Item -----\n\nexport interface BitkitListItemProps {\n children: ReactNode;\n helperText?: ReactNode;\n icon?: BitkitIconComponent;\n iconColor?: string;\n}\n\nconst UNORDERED_ICON_SIZE: Record<BitkitListSize, '16' | '24'> = {\n lg: '24',\n md: '16',\n sm: '16',\n};\n\nconst BitkitListItem = forwardRef<HTMLLIElement, BitkitListItemProps>((props, ref) => {\n const { children, helperText, icon: Icon, iconColor } = props;\n const { colorVariant, size, textColor, variant } = useBitkitListContext();\n\n if (variant === 'unstyled') {\n return (\n <List.Item ref={ref} color={textColor === 'secondary' ? 'text/secondary' : 'text/body'}>\n {children}\n </List.Item>\n );\n }\n\n if (variant === 'inline') {\n return (\n <List.Item\n ref={ref}\n alignItems=\"center\"\n color={textColor === 'secondary' ? 'text/secondary' : 'text/body'}\n _notFirst={{\n _before: {\n content: '\"\\\\2022\"',\n color: 'text/tertiary',\n marginInline: '8',\n },\n }}\n >\n {children}\n </List.Item>\n );\n }\n\n const content = helperText ? (\n <Box display=\"flex\" flex=\"1\" flexDirection=\"column\" minWidth=\"0\">\n {children}\n <Text color=\"text/secondary\" textStyle=\"body/md/regular\">\n {helperText}\n </Text>\n </Box>\n ) : (\n children\n );\n\n if (variant === 'ordered') {\n return (\n <List.Item ref={ref} counterIncrement=\"bitkit-list\" gap={helperText ? '12' : undefined}>\n {Icon ? (\n <List.Indicator color={iconColor ?? 'icon/secondary'}>\n <Icon size={UNORDERED_ICON_SIZE[size]} />\n </List.Indicator>\n ) : (\n <List.Indicator _before={{ content: 'counter(bitkit-list) \".\"' }} />\n )}\n {content}\n </List.Item>\n );\n }\n\n if (variant === 'explainer') {\n return (\n <List.Item\n ref={ref}\n counterIncrement=\"bitkit-list\"\n gap={helperText ? '12' : '6'}\n marginBlockEnd={helperText ? '8' : undefined}\n >\n {Icon ? (\n <List.Indicator color={iconColor ?? `color/${colorVariant}/strong`}>\n <Icon size={UNORDERED_ICON_SIZE[size]} />\n </List.Indicator>\n ) : (\n <List.Indicator\n _before={{ content: 'counter(bitkit-list)' }}\n background={`color/${colorVariant}/subtle`}\n borderRadius=\"50%\"\n color={`color/${colorVariant}/strong`}\n height={helperText ? '24' : '20'}\n // The 20px circle keeps the marker's 24px vertical slot through a block-end margin\n // alone: centering it in that slot would put it half a line below the first line of\n // text, whose line box is 20px.\n marginBlockEnd={helperText ? undefined : '4'}\n overflow=\"hidden\"\n textStyle=\"comp/badge/sm\"\n width={helperText ? '24' : '20'}\n />\n )}\n {content}\n </List.Item>\n );\n }\n\n // unordered (default)\n if (Icon) {\n return (\n <List.Item ref={ref} gap={helperText ? '12' : '8'}>\n <List.Indicator color={iconColor ?? 'icon/secondary'}>\n <Icon size={UNORDERED_ICON_SIZE[size]} />\n </List.Indicator>\n {content}\n </List.Item>\n );\n }\n\n return (\n <List.Item ref={ref} gap={helperText ? '12' : undefined}>\n <List.Indicator aria-hidden>•</List.Indicator>\n {content}\n </List.Item>\n );\n});\n\nBitkitListItem.displayName = 'BitkitListItem';\n\nexport default withSubComponents(BitkitList, { Item: BitkitListItem });\n"],"mappings":";;;;;;;;AAuBA,IAA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AC5C,OACQ;;AAEf,CAAC;AAED,eAAe,cAAc;AAE7B,IAAA,qBAAe,kBAAkB,YAAY,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { BoxProps } from '@chakra-ui/react/box';
2
+ import { HTMLChakraProps } from '@chakra-ui/react/styled-system';
3
+ import { ReactNode } from 'react';
4
+ import { BitkitIconComponent } from '../../icons';
5
+ import { BitkitGroupHeadingProps } from '../BitkitGroupHeading/BitkitGroupHeading';
6
+ export interface BitkitSidebarProps extends BoxProps {
7
+ children: ReactNode;
8
+ }
9
+ interface BitkitSidebarItemCommonProps {
10
+ badge?: ReactNode;
11
+ children: ReactNode;
12
+ icon?: BitkitIconComponent;
13
+ selected?: boolean;
14
+ suffixIcon?: BitkitIconComponent;
15
+ }
16
+ interface BitkitSidebarItemLinkProps extends Omit<HTMLChakraProps<'a'>, 'children'>, BitkitSidebarItemCommonProps {
17
+ href: string;
18
+ }
19
+ interface BitkitSidebarItemButtonProps extends Omit<HTMLChakraProps<'button'>, 'children'>, BitkitSidebarItemCommonProps {
20
+ href?: never;
21
+ }
22
+ export type BitkitSidebarItemProps = BitkitSidebarItemButtonProps | BitkitSidebarItemLinkProps;
23
+ export interface BitkitSidebarTitleProps extends BoxProps {
24
+ backHref?: string;
25
+ backLabel?: string;
26
+ children: ReactNode;
27
+ onBackClick?: () => void;
28
+ }
29
+ export interface BitkitSidebarFooterProps extends BoxProps {
30
+ children: ReactNode;
31
+ }
32
+ export interface BitkitSidebarProjectProps extends BoxProps {
33
+ label: string;
34
+ value: string;
35
+ }
36
+ export type BitkitSidebarGroupHeadingProps = BitkitGroupHeadingProps;
37
+ declare const _default: import('react').ForwardRefExoticComponent<BitkitSidebarProps & import('react').RefAttributes<HTMLElement>> & {
38
+ Divider: import('react').ForwardRefExoticComponent<import('react').RefAttributes<HTMLDivElement>>;
39
+ Footer: import('react').ForwardRefExoticComponent<BitkitSidebarFooterProps & import('react').RefAttributes<HTMLDivElement>>;
40
+ GroupHeading: import('react').ForwardRefExoticComponent<BitkitGroupHeadingProps & import('react').RefAttributes<HTMLDivElement>>;
41
+ Item: import('react').ForwardRefExoticComponent<BitkitSidebarItemProps & import('react').RefAttributes<HTMLButtonElement & HTMLAnchorElement>>;
42
+ Project: import('react').ForwardRefExoticComponent<BitkitSidebarProjectProps & import('react').RefAttributes<HTMLDivElement>>;
43
+ Title: import('react').ForwardRefExoticComponent<BitkitSidebarTitleProps & import('react').RefAttributes<HTMLDivElement>>;
44
+ };
45
+ export default _default;
@@ -0,0 +1,147 @@
1
+ import { withSubComponents } from "../../utilities/withSubComponents.js";
2
+ import IconChevronLeft from "../../icons/IconChevronLeft.js";
3
+ import BitkitLabelTooltip from "../BitkitLabelTooltip/BitkitLabelTooltip.js";
4
+ import BitkitGroupHeading from "../BitkitGroupHeading/BitkitGroupHeading.js";
5
+ import { Box } from "@chakra-ui/react/box";
6
+ import { chakra, useRecipe, useSlotRecipe } from "@chakra-ui/react/styled-system";
7
+ import { forwardRef } from "react";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
+ import { Separator } from "@chakra-ui/react/separator";
10
+ //#region lib/components/BitkitSidebar/BitkitSidebar.tsx
11
+ var BitkitSidebar = forwardRef((props, ref) => {
12
+ const { children, ...rest } = props;
13
+ const styles = useSlotRecipe({ key: "sidebar" })();
14
+ return /* @__PURE__ */ jsx(Box, {
15
+ ref,
16
+ asChild: true,
17
+ css: styles.root,
18
+ ...rest,
19
+ children: /* @__PURE__ */ jsx("nav", { children })
20
+ });
21
+ });
22
+ BitkitSidebar.displayName = "BitkitSidebar";
23
+ var BitkitSidebarItem = forwardRef((props, ref) => {
24
+ const { badge, children, icon: Icon, selected, suffixIcon: SuffixIcon, ...rest } = props;
25
+ const styles = useSlotRecipe({ key: "sidebar" })({ selected });
26
+ const itemContent = /* @__PURE__ */ jsxs(Fragment$1, { children: [
27
+ Icon && /* @__PURE__ */ jsx(Icon, {
28
+ css: styles.itemIcon,
29
+ size: "24"
30
+ }),
31
+ /* @__PURE__ */ jsx(chakra.span, {
32
+ css: styles.itemLabel,
33
+ children
34
+ }),
35
+ badge,
36
+ SuffixIcon && /* @__PURE__ */ jsx(SuffixIcon, {
37
+ css: styles.suffixIcon,
38
+ size: "24"
39
+ }),
40
+ /* @__PURE__ */ jsx(chakra.div, { css: styles.selectionMarker })
41
+ ] });
42
+ if (rest.href !== void 0) {
43
+ const { className, ...linkRest } = rest;
44
+ return /* @__PURE__ */ jsx(chakra.a, {
45
+ ref,
46
+ ...linkRest,
47
+ "aria-current": selected ? "page" : void 0,
48
+ className: className ? `group ${className}` : "group",
49
+ css: styles.item,
50
+ children: itemContent
51
+ });
52
+ }
53
+ const { className, href: _, ...buttonRest } = rest;
54
+ return /* @__PURE__ */ jsx(chakra.button, {
55
+ ref,
56
+ ...buttonRest,
57
+ "aria-pressed": selected,
58
+ className: className ? `group ${className}` : "group",
59
+ css: styles.item,
60
+ type: "button",
61
+ children: itemContent
62
+ });
63
+ });
64
+ BitkitSidebarItem.displayName = "BitkitSidebarItem";
65
+ var BitkitSidebarTitle = forwardRef((props, ref) => {
66
+ const { backHref, backLabel = "Back", children, onBackClick, ...rest } = props;
67
+ const styles = useSlotRecipe({ key: "sidebar" })();
68
+ const controlButtonRecipe = useRecipe({ key: "controlButton" });
69
+ const hasBack = !!backHref || !!onBackClick;
70
+ const BackElement = onBackClick ? chakra.button : chakra.a;
71
+ return /* @__PURE__ */ jsxs(Box, {
72
+ ref,
73
+ css: hasBack ? styles.titleWithBack : styles.title,
74
+ ...rest,
75
+ children: [hasBack && /* @__PURE__ */ jsx(BitkitLabelTooltip, {
76
+ text: backLabel,
77
+ children: /* @__PURE__ */ jsx(BackElement, {
78
+ "aria-label": backLabel,
79
+ css: controlButtonRecipe({ size: "sm" }),
80
+ ...onBackClick ? {
81
+ onClick: onBackClick,
82
+ type: "button"
83
+ } : { href: backHref },
84
+ children: /* @__PURE__ */ jsx(IconChevronLeft, { size: "24" })
85
+ })
86
+ }), children]
87
+ });
88
+ });
89
+ BitkitSidebarTitle.displayName = "BitkitSidebarTitle";
90
+ var BitkitSidebarFooter = forwardRef((props, ref) => {
91
+ const { children, ...rest } = props;
92
+ const styles = useSlotRecipe({ key: "sidebar" })();
93
+ return /* @__PURE__ */ jsx(Box, {
94
+ ref,
95
+ css: styles.footer,
96
+ ...rest,
97
+ children
98
+ });
99
+ });
100
+ BitkitSidebarFooter.displayName = "BitkitSidebarFooter";
101
+ var BitkitSidebarProject = forwardRef((props, ref) => {
102
+ const { label, value, ...rest } = props;
103
+ const styles = useSlotRecipe({ key: "sidebar" })();
104
+ return /* @__PURE__ */ jsxs(Box, {
105
+ ref,
106
+ css: styles.project,
107
+ ...rest,
108
+ children: [/* @__PURE__ */ jsx(chakra.span, {
109
+ css: styles.projectLabel,
110
+ children: label
111
+ }), /* @__PURE__ */ jsx(chakra.span, {
112
+ css: styles.projectValue,
113
+ children: value
114
+ })]
115
+ });
116
+ });
117
+ BitkitSidebarProject.displayName = "BitkitSidebarProject";
118
+ var BitkitSidebarGroupHeading = forwardRef((props, ref) => {
119
+ return /* @__PURE__ */ jsx(BitkitGroupHeading, {
120
+ ref,
121
+ paddingBlockEnd: "12",
122
+ paddingBlockStart: "24",
123
+ paddingInline: "32",
124
+ ...props
125
+ });
126
+ });
127
+ BitkitSidebarGroupHeading.displayName = "BitkitSidebarGroupHeading";
128
+ var BitkitSidebarDivider = forwardRef((_, ref) => {
129
+ const styles = useSlotRecipe({ key: "sidebar" })();
130
+ return /* @__PURE__ */ jsx(Separator, {
131
+ ref,
132
+ css: styles.divider
133
+ });
134
+ });
135
+ BitkitSidebarDivider.displayName = "BitkitSidebarDivider";
136
+ var BitkitSidebar_default = withSubComponents(BitkitSidebar, {
137
+ Divider: BitkitSidebarDivider,
138
+ Footer: BitkitSidebarFooter,
139
+ GroupHeading: BitkitSidebarGroupHeading,
140
+ Item: BitkitSidebarItem,
141
+ Project: BitkitSidebarProject,
142
+ Title: BitkitSidebarTitle
143
+ });
144
+ //#endregion
145
+ export { BitkitSidebar_default as default };
146
+
147
+ //# sourceMappingURL=BitkitSidebar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BitkitSidebar.js","names":[],"sources":["../../../lib/components/BitkitSidebar/BitkitSidebar.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { Separator } from '@chakra-ui/react/separator';\nimport { chakra, type HTMLChakraProps, useRecipe, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport IconChevronLeft from '../../icons/IconChevronLeft';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitkitGroupHeading, { type BitkitGroupHeadingProps } from '../BitkitGroupHeading/BitkitGroupHeading';\nimport BitkitLabelTooltip from '../BitkitLabelTooltip/BitkitLabelTooltip';\n\n// ----- BitkitSidebar (Root) -----\n\nexport interface BitkitSidebarProps extends BoxProps {\n children: ReactNode;\n}\n\nconst BitkitSidebar = forwardRef<HTMLElement, BitkitSidebarProps>((props, ref) => {\n const { children, ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'sidebar' });\n const styles = recipe();\n\n return (\n <Box ref={ref} asChild css={styles.root} {...rest}>\n <nav>{children}</nav>\n </Box>\n );\n});\n\nBitkitSidebar.displayName = 'BitkitSidebar';\n\n// ----- BitkitSidebar.Item -----\n\ninterface BitkitSidebarItemCommonProps {\n badge?: ReactNode;\n children: ReactNode;\n icon?: BitkitIconComponent;\n selected?: boolean;\n suffixIcon?: BitkitIconComponent;\n}\n\ninterface BitkitSidebarItemLinkProps extends Omit<HTMLChakraProps<'a'>, 'children'>, BitkitSidebarItemCommonProps {\n href: string;\n}\n\ninterface BitkitSidebarItemButtonProps\n extends Omit<HTMLChakraProps<'button'>, 'children'>, BitkitSidebarItemCommonProps {\n href?: never;\n}\n\nexport type BitkitSidebarItemProps = BitkitSidebarItemButtonProps | BitkitSidebarItemLinkProps;\n\nconst BitkitSidebarItem = forwardRef<HTMLButtonElement & HTMLAnchorElement, BitkitSidebarItemProps>((props, ref) => {\n const { badge, children, icon: Icon, selected, suffixIcon: SuffixIcon, ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'sidebar' });\n const styles = recipe({ selected });\n\n const itemContent = (\n <>\n {Icon && <Icon css={styles.itemIcon} size=\"24\" />}\n <chakra.span css={styles.itemLabel}>{children}</chakra.span>\n {badge}\n {SuffixIcon && <SuffixIcon css={styles.suffixIcon} size=\"24\" />}\n <chakra.div css={styles.selectionMarker} />\n </>\n );\n\n if (rest.href !== undefined) {\n const { className, ...linkRest } = rest;\n return (\n <chakra.a\n ref={ref}\n {...linkRest}\n aria-current={selected ? 'page' : undefined}\n className={className ? `group ${className}` : 'group'}\n css={styles.item}\n >\n {itemContent}\n </chakra.a>\n );\n }\n\n const { className, href: _, ...buttonRest } = rest;\n return (\n <chakra.button\n ref={ref}\n {...buttonRest}\n aria-pressed={selected}\n className={className ? `group ${className}` : 'group'}\n css={styles.item}\n type=\"button\"\n >\n {itemContent}\n </chakra.button>\n );\n});\n\nBitkitSidebarItem.displayName = 'BitkitSidebarItem';\n\n// ----- BitkitSidebar.Title -----\n\nexport interface BitkitSidebarTitleProps extends BoxProps {\n backHref?: string;\n backLabel?: string;\n children: ReactNode;\n onBackClick?: () => void;\n}\n\nconst BitkitSidebarTitle = forwardRef<HTMLDivElement, BitkitSidebarTitleProps>((props, ref) => {\n const { backHref, backLabel = 'Back', children, onBackClick, ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'sidebar' });\n const styles = recipe();\n const controlButtonRecipe = useRecipe({ key: 'controlButton' });\n\n const hasBack = !!backHref || !!onBackClick;\n\n const BackElement = onBackClick ? chakra.button : chakra.a;\n\n return (\n <Box ref={ref} css={hasBack ? styles.titleWithBack : styles.title} {...rest}>\n {hasBack && (\n <BitkitLabelTooltip text={backLabel}>\n <BackElement\n aria-label={backLabel}\n css={controlButtonRecipe({ size: 'sm' })}\n {...(onBackClick ? { onClick: onBackClick, type: 'button' as const } : { href: backHref })}\n >\n <IconChevronLeft size=\"24\" />\n </BackElement>\n </BitkitLabelTooltip>\n )}\n {children}\n </Box>\n );\n});\n\nBitkitSidebarTitle.displayName = 'BitkitSidebarTitle';\n\n// ----- BitkitSidebar.Footer -----\n\nexport interface BitkitSidebarFooterProps extends BoxProps {\n children: ReactNode;\n}\n\nconst BitkitSidebarFooter = forwardRef<HTMLDivElement, BitkitSidebarFooterProps>((props, ref) => {\n const { children, ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'sidebar' });\n const styles = recipe();\n\n return (\n <Box ref={ref} css={styles.footer} {...rest}>\n {children}\n </Box>\n );\n});\n\nBitkitSidebarFooter.displayName = 'BitkitSidebarFooter';\n\n// ----- BitkitSidebar.Project -----\n\nexport interface BitkitSidebarProjectProps extends BoxProps {\n label: string;\n value: string;\n}\n\nconst BitkitSidebarProject = forwardRef<HTMLDivElement, BitkitSidebarProjectProps>((props, ref) => {\n const { label, value, ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'sidebar' });\n const styles = recipe();\n\n return (\n <Box ref={ref} css={styles.project} {...rest}>\n <chakra.span css={styles.projectLabel}>{label}</chakra.span>\n <chakra.span css={styles.projectValue}>{value}</chakra.span>\n </Box>\n );\n});\n\nBitkitSidebarProject.displayName = 'BitkitSidebarProject';\n\n// ----- BitkitSidebar.GroupHeading -----\n\nexport type BitkitSidebarGroupHeadingProps = BitkitGroupHeadingProps;\n\nconst BitkitSidebarGroupHeading = forwardRef<HTMLDivElement, BitkitSidebarGroupHeadingProps>((props, ref) => {\n return <BitkitGroupHeading ref={ref} paddingBlockEnd=\"12\" paddingBlockStart=\"24\" paddingInline=\"32\" {...props} />;\n});\n\nBitkitSidebarGroupHeading.displayName = 'BitkitSidebarGroupHeading';\n\n// ----- BitkitSidebar.Divider -----\n\nconst BitkitSidebarDivider = forwardRef<HTMLDivElement>((_, ref) => {\n const recipe = useSlotRecipe({ key: 'sidebar' });\n const styles = recipe();\n\n return <Separator ref={ref} css={styles.divider} />;\n});\n\nBitkitSidebarDivider.displayName = 'BitkitSidebarDivider';\n\nexport default withSubComponents(BitkitSidebar, {\n Divider: BitkitSidebarDivider,\n Footer: BitkitSidebarFooter,\n GroupHeading: BitkitSidebarGroupHeading,\n Item: BitkitSidebarItem,\n Project: BitkitSidebarProject,\n Title: BitkitSidebarTitle,\n});\n"],"mappings":";;;;;;;;;;AAiBA,IAAM,gBAAgB,YAA6C,OAAO,QAAQ;CAChF,MAAM,EAAE,UAAU,GAAG,SAAS;CAG9B,MAAM,SADS,cAAc,EAAE,KAAK,UAAU,CAC/B,CAAA,CAAO;CAEtB,OACE,oBAAC,KAAD;EAAU;EAAK,SAAA;EAAQ,KAAK,OAAO;EAAM,GAAI;EAC3C,UAAA,oBAAC,OAAD,EAAM,SAAc,CAAA;CACjB,CAAA;AAET,CAAC;AAED,cAAc,cAAc;AAuB5B,IAAM,oBAAoB,YAA2E,OAAO,QAAQ;CAClH,MAAM,EAAE,OAAO,UAAU,MAAM,MAAM,UAAU,YAAY,YAAY,GAAG,SAAS;CAGnF,MAAM,SADS,cAAc,EAAE,KAAK,UAAU,CAC/B,CAAA,CAAO,EAAE,SAAS,CAAC;CAElC,MAAM,cACJ,qBAAA,YAAA,EAAA,UAAA;EACG,QAAQ,oBAAC,MAAD;GAAM,KAAK,OAAO;GAAU,MAAK;EAAM,CAAA;EAChD,oBAAC,OAAO,MAAR;GAAa,KAAK,OAAO;GAAY;EAAsB,CAAA;EAC1D;EACA,cAAc,oBAAC,YAAD;GAAY,KAAK,OAAO;GAAY,MAAK;EAAM,CAAA;EAC9D,oBAAC,OAAO,KAAR,EAAY,KAAK,OAAO,gBAAkB,CAAA;CAC1C,EAAA,CAAA;CAGJ,IAAI,KAAK,SAAS,KAAA,GAAW;EAC3B,MAAM,EAAE,WAAW,GAAG,aAAa;EACnC,OACE,oBAAC,OAAO,GAAR;GACO;GACL,GAAI;GACJ,gB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AAQ,GAAI;EACpC;CACE,CAAA;AAET,CAAC;AAED,oBAAoB,cAAc;AASlC,IAAM,uBAAuB,YAAuD,OAAO,QAAQ;CACjG,MAAM,EAAE,OAAO,OAAO,GAAG,SAAS;CAGlC,MAAM,SADS,cAAc,EAAE,KAAK,UAAU,CAC/B,CAAA,CAAO;CAEtB,OACE,qBAAC,KAAD;EAAU;EAAK,KAAK,OAAO;EAAS,GAAI;EAAxC,UAAA,CACE,oBAAC,OAAO,MAAR;GAAa,KAAK,OAAO;GAAe,UAAA;EAAmB,CAAA,GAC3D,oBAAC,OAAO,MAAR;GAAa,KAAK,OAAO;GAAe,UAAA;EAAmB,CAAA,CACxD;;AAET,CAAC;AAED,qBAAqB,cAAc;AAMnC,IAAM,4BAA4B,YAA4D,OAAO,QAAQ;CAC3G,OAAO,oBAAC,oBAAD;EAAyB;EAAK,iBAAgB;EAAK,mBAAkB;EAAK,eAAc;EAAK,GAAI;CAAQ,CAAA;AAClH,CAAC;AAED,0BAA0B,cAAc;AAIxC,IAAM,uBAAuB,YAA4B,GAAG,QAAQ;CAElE,MAAM,SADS,cAAc,EAAE,KAAK,UAAU,CAC/B,CAAA,CAAO;CAEtB,OAAO,oBAAC,WAAD;EAAgB;EAAK,KAAK,OAAO;CAAU,CAAA;AACpD,CAAC;AAED,qBAAqB,cAAc;AAEnC,IAAA,wBAAe,kBAAkB,eAAe;CAC9C,SAAS;CACT,QAAQ;CACR,cAAc;CACd,MAAM;CACN,SAAS;CACT,OAAO;AACT,CAAC"}
@@ -48,7 +48,7 @@ export interface BitkitBulkActionsRowProps extends Omit<Table.RowProps, 'childre
48
48
  /**
49
49
  * The bar above the column headers that appears while rows are selected: what is selected, the
50
50
  * offer to widen the selection to every page, and the actions to run on it. Belongs in
51
- * `Table.Header`, before the `Table.Row` that holds the column headers.
51
+ * `BitkitTable.Header`, before the `BitkitTable.Row` that holds the column headers.
52
52
  *
53
53
  * The count is mirrored into a visually hidden `aria-live` region, which is deliberately filled a
54
54
  * render after mount — a live region that enters the DOM with its text already in it is not
@@ -56,9 +56,9 @@ export interface BitkitBulkActionsRowProps extends Omit<Table.RowProps, 'childre
56
56
  *
57
57
  * @example
58
58
  * ```tsx
59
- * <Table.Header>
59
+ * <BitkitTable.Header>
60
60
  * {selected.length > 0 && (
61
- * <BitkitBulkActionsRow
61
+ * <BitkitTable.BulkActionsRow
62
62
  * colSpan={COL_COUNT}
63
63
  * items={{ one: 'workflow', other: 'workflows' }}
64
64
  * onCancel={clearSelection}
@@ -70,10 +70,10 @@ export interface BitkitBulkActionsRowProps extends Omit<Table.RowProps, 'childre
70
70
  * <BitkitButton icon={IconMinusCircle} size="md" variant="danger-secondary">
71
71
  * Remove
72
72
  * </BitkitButton>
73
- * </BitkitBulkActionsRow>
73
+ * </BitkitTable.BulkActionsRow>
74
74
  * )}
75
- * <Table.Row>{columnHeaders}</Table.Row>
76
- * </Table.Header>
75
+ * <BitkitTable.Row>{columnHeaders}</BitkitTable.Row>
76
+ * </BitkitTable.Header>
77
77
  * ```
78
78
  */
79
79
  declare const BitkitBulkActionsRow: import('react').ForwardRefExoticComponent<BitkitBulkActionsRowProps & import('react').RefAttributes<HTMLTableRowElement>>;
@@ -25,7 +25,7 @@ var resolveItems = (items, count) => {
25
25
  /**
26
26
  * The bar above the column headers that appears while rows are selected: what is selected, the
27
27
  * offer to widen the selection to every page, and the actions to run on it. Belongs in
28
- * `Table.Header`, before the `Table.Row` that holds the column headers.
28
+ * `BitkitTable.Header`, before the `BitkitTable.Row` that holds the column headers.
29
29
  *
30
30
  * The count is mirrored into a visually hidden `aria-live` region, which is deliberately filled a
31
31
  * render after mount — a live region that enters the DOM with its text already in it is not
@@ -33,9 +33,9 @@ var resolveItems = (items, count) => {
33
33
  *
34
34
  * @example
35
35
  * ```tsx
36
- * <Table.Header>
36
+ * <BitkitTable.Header>
37
37
  * {selected.length > 0 && (
38
- * <BitkitBulkActionsRow
38
+ * <BitkitTable.BulkActionsRow
39
39
  * colSpan={COL_COUNT}
40
40
  * items={{ one: 'workflow', other: 'workflows' }}
41
41
  * onCancel={clearSelection}
@@ -47,10 +47,10 @@ var resolveItems = (items, count) => {
47
47
  * <BitkitButton icon={IconMinusCircle} size="md" variant="danger-secondary">
48
48
  * Remove
49
49
  * </BitkitButton>
50
- * </BitkitBulkActionsRow>
50
+ * </BitkitTable.BulkActionsRow>
51
51
  * )}
52
- * <Table.Row>{columnHeaders}</Table.Row>
53
- * </Table.Header>
52
+ * <BitkitTable.Row>{columnHeaders}</BitkitTable.Row>
53
+ * </BitkitTable.Header>
54
54
  * ```
55
55
  */
56
56
  var BitkitBulkActionsRow = forwardRef((props, ref) => {
@@ -117,7 +117,7 @@ var BitkitBulkActionsRow = forwardRef((props, ref) => {
117
117
  })
118
118
  });
119
119
  });
120
- BitkitBulkActionsRow.displayName = "BitkitBulkActionsRow";
120
+ BitkitBulkActionsRow.displayName = "BitkitTable.BulkActionsRow";
121
121
  //#endregion
122
122
  export { BitkitBulkActionsRow as default };
123
123
 
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitBulkActionsRow.js","names":[],"sources":["../../../lib/components/BitkitTable/BitkitBulkActionsRow.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { Text } from '@chakra-ui/react/text';\nimport { VisuallyHidden } from '@chakra-ui/react/visually-hidden';\nimport { forwardRef, type ReactNode, useEffect, useState } from 'react';\n\nimport formatLabel from '../../utilities/formatLabel';\nimport BitkitButton from '../BitkitButton/BitkitButton';\n\n/**\n * The noun the bar counts. A single string is used for every count; pass `{ one, other }` to get\n * `1 workflow selected.` instead of `1 workflows selected.`\n */\nexport type BitkitBulkActionsItems = string | { one: string; other: string };\n\n/**\n * Overrides for the bar's sentences. Each template can use `{items}` (the `items` prop, already\n * resolved to the form matching that sentence's count), `{selectedCount}` and `{totalItems}`.\n * Override a whole sentence for wording a template can't express, such as another language's\n * grammar.\n */\nexport interface BitkitBulkActionsLabels {\n /** `selectionState=\"all\"`. Default: `All {totalItems} {items} selected.` */\n allSelected?: string;\n /** Default: `Cancel` */\n cancel?: string;\n /** The link offering the rows beyond this page. Default: `Select all {totalItems} {items}` */\n selectAll?: string;\n /** `selectionState=\"some\"`. Default: `{selectedCount} {items} selected.` */\n selected?: string;\n /** `selectionState=\"allOnPage\"`. Default: `{selectedCount} {items} selected on this page.` */\n selectedOnPage?: string;\n}\n\nconst DEFAULT_LABELS: Required<BitkitBulkActionsLabels> = {\n allSelected: 'All {totalItems} {items} selected.',\n cancel: 'Cancel',\n selectAll: 'Select all {totalItems} {items}',\n selected: '{selectedCount} {items} selected.',\n selectedOnPage: '{selectedCount} {items} selected on this page.',\n};\n\nconst DEFAULT_ITEMS: BitkitBulkActionsItems = { one: 'item', other: 'items' };\n\nconst resolveItems = (items: BitkitBulkActionsItems, count: number) => {\n if (typeof items === 'string') return items;\n return count === 1 ? items.one : items.other;\n};\n\nexport interface BitkitBulkActionsRowProps extends Omit<Table.RowProps, 'children'> {\n /** The bulk action buttons, rendered after `Cancel`. */\n children?: ReactNode;\n /** Must match the table's column count, so the row spans the full width. */\n colSpan: number;\n /** The counted noun. Default: `{ one: 'item', other: 'items' }` */\n items?: BitkitBulkActionsItems;\n labels?: BitkitBulkActionsLabels;\n onCancel: () => void;\n /** Renders the `Select all {totalItems} {items}` link while `selectionState=\"allOnPage\"`. */\n onSelectAll?: () => void;\n selectedCount: number;\n /**\n * `some` — part of the page is selected. `allOnPage` — the whole page is selected, and the rows\n * beyond it are still on offer. `all` — everything across every page is selected.\n */\n selectionState: 'some' | 'allOnPage' | 'all';\n totalItems: number;\n}\n\n/**\n * The bar above the column headers that appears while rows are selected: what is selected, the\n * offer to widen the selection to every page, and the actions to run on it. Belongs in\n * `Table.Header`, before the `Table.Row` that holds the column headers.\n *\n * The count is mirrored into a visually hidden `aria-live` region, which is deliberately filled a\n * render after mount — a live region that enters the DOM with its text already in it is not\n * announced, so the first selection would go unspoken otherwise.\n *\n * @example\n * ```tsx\n * <Table.Header>\n * {selected.length > 0 && (\n * <BitkitBulkActionsRow\n * colSpan={COL_COUNT}\n * items={{ one: 'workflow', other: 'workflows' }}\n * onCancel={clearSelection}\n * onSelectAll={() => setAllAcrossPages(true)}\n * selectedCount={selected.length}\n * selectionState={selectionState}\n * totalItems={TOTAL_ITEMS}\n * >\n * <BitkitButton icon={IconMinusCircle} size=\"md\" variant=\"danger-secondary\">\n * Remove\n * </BitkitButton>\n * </BitkitBulkActionsRow>\n * )}\n * <Table.Row>{columnHeaders}</Table.Row>\n * </Table.Header>\n * ```\n */\nconst BitkitBulkActionsRow = forwardRef<HTMLTableRowElement, BitkitBulkActionsRowProps>((props, ref) => {\n const {\n children,\n colSpan,\n items = DEFAULT_ITEMS,\n labels: labelsProp,\n onCancel,\n onSelectAll,\n selectedCount,\n selectionState,\n totalItems,\n ...rest\n } = props;\n\n const styles = useTableStyles();\n const labels = { ...DEFAULT_LABELS, ...labelsProp };\n\n const countLabel = {\n all: labels.allSelected,\n allOnPage: labels.selectedOnPage,\n some: labels.selected,\n }[selectionState];\n const count = selectionState === 'all' ? totalItems : selectedCount;\n\n const countText = formatLabel(countLabel, {\n items: resolveItems(items, count),\n selectedCount,\n totalItems,\n });\n\n const selectAllText = formatLabel(labels.selectAll, {\n items: resolveItems(items, totalItems),\n selectedCount,\n totalItems,\n });\n\n const [announcement, setAnnouncement] = useState('');\n\n useEffect(() => {\n setAnnouncement(countText);\n }, [countText]);\n\n return (\n <Table.Row ref={ref} {...rest}>\n <Table.Cell colSpan={colSpan} css={styles.utilityCell}>\n <Box css={styles.bulkActionsGroup}>\n <Text color=\"text/body\" textStyle=\"body/md/regular\">\n {countText}\n </Text>\n <VisuallyHidden aria-live=\"polite\">{announcement}</VisuallyHidden>\n {selectionState === 'allOnPage' && !!onSelectAll && (\n <BitkitButton onClick={onSelectAll} size=\"sm\" variant=\"tertiary\">\n {selectAllText}\n </BitkitButton>\n )}\n <Box css={styles.bulkActionsButtons}>\n <BitkitButton onClick={onCancel} size=\"md\" variant=\"tertiary\">\n {labels.cancel}\n </BitkitButton>\n {children}\n </Box>\n </Box>\n </Table.Cell>\n </Table.Row>\n );\n});\n\nBitkitBulkActionsRow.displayName = 'BitkitBulkActionsRow';\n\nexport default BitkitBulkActionsRow;\n"],"mappings":";;;;;;;;;AAkCA,IAAM,iBAAoD;CACxD,aAAa;CACb,QAAQ;CACR,WAAW;CACX,UAAU;CACV,gBAAgB;AAClB;AAEA,IAAM,gBAAwC;CAAE,KAAK;CAAQ,OAAO;AAAQ;AAE5E,IAAM,gBAAgB,OAA+B,UAAkB;CACrE,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,OAAO,UAAU,IAAI,MAAM,MAAM,MAAM;AACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,IAAM,uBAAuB,YAA4D,OAAO,QAAQ;CACtG,MAAM,EACJ,UACA,SACA,QAAQ,eACR,QAAQ,YACR,UACA,aACA,eACA,gBACA,YACA,GAAG,SACD;CAEJ,MAAM,SAAS,eAAe;CAC9B,MAAM,SAAS;EAAE,GAAG;EAAgB,GAAG;CAAW;CAElD,MAAM,aAAa;EACjB,KAAK,OAAO;EACZ,WAAW,OAAO;EAClB,MAAM,OAAO;CACf,EAAE;CAGF,MAAM,YAAY,YAAY,YAAY;EACxC,OAAO,aAAa,OAHR,mBAAmB,QAAQ,aAAa,aAGpB;EAChC;EACA;CACF,CAAC;CAED,MAAM,gBAAgB,YAAY,OAAO,WAAW;EAClD,OAAO,aAAa,OAAO,UAAU;EACrC;EACA;CACF,CAAC;CAED,MAAM,CAAC,cAAc,mBAAmB,SAAS,EAAE;CAEnD,gBAAgB;EACd,gBAAgB,SAAS;CAC3B,GAAG,CAAC,SAAS,CAAC;CAEd,OACE,oBAAC,MAAM,KAAP;EAAgB;EAAK,GAAI;EACvB,UAAA,oBAAC,MAAM,MAAP;GAAqB;GAAS,KAAK,OAAO;GACxC,UAAA,qBAAC,KAAD;IAAK,KAAK,OAAO;IAAjB,UAAA;KACE,oBAAC,MAAD;MAAM,OAAM;MAAY,WAAU;MAC/B,UAAA;KACG,CAAA;KACN,oBAAC,gBAAD;MAAgB,aAAU;MAAU,UAAA;KAA6B,CAAA;KAChE,mBAAmB,eAAe,CAAC,CAAC,eACnC,oBAAC,cAAD;MAAc,SAAS;MAAa,MAAK;MAAK,SAAQ;MACnD,UAAA;KACW,CAAA;KAEhB,qBAAC,KAAD;MAAK,KAAK,OAAO;MAAjB,UAAA,CACE,oBAAC,cAAD;OAAc,SAAS;OAAU,MAAK;OAAK,SAAQ;OAChD,UAAA,OAAO;MACI,CAAA,GACb,QACE;;IACF;;EACK,CAAA;CACH,CAAA;AAEf,CAAC;AAED,qBAAqB,cAAc"}
1
+ {"version":3,"file":"BitkitBulkActionsRow.js","names":[],"sources":["../../../lib/components/BitkitTable/BitkitBulkActionsRow.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { Text } from '@chakra-ui/react/text';\nimport { VisuallyHidden } from '@chakra-ui/react/visually-hidden';\nimport { forwardRef, type ReactNode, useEffect, useState } from 'react';\n\nimport formatLabel from '../../utilities/formatLabel';\nimport BitkitButton from '../BitkitButton/BitkitButton';\n\n/**\n * The noun the bar counts. A single string is used for every count; pass `{ one, other }` to get\n * `1 workflow selected.` instead of `1 workflows selected.`\n */\nexport type BitkitBulkActionsItems = string | { one: string; other: string };\n\n/**\n * Overrides for the bar's sentences. Each template can use `{items}` (the `items` prop, already\n * resolved to the form matching that sentence's count), `{selectedCount}` and `{totalItems}`.\n * Override a whole sentence for wording a template can't express, such as another language's\n * grammar.\n */\nexport interface BitkitBulkActionsLabels {\n /** `selectionState=\"all\"`. Default: `All {totalItems} {items} selected.` */\n allSelected?: string;\n /** Default: `Cancel` */\n cancel?: string;\n /** The link offering the rows beyond this page. Default: `Select all {totalItems} {items}` */\n selectAll?: string;\n /** `selectionState=\"some\"`. Default: `{selectedCount} {items} selected.` */\n selected?: string;\n /** `selectionState=\"allOnPage\"`. Default: `{selectedCount} {items} selected on this page.` */\n selectedOnPage?: string;\n}\n\nconst DEFAULT_LABELS: Required<BitkitBulkActionsLabels> = {\n allSelected: 'All {totalItems} {items} selected.',\n cancel: 'Cancel',\n selectAll: 'Select all {totalItems} {items}',\n selected: '{selectedCount} {items} selected.',\n selectedOnPage: '{selectedCount} {items} selected on this page.',\n};\n\nconst DEFAULT_ITEMS: BitkitBulkActionsItems = { one: 'item', other: 'items' };\n\nconst resolveItems = (items: BitkitBulkActionsItems, count: number) => {\n if (typeof items === 'string') return items;\n return count === 1 ? items.one : items.other;\n};\n\nexport interface BitkitBulkActionsRowProps extends Omit<Table.RowProps, 'children'> {\n /** The bulk action buttons, rendered after `Cancel`. */\n children?: ReactNode;\n /** Must match the table's column count, so the row spans the full width. */\n colSpan: number;\n /** The counted noun. Default: `{ one: 'item', other: 'items' }` */\n items?: BitkitBulkActionsItems;\n labels?: BitkitBulkActionsLabels;\n onCancel: () => void;\n /** Renders the `Select all {totalItems} {items}` link while `selectionState=\"allOnPage\"`. */\n onSelectAll?: () => void;\n selectedCount: number;\n /**\n * `some` — part of the page is selected. `allOnPage` — the whole page is selected, and the rows\n * beyond it are still on offer. `all` — everything across every page is selected.\n */\n selectionState: 'some' | 'allOnPage' | 'all';\n totalItems: number;\n}\n\n/**\n * The bar above the column headers that appears while rows are selected: what is selected, the\n * offer to widen the selection to every page, and the actions to run on it. Belongs in\n * `BitkitTable.Header`, before the `BitkitTable.Row` that holds the column headers.\n *\n * The count is mirrored into a visually hidden `aria-live` region, which is deliberately filled a\n * render after mount — a live region that enters the DOM with its text already in it is not\n * announced, so the first selection would go unspoken otherwise.\n *\n * @example\n * ```tsx\n * <BitkitTable.Header>\n * {selected.length > 0 && (\n * <BitkitTable.BulkActionsRow\n * colSpan={COL_COUNT}\n * items={{ one: 'workflow', other: 'workflows' }}\n * onCancel={clearSelection}\n * onSelectAll={() => setAllAcrossPages(true)}\n * selectedCount={selected.length}\n * selectionState={selectionState}\n * totalItems={TOTAL_ITEMS}\n * >\n * <BitkitButton icon={IconMinusCircle} size=\"md\" variant=\"danger-secondary\">\n * Remove\n * </BitkitButton>\n * </BitkitTable.BulkActionsRow>\n * )}\n * <BitkitTable.Row>{columnHeaders}</BitkitTable.Row>\n * </BitkitTable.Header>\n * ```\n */\nconst BitkitBulkActionsRow = forwardRef<HTMLTableRowElement, BitkitBulkActionsRowProps>((props, ref) => {\n const {\n children,\n colSpan,\n items = DEFAULT_ITEMS,\n labels: labelsProp,\n onCancel,\n onSelectAll,\n selectedCount,\n selectionState,\n totalItems,\n ...rest\n } = props;\n\n const styles = useTableStyles();\n const labels = { ...DEFAULT_LABELS, ...labelsProp };\n\n const countLabel = {\n all: labels.allSelected,\n allOnPage: labels.selectedOnPage,\n some: labels.selected,\n }[selectionState];\n const count = selectionState === 'all' ? totalItems : selectedCount;\n\n const countText = formatLabel(countLabel, {\n items: resolveItems(items, count),\n selectedCount,\n totalItems,\n });\n\n const selectAllText = formatLabel(labels.selectAll, {\n items: resolveItems(items, totalItems),\n selectedCount,\n totalItems,\n });\n\n const [announcement, setAnnouncement] = useState('');\n\n useEffect(() => {\n setAnnouncement(countText);\n }, [countText]);\n\n return (\n <Table.Row ref={ref} {...rest}>\n <Table.Cell colSpan={colSpan} css={styles.utilityCell}>\n <Box css={styles.bulkActionsGroup}>\n <Text color=\"text/body\" textStyle=\"body/md/regular\">\n {countText}\n </Text>\n <VisuallyHidden aria-live=\"polite\">{announcement}</VisuallyHidden>\n {selectionState === 'allOnPage' && !!onSelectAll && (\n <BitkitButton onClick={onSelectAll} size=\"sm\" variant=\"tertiary\">\n {selectAllText}\n </BitkitButton>\n )}\n <Box css={styles.bulkActionsButtons}>\n <BitkitButton onClick={onCancel} size=\"md\" variant=\"tertiary\">\n {labels.cancel}\n </BitkitButton>\n {children}\n </Box>\n </Box>\n </Table.Cell>\n </Table.Row>\n );\n});\n\nBitkitBulkActionsR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AAA;KAA6B,CAAA;KAChE,mBAAmB,eAAe,CAAC,CAAC,eACnC,oBAAC,cAAD;MAAc,SAAS;MAAa,MAAK;MAAK,SAAQ;MACnD,UAAA;KACW,CAAA;KAEhB,qBAAC,KAAD;MAAK,KAAK,OAAO;MAAjB,UAAA,CACE,oBAAC,cAAD;OAAc,SAAS;OAAU,MAAK;OAAK,SAAQ;OAChD,UAAA,OAAO;MACI,CAAA,GACb,QACE;;IACF;;EACK,CAAA;CACH,CAAA;AAEf,CAAC;AAED,qBAAqB,cAAc"}
@@ -2,7 +2,7 @@ import { Table } from '@chakra-ui/react/table';
2
2
  import { BitkitDefinitionTooltipProps } from '../BitkitDefinitionTooltip/BitkitDefinitionTooltip';
3
3
  /**
4
4
  * Everything `BitkitDefinitionTooltip` takes — `children` is the column title, `text` the definition
5
- * — on top of everything a `Table.ColumnHeader` takes. The two the header owns are gone: `textSize`,
5
+ * — on top of everything a `BitkitTable.ColumnHeader` takes. The two the header owns are gone: `textSize`,
6
6
  * because the point is to keep the header's own type, and the tooltip's `truncate`, because the title
7
7
  * always truncates and `truncate` stays the header cell's own style prop.
8
8
  */
@@ -17,7 +17,7 @@ export interface BitkitDefinitionColumnHeaderProps extends Omit<Table.ColumnHead
17
17
  * the latter's recipe always applies a `textSize`, and there is no value for it that means "inherit".
18
18
  *
19
19
  * Only the title is the trigger, so the rest of the header stays inert. Everything else a
20
- * `Table.ColumnHeader` takes — `textAlign`, `width`, `colSpan` — still applies.
20
+ * `BitkitTable.ColumnHeader` takes — `textAlign`, `width`, `colSpan` — still applies.
21
21
  */
22
22
  declare const BitkitDefinitionColumnHeader: import('react').ForwardRefExoticComponent<BitkitDefinitionColumnHeaderProps & import('react').RefAttributes<HTMLTableCellElement>>;
23
23
  export default BitkitDefinitionColumnHeader;
@@ -13,7 +13,7 @@ import { Table, useTableStyles } from "@chakra-ui/react/table";
13
13
  * the latter's recipe always applies a `textSize`, and there is no value for it that means "inherit".
14
14
  *
15
15
  * Only the title is the trigger, so the rest of the header stays inert. Everything else a
16
- * `Table.ColumnHeader` takes — `textAlign`, `width`, `colSpan` — still applies.
16
+ * `BitkitTable.ColumnHeader` takes — `textAlign`, `width`, `colSpan` — still applies.
17
17
  */
18
18
  var BitkitDefinitionColumnHeader = forwardRef(({ button, children, disablePortal, learnMoreTarget, learnMoreUrl, method = "click", placement, text, ...rest }, ref) => {
19
19
  const styles = useTableStyles();
@@ -46,7 +46,7 @@ var BitkitDefinitionColumnHeader = forwardRef(({ button, children, disablePortal
46
46
  })
47
47
  });
48
48
  });
49
- BitkitDefinitionColumnHeader.displayName = "BitkitDefinitionColumnHeader";
49
+ BitkitDefinitionColumnHeader.displayName = "BitkitTable.DefinitionColumnHeader";
50
50
  //#endregion
51
51
  export { BitkitDefinitionColumnHeader as default };
52
52
 
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitDefinitionColumnHeader.js","names":[],"sources":["../../../lib/components/BitkitTable/BitkitDefinitionColumnHeader.tsx"],"sourcesContent":["import { chakra } from '@chakra-ui/react/styled-system';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef, useState } from 'react';\n\nimport { type BitkitDefinitionTooltipProps } from '../BitkitDefinitionTooltip/BitkitDefinitionTooltip';\nimport BitkitTooltip from '../BitkitTooltip/BitkitTooltip';\n\n/**\n * Everything `BitkitDefinitionTooltip` takes — `children` is the column title, `text` the definition\n * — on top of everything a `Table.ColumnHeader` takes. The two the header owns are gone: `textSize`,\n * because the point is to keep the header's own type, and the tooltip's `truncate`, because the title\n * always truncates and `truncate` stays the header cell's own style prop.\n */\nexport interface BitkitDefinitionColumnHeaderProps\n extends Omit<Table.ColumnHeaderProps, 'children'>, Omit<BitkitDefinitionTooltipProps, 'textSize' | 'truncate'> {}\n\n/**\n * A column header whose title is a glossary term: underlined, and revealing what the column means on\n * demand. It is `BitkitDefinitionTooltip` for a table header — same props, same behaviour, except the\n * title keeps the header's own type (`heading/h5`) instead of the body type that component pins.\n *\n * That type is also why it composes `BitkitTooltip` rather than rendering a `BitkitDefinitionTooltip`:\n * the latter's recipe always applies a `textSize`, and there is no value for it that means \"inherit\".\n *\n * Only the title is the trigger, so the rest of the header stays inert. Everything else a\n * `Table.ColumnHeader` takes — `textAlign`, `width`, `colSpan` — still applies.\n */\nconst BitkitDefinitionColumnHeader = forwardRef<HTMLTableCellElement, BitkitDefinitionColumnHeaderProps>(\n (\n { button, children, disablePortal, learnMoreTarget, learnMoreUrl, method = 'click', placement, text, ...rest },\n ref,\n ) => {\n const styles = useTableStyles();\n const [open, setOpen] = useState(false);\n const isClick = method === 'click';\n\n return (\n <Table.ColumnHeader ref={ref} {...rest}>\n <BitkitTooltip\n button={button}\n closeOnClick={isClick ? false : undefined}\n disablePortal={disablePortal}\n learnMoreTarget={learnMoreTarget}\n learnMoreUrl={learnMoreUrl}\n onOpenChange={\n isClick\n ? ({ open: nextOpen }) => {\n if (!nextOpen) setOpen(false);\n }\n : undefined\n }\n open={isClick ? open : undefined}\n openDelay={isClick ? Infinity : undefined}\n placement={placement}\n text={text}\n >\n {/* chakra.button: no named primitive attaches a recipe slot to a bare trigger button */}\n <chakra.button\n aria-expanded={isClick ? open : undefined}\n css={styles.definitionTrigger}\n onClick={isClick ? () => setOpen(!open) : undefined}\n truncate\n type=\"button\"\n >\n {children}\n </chakra.button>\n </BitkitTooltip>\n </Table.ColumnHeader>\n );\n },\n);\n\nBitkitDefinitionColumnHeader.displayName = 'BitkitDefinitionColumnHeader';\n\nexport default BitkitDefinitionColumnHeader;\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,IAAM,+BAA+B,YAEjC,EAAE,QAAQ,UAAU,eAAe,iBAAiB,cAAc,SAAS,SAAS,WAAW,MAAM,GAAG,QACxG,QACG;CACH,MAAM,SAAS,eAAe;CAC9B,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,UAAU,WAAW;CAE3B,OACE,oBAAC,MAAM,cAAP;EAAyB;EAAK,GAAI;EAChC,UAAA,oBAAC,eAAD;GACU;GACR,cAAc,UAAU,QAAQ,KAAA;GACjB;GACE;GACH;GACd,cACE,WACK,EAAE,MAAM,eAAe;IACtB,IAAI,CAAC,UAAU,QAAQ,KAAK;GAC9B,IACA,KAAA;GAEN,MAAM,UAAU,OAAO,KAAA;GACvB,WAAW,UAAU,WAAW,KAAA;GACrB;GACL;GAGN,UAAA,oBAAC,OAAO,QAAR;IACE,iBAAe,UAAU,OAAO,KAAA;IAChC,KAAK,OAAO;IACZ,SAAS,gBAAgB,QAAQ,CAAC,IAAI,IAAI,KAAA;IAC1C,UAAA;IACA,MAAK;IAEJ;GACY,CAAA;EACF,CAAA;CACG,CAAA;AAExB,CACF;AAEA,6BAA6B,cAAc"}
1
+ {"version":3,"file":"BitkitDefinitionColumnHeader.js","names":[],"sources":["../../../lib/components/BitkitTable/BitkitDefinitionColumnHeader.tsx"],"sourcesContent":["import { chakra } from '@chakra-ui/react/styled-system';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef, useState } from 'react';\n\nimport { type BitkitDefinitionTooltipProps } from '../BitkitDefinitionTooltip/BitkitDefinitionTooltip';\nimport BitkitTooltip from '../BitkitTooltip/BitkitTooltip';\n\n/**\n * Everything `BitkitDefinitionTooltip` takes — `children` is the column title, `text` the definition\n * — on top of everything a `BitkitTable.ColumnHeader` takes. The two the header owns are gone: `textSize`,\n * because the point is to keep the header's own type, and the tooltip's `truncate`, because the title\n * always truncates and `truncate` stays the header cell's own style prop.\n */\nexport interface BitkitDefinitionColumnHeaderProps\n extends Omit<Table.ColumnHeaderProps, 'children'>, Omit<BitkitDefinitionTooltipProps, 'textSize' | 'truncate'> {}\n\n/**\n * A column header whose title is a glossary term: underlined, and revealing what the column means on\n * demand. It is `BitkitDefinitionTooltip` for a table header — same props, same behaviour, except the\n * title keeps the header's own type (`heading/h5`) instead of the body type that component pins.\n *\n * That type is also why it composes `BitkitTooltip` rather than rendering a `BitkitDefinitionTooltip`:\n * the latter's recipe always applies a `textSize`, and there is no value for it that means \"inherit\".\n *\n * Only the title is the trigger, so the rest of the header stays inert. Everything else a\n * `BitkitTable.ColumnHeader` takes — `textAlign`, `width`, `colSpan` — still applies.\n */\nconst BitkitDefinitionColumnHeader = forwardRef<HTMLTableCellElement, BitkitDefinitionColumnHeaderProps>(\n (\n { button, children, disablePortal, learnMoreTarget, learnMoreUrl, method = 'click', placement, text, ...rest },\n ref,\n ) => {\n const styles = useTableStyles();\n const [open, setOpen] = useState(false);\n const isClick = method === 'click';\n\n return (\n <Table.ColumnHeader ref={ref} {...rest}>\n <BitkitTooltip\n button={button}\n closeOnClick={isClick ? false : undefined}\n disablePortal={disablePortal}\n learnMoreTarget={learnMoreTarget}\n learnMoreUrl={learnMoreUrl}\n onOpenChange={\n isClick\n ? ({ open: nextOpen }) => {\n if (!nextOpen) setOpen(false);\n }\n : undefined\n }\n open={isClick ? open : undefined}\n openDelay={isClick ? Infinity : undefined}\n placement={placement}\n text={text}\n >\n {/* chakra.button: no named primitive attaches a recipe slot to a bare trigger button */}\n <chakra.button\n aria-expanded={isClick ? open : undefined}\n css={styles.definitionTrigger}\n onClick={isClick ? () => setOpen(!open) : undefined}\n truncate\n type=\"button\"\n >\n {children}\n </chakra.button>\n </BitkitTooltip>\n </Table.ColumnHeader>\n );\n },\n);\n\nBitkitDefinitionColumnHeader.displayName = 'BitkitTable.DefinitionColumnHeader';\n\nexport default BitkitDefinitionColumnHeader;\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,IAAM,+BAA+B,YAEjC,EAAE,QAAQ,UAAU,eAAe,iBAAiB,cAAc,SAAS,SAAS,WAAW,MAAM,GAAG,QACxG,QACG;CACH,MAAM,SAAS,eAAe;CAC9B,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,UAAU,WAAW;CAE3B,OACE,oBAAC,MAAM,cAAP;EAAyB;EAAK,GAAI;EAChC,UAAA,oBAAC,eAAD;GACU;GACR,cAAc,UAAU,QAAQ,KAAA;GACjB;GACE;GACH;GACd,cACE,WACK,EAAE,MAAM,eAAe;IACtB,IAAI,CAAC,UAAU,QAAQ,KAAK;GAC9B,IACA,KAAA;GAEN,MAAM,UAAU,OAAO,KAAA;GACvB,WAAW,UAAU,WAAW,KAAA;GACrB;GACL;GAGN,UAAA,oBAAC,OAAO,QAAR;IACE,iBAAe,UAAU,OAAO,KAAA;IAChC,KAAK,OAAO;IACZ,SAAS,gBAAgB,QAAQ,CAAC,IAAI,IAAI,KAAA;IAC1C,UAAA;IACA,MAAK;IAEJ;GACY,CAAA;EACF,CAAA;CACG,CAAA;AAExB,CACF;AAEA,6BAA6B,cAAc"}
@@ -37,7 +37,7 @@ var BitkitExpandableRow = forwardRef(({ children, colSpan, defaultOpen = false,
37
37
  })] })
38
38
  });
39
39
  });
40
- BitkitExpandableRow.displayName = "BitkitExpandableRow";
40
+ BitkitExpandableRow.displayName = "BitkitTable.ExpandableRow";
41
41
  //#endregion
42
42
  export { BitkitExpandableRow as default };
43
43
 
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitExpandableRow.js","names":[],"sources":["../../../lib/components/BitkitTable/BitkitExpandableRow.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Collapsible } from '@chakra-ui/react/collapsible';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport AssetSelectChevron from '../../utilities/AssetSelectChevron';\n\nexport interface BitkitExpandableRowProps {\n children: ReactNode;\n colSpan: number;\n defaultOpen?: boolean;\n expandedContent: ReactNode;\n}\n\nconst BitkitExpandableRow = forwardRef<HTMLTableRowElement, BitkitExpandableRowProps>(\n ({ children, colSpan, defaultOpen = false, expandedContent }, ref) => {\n const styles = useTableStyles();\n\n return (\n <Collapsible.Root asChild defaultOpen={defaultOpen}>\n <>\n <Table.Row ref={ref} css={styles.expandableRow}>\n <Table.Cell css={styles.expandCell}>\n <Collapsible.Trigger aria-label=\"Toggle row details\" css={styles.expandTrigger}>\n <Collapsible.Indicator asChild>\n <AssetSelectChevron color=\"button/secondary/text\" />\n </Collapsible.Indicator>\n </Collapsible.Trigger>\n </Table.Cell>\n {children}\n </Table.Row>\n <Table.Row css={styles.expandedRow}>\n <Table.Cell colSpan={colSpan} css={styles.expandedCell}>\n <Collapsible.Content>\n <Box css={styles.expandedContent}>{expandedContent}</Box>\n </Collapsible.Content>\n </Table.Cell>\n </Table.Row>\n </>\n </Collapsible.Root>\n );\n },\n);\n\nBitkitExpandableRow.displayName = 'BitkitExpandableRow';\n\nexport default BitkitExpandableRow;\n"],"mappings":";;;;;;;AAcA,IAAM,sBAAsB,YACzB,EAAE,UAAU,SAAS,cAAc,OAAO,mBAAmB,QAAQ;CACpE,MAAM,SAAS,eAAe;CAE9B,OACE,oBAAC,YAAY,MAAb;EAAkB,SAAA;EAAqB;EACrC,UAAA,qBAAA,YAAA,EAAA,UAAA,CACE,qBAAC,MAAM,KAAP;GAAgB;GAAK,KAAK,OAAO;GAAjC,UAAA,CACE,oBAAC,MAAM,MAAP;IAAY,KAAK,OAAO;IACtB,UAAA,oBAAC,YAAY,SAAb;KAAqB,cAAW;KAAqB,KAAK,OAAO;KAC/D,UAAA,oBAAC,YAAY,WAAb;MAAuB,SAAA;MACrB,UAAA,oBAAC,oBAAD,EAAoB,OAAM,wBAAyB,CAAA;KAC9B,CAAA;IACJ,CAAA;GACX,CAAA,GACX,QACQ;EACX,CAAA,GAAA,oBAAC,MAAM,KAAP;GAAW,KAAK,OAAO;GACrB,UAAA,oBAAC,MAAM,MAAP;IAAqB;IAAS,KAAK,OAAO;IACxC,UAAA,oBAAC,YAAY,SAAb,EAAA,UACE,oBAAC,KAAD;KAAK,KAAK,OAAO;KAAkB,UAAA;IAAqB,CAAA,EACrC,CAAA;GACX,CAAA;EACH,CAAA,CACX,EAAA,CAAA;CACc,CAAA;AAEtB,CACF;AAEA,oBAAoB,cAAc"}
1
+ {"version":3,"file":"BitkitExpandableRow.js","names":[],"sources":["../../../lib/components/BitkitTable/BitkitExpandableRow.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Collapsible } from '@chakra-ui/react/collapsible';\nimport { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport AssetSelectChevron from '../../utilities/AssetSelectChevron';\n\nexport interface BitkitExpandableRowProps {\n children: ReactNode;\n colSpan: number;\n defaultOpen?: boolean;\n expandedContent: ReactNode;\n}\n\nconst BitkitExpandableRow = forwardRef<HTMLTableRowElement, BitkitExpandableRowProps>(\n ({ children, colSpan, defaultOpen = false, expandedContent }, ref) => {\n const styles = useTableStyles();\n\n return (\n <Collapsible.Root asChild defaultOpen={defaultOpen}>\n <>\n <Table.Row ref={ref} css={styles.expandableRow}>\n <Table.Cell css={styles.expandCell}>\n <Collapsible.Trigger aria-label=\"Toggle row details\" css={styles.expandTrigger}>\n <Collapsible.Indicator asChild>\n <AssetSelectChevron color=\"button/secondary/text\" />\n </Collapsible.Indicator>\n </Collapsible.Trigger>\n </Table.Cell>\n {children}\n </Table.Row>\n <Table.Row css={styles.expandedRow}>\n <Table.Cell colSpan={colSpan} css={styles.expandedCell}>\n <Collapsible.Content>\n <Box css={styles.expandedContent}>{expandedContent}</Box>\n </Collapsible.Content>\n </Table.Cell>\n </Table.Row>\n </>\n </Collapsible.Root>\n );\n },\n);\n\nBitkitExpandableRow.displayName = 'BitkitTable.ExpandableRow';\n\nexport default BitkitExpandableRow;\n"],"mappings":";;;;;;;AAcA,IAAM,sBAAsB,YACzB,EAAE,UAAU,SAAS,cAAc,OAAO,mBAAmB,QAAQ;CACpE,MAAM,SAAS,eAAe;CAE9B,OACE,oBAAC,YAAY,MAAb;EAAkB,SAAA;EAAqB;EACrC,UAAA,qBAAA,YAAA,EAAA,UAAA,CACE,qBAAC,MAAM,KAAP;GAAgB;GAAK,KAAK,OAAO;GAAjC,UAAA,CACE,oBAAC,MAAM,MAAP;IAAY,KAAK,OAAO;IACtB,UAAA,oBAAC,YAAY,SAAb;KAAqB,cAAW;KAAqB,KAAK,OAAO;KAC/D,UAAA,oBAAC,YAAY,WAAb;MAAuB,SAAA;MACrB,UAAA,oBAAC,oBAAD,EAAoB,OAAM,wBAAyB,CAAA;KAC9B,CAAA;IACJ,CAAA;GACX,CAAA,GACX,QACQ;EACX,CAAA,GAAA,oBAAC,MAAM,KAAP;GAAW,KAAK,OAAO;GACrB,UAAA,oBAAC,MAAM,MAAP;IAAqB;IAAS,KAAK,OAAO;IACxC,UAAA,oBAAC,YAAY,SAAb,EAAA,UACE,oBAAC,KAAD;KAAK,KAAK,OAAO;KAAkB,UAAA;IAAqB,CAAA,EACrC,CAAA;GACX,CAAA;EACH,CAAA,CACX,EAAA,CAAA;CACc,CAAA;AAEtB,CACF;AAEA,oBAAoB,cAAc"}