@bitrise/bitkit-v2 0.3.477-beta.3030 → 0.3.478-beta.3034

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 (135) hide show
  1. package/dist/components/BitkitCalendar/BitkitCalendar.d.ts +12 -0
  2. package/dist/components/BitkitCalendar/BitkitCalendar.js +7 -1
  3. package/dist/components/BitkitCalendar/BitkitCalendar.js.map +1 -1
  4. package/dist/components/BitkitCalendar/components/CalendarContent.d.ts +5 -1
  5. package/dist/components/BitkitCalendar/components/CalendarContent.js +60 -43
  6. package/dist/components/BitkitCalendar/components/CalendarContent.js.map +1 -1
  7. package/dist/components/BitkitCalendar/components/CalendarMonth.d.ts +4 -2
  8. package/dist/components/BitkitCalendar/components/CalendarMonth.js +15 -5
  9. package/dist/components/BitkitCalendar/components/CalendarMonth.js.map +1 -1
  10. package/dist/components/BitkitCalendar/components/CalendarMonthSelect.d.ts +2 -1
  11. package/dist/components/BitkitCalendar/components/CalendarMonthSelect.js +3 -2
  12. package/dist/components/BitkitCalendar/components/CalendarMonthSelect.js.map +1 -1
  13. package/dist/components/BitkitCalendar/components/CalendarNextTrigger.d.ts +3 -1
  14. package/dist/components/BitkitCalendar/components/CalendarNextTrigger.js +3 -3
  15. package/dist/components/BitkitCalendar/components/CalendarNextTrigger.js.map +1 -1
  16. package/dist/components/BitkitCalendar/components/CalendarPrevTrigger.d.ts +3 -1
  17. package/dist/components/BitkitCalendar/components/CalendarPrevTrigger.js +3 -3
  18. package/dist/components/BitkitCalendar/components/CalendarPrevTrigger.js.map +1 -1
  19. package/dist/components/BitkitCalendar/components/CalendarSelect.d.ts +1 -0
  20. package/dist/components/BitkitCalendar/components/CalendarSelect.js +5 -3
  21. package/dist/components/BitkitCalendar/components/CalendarSelect.js.map +1 -1
  22. package/dist/components/BitkitCalendar/components/CalendarYearSelect.d.ts +2 -1
  23. package/dist/components/BitkitCalendar/components/CalendarYearSelect.js +3 -2
  24. package/dist/components/BitkitCalendar/components/CalendarYearSelect.js.map +1 -1
  25. package/dist/components/BitkitDatePicker/BitkitDatePicker.d.ts +2 -0
  26. package/dist/components/BitkitDatePicker/BitkitDatePicker.js +2 -1
  27. package/dist/components/BitkitDatePicker/BitkitDatePicker.js.map +1 -1
  28. package/dist/components/BitkitFilter/BitkitFilter.context.d.ts +65 -0
  29. package/dist/components/BitkitFilter/BitkitFilter.context.js +82 -0
  30. package/dist/components/BitkitFilter/BitkitFilter.context.js.map +1 -0
  31. package/dist/components/BitkitFilter/BitkitFilter.d.ts +55 -0
  32. package/dist/components/BitkitFilter/BitkitFilter.js +247 -0
  33. package/dist/components/BitkitFilter/BitkitFilter.js.map +1 -0
  34. package/dist/components/BitkitFilter/BitkitFilter.utils.d.ts +18 -0
  35. package/dist/components/BitkitFilter/BitkitFilter.utils.js +42 -0
  36. package/dist/components/BitkitFilter/BitkitFilter.utils.js.map +1 -0
  37. package/dist/components/BitkitFilter/BitkitFilterAdd.d.ts +18 -0
  38. package/dist/components/BitkitFilter/BitkitFilterAdd.js +200 -0
  39. package/dist/components/BitkitFilter/BitkitFilterAdd.js.map +1 -0
  40. package/dist/components/BitkitFilter/BitkitFilterDateRange.d.ts +26 -0
  41. package/dist/components/BitkitFilter/BitkitFilterDateRange.js +118 -0
  42. package/dist/components/BitkitFilter/BitkitFilterDateRange.js.map +1 -0
  43. package/dist/components/BitkitFilter/BitkitFilterSearch.d.ts +23 -0
  44. package/dist/components/BitkitFilter/BitkitFilterSearch.js +72 -0
  45. package/dist/components/BitkitFilter/BitkitFilterSearch.js.map +1 -0
  46. package/dist/components/BitkitFilter/BitkitFilterSelect.d.ts +61 -0
  47. package/dist/components/BitkitFilter/BitkitFilterSelect.js +149 -0
  48. package/dist/components/BitkitFilter/BitkitFilterSelect.js.map +1 -0
  49. package/dist/components/BitkitFilter/BitkitFilterSwitch.d.ts +28 -0
  50. package/dist/components/BitkitFilter/BitkitFilterSwitch.js +87 -0
  51. package/dist/components/BitkitFilter/BitkitFilterSwitch.js.map +1 -0
  52. package/dist/components/BitkitFilter/components/FilterChip.d.ts +23 -0
  53. package/dist/components/BitkitFilter/components/FilterChip.js +66 -0
  54. package/dist/components/BitkitFilter/components/FilterChip.js.map +1 -0
  55. package/dist/components/BitkitFilter/components/FilterField.d.ts +15 -0
  56. package/dist/components/BitkitFilter/components/FilterField.js +60 -0
  57. package/dist/components/BitkitFilter/components/FilterField.js.map +1 -0
  58. package/dist/components/BitkitFilter/components/FilterPanel.d.ts +42 -0
  59. package/dist/components/BitkitFilter/components/FilterPanel.js +126 -0
  60. package/dist/components/BitkitFilter/components/FilterPanel.js.map +1 -0
  61. package/dist/components/BitkitFilter/components/FilterSearchInput.d.ts +15 -0
  62. package/dist/components/BitkitFilter/components/FilterSearchInput.js +41 -0
  63. package/dist/components/BitkitFilter/components/FilterSearchInput.js.map +1 -0
  64. package/dist/components/BitkitFilter/components/FilterSelectForm.d.ts +45 -0
  65. package/dist/components/BitkitFilter/components/FilterSelectForm.js +324 -0
  66. package/dist/components/BitkitFilter/components/FilterSelectForm.js.map +1 -0
  67. package/dist/components/BitkitLabelTooltip/BitkitLabelTooltip.d.ts +4 -3
  68. package/dist/components/BitkitLabelTooltip/BitkitLabelTooltip.js +3 -2
  69. package/dist/components/BitkitLabelTooltip/BitkitLabelTooltip.js.map +1 -1
  70. package/dist/components/BitkitMarkdown/BitkitMarkdown.js +1 -1
  71. package/dist/components/BitkitNoteCard/BitkitNoteCard.js +1 -1
  72. package/dist/components/BitkitSteps/BitkitSteps.d.ts +2 -0
  73. package/dist/components/BitkitSteps/BitkitSteps.js +9 -4
  74. package/dist/components/BitkitSteps/BitkitSteps.js.map +1 -1
  75. package/dist/components/index.d.ts +6 -1
  76. package/dist/main.js +8 -9
  77. package/dist/theme/recipes/index.d.ts +525 -0
  78. package/dist/theme/recipes/index.js +1 -3
  79. package/dist/theme/recipes/index.js.map +1 -1
  80. package/dist/theme/slot-recipes/DatePicker.recipe.d.ts +15 -0
  81. package/dist/theme/slot-recipes/DatePicker.recipe.js +72 -22
  82. package/dist/theme/slot-recipes/DatePicker.recipe.js.map +1 -1
  83. package/dist/theme/slot-recipes/DatePickerSelect.recipe.d.ts +85 -0
  84. package/dist/theme/slot-recipes/DatePickerSelect.recipe.js +35 -10
  85. package/dist/theme/slot-recipes/DatePickerSelect.recipe.js.map +1 -1
  86. package/dist/theme/slot-recipes/Filter.recipe.d.ts +37 -0
  87. package/dist/theme/slot-recipes/Filter.recipe.js +649 -0
  88. package/dist/theme/slot-recipes/Filter.recipe.js.map +1 -0
  89. package/dist/theme/slot-recipes/Listbox.recipe.d.ts +22 -0
  90. package/dist/theme/slot-recipes/Listbox.recipe.js +92 -0
  91. package/dist/theme/slot-recipes/Listbox.recipe.js.map +1 -0
  92. package/dist/theme/slot-recipes/Menu.recipe.js +6 -1
  93. package/dist/theme/slot-recipes/Menu.recipe.js.map +1 -1
  94. package/dist/theme/slot-recipes/Steps.recipe.js +1 -1
  95. package/dist/theme/slot-recipes/Steps.recipe.js.map +1 -1
  96. package/dist/theme/slot-recipes/Tag.recipe.d.ts +1 -1
  97. package/dist/theme/slot-recipes/index.d.ts +158 -2
  98. package/dist/theme/slot-recipes/index.js +4 -2
  99. package/dist/theme/slot-recipes/index.js.map +1 -1
  100. package/dist/theme/themeUtils.d.ts +0 -6
  101. package/dist/theme/themeUtils.js +1 -7
  102. package/dist/theme/themeUtils.js.map +1 -1
  103. package/dist/utilities/BitkitPortalContext.js +3 -2
  104. package/dist/utilities/BitkitPortalContext.js.map +1 -1
  105. package/docs/v1-to-v2-migration-guide.md +48 -1
  106. package/package.json +1 -1
  107. package/dist/components/BitkitUIHeader/BitkitUIHeader.d.ts +0 -37
  108. package/dist/components/BitkitUIHeader/BitkitUIHeader.js +0 -99
  109. package/dist/components/BitkitUIHeader/BitkitUIHeader.js.map +0 -1
  110. package/dist/components/BitkitUIHeader/BitriseLogo.d.ts +0 -10
  111. package/dist/components/BitkitUIHeader/BitriseLogo.js +0 -86
  112. package/dist/components/BitkitUIHeader/BitriseLogo.js.map +0 -1
  113. package/dist/components/BitkitUIHeader/UIHeaderAccount.d.ts +0 -22
  114. package/dist/components/BitkitUIHeader/UIHeaderAccount.js +0 -38
  115. package/dist/components/BitkitUIHeader/UIHeaderAccount.js.map +0 -1
  116. package/dist/components/BitkitUIHeader/UIHeaderButton.d.ts +0 -33
  117. package/dist/components/BitkitUIHeader/UIHeaderButton.js +0 -41
  118. package/dist/components/BitkitUIHeader/UIHeaderButton.js.map +0 -1
  119. package/dist/components/BitkitUIHeader/UIHeaderContext.d.ts +0 -13
  120. package/dist/components/BitkitUIHeader/UIHeaderContext.js +0 -11
  121. package/dist/components/BitkitUIHeader/UIHeaderContext.js.map +0 -1
  122. package/dist/components/BitkitUIHeader/UIHeaderControl.d.ts +0 -67
  123. package/dist/components/BitkitUIHeader/UIHeaderControl.js +0 -65
  124. package/dist/components/BitkitUIHeader/UIHeaderControl.js.map +0 -1
  125. package/dist/components/BitkitUIHeader/UIHeaderNavButton.d.ts +0 -20
  126. package/dist/components/BitkitUIHeader/UIHeaderNavButton.js +0 -46
  127. package/dist/components/BitkitUIHeader/UIHeaderNavButton.js.map +0 -1
  128. package/dist/components/BitkitUIHeader/UIHeaderSearch.d.ts +0 -32
  129. package/dist/components/BitkitUIHeader/UIHeaderSearch.js +0 -107
  130. package/dist/components/BitkitUIHeader/UIHeaderSearch.js.map +0 -1
  131. package/dist/theme/recipes/UIHeaderButton.recipe.js +0 -103
  132. package/dist/theme/recipes/UIHeaderButton.recipe.js.map +0 -1
  133. package/dist/theme/slot-recipes/UIHeader.recipe.d.ts +0 -3
  134. package/dist/theme/slot-recipes/UIHeader.recipe.js +0 -229
  135. package/dist/theme/slot-recipes/UIHeader.recipe.js.map +0 -1
@@ -1,67 +0,0 @@
1
- import { HTMLChakraProps } from '@chakra-ui/react/styled-system';
2
- import { ReactNode } from 'react';
3
- import { BitkitIconComponent } from '../../icons';
4
- interface ControlCommonProps {
5
- /**
6
- * Marks the control as carrying something unread. A dot, with no count — the design draws one
7
- * size of marker and nothing inside it.
8
- */
9
- badge?: boolean;
10
- /**
11
- * The control's accessible name. It shows no text of its own, so this is what a screen reader
12
- * announces.
13
- */
14
- label: string;
15
- /**
16
- * Marks the control as the one whose panel is open: a lighter background and an indicator along
17
- * the bottom edge of the bar. The consumer owns the panel, so it owns this too.
18
- *
19
- * It says nothing about where the user is. A control that is a link stays a link to somewhere
20
- * else, so this paints it without claiming it is the current page.
21
- */
22
- selected?: boolean;
23
- }
24
- interface ControlBaseCommonProps extends ControlCommonProps {
25
- children: ReactNode;
26
- /**
27
- * Which of the bar's control footprints to wear: the 48px square the icon controls and the
28
- * account button share, or the wider mobile navigation button. Named around the slot it picks
29
- * rather than `slot`, which is a native attribute every DOM element already takes.
30
- */
31
- footprint: 'control' | 'navButton';
32
- }
33
- interface ControlBaseAsButtonProps extends ControlBaseCommonProps, Omit<HTMLChakraProps<'button'>, 'children' | 'disabled'> {
34
- href?: undefined;
35
- isExternal?: undefined;
36
- }
37
- interface ControlBaseAsAnchorProps extends ControlBaseCommonProps, Omit<HTMLChakraProps<'a'>, 'children'> {
38
- href: string;
39
- isExternal?: boolean;
40
- }
41
- type ControlBaseProps = ControlBaseAsButtonProps | ControlBaseAsAnchorProps;
42
- /**
43
- * The chrome every control in the bar shares: the hover and selected backgrounds, the unread dot,
44
- * the indicator, and the choice between a button and a link. What sits inside it — an icon, an
45
- * avatar — is the caller's.
46
- */
47
- export declare const UIHeaderControlBase: import('react').ForwardRefExoticComponent<ControlBaseProps & import('react').RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
48
- export interface BitkitUIHeaderControlAsButtonProps extends ControlCommonProps, Omit<HTMLChakraProps<'button'>, 'children' | 'disabled'> {
49
- href?: undefined;
50
- icon: BitkitIconComponent;
51
- isExternal?: undefined;
52
- }
53
- export interface BitkitUIHeaderControlAsAnchorProps extends ControlCommonProps, Omit<HTMLChakraProps<'a'>, 'children'> {
54
- href: string;
55
- icon: BitkitIconComponent;
56
- isExternal?: boolean;
57
- }
58
- export type BitkitUIHeaderControlProps = BitkitUIHeaderControlAsButtonProps | BitkitUIHeaderControlAsAnchorProps;
59
- /**
60
- * One icon button in the header bar — changelog, help, notifications, the mobile navigation
61
- * opener. It is a link when given an `href` and a button otherwise.
62
- *
63
- * The icon carries no label of its own, so `label` is required. There is no tooltip: the design
64
- * does not draw one.
65
- */
66
- declare const UIHeaderControl: import('react').ForwardRefExoticComponent<BitkitUIHeaderControlProps & import('react').RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
67
- export default UIHeaderControl;
@@ -1,65 +0,0 @@
1
- import { useUIHeaderContext } from "./UIHeaderContext.js";
2
- import { Box } from "@chakra-ui/react/box";
3
- import { chakra } from "@chakra-ui/react/styled-system";
4
- import { forwardRef } from "react";
5
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
- //#region lib/components/BitkitUIHeader/UIHeaderControl.tsx
7
- /**
8
- * The chrome every control in the bar shares: the hover and selected backgrounds, the unread dot,
9
- * the indicator, and the choice between a button and a link. What sits inside it — an icon, an
10
- * avatar — is the caller's.
11
- */
12
- var UIHeaderControlBase = forwardRef((props, ref) => {
13
- const { styles } = useUIHeaderContext();
14
- const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
15
- props.children,
16
- props.badge && /* @__PURE__ */ jsx(Box, { css: styles.badge }),
17
- props.selected && /* @__PURE__ */ jsx(Box, { css: styles.indicator })
18
- ] });
19
- if (props.href !== void 0) {
20
- const { badge: _badge, children: _children, css, footprint, isExternal, label, rel, selected, target, ...anchorRest } = props;
21
- return /* @__PURE__ */ jsx(chakra.a, {
22
- ref,
23
- "aria-label": label,
24
- "data-selected": selected ? "" : void 0,
25
- rel: isExternal ? rel ? `${rel} noreferrer noopener` : "noreferrer noopener" : rel,
26
- target: isExternal ? "_blank" : target,
27
- ...anchorRest,
28
- css: [styles[footprint], css],
29
- children: content
30
- });
31
- }
32
- const { badge: _badge, children: _children, css, footprint, href: _href, isExternal: _isExternal, label, selected, ...buttonRest } = props;
33
- return /* @__PURE__ */ jsx(chakra.button, {
34
- ref,
35
- "aria-expanded": selected,
36
- "aria-label": label,
37
- "data-selected": selected ? "" : void 0,
38
- type: "button",
39
- ...buttonRest,
40
- css: [styles[footprint], css],
41
- children: content
42
- });
43
- });
44
- UIHeaderControlBase.displayName = "UIHeaderControlBase";
45
- /**
46
- * One icon button in the header bar — changelog, help, notifications, the mobile navigation
47
- * opener. It is a link when given an `href` and a button otherwise.
48
- *
49
- * The icon carries no label of its own, so `label` is required. There is no tooltip: the design
50
- * does not draw one.
51
- */
52
- var UIHeaderControl = forwardRef((props, ref) => {
53
- const { icon: Icon, ...rest } = props;
54
- return /* @__PURE__ */ jsx(UIHeaderControlBase, {
55
- ref,
56
- footprint: "control",
57
- ...rest,
58
- children: /* @__PURE__ */ jsx(Icon, {})
59
- });
60
- });
61
- UIHeaderControl.displayName = "BitkitUIHeader.Control";
62
- //#endregion
63
- export { UIHeaderControlBase, UIHeaderControl as default };
64
-
65
- //# sourceMappingURL=UIHeaderControl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UIHeaderControl.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitUIHeader/UIHeaderControl.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { chakra, type HTMLChakraProps } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type ReactNode, type Ref } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport { useUIHeaderContext } from './UIHeaderContext';\n\ninterface ControlCommonProps {\n /**\n * Marks the control as carrying something unread. A dot, with no count — the design draws one\n * size of marker and nothing inside it.\n */\n badge?: boolean;\n /**\n * The control's accessible name. It shows no text of its own, so this is what a screen reader\n * announces.\n */\n label: string;\n /**\n * Marks the control as the one whose panel is open: a lighter background and an indicator along\n * the bottom edge of the bar. The consumer owns the panel, so it owns this too.\n *\n * It says nothing about where the user is. A control that is a link stays a link to somewhere\n * else, so this paints it without claiming it is the current page.\n */\n selected?: boolean;\n}\n\ninterface ControlBaseCommonProps extends ControlCommonProps {\n children: ReactNode;\n /**\n * Which of the bar's control footprints to wear: the 48px square the icon controls and the\n * account button share, or the wider mobile navigation button. Named around the slot it picks\n * rather than `slot`, which is a native attribute every DOM element already takes.\n */\n footprint: 'control' | 'navButton';\n}\n\n// The bar draws no disabled control, so there is no `state` prop and no `disabled` either — a\n// control with nothing to do is one the consumer leaves out.\ninterface ControlBaseAsButtonProps\n extends ControlBaseCommonProps, Omit<HTMLChakraProps<'button'>, 'children' | 'disabled'> {\n href?: undefined;\n isExternal?: undefined;\n}\n\ninterface ControlBaseAsAnchorProps extends ControlBaseCommonProps, Omit<HTMLChakraProps<'a'>, 'children'> {\n href: string;\n isExternal?: boolean;\n}\n\ntype ControlBaseProps = ControlBaseAsButtonProps | ControlBaseAsAnchorProps;\n\n/**\n * The chrome every control in the bar shares: the hover and selected backgrounds, the unread dot,\n * the indicator, and the choice between a button and a link. What sits inside it — an icon, an\n * avatar — is the caller's.\n */\nexport const UIHeaderControlBase = forwardRef<HTMLButtonElement | HTMLAnchorElement, ControlBaseProps>((props, ref) => {\n const { styles } = useUIHeaderContext();\n\n const content = (\n <>\n {props.children}\n {props.badge && <Box css={styles.badge} />}\n {props.selected && <Box css={styles.indicator} />}\n </>\n );\n\n if (props.href !== undefined) {\n const {\n badge: _badge,\n children: _children,\n css,\n footprint,\n isExternal,\n label,\n rel,\n selected,\n target,\n ...anchorRest\n } = props;\n\n return (\n // `chakra.a` rather than `Link`, which carries a recipe of its own: a control is styled\n // entirely by the header's own slot.\n <chakra.a\n ref={ref as Ref<HTMLAnchorElement>}\n aria-label={label}\n data-selected={selected ? '' : undefined}\n rel={isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel}\n target={isExternal ? '_blank' : target}\n {...anchorRest}\n css={[styles[footprint], css]}\n >\n {content}\n </chakra.a>\n );\n }\n\n const {\n badge: _badge,\n children: _children,\n css,\n footprint,\n href: _href,\n isExternal: _isExternal,\n label,\n selected,\n ...buttonRest\n } = props;\n\n return (\n // `chakra.button` rather than `Button`, which carries a recipe of its own: a control is styled\n // entirely by the header's own slot.\n <chakra.button\n ref={ref as Ref<HTMLButtonElement>}\n aria-expanded={selected}\n aria-label={label}\n data-selected={selected ? '' : undefined}\n // A header control is an action, not a form submit. Before the spread, so a consumer can\n // still opt into `type=\"submit\"`.\n type=\"button\"\n {...buttonRest}\n css={[styles[footprint], css]}\n >\n {content}\n </chakra.button>\n );\n});\n\nUIHeaderControlBase.displayName = 'UIHeaderControlBase';\n\nexport interface BitkitUIHeaderControlAsButtonProps\n extends ControlCommonProps, Omit<HTMLChakraProps<'button'>, 'children' | 'disabled'> {\n href?: undefined;\n icon: BitkitIconComponent;\n isExternal?: undefined;\n}\n\nexport interface BitkitUIHeaderControlAsAnchorProps extends ControlCommonProps, Omit<HTMLChakraProps<'a'>, 'children'> {\n href: string;\n icon: BitkitIconComponent;\n isExternal?: boolean;\n}\n\nexport type BitkitUIHeaderControlProps = BitkitUIHeaderControlAsButtonProps | BitkitUIHeaderControlAsAnchorProps;\n\n/**\n * One icon button in the header bar — changelog, help, notifications, the mobile navigation\n * opener. It is a link when given an `href` and a button otherwise.\n *\n * The icon carries no label of its own, so `label` is required. There is no tooltip: the design\n * does not draw one.\n */\nconst UIHeaderControl = forwardRef<HTMLButtonElement | HTMLAnchorElement, BitkitUIHeaderControlProps>((props, ref) => {\n const { icon: Icon, ...rest } = props;\n\n return (\n <UIHeaderControlBase ref={ref} footprint=\"control\" {...rest}>\n <Icon />\n </UIHeaderControlBase>\n );\n});\n\nUIHeaderControl.displayName = 'BitkitUIHeader.Control';\n\nexport default UIHeaderControl;\n"],"mappings":";;;;;;;;;;;AA0DA,IAAa,sBAAsB,YAAqE,OAAO,QAAQ;CACrH,MAAM,EAAE,WAAW,mBAAmB;CAEtC,MAAM,UACJ,qBAAAA,YAAA,EAAA,UAAA;EACG,MAAM;EACN,MAAM,SAAS,oBAAC,KAAD,EAAK,KAAK,OAAO,MAAQ,CAAA;EACxC,MAAM,YAAY,oBAAC,KAAD,EAAK,KAAK,OAAO,UAAY,CAAA;CAChD,EAAA,CAAA;CAGJ,IAAI,MAAM,SAAS,KAAA,GAAW;EAC5B,MAAM,EACJ,OAAO,QACP,UAAU,WACV,KACA,WACA,YACA,OACA,KACA,UACA,QACA,GAAG,eACD;EAEJ,OAGE,oBAAC,OAAO,GAAR;GACO;GACL,cAAY;GACZ,iBAAe,WAAW,KAAK,KAAA;GAC/B,KAAK,aAAc,MAAM,GAAG,IAAI,wBAAwB,wBAAyB;GACjF,QAAQ,aAAa,WAAW;GAChC,GAAI;GACJ,KAAK,CAAC,OAAO,YAAY,GAAG;GAE3B,UAAA;EACO,CAAA;CAEd;CAEA,MAAM,EACJ,OAAO,QACP,UAAU,WACV,KACA,WACA,MAAM,OACN,YAAY,aACZ,OACA,UACA,GAAG,eACD;CAEJ,OAGE,oBAAC,OAAO,QAAR;EACO;EACL,iBAAe;EACf,cAAY;EACZ,iBAAe,WAAW,KAAK,KAAA;EAG/B,MAAK;EACL,GAAI;EACJ,KAAK,CAAC,OAAO,YAAY,GAAG;EAE3B,UAAA;CACY,CAAA;AAEnB,CAAC;AAED,oBAAoB,cAAc;;;;;;;;AAwBlC,IAAM,kBAAkB,YAA+E,OAAO,QAAQ;CACpH,MAAM,EAAE,MAAM,MAAM,GAAG,SAAS;CAEhC,OACE,oBAAC,qBAAD;EAA0B;EAAK,WAAU;EAAU,GAAI;EACrD,UAAA,oBAAC,MAAD,CAAO,CAAA;CACY,CAAA;AAEzB,CAAC;AAED,gBAAgB,cAAc"}
@@ -1,20 +0,0 @@
1
- import { HTMLChakraProps } from '@chakra-ui/react/styled-system';
2
- export interface BitkitUIHeaderNavButtonProps extends Omit<HTMLChakraProps<'button'>, 'children' | 'disabled'> {
3
- /** The accessible name. */
4
- label?: string;
5
- /** The current workspace. Shown as the avatar's initials when it has no logo. */
6
- name: string;
7
- /** The workspace's logo. Without one the avatar falls back to its initials. */
8
- src?: string;
9
- }
10
- /**
11
- * Opens `BitkitUISideNav` on mobile, where the navigation is a drawer rather than a rail. It sits
12
- * in the header's `leading` slot, which is hidden from the `tablet` breakpoint up.
13
- *
14
- * The two components do not know about each other: this button's `onClick` sets the navigation's
15
- * `open`, and the navigation asks to close through its own `onOpenChange`.
16
- *
17
- * It shows the current workspace, so switching workspaces is one tap away from anywhere.
18
- */
19
- declare const UIHeaderNavButton: import('react').ForwardRefExoticComponent<BitkitUIHeaderNavButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
20
- export default UIHeaderNavButton;
@@ -1,46 +0,0 @@
1
- import IconMenuHamburger from "../../icons/IconMenuHamburger.js";
2
- import BitkitAvatar from "../BitkitAvatar/BitkitAvatar.js";
3
- import { useUIHeaderContext } from "./UIHeaderContext.js";
4
- import { UIHeaderControlBase } from "./UIHeaderControl.js";
5
- import { Box } from "@chakra-ui/react/box";
6
- import { forwardRef } from "react";
7
- import { jsx, jsxs } from "react/jsx-runtime";
8
- //#region lib/components/BitkitUIHeader/UIHeaderNavButton.tsx
9
- /**
10
- * Opens `BitkitUISideNav` on mobile, where the navigation is a drawer rather than a rail. It sits
11
- * in the header's `leading` slot, which is hidden from the `tablet` breakpoint up.
12
- *
13
- * The two components do not know about each other: this button's `onClick` sets the navigation's
14
- * `open`, and the navigation asks to close through its own `onOpenChange`.
15
- *
16
- * It shows the current workspace, so switching workspaces is one tap away from anywhere.
17
- */
18
- var UIHeaderNavButton = forwardRef((props, ref) => {
19
- const { label = "Open navigation", name, src, ...rest } = props;
20
- const { styles } = useUIHeaderContext();
21
- const avatarProps = src ? {
22
- src,
23
- variant: "image"
24
- } : { variant: "letters" };
25
- return /* @__PURE__ */ jsxs(UIHeaderControlBase, {
26
- ref,
27
- footprint: "navButton",
28
- label,
29
- ...rest,
30
- children: [/* @__PURE__ */ jsx(BitkitAvatar, {
31
- name,
32
- ...avatarProps
33
- }), /* @__PURE__ */ jsx(Box, {
34
- css: styles.navButtonBadge,
35
- children: /* @__PURE__ */ jsx(IconMenuHamburger, {
36
- css: styles.navButtonIcon,
37
- size: "16"
38
- })
39
- })]
40
- });
41
- });
42
- UIHeaderNavButton.displayName = "BitkitUIHeader.NavButton";
43
- //#endregion
44
- export { UIHeaderNavButton as default };
45
-
46
- //# sourceMappingURL=UIHeaderNavButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UIHeaderNavButton.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/UIHeaderNavButton.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { type HTMLChakraProps } from '@chakra-ui/react/styled-system';\nimport { forwardRef } from 'react';\n\nimport { IconMenuHamburger } from '../../icons';\nimport BitkitAvatar from '../BitkitAvatar/BitkitAvatar';\nimport { useUIHeaderContext } from './UIHeaderContext';\nimport { UIHeaderControlBase } from './UIHeaderControl';\n\nexport interface BitkitUIHeaderNavButtonProps extends Omit<HTMLChakraProps<'button'>, 'children' | 'disabled'> {\n /** The accessible name. */\n label?: string;\n /** The current workspace. Shown as the avatar's initials when it has no logo. */\n name: string;\n /** The workspace's logo. Without one the avatar falls back to its initials. */\n src?: string;\n}\n\n/**\n * Opens `BitkitUISideNav` on mobile, where the navigation is a drawer rather than a rail. It sits\n * in the header's `leading` slot, which is hidden from the `tablet` breakpoint up.\n *\n * The two components do not know about each other: this button's `onClick` sets the navigation's\n * `open`, and the navigation asks to close through its own `onOpenChange`.\n *\n * It shows the current workspace, so switching workspaces is one tap away from anywhere.\n */\nconst UIHeaderNavButton = forwardRef<HTMLButtonElement, BitkitUIHeaderNavButtonProps>((props, ref) => {\n const { label = 'Open navigation', name, src, ...rest } = props;\n\n const { styles } = useUIHeaderContext();\n\n const avatarProps = src ? ({ src, variant: 'image' } as const) : ({ variant: 'letters' } as const);\n\n return (\n <UIHeaderControlBase ref={ref} footprint=\"navButton\" label={label} {...rest}>\n <BitkitAvatar name={name} {...avatarProps} />\n <Box css={styles.navButtonBadge}>\n <IconMenuHamburger css={styles.navButtonIcon} size=\"16\" />\n </Box>\n </UIHeaderControlBase>\n );\n});\n\nUIHeaderNavButton.displayName = 'BitkitUIHeader.NavButton';\n\nexport default UIHeaderNavButton;\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,IAAM,oBAAoB,YAA6D,OAAO,QAAQ;CACpG,MAAM,EAAE,QAAQ,mBAAmB,MAAM,KAAK,GAAG,SAAS;CAE1D,MAAM,EAAE,WAAW,mBAAmB;CAEtC,MAAM,cAAc,MAAO;EAAE;EAAK,SAAS;CAAQ,IAAe,EAAE,SAAS,UAAU;CAEvF,OACE,qBAAC,qBAAD;EAA0B;EAAK,WAAU;EAAmB;EAAO,GAAI;EAAvE,UAAA,CACE,oBAAC,cAAD;GAAoB;GAAM,GAAI;EAAc,CAAA,GAC5C,oBAAC,KAAD;GAAK,KAAK,OAAO;GACf,UAAA,oBAAC,mBAAD;IAAmB,KAAK,OAAO;IAAe,MAAK;GAAM,CAAA;EACtD,CAAA,CACc;;AAEzB,CAAC;AAED,kBAAkB,cAAc"}
@@ -1,32 +0,0 @@
1
- import { BoxProps } from '@chakra-ui/react/box';
2
- import { Ref } from 'react';
3
- export interface BitkitUIHeaderSearchProps extends Omit<BoxProps, 'children' | 'onChange'> {
4
- /**
5
- * The search field, for anchoring the results to it. The component owns no results list: what a
6
- * search turns up differs per product, so the consumer renders its own panel against this.
7
- */
8
- inputRef?: Ref<HTMLInputElement>;
9
- /** The accessible name of both the button and the field. */
10
- label?: string;
11
- /**
12
- * Called when the button is pressed, and when Escape closes the field.
13
- *
14
- * From `tablet` up this opens the field in place. Below it there is no inline field — the button
15
- * is a plain trigger, and what it opens is the consumer's to render.
16
- */
17
- onOpenChange?: (open: boolean) => void;
18
- onValueChange?: (value: string) => void;
19
- open?: boolean;
20
- placeholder?: string;
21
- /** Marks the button as the one whose panel is open. Meant for the mobile trigger. */
22
- selected?: boolean;
23
- value?: string;
24
- }
25
- /**
26
- * Search in the header bar: a button that opens a field lying over it, so opening the search moves
27
- * nothing else in the bar.
28
- *
29
- * It is controlled. Hold `open` and `value` yourself, and render the results against `inputRef`.
30
- */
31
- declare const UIHeaderSearch: import('react').ForwardRefExoticComponent<BitkitUIHeaderSearchProps & import('react').RefAttributes<HTMLDivElement>>;
32
- export default UIHeaderSearch;
@@ -1,107 +0,0 @@
1
- import IconMagnifier from "../../icons/IconMagnifier.js";
2
- import BitkitCloseButton from "../BitkitCloseButton/BitkitCloseButton.js";
3
- import { useUIHeaderContext } from "./UIHeaderContext.js";
4
- import { UIHeaderControlBase } from "./UIHeaderControl.js";
5
- import { Box } from "@chakra-ui/react/box";
6
- import { chakra } from "@chakra-ui/react/styled-system";
7
- import { forwardRef, useEffect, useMemo, useRef } from "react";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
- import { useCallbackRef } from "@chakra-ui/react/hooks";
10
- import { mergeRefs } from "@chakra-ui/react";
11
- //#region lib/components/BitkitUIHeader/UIHeaderSearch.tsx
12
- /**
13
- * Search in the header bar: a button that opens a field lying over it, so opening the search moves
14
- * nothing else in the bar.
15
- *
16
- * It is controlled. Hold `open` and `value` yourself, and render the results against `inputRef`.
17
- */
18
- var UIHeaderSearch = forwardRef((props, ref) => {
19
- const { css, inputRef, label = "Search", onOpenChange, onValueChange, open = false, placeholder, selected, value = "", ...rest } = props;
20
- const { barRef, styles } = useUIHeaderContext();
21
- const buttonElementRef = useRef(null);
22
- const inputElementRef = useRef(null);
23
- const searchElementRef = useRef(null);
24
- const restoreFocusRef = useRef(false);
25
- const setInputRef = useMemo(() => mergeRefs(inputElementRef, inputRef), [inputRef]);
26
- const setSearchRef = useMemo(() => mergeRefs(searchElementRef, ref), [ref]);
27
- const handleOpenChange = useCallbackRef(onOpenChange);
28
- useEffect(() => {
29
- if (open) {
30
- inputElementRef.current?.focus();
31
- return;
32
- }
33
- if (!restoreFocusRef.current) return;
34
- restoreFocusRef.current = false;
35
- buttonElementRef.current?.focus();
36
- }, [open]);
37
- useEffect(() => {
38
- if (!open) return void 0;
39
- const bar = barRef.current;
40
- if (!bar) return void 0;
41
- const dismiss = (event) => {
42
- const target = event.target instanceof Node ? event.target : null;
43
- if (!target || searchElementRef.current?.contains(target)) return;
44
- handleOpenChange?.(false);
45
- };
46
- bar.addEventListener("pointerdown", dismiss);
47
- return () => bar.removeEventListener("pointerdown", dismiss);
48
- }, [
49
- barRef,
50
- handleOpenChange,
51
- open
52
- ]);
53
- const handleKeyDown = (event) => {
54
- if (event.key !== "Escape") return;
55
- event.stopPropagation();
56
- event.preventDefault();
57
- restoreFocusRef.current = true;
58
- onOpenChange?.(false);
59
- };
60
- const handleClear = () => {
61
- onValueChange?.("");
62
- inputElementRef.current?.focus();
63
- };
64
- return /* @__PURE__ */ jsxs(Box, {
65
- ref: setSearchRef,
66
- css: [styles.search, css],
67
- ...rest,
68
- children: [/* @__PURE__ */ jsx(UIHeaderControlBase, {
69
- ref: buttonElementRef,
70
- css: styles.searchButton,
71
- "data-open": open ? "" : void 0,
72
- footprint: "control",
73
- label,
74
- onClick: () => onOpenChange?.(!open),
75
- selected,
76
- children: /* @__PURE__ */ jsx(IconMagnifier, {})
77
- }), /* @__PURE__ */ jsxs(Box, {
78
- css: styles.searchField,
79
- "data-open": open ? "" : void 0,
80
- children: [
81
- /* @__PURE__ */ jsx(IconMagnifier, { css: styles.searchIcon }),
82
- /* @__PURE__ */ jsx(chakra.input, {
83
- ref: setInputRef,
84
- "aria-label": label,
85
- css: styles.searchInput,
86
- onChange: (event) => onValueChange?.(event.target.value),
87
- onKeyDown: handleKeyDown,
88
- placeholder,
89
- type: "search",
90
- value
91
- }),
92
- !!value && /* @__PURE__ */ jsx(BitkitCloseButton, {
93
- "aria-label": "Clear search",
94
- colorVariant: "white",
95
- css: styles.searchClear,
96
- onClick: handleClear,
97
- size: "sm"
98
- })
99
- ]
100
- })]
101
- });
102
- });
103
- UIHeaderSearch.displayName = "BitkitUIHeader.Search";
104
- //#endregion
105
- export { UIHeaderSearch as default };
106
-
107
- //# sourceMappingURL=UIHeaderSearch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UIHeaderSearch.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/UIHeaderSearch.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { mergeRefs } from '@chakra-ui/react';\nimport { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { useCallbackRef } from '@chakra-ui/react/hooks';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type KeyboardEvent, type Ref, useEffect, useMemo, useRef } from 'react';\n\nimport { IconMagnifier } from '../../icons';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\nimport { useUIHeaderContext } from './UIHeaderContext';\nimport { UIHeaderControlBase } from './UIHeaderControl';\n\nexport interface BitkitUIHeaderSearchProps extends Omit<BoxProps, 'children' | 'onChange'> {\n /**\n * The search field, for anchoring the results to it. The component owns no results list: what a\n * search turns up differs per product, so the consumer renders its own panel against this.\n */\n inputRef?: Ref<HTMLInputElement>;\n /** The accessible name of both the button and the field. */\n label?: string;\n /**\n * Called when the button is pressed, and when Escape closes the field.\n *\n * From `tablet` up this opens the field in place. Below it there is no inline field — the button\n * is a plain trigger, and what it opens is the consumer's to render.\n */\n onOpenChange?: (open: boolean) => void;\n onValueChange?: (value: string) => void;\n open?: boolean;\n placeholder?: string;\n /** Marks the button as the one whose panel is open. Meant for the mobile trigger. */\n selected?: boolean;\n value?: string;\n}\n\n/**\n * Search in the header bar: a button that opens a field lying over it, so opening the search moves\n * nothing else in the bar.\n *\n * It is controlled. Hold `open` and `value` yourself, and render the results against `inputRef`.\n */\nconst UIHeaderSearch = forwardRef<HTMLDivElement, BitkitUIHeaderSearchProps>((props, ref) => {\n const {\n css,\n inputRef,\n label = 'Search',\n onOpenChange,\n onValueChange,\n open = false,\n placeholder,\n selected,\n value = '',\n ...rest\n } = props;\n\n const { barRef, styles } = useUIHeaderContext();\n\n const buttonElementRef = useRef<HTMLButtonElement>(null);\n const inputElementRef = useRef<HTMLInputElement>(null);\n const searchElementRef = useRef<HTMLDivElement>(null);\n const restoreFocusRef = useRef(false);\n const setInputRef = useMemo(() => mergeRefs(inputElementRef, inputRef), [inputRef]);\n const setSearchRef = useMemo(() => mergeRefs(searchElementRef, ref), [ref]);\n\n // The field is controlled, so `onOpenChange` is usually a fresh arrow on every keystroke. Held\n // by a ref, the dismiss listener below is subscribed once per opening rather than per character.\n const handleOpenChange = useCallbackRef(onOpenChange);\n\n // Escape hands focus back to the button that opened the field, but only once the field is closed:\n // while it is open the button is `visibility: hidden`, and a hidden element cannot take focus.\n useEffect(() => {\n if (open) {\n inputElementRef.current?.focus();\n return;\n }\n\n if (!restoreFocusRef.current) return;\n restoreFocusRef.current = false;\n buttonElementRef.current?.focus();\n }, [open]);\n\n // Reaching for another control in the bar is as much a way out of the search as Escape, so the\n // open field gives way to it. Only presses in the bar itself count: the results are the\n // consumer's to render — in the `banner` slot as readily as anywhere else — and choosing from\n // them must not close the search.\n useEffect(() => {\n if (!open) return undefined;\n\n const bar = barRef.current;\n if (!bar) return undefined;\n\n const dismiss = (event: PointerEvent) => {\n const target = event.target instanceof Node ? event.target : null;\n if (!target || searchElementRef.current?.contains(target)) return;\n handleOpenChange?.(false);\n };\n\n bar.addEventListener('pointerdown', dismiss);\n return () => bar.removeEventListener('pointerdown', dismiss);\n }, [barRef, handleOpenChange, open]);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Escape') return;\n event.stopPropagation();\n // A `type=\"search\"` input clears itself on Escape in Chromium, which would wipe the consumer's\n // value behind its back. Closing the field is all Escape does here.\n event.preventDefault();\n restoreFocusRef.current = true;\n onOpenChange?.(false);\n };\n\n const handleClear = () => {\n onValueChange?.('');\n inputElementRef.current?.focus();\n };\n\n return (\n <Box ref={setSearchRef} css={[styles.search, css]} {...rest}>\n <UIHeaderControlBase\n ref={buttonElementRef}\n css={styles.searchButton}\n data-open={open ? '' : undefined}\n footprint=\"control\"\n label={label}\n onClick={() => onOpenChange?.(!open)}\n selected={selected}\n >\n <IconMagnifier />\n </UIHeaderControlBase>\n <Box css={styles.searchField} data-open={open ? '' : undefined}>\n <IconMagnifier css={styles.searchIcon} />\n {/* No named primitive fits: Chakra's `Input` carries its own recipe, and this field is\n styled entirely by the header's own slot. */}\n <chakra.input\n ref={setInputRef}\n aria-label={label}\n css={styles.searchInput}\n onChange={(event) => onValueChange?.(event.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n type=\"search\"\n value={value}\n />\n {!!value && (\n <BitkitCloseButton\n aria-label=\"Clear search\"\n colorVariant=\"white\"\n css={styles.searchClear}\n onClick={handleClear}\n size=\"sm\"\n />\n )}\n </Box>\n </Box>\n );\n});\n\nUIHeaderSearch.displayName = 'BitkitUIHeader.Search';\n\nexport default UIHeaderSearch;\n"],"mappings":";;;;;;;;;;;;;;;;;AAyCA,IAAM,iBAAiB,YAAuD,OAAO,QAAQ;CAC3F,MAAM,EACJ,KACA,UACA,QAAQ,UACR,cACA,eACA,OAAO,OACP,aACA,UACA,QAAQ,IACR,GAAG,SACD;CAEJ,MAAM,EAAE,QAAQ,WAAW,mBAAmB;CAE9C,MAAM,mBAAmB,OAA0B,IAAI;CACvD,MAAM,kBAAkB,OAAyB,IAAI;CACrD,MAAM,mBAAmB,OAAuB,IAAI;CACpD,MAAM,kBAAkB,OAAO,KAAK;CACpC,MAAM,cAAc,cAAc,UAAU,iBAAiB,QAAQ,GAAG,CAAC,QAAQ,CAAC;CAClF,MAAM,eAAe,cAAc,UAAU,kBAAkB,GAAG,GAAG,CAAC,GAAG,CAAC;CAI1E,MAAM,mBAAmB,eAAe,YAAY;CAIpD,gBAAgB;EACd,IAAI,MAAM;GACR,gBAAgB,SAAS,MAAM;GAC/B;EACF;EAEA,IAAI,CAAC,gBAAgB,SAAS;EAC9B,gBAAgB,UAAU;EAC1B,iBAAiB,SAAS,MAAM;CAClC,GAAG,CAAC,IAAI,CAAC;CAMT,gBAAgB;EACd,IAAI,CAAC,MAAM,OAAO,KAAA;EAElB,MAAM,MAAM,OAAO;EACnB,IAAI,CAAC,KAAK,OAAO,KAAA;EAEjB,MAAM,WAAW,UAAwB;GACvC,MAAM,SAAS,MAAM,kBAAkB,OAAO,MAAM,SAAS;GAC7D,IAAI,CAAC,UAAU,iBAAiB,SAAS,SAAS,MAAM,GAAG;GAC3D,mBAAmB,KAAK;EAC1B;EAEA,IAAI,iBAAiB,eAAe,OAAO;EAC3C,aAAa,IAAI,oBAAoB,eAAe,OAAO;CAC7D,GAAG;EAAC;EAAQ;EAAkB;CAAI,CAAC;CAEnC,MAAM,iBAAiB,UAA2C;EAChE,IAAI,MAAM,QAAQ,UAAU;EAC5B,MAAM,gBAAgB;EAGtB,MAAM,eAAe;EACrB,gBAAgB,UAAU;EAC1B,eAAe,KAAK;CACtB;CAEA,MAAM,oBAAoB;EACxB,gBAAgB,EAAE;EAClB,gBAAgB,SAAS,MAAM;CACjC;CAEA,OACE,qBAAC,KAAD;EAAK,KAAK;EAAc,KAAK,CAAC,OAAO,QAAQ,GAAG;EAAG,GAAI;EAAvD,UAAA,CACE,oBAAC,qBAAD;GACE,KAAK;GACL,KAAK,OAAO;GACZ,aAAW,OAAO,KAAK,KAAA;GACvB,WAAU;GACH;GACP,eAAe,eAAe,CAAC,IAAI;GACzB;GAEV,UAAA,oBAAC,eAAD,CAAgB,CAAA;EACG,CAAA,GACrB,qBAAC,KAAD;GAAK,KAAK,OAAO;GAAa,aAAW,OAAO,KAAK,KAAA;GAArD,UAAA;IACE,oBAAC,eAAD,EAAe,KAAK,OAAO,WAAa,CAAA;IAGxC,oBAAC,OAAO,OAAR;KACE,KAAK;KACL,cAAY;KACZ,KAAK,OAAO;KACZ,WAAW,UAAU,gBAAgB,MAAM,OAAO,KAAK;KACvD,WAAW;KACE;KACb,MAAK;KACE;IACR,CAAA;IACA,CAAC,CAAC,SACD,oBAAC,mBAAD;KACE,cAAW;KACX,cAAa;KACb,KAAK,OAAO;KACZ,SAAS;KACT,MAAK;IACN,CAAA;GAEA;EACF,CAAA,CAAA;;AAET,CAAC;AAED,eAAe,cAAc"}
@@ -1,103 +0,0 @@
1
- import { rem } from "../themeUtils.js";
2
- import { defineRecipe } from "@chakra-ui/react/styled-system";
3
- //#region lib/theme/recipes/UIHeaderButton.recipe.ts
4
- var borderColors = (variant) => variant === "secondary" ? {
5
- base: "sys/ui/header/button/secondary/border",
6
- disabled: "sys/ui/header/button/secondary/border-disabled"
7
- } : {
8
- base: "transparent",
9
- disabled: "transparent"
10
- };
11
- var variantStyles = (variant) => {
12
- const border = borderColors(variant);
13
- return {
14
- background: `sys/ui/header/button/${variant}/bg`,
15
- borderColor: border.base,
16
- color: `sys/ui/header/button/${variant}/fg`,
17
- _hover: {
18
- background: `sys/ui/header/button/${variant}/bg-hover`,
19
- _active: { background: `sys/ui/header/button/${variant}/bg-active` }
20
- },
21
- _active: { background: `sys/ui/header/button/${variant}/bg-active` },
22
- _selected: {
23
- background: `sys/ui/header/button/${variant}/bg-active`,
24
- _hover: { background: `sys/ui/header/button/${variant}/bg-active` }
25
- },
26
- _disabled: {
27
- background: `sys/ui/header/button/${variant}/bg-disabled`,
28
- borderColor: border.disabled,
29
- color: `sys/ui/header/button/${variant}/fg-disabled`,
30
- cursor: "not-allowed"
31
- }
32
- };
33
- };
34
- var badgeDot = {
35
- background: "sys/ui/header/badge/indigo",
36
- borderRadius: "full",
37
- content: "\"\"",
38
- pointerEvents: "none",
39
- position: "absolute"
40
- };
41
- var badgeStyles = {
42
- _before: {
43
- ...badgeDot,
44
- height: "8",
45
- insetBlockStart: "-4",
46
- insetInlineEnd: "-4",
47
- width: "8"
48
- },
49
- _after: {
50
- ...badgeDot,
51
- height: rem(10),
52
- insetBlockStart: rem(-5),
53
- insetInlineEnd: rem(-5),
54
- opacity: .5,
55
- width: rem(10)
56
- }
57
- };
58
- var uiHeaderButtonRecipe = defineRecipe({
59
- className: "ui-header-button",
60
- base: {
61
- alignItems: "center",
62
- borderRadius: "4",
63
- borderStyle: "solid",
64
- borderWidth: "1",
65
- cursor: "pointer",
66
- display: "inline-flex",
67
- flexShrink: 0,
68
- gap: "4",
69
- height: "32",
70
- justifyContent: "center",
71
- minWidth: "48",
72
- paddingInline: "8",
73
- position: "relative",
74
- textDecoration: "none",
75
- textStyle: "comp/button/sm",
76
- whiteSpace: "nowrap",
77
- "&:not(:last-child)": { marginInlineEnd: "8" },
78
- _disabled: { cursor: "not-allowed" }
79
- },
80
- variants: {
81
- variant: {
82
- primary: variantStyles("primary"),
83
- secondary: variantStyles("secondary"),
84
- tertiary: variantStyles("tertiary")
85
- },
86
- badge: {
87
- idle: badgeStyles,
88
- pulse: {
89
- ...badgeStyles,
90
- _after: {
91
- ...badgeStyles._after,
92
- animation: "ping",
93
- _motionReduce: { animation: "none" }
94
- }
95
- }
96
- }
97
- },
98
- defaultVariants: { variant: "primary" }
99
- });
100
- //#endregion
101
- export { uiHeaderButtonRecipe as default };
102
-
103
- //# sourceMappingURL=UIHeaderButton.recipe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UIHeaderButton.recipe.js","names":[],"sources":["../../../lib/theme/recipes/UIHeaderButton.recipe.ts"],"sourcesContent":["import { defineRecipe, type SystemStyleObject } from '@chakra-ui/react/styled-system';\n\nimport { rem } from '../themeUtils';\n\ntype Variant = 'primary' | 'secondary' | 'tertiary';\n\nconst borderColors = (variant: Variant) =>\n variant === 'secondary'\n ? { base: 'sys/ui/header/button/secondary/border', disabled: 'sys/ui/header/button/secondary/border-disabled' }\n : { base: 'transparent', disabled: 'transparent' };\n\nconst variantStyles = (variant: Variant): SystemStyleObject => {\n const border = borderColors(variant);\n\n return {\n background: `sys/ui/header/button/${variant}/bg`,\n borderColor: border.base,\n color: `sys/ui/header/button/${variant}/fg`,\n // `_hover`/`_active` compile to `:not(:disabled, [data-disabled])`, so they never match a\n // disabled button and `_disabled` wins without `!important`.\n _hover: {\n background: `sys/ui/header/button/${variant}/bg-hover`,\n // Repeat active under hover so clicking while hovering keeps the active styles.\n _active: {\n background: `sys/ui/header/button/${variant}/bg-active`,\n },\n },\n _active: {\n background: `sys/ui/header/button/${variant}/bg-active`,\n },\n // A button that holds a panel open stays pressed while the panel is, hover included — letting\n // hover lighten it would read as the panel having closed.\n _selected: {\n background: `sys/ui/header/button/${variant}/bg-active`,\n _hover: {\n background: `sys/ui/header/button/${variant}/bg-active`,\n },\n },\n _disabled: {\n background: `sys/ui/header/button/${variant}/bg-disabled`,\n borderColor: border.disabled,\n color: `sys/ui/header/button/${variant}/fg-disabled`,\n cursor: 'not-allowed',\n },\n };\n};\n\nconst badgeDot: SystemStyleObject = {\n background: 'sys/ui/header/badge/indigo',\n borderRadius: 'full',\n content: '\"\"',\n pointerEvents: 'none',\n position: 'absolute',\n};\n\nconst badgeStyles: SystemStyleObject = {\n _before: {\n ...badgeDot,\n height: '8',\n insetBlockStart: '-4',\n insetInlineEnd: '-4',\n width: '8',\n },\n _after: {\n ...badgeDot,\n height: rem(10),\n insetBlockStart: rem(-5),\n insetInlineEnd: rem(-5),\n opacity: 0.5,\n width: rem(10),\n },\n};\n\nconst uiHeaderButtonRecipe = defineRecipe({\n className: 'ui-header-button',\n base: {\n alignItems: 'center',\n borderRadius: '4',\n borderStyle: 'solid',\n borderWidth: '1',\n cursor: 'pointer',\n display: 'inline-flex',\n flexShrink: 0,\n gap: '4',\n height: '32',\n justifyContent: 'center',\n minWidth: '48',\n paddingInline: '8',\n position: 'relative',\n textDecoration: 'none',\n textStyle: 'comp/button/sm',\n whiteSpace: 'nowrap',\n '&:not(:last-child)': {\n marginInlineEnd: '8',\n },\n _disabled: {\n cursor: 'not-allowed',\n },\n },\n variants: {\n variant: {\n primary: variantStyles('primary'),\n secondary: variantStyles('secondary'),\n tertiary: variantStyles('tertiary'),\n },\n badge: {\n idle: badgeStyles,\n pulse: {\n ...badgeStyles,\n _after: {\n ...badgeStyles._after,\n // The system's own ping: the ring expands past the dot and fades out.\n animation: 'ping',\n _motionReduce: {\n animation: 'none',\n },\n },\n },\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n});\n\nexport default uiHeaderButtonRecipe;\n"],"mappings":";;;AAMA,IAAM,gBAAgB,YACpB,YAAY,cACR;CAAE,MAAM;CAAyC,UAAU;AAAiD,IAC5G;CAAE,MAAM;CAAe,UAAU;AAAc;AAErD,IAAM,iBAAiB,YAAwC;CAC7D,MAAM,SAAS,aAAa,OAAO;CAEnC,OAAO;EACL,YAAY,wBAAwB,QAAQ;EAC5C,aAAa,OAAO;EACpB,OAAO,wBAAwB,QAAQ;EAGvC,QAAQ;GACN,YAAY,wBAAwB,QAAQ;GAE5C,SAAS,EACP,YAAY,wBAAwB,QAAQ,YAC9C;EACF;EACA,SAAS,EACP,YAAY,wBAAwB,QAAQ,YAC9C;EAGA,WAAW;GACT,YAAY,wBAAwB,QAAQ;GAC5C,QAAQ,EACN,YAAY,wBAAwB,QAAQ,YAC9C;EACF;EACA,WAAW;GACT,YAAY,wBAAwB,QAAQ;GAC5C,aAAa,OAAO;GACpB,OAAO,wBAAwB,QAAQ;GACvC,QAAQ;EACV;CACF;AACF;AAEA,IAAM,WAA8B;CAClC,YAAY;CACZ,cAAc;CACd,SAAS;CACT,eAAe;CACf,UAAU;AACZ;AAEA,IAAM,cAAiC;CACrC,SAAS;EACP,GAAG;EACH,QAAQ;EACR,iBAAiB;EACjB,gBAAgB;EAChB,OAAO;CACT;CACA,QAAQ;EACN,GAAG;EACH,QAAQ,IAAI,EAAE;EACd,iBAAiB,IAAI,EAAE;EACvB,gBAAgB,IAAI,EAAE;EACtB,SAAS;EACT,OAAO,IAAI,EAAE;CACf;AACF;AAEA,IAAM,uBAAuB,aAAa;CACxC,WAAW;CACX,MAAM;EACJ,YAAY;EACZ,cAAc;EACd,aAAa;EACb,aAAa;EACb,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,KAAK;EACL,QAAQ;EACR,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf,UAAU;EACV,gBAAgB;EAChB,WAAW;EACX,YAAY;EACZ,sBAAsB,EACpB,iBAAiB,IACnB;EACA,WAAW,EACT,QAAQ,cACV;CACF;CACA,UAAU;EACR,SAAS;GACP,SAAS,cAAc,SAAS;GAChC,WAAW,cAAc,WAAW;GACpC,UAAU,cAAc,UAAU;EACpC;EACA,OAAO;GACL,MAAM;GACN,OAAO;IACL,GAAG;IACH,QAAQ;KACN,GAAG,YAAY;KAEf,WAAW;KACX,eAAe,EACb,WAAW,OACb;IACF;GACF;EACF;CACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const uiHeaderHeight: `${number}rem`;
2
- declare const uiHeaderSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"search" | "badge" | "banner" | "bar" | "root" | "indicator" | "spacer" | "control" | "searchInput" | "searchClear" | "actions" | "navButton" | "accountAvatar" | "accountIcon" | "navButtonBadge" | "navButtonIcon" | "searchButton" | "searchField" | "searchIcon" | "leading" | "logoBlock" | "logoLink", import('@chakra-ui/react').SlotRecipeVariantRecord<"search" | "badge" | "banner" | "bar" | "root" | "indicator" | "spacer" | "control" | "searchInput" | "searchClear" | "actions" | "navButton" | "accountAvatar" | "accountIcon" | "navButtonBadge" | "navButtonIcon" | "searchButton" | "searchField" | "searchIcon" | "leading" | "logoBlock" | "logoLink">>;
3
- export default uiHeaderSlotRecipe;