@calcifer-design/ui 0.6.0 → 0.8.0

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 (189) hide show
  1. package/dist/components/Alert/Alert.d.ts +5 -2
  2. package/dist/components/Alert/Alert.js +1 -0
  3. package/dist/components/Alert/Alert.module.js +5 -5
  4. package/dist/components/Alert/Alert_module.css +20 -17
  5. package/dist/components/Avatar/Avatar.d.ts +16 -2
  6. package/dist/components/Avatar/Avatar.js +23 -7
  7. package/dist/components/Avatar/Avatar.module.js +3 -3
  8. package/dist/components/Avatar/Avatar_module.css +58 -17
  9. package/dist/components/Avatar/avatarColor.d.ts +12 -0
  10. package/dist/components/Avatar/avatarColor.js +12 -0
  11. package/dist/components/AvatarGroup/AvatarGroup.d.ts +37 -0
  12. package/dist/components/AvatarGroup/AvatarGroup.js +52 -0
  13. package/dist/components/AvatarGroup/AvatarGroup.module.js +8 -0
  14. package/dist/components/AvatarGroup/AvatarGroup_module.css +67 -0
  15. package/dist/components/Breadcrumb/Breadcrumb.module.js +6 -6
  16. package/dist/components/Breadcrumb/Breadcrumb_module.css +7 -7
  17. package/dist/components/Button/Button.d.ts +40 -4
  18. package/dist/components/Button/Button.js +48 -11
  19. package/dist/components/Button/Button.module.js +6 -2
  20. package/dist/components/Button/Button_module.css +143 -17
  21. package/dist/components/Button/LinkButton.d.ts +10 -3
  22. package/dist/components/Button/LinkButton.js +16 -5
  23. package/dist/components/Card/Card.module.js +5 -5
  24. package/dist/components/Card/Card_module.css +15 -9
  25. package/dist/components/CardList/CardList.module.js +3 -3
  26. package/dist/components/CardList/CardList_module.css +5 -3
  27. package/dist/components/Checkbox/Checkbox.module.js +2 -2
  28. package/dist/components/Checkbox/Checkbox_module.css +3 -3
  29. package/dist/components/ChoiceCard/ChoiceCard.d.ts +34 -0
  30. package/dist/components/ChoiceCard/ChoiceCard.js +81 -0
  31. package/dist/components/ChoiceCard/ChoiceCard.module.js +12 -0
  32. package/dist/components/ChoiceCard/ChoiceCard_module.css +161 -0
  33. package/dist/components/Collapsible/Collapsible.d.ts +39 -0
  34. package/dist/components/Collapsible/Collapsible.js +63 -0
  35. package/dist/components/Collapsible/Collapsible.module.js +10 -0
  36. package/dist/components/Collapsible/Collapsible_module.css +80 -0
  37. package/dist/components/DataGrid/DataGrid.module.js +32 -32
  38. package/dist/components/DataGrid/DataGrid_module.css +67 -62
  39. package/dist/components/DataTable/DataTable.module.js +9 -9
  40. package/dist/components/DataTable/DataTable_module.css +24 -21
  41. package/dist/components/DatePicker/DatePicker.d.ts +15 -1
  42. package/dist/components/DatePicker/DatePicker.js +33 -5
  43. package/dist/components/DatePicker/DatePicker.module.js +10 -10
  44. package/dist/components/DatePicker/DatePicker_module.css +22 -21
  45. package/dist/components/Descriptions/Descriptions.module.js +4 -4
  46. package/dist/components/Descriptions/Descriptions_module.css +12 -8
  47. package/dist/components/Dialog/Dialog.d.ts +30 -2
  48. package/dist/components/Dialog/Dialog.js +53 -11
  49. package/dist/components/Dialog/Dialog.module.js +8 -6
  50. package/dist/components/Dialog/Dialog_module.css +60 -13
  51. package/dist/components/EmptyState/EmptyState.d.ts +41 -0
  52. package/dist/components/EmptyState/EmptyState.js +39 -0
  53. package/dist/components/EmptyState/EmptyState.module.js +9 -0
  54. package/dist/components/EmptyState/EmptyState_module.css +65 -0
  55. package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +5 -2
  56. package/dist/components/ErrorBoundary/ErrorBoundary.module.js +1 -1
  57. package/dist/components/ErrorBoundary/ErrorBoundary_module.css +1 -1
  58. package/dist/components/Field/AffixInput.d.ts +28 -0
  59. package/dist/components/Field/AffixInput.js +50 -0
  60. package/dist/components/Field/GroupFrame.d.ts +19 -0
  61. package/dist/components/Field/GroupFrame.js +31 -0
  62. package/dist/components/Field/PickerField.d.ts +8 -2
  63. package/dist/components/Field/PickerField.js +12 -8
  64. package/dist/components/Field/PickerField.module.js +4 -4
  65. package/dist/components/Field/PickerField_module.css +11 -6
  66. package/dist/components/FilterBar/FilterBar.module.js +9 -9
  67. package/dist/components/FilterBar/FilterBar_module.css +13 -13
  68. package/dist/components/Form/Form.d.ts +9 -7
  69. package/dist/components/Form/Form.module.js +1 -1
  70. package/dist/components/Form/Form_module.css +1 -1
  71. package/dist/components/IconButton/IconButton.d.ts +1 -1
  72. package/dist/components/IconButton/IconButton.module.js +2 -2
  73. package/dist/components/IconButton/IconButton_module.css +28 -17
  74. package/dist/components/Menu/Menu.js +3 -0
  75. package/dist/components/Menu/Menu.module.js +2 -2
  76. package/dist/components/Menu/Menu_module.css +5 -4
  77. package/dist/components/NavMenu/NavMenu.d.ts +27 -4
  78. package/dist/components/NavMenu/NavMenu.js +10 -8
  79. package/dist/components/NavMenu/NavMenu.module.js +6 -6
  80. package/dist/components/NavMenu/NavMenu_module.css +37 -19
  81. package/dist/components/NavMenu/currentPath.d.ts +9 -0
  82. package/dist/components/NavMenu/currentPath.js +5 -0
  83. package/dist/components/PageHeading/PageHeading.module.js +3 -3
  84. package/dist/components/PageHeading/PageHeading_module.css +12 -9
  85. package/dist/components/PageShell/PageShell.module.js +5 -5
  86. package/dist/components/PageShell/PageShell_module.css +9 -9
  87. package/dist/components/Popover/Popover.js +3 -0
  88. package/dist/components/Popover/Popover.module.js +2 -2
  89. package/dist/components/Popover/Popover_module.css +6 -3
  90. package/dist/components/ProgressBar/ProgressBar.d.ts +55 -0
  91. package/dist/components/ProgressBar/ProgressBar.js +76 -0
  92. package/dist/components/ProgressBar/ProgressBar.module.js +12 -0
  93. package/dist/components/ProgressBar/ProgressBar_module.css +120 -0
  94. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  95. package/dist/components/RadioGroup/RadioGroup.js +35 -49
  96. package/dist/components/RadioGroup/RadioGroup.module.js +2 -2
  97. package/dist/components/RadioGroup/RadioGroup_module.css +2 -2
  98. package/dist/components/SearchField/SearchField.d.ts +32 -0
  99. package/dist/components/SearchField/SearchField.js +100 -0
  100. package/dist/components/SearchField/SearchField.module.js +8 -0
  101. package/dist/components/SearchField/SearchField_module.css +34 -0
  102. package/dist/components/Segmented/Segmented.d.ts +23 -6
  103. package/dist/components/Segmented/Segmented.js +37 -20
  104. package/dist/components/Segmented/Segmented.module.js +4 -3
  105. package/dist/components/Segmented/Segmented_module.css +46 -20
  106. package/dist/components/Select/Select.js +3 -0
  107. package/dist/components/Select/Select.module.js +5 -5
  108. package/dist/components/Select/Select_module.css +12 -11
  109. package/dist/components/Skeleton/Skeleton.module.js +3 -3
  110. package/dist/components/Skeleton/Skeleton_module.css +9 -9
  111. package/dist/components/SkipLink/SkipLink.module.js +1 -1
  112. package/dist/components/SkipLink/SkipLink_module.css +4 -4
  113. package/dist/components/Spinner/Spinner.module.js +3 -3
  114. package/dist/components/Spinner/Spinner_module.css +7 -7
  115. package/dist/components/StatusDot/StatusDot.module.js +5 -5
  116. package/dist/components/StatusDot/StatusDot_module.css +11 -11
  117. package/dist/components/Steps/Steps.module.js +6 -6
  118. package/dist/components/Steps/Steps_module.css +19 -19
  119. package/dist/components/Switch/Switch.module.js +2 -2
  120. package/dist/components/Switch/Switch_module.css +5 -5
  121. package/dist/components/TabBar/TabBar.d.ts +26 -0
  122. package/dist/components/TabBar/TabBar.js +52 -0
  123. package/dist/components/TabBar/TabBar.module.js +11 -0
  124. package/dist/components/TabBar/TabBar_module.css +100 -0
  125. package/dist/components/Tabs/Tabs.module.js +4 -4
  126. package/dist/components/Tabs/Tabs_module.css +9 -8
  127. package/dist/components/Tag/Tag.module.js +1 -1
  128. package/dist/components/Tag/Tag_module.css +3 -2
  129. package/dist/components/TextArea/TextArea.module.js +1 -1
  130. package/dist/components/TextArea/TextArea_module.css +6 -2
  131. package/dist/components/TextInput/TextInput.d.ts +14 -2
  132. package/dist/components/TextInput/TextInput.js +4 -5
  133. package/dist/components/ThemeScope/PortalContainerContext.d.ts +17 -0
  134. package/dist/components/ThemeScope/PortalContainerContext.js +6 -0
  135. package/dist/components/ThemeScope/ThemeScope.d.ts +23 -0
  136. package/dist/components/ThemeScope/ThemeScope.js +29 -0
  137. package/dist/components/ThemeScope/ThemeScope.module.js +6 -0
  138. package/dist/components/ThemeScope/ThemeScope_module.css +10 -0
  139. package/dist/components/TimePicker/TimePicker.d.ts +15 -2
  140. package/dist/components/TimePicker/TimePicker.js +5 -5
  141. package/dist/components/Timeline/Timeline.module.js +8 -8
  142. package/dist/components/Timeline/Timeline_module.css +15 -13
  143. package/dist/components/ToastRegion/ToastRegion.js +3 -0
  144. package/dist/components/ToastRegion/ToastRegion.module.js +6 -6
  145. package/dist/components/ToastRegion/ToastRegion_module.css +23 -19
  146. package/dist/components/ToggleChip/ToggleChip.d.ts +49 -0
  147. package/dist/components/ToggleChip/ToggleChip.js +45 -0
  148. package/dist/components/ToggleChip/ToggleChip.module.js +9 -0
  149. package/dist/components/ToggleChip/ToggleChipGroup.d.ts +57 -0
  150. package/dist/components/ToggleChip/ToggleChipGroup.js +93 -0
  151. package/dist/components/ToggleChip/ToggleChip_module.css +97 -0
  152. package/dist/components/Toolbar/Toolbar.module.js +3 -3
  153. package/dist/components/Toolbar/Toolbar_module.css +5 -5
  154. package/dist/components/Tooltip/Tooltip.js +3 -0
  155. package/dist/components/Tree/Tree.module.js +8 -8
  156. package/dist/components/Tree/Tree_module.css +20 -20
  157. package/dist/components/TreeSelect/TreeSelect.js +3 -0
  158. package/dist/components/TreeSelect/TreeSelect.module.js +3 -3
  159. package/dist/components/TreeSelect/TreeSelect_module.css +4 -4
  160. package/dist/components/Upload/Upload.module.js +8 -8
  161. package/dist/components/Upload/Upload_module.css +16 -16
  162. package/dist/components/ViewField/ViewField.module.js +2 -2
  163. package/dist/components/ViewField/ViewField_module.css +3 -3
  164. package/dist/hooks/useControllable.d.ts +11 -0
  165. package/dist/hooks/useControllable.js +13 -0
  166. package/dist/hooks/useIndexedToggleGroup.d.ts +30 -0
  167. package/dist/hooks/useIndexedToggleGroup.js +26 -0
  168. package/dist/hooks/useOverflowFocusable.d.ts +17 -0
  169. package/dist/hooks/useOverflowFocusable.js +36 -0
  170. package/dist/icons/SearchIcon.d.ts +9 -0
  171. package/dist/icons/SearchIcon.js +23 -0
  172. package/dist/index.d.ts +26 -0
  173. package/dist/index.js +12 -0
  174. package/dist/styles/a11y.module.js +1 -1
  175. package/dist/styles/a11y_module.css +1 -1
  176. package/dist/styles/base.css +17 -0
  177. package/dist/styles/closeCircle.module.js +5 -0
  178. package/dist/styles/closeCircle_module.css +12 -0
  179. package/dist/styles/field.module.js +14 -11
  180. package/dist/styles/field_module.css +94 -25
  181. package/dist/styles/pair.module.js +2 -2
  182. package/dist/styles/pair_module.css +5 -3
  183. package/dist/styles/popup.module.js +5 -5
  184. package/dist/styles/popup_module.css +35 -28
  185. package/dist/utils/focusInputFromPill.d.ts +12 -0
  186. package/dist/utils/focusInputFromPill.js +7 -0
  187. package/dist/utils/hasContent.d.ts +8 -0
  188. package/dist/utils/hasContent.js +4 -0
  189. package/package.json +2 -2
@@ -1,8 +1,9 @@
1
- .item-toMw6 {
1
+ .ui0-8-0-item-toMw6 {
2
2
  min-height: var(--size-touch);
3
3
  padding-inline: var(--space-3);
4
4
  border-radius: var(--radius-md);
5
5
  color: var(--color-text);
6
+ font-family: var(--font-sans);
6
7
  font-size: var(--text-md);
7
8
  cursor: pointer;
8
9
  -webkit-user-select: none;
@@ -11,17 +12,17 @@
11
12
  display: flex;
12
13
  }
13
14
 
14
- .item-toMw6[data-highlighted] {
15
+ .ui0-8-0-item-toMw6[data-highlighted] {
15
16
  background: var(--color-surface-2);
16
17
  color: var(--color-text);
17
18
  }
18
19
 
19
- .item-toMw6[data-disabled] {
20
+ .ui0-8-0-item-toMw6[data-disabled] {
20
21
  color: var(--color-text-subtle);
21
22
  cursor: not-allowed;
22
23
  }
23
24
 
24
- .separator-mmvmF {
25
+ .ui0-8-0-separator-mmvmF {
25
26
  height: 1px;
26
27
  margin-block: var(--space-1);
27
28
  background: var(--color-border);
@@ -8,12 +8,35 @@ export interface LinkRenderProps {
8
8
  'aria-current'?: 'page';
9
9
  children: ReactNode;
10
10
  }
11
- export interface NavMenuProps {
12
- items: NavItem[];
11
+ /**
12
+ * `Item` is the shape of one entry: anything with an `href` and a `label`. The shell passes its own
13
+ * (a typed route, an icon) and gets the same object back in `renderLink`.
14
+ */
15
+ export interface NavMenuProps<Item extends NavItem = NavItem> {
16
+ items: readonly Item[];
13
17
  currentPath: string;
14
18
  /** Accessible name for the navigation landmark. */
15
19
  label?: string;
16
20
  /** Lets the shell render router links; defaults to a plain anchor. */
17
- renderLink?: (item: NavItem, props: LinkRenderProps) => ReactElement;
21
+ renderLink?: (item: Item, props: LinkRenderProps) => ReactElement;
22
+ /**
23
+ * `'vertical'` stacks the links for a sidebar, each one as wide as the list. It applies to the
24
+ * wide layout only: below `md` the links are already a column inside the menu, so it is ignored.
25
+ */
26
+ orientation?: 'horizontal' | 'vertical';
27
+ /**
28
+ * The menu button's accessible name below `md`, while the menu is closed (`open`, default
29
+ * "Open menu") and while it is open (`close`, default "Close menu").
30
+ */
31
+ labels?: {
32
+ open?: string;
33
+ close?: string;
34
+ };
18
35
  }
19
- export declare function NavMenu({ items, currentPath, label, renderLink, }: NavMenuProps): import("react").JSX.Element;
36
+ /**
37
+ * The plain anchor both `NavMenu` and `TabBar` fall back on when the shell passes no `renderLink`.
38
+ * Shared between the two components, so it is exported from this module, but it is not in the
39
+ * package's exports.
40
+ */
41
+ export declare function defaultRenderLink(item: NavItem, { children, ...linkProps }: LinkRenderProps): ReactElement;
42
+ export declare function NavMenu<Item extends NavItem = NavItem>({ items, currentPath, label, renderLink, orientation, labels, }: NavMenuProps<Item>): import("react").JSX.Element;
@@ -2,7 +2,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Menu } from "@base-ui/react/menu";
3
3
  import { useState } from "react";
4
4
  import { minWidth, useMediaQuery } from "../../hooks/useMediaQuery.js";
5
+ import { usePortalContainer } from "../ThemeScope/PortalContainerContext.js";
5
6
  import popup_module from "../../styles/popup.module.js";
7
+ import { isCurrentPath } from "./currentPath.js";
6
8
  import NavMenu_module from "./NavMenu.module.js";
7
9
  function defaultRenderLink(item, { children, ...linkProps }) {
8
10
  return /*#__PURE__*/ jsx("a", {
@@ -11,19 +13,16 @@ function defaultRenderLink(item, { children, ...linkProps }) {
11
13
  children: children
12
14
  });
13
15
  }
14
- function isCurrent(item, currentPath) {
15
- if ('/' === item.href) return '/' === currentPath;
16
- return currentPath === item.href || currentPath.startsWith(`${item.href}/`);
17
- }
18
16
  function linkPropsFor(item, currentPath) {
19
17
  return {
20
18
  className: NavMenu_module.link,
21
- 'aria-current': isCurrent(item, currentPath) ? 'page' : void 0,
19
+ 'aria-current': isCurrentPath(item.href, currentPath) ? 'page' : void 0,
22
20
  children: item.label
23
21
  };
24
22
  }
25
- function NavMenu({ items, currentPath, label = 'Primary', renderLink = defaultRenderLink }) {
23
+ function NavMenu({ items, currentPath, label = 'Primary', renderLink = defaultRenderLink, orientation = 'horizontal', labels }) {
26
24
  const isWide = useMediaQuery(minWidth('md'));
25
+ const container = usePortalContainer();
27
26
  const [open, setOpen] = useState(false);
28
27
  const [previousPath, setPreviousPath] = useState(currentPath);
29
28
  if (currentPath !== previousPath) {
@@ -33,8 +32,10 @@ function NavMenu({ items, currentPath, label = 'Primary', renderLink = defaultRe
33
32
  if (isWide) return /*#__PURE__*/ jsx("nav", {
34
33
  className: NavMenu_module.root,
35
34
  "aria-label": label,
35
+ "data-orientation": orientation,
36
36
  children: /*#__PURE__*/ jsx("ul", {
37
37
  className: NavMenu_module.list,
38
+ "data-orientation": orientation,
38
39
  children: items.map((item)=>/*#__PURE__*/ jsx("li", {
39
40
  children: renderLink(item, linkPropsFor(item, currentPath))
40
41
  }, item.href))
@@ -50,7 +51,7 @@ function NavMenu({ items, currentPath, label = 'Primary', renderLink = defaultRe
50
51
  children: [
51
52
  /*#__PURE__*/ jsx(Menu.Trigger, {
52
53
  className: NavMenu_module.trigger,
53
- "aria-label": open ? 'Close menu' : 'Open menu',
54
+ "aria-label": open ? labels?.close ?? 'Close menu' : labels?.open ?? 'Open menu',
54
55
  children: /*#__PURE__*/ jsx("svg", {
55
56
  className: NavMenu_module.triggerIcon,
56
57
  viewBox: "0 0 18 18",
@@ -66,6 +67,7 @@ function NavMenu({ items, currentPath, label = 'Primary', renderLink = defaultRe
66
67
  })
67
68
  }),
68
69
  /*#__PURE__*/ jsx(Menu.Portal, {
70
+ container: container,
69
71
  children: /*#__PURE__*/ jsx(Menu.Positioner, {
70
72
  className: popup_module.layer,
71
73
  side: "bottom",
@@ -85,4 +87,4 @@ function NavMenu({ items, currentPath, label = 'Primary', renderLink = defaultRe
85
87
  })
86
88
  });
87
89
  }
88
- export { NavMenu };
90
+ export { NavMenu, defaultRenderLink };
@@ -1,10 +1,10 @@
1
1
  import "./NavMenu_module.css";
2
2
  const NavMenu_module = {
3
- root: "root-wsLiH",
4
- list: "list-hzkjq",
5
- link: "link-R0jaI",
6
- trigger: "trigger-dj75u",
7
- triggerIcon: "triggerIcon-gSo04",
8
- item: "item-yXJoa"
3
+ root: "ui0-8-0-root-wsLiH",
4
+ list: "ui0-8-0-list-hzkjq",
5
+ link: "ui0-8-0-link-R0jaI",
6
+ trigger: "ui0-8-0-trigger-dj75u",
7
+ triggerIcon: "ui0-8-0-triggerIcon-gSo04",
8
+ item: "ui0-8-0-item-yXJoa"
9
9
  };
10
10
  export default NavMenu_module;
@@ -1,9 +1,13 @@
1
- .root-wsLiH {
1
+ .ui0-8-0-root-wsLiH {
2
2
  align-items: center;
3
3
  display: flex;
4
4
  }
5
5
 
6
- .list-hzkjq {
6
+ .ui0-8-0-root-wsLiH[data-orientation="vertical"] {
7
+ align-items: stretch;
8
+ }
9
+
10
+ .ui0-8-0-list-hzkjq {
7
11
  align-items: center;
8
12
  gap: var(--space-5);
9
13
  margin: 0;
@@ -12,36 +16,49 @@
12
16
  display: flex;
13
17
  }
14
18
 
15
- .link-R0jaI {
16
- min-height: var(--size-touch);
17
- border-radius: var(--radius-sm);
18
- color: var(--color-text-muted);
19
+ .ui0-8-0-list-hzkjq[data-orientation="vertical"] {
20
+ align-items: stretch;
21
+ gap: var(--space-2);
22
+ flex-direction: column;
23
+ flex: auto;
24
+ }
25
+
26
+ .ui0-8-0-link-R0jaI {
27
+ min-height: var(--size-control);
28
+ border-radius: var(--radius-option);
29
+ color: var(--color-nav-text);
30
+ font-family: var(--font-sans);
19
31
  font-size: var(--text-sm);
32
+ font-weight: var(--font-weight-nav);
20
33
  white-space: nowrap;
21
34
  transition-property: color;
22
35
  transition-duration: var(--motion-duration-1);
23
36
  transition-timing-function: var(--motion-ease);
24
37
  align-items: center;
25
- font-weight: 400;
26
38
  text-decoration: none;
27
39
  display: inline-flex;
28
40
  }
29
41
 
30
- .link-R0jaI[aria-current="page"] {
31
- color: var(--color-text);
32
- font-weight: 500;
42
+ .ui0-8-0-list-hzkjq[data-orientation="vertical"] .ui0-8-0-link-R0jaI {
43
+ display: flex;
44
+ }
45
+
46
+ .ui0-8-0-link-R0jaI[aria-current="page"] {
47
+ background: var(--color-nav-selected);
48
+ color: var(--color-nav-selected-text);
49
+ font-weight: var(--font-weight-nav-selected);
33
50
  }
34
51
 
35
52
  @media (hover: hover) {
36
- .link-R0jaI:hover {
53
+ .ui0-8-0-link-R0jaI:hover:not([aria-current="page"]) {
37
54
  color: var(--color-text);
38
55
  }
39
56
  }
40
57
 
41
- .trigger-dj75u {
42
- width: var(--size-touch);
43
- height: var(--size-touch);
44
- border-radius: var(--radius-md);
58
+ .ui0-8-0-trigger-dj75u {
59
+ width: var(--size-control);
60
+ height: var(--size-control);
61
+ border-radius: var(--radius-control);
45
62
  color: var(--color-text);
46
63
  cursor: pointer;
47
64
  background: none;
@@ -52,18 +69,19 @@
52
69
  display: inline-flex;
53
70
  }
54
71
 
55
- .triggerIcon-gSo04 {
72
+ .ui0-8-0-triggerIcon-gSo04 {
56
73
  width: 1.125rem;
57
74
  height: 1.125rem;
58
75
  }
59
76
 
60
- .item-yXJoa {
77
+ .ui0-8-0-item-yXJoa {
61
78
  padding-inline: var(--space-3);
62
- border-radius: var(--radius-md);
79
+ border-radius: var(--radius-control);
80
+ font-family: var(--font-sans);
63
81
  font-size: var(--text-md);
64
82
  }
65
83
 
66
- .item-yXJoa[data-highlighted] {
84
+ .ui0-8-0-item-yXJoa[data-highlighted] {
67
85
  background: var(--color-surface-2);
68
86
  color: var(--color-text);
69
87
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Whether `href` is the page the app is on, or an ancestor of it. The root is the exception: `/`
3
+ * is an ancestor of every path, so it matches only itself, or the home link would read as current
4
+ * everywhere. Any other href matches itself and anything beneath it (`/events` holds
5
+ * `/events/e1` and `/events/`) but not a sibling that merely shares the prefix (`/eventsx`).
6
+ *
7
+ * Shared by `NavMenu` and `TabBar`; internal, not part of the package's exports.
8
+ */
9
+ export declare function isCurrentPath(href: string, currentPath: string): boolean;
@@ -0,0 +1,5 @@
1
+ function isCurrentPath(href, currentPath) {
2
+ if ('/' === href) return '/' === currentPath;
3
+ return currentPath === href || currentPath.startsWith(`${href}/`);
4
+ }
5
+ export { isCurrentPath };
@@ -1,7 +1,7 @@
1
1
  import "./PageHeading_module.css";
2
2
  const PageHeading_module = {
3
- root: "root-G6df9",
4
- eyebrow: "eyebrow-N5iEz",
5
- heading: "heading-C4QBU"
3
+ root: "ui0-8-0-root-G6df9",
4
+ eyebrow: "ui0-8-0-eyebrow-N5iEz",
5
+ heading: "ui0-8-0-heading-C4QBU"
6
6
  };
7
7
  export default PageHeading_module;
@@ -1,10 +1,10 @@
1
- .root-G6df9 {
1
+ .ui0-8-0-root-G6df9 {
2
2
  gap: var(--space-2);
3
3
  flex-direction: column;
4
4
  display: flex;
5
5
  }
6
6
 
7
- .eyebrow-N5iEz {
7
+ .ui0-8-0-eyebrow-N5iEz {
8
8
  font-family: var(--font-mono);
9
9
  font-size: var(--text-sm);
10
10
  color: var(--color-text-muted);
@@ -12,16 +12,19 @@
12
12
  letter-spacing: var(--tracking-wide);
13
13
  }
14
14
 
15
- .heading-C4QBU {
15
+ .ui0-8-0-heading-C4QBU {
16
16
  font-size: var(--text-h1);
17
+ font-family: var(--font-display);
18
+ font-weight: var(--font-weight-display);
19
+ font-stretch: var(--font-stretch-display);
20
+ text-transform: var(--text-transform-display);
17
21
  letter-spacing: var(--tracking-h1);
18
- font-weight: 600;
19
22
  line-height: var(--leading-display);
20
23
  text-wrap: balance;
21
24
  outline-offset: var(--space-2);
22
25
  }
23
26
 
24
- .heading-C4QBU[data-size="display"] {
27
+ .ui0-8-0-heading-C4QBU[data-size="display"] {
25
28
  max-width: 12ch;
26
29
  font-size: var(--text-display);
27
30
  letter-spacing: var(--tracking-display);
@@ -29,25 +32,25 @@
29
32
  }
30
33
 
31
34
  @media (width >= 112.5rem) {
32
- .heading-C4QBU[data-size="display"] {
35
+ .ui0-8-0-heading-C4QBU[data-size="display"] {
33
36
  font-size: var(--text-display-wide);
34
37
  }
35
38
  }
36
39
 
37
- .heading-C4QBU[data-size="compact"] {
40
+ .ui0-8-0-heading-C4QBU[data-size="compact"] {
38
41
  font-size: var(--text-h2);
39
42
  letter-spacing: var(--tracking-heading);
40
43
  line-height: var(--leading-tight);
41
44
  }
42
45
 
43
- .heading-C4QBU[data-level="2"] {
46
+ .ui0-8-0-heading-C4QBU[data-level="2"] {
44
47
  max-width: none;
45
48
  font-size: var(--text-h2-feature);
46
49
  letter-spacing: var(--tracking-heading);
47
50
  line-height: var(--leading-tight);
48
51
  }
49
52
 
50
- .heading-C4QBU:focus:not(:focus-visible) {
53
+ .ui0-8-0-heading-C4QBU:focus:not(:focus-visible) {
51
54
  outline: none;
52
55
  }
53
56
 
@@ -1,9 +1,9 @@
1
1
  import "./PageShell_module.css";
2
2
  const PageShell_module = {
3
- root: "root-GtYdg",
4
- header: "header-YzERL",
5
- sidebar: "sidebar-acwxu",
6
- main: "main-A7fFb",
7
- footer: "footer-O0lU7"
3
+ root: "ui0-8-0-root-GtYdg",
4
+ header: "ui0-8-0-header-YzERL",
5
+ sidebar: "ui0-8-0-sidebar-acwxu",
6
+ main: "ui0-8-0-main-A7fFb",
7
+ footer: "ui0-8-0-footer-O0lU7"
8
8
  };
9
9
  export default PageShell_module;
@@ -1,4 +1,4 @@
1
- .root-GtYdg {
1
+ .ui0-8-0-root-GtYdg {
2
2
  grid-template: "header"
3
3
  "sidebar"
4
4
  "main" 1fr
@@ -9,47 +9,47 @@
9
9
  position: relative;
10
10
  }
11
11
 
12
- .header-YzERL {
12
+ .ui0-8-0-header-YzERL {
13
13
  padding: var(--space-3) var(--space-4);
14
14
  border-bottom: 1px solid var(--color-border);
15
15
  grid-area: header;
16
16
  }
17
17
 
18
- .sidebar-acwxu {
18
+ .ui0-8-0-sidebar-acwxu {
19
19
  padding: var(--space-4);
20
20
  border-bottom: 1px solid var(--color-border);
21
21
  grid-area: sidebar;
22
22
  }
23
23
 
24
- .main-A7fFb {
24
+ .ui0-8-0-main-A7fFb {
25
25
  padding: var(--space-5) var(--space-4);
26
26
  grid-area: main;
27
27
  }
28
28
 
29
- .main-A7fFb:focus-visible {
29
+ .ui0-8-0-main-A7fFb:focus-visible {
30
30
  outline-offset: calc(var(--focus-ring-width) * -1);
31
31
  }
32
32
 
33
- .footer-O0lU7 {
33
+ .ui0-8-0-footer-O0lU7 {
34
34
  padding: var(--space-3) var(--space-4);
35
35
  border-top: 1px solid var(--color-border);
36
36
  grid-area: footer;
37
37
  }
38
38
 
39
39
  @media (width >= 48rem) {
40
- .root-GtYdg[data-has-sidebar] {
40
+ .ui0-8-0-root-GtYdg[data-has-sidebar] {
41
41
  grid-template: "header header"
42
42
  "sidebar main" 1fr
43
43
  "footer footer"
44
44
  / 16rem minmax(0, 1fr);
45
45
  }
46
46
 
47
- .sidebar-acwxu {
47
+ .ui0-8-0-sidebar-acwxu {
48
48
  border-inline-end: 1px solid var(--color-border);
49
49
  border-bottom: 0;
50
50
  }
51
51
 
52
- .main-A7fFb {
52
+ .ui0-8-0-main-A7fFb {
53
53
  padding-inline: var(--space-5);
54
54
  }
55
55
  }
@@ -1,5 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Popover } from "@base-ui/react/popover";
3
+ import { usePortalContainer } from "../ThemeScope/PortalContainerContext.js";
3
4
  import a11y_module from "../../styles/a11y.module.js";
4
5
  import popup_module from "../../styles/popup.module.js";
5
6
  import Popover_module from "./Popover.module.js";
@@ -10,6 +11,7 @@ const headingTags = {
10
11
  };
11
12
  function Popover_Popover({ trigger, heading, headingLevel = 3, description, children, side = 'bottom', align = 'center', sideOffset = 8, modal = false, closeLabel = 'Close', open, defaultOpen, onOpenChange }) {
12
13
  const Heading = headingTags[headingLevel] ?? 'h3';
14
+ const container = usePortalContainer();
13
15
  return /*#__PURE__*/ jsxs(Popover.Root, {
14
16
  open: open,
15
17
  defaultOpen: defaultOpen,
@@ -20,6 +22,7 @@ function Popover_Popover({ trigger, heading, headingLevel = 3, description, chil
20
22
  render: trigger
21
23
  }),
22
24
  /*#__PURE__*/ jsxs(Popover.Portal, {
25
+ container: container,
23
26
  children: [
24
27
  true === modal ? /*#__PURE__*/ jsx(Popover.Backdrop, {
25
28
  className: [
@@ -1,6 +1,6 @@
1
1
  import "./Popover_module.css";
2
2
  const Popover_module = {
3
- heading: "heading-d0Ysc",
4
- description: "description-IgC4A"
3
+ heading: "ui0-8-0-heading-d0Ysc",
4
+ description: "ui0-8-0-description-IgC4A"
5
5
  };
6
6
  export default Popover_module;
@@ -1,12 +1,15 @@
1
- .heading-d0Ysc {
1
+ .ui0-8-0-heading-d0Ysc {
2
2
  color: var(--color-text);
3
+ font-family: var(--font-sans);
3
4
  font-size: var(--text-sm);
4
- font-weight: 600;
5
+ font-weight: var(--font-weight-heading);
5
6
  line-height: var(--leading-snug);
6
7
  }
7
8
 
8
- .description-IgC4A {
9
+ .ui0-8-0-description-IgC4A {
9
10
  color: var(--color-text-muted);
11
+ font-family: var(--font-body);
12
+ font-weight: var(--font-weight-body);
10
13
  font-size: var(--text-sm);
11
14
  line-height: var(--leading-prose);
12
15
  }
@@ -0,0 +1,55 @@
1
+ import { type ReactNode } from 'react';
2
+ /** The statuses that carry a spoken word; `active` is the normal case and says nothing. */
3
+ type ProgressBarStatusWord = 'finished' | 'error';
4
+ /** Every word the bar speaks: the two status words, and the value of a bar with none. */
5
+ type ProgressBarWord = ProgressBarStatusWord | 'indeterminate';
6
+ export interface ProgressBarProps {
7
+ /** The accessible name; visible unless `hideLabel`. */
8
+ label: string;
9
+ /** Keeps the label as the bar's name and takes it off the screen. */
10
+ hideLabel?: boolean;
11
+ /** A line under the track. It is the bar's accessible description. */
12
+ helperText?: ReactNode;
13
+ /**
14
+ * 0 to `max`; anything outside is clamped. `null`, and any value that is not a finite number,
15
+ * is indeterminate: the bar slides and states no value. A `finished` bar ignores it.
16
+ */
17
+ value: number | null;
18
+ /** The value that fills the track. Anything that is not a positive finite number reads as 100. */
19
+ max?: number;
20
+ /**
21
+ * `finished` fills the track and says so, whatever `value` is. `error` keeps the value and draws
22
+ * it in the danger colour. Both are also stated in a visually hidden word, for assistive
23
+ * technology, so pair `error` with `helperText` to give sighted people the reason in words.
24
+ */
25
+ status?: 'active' | 'finished' | 'error';
26
+ /**
27
+ * The track's height: 0.5rem, or 0.25rem at `sm`. A consumer sets another through the
28
+ * `--progress-bar-track-size` hook, on a `ThemeScope` or another DOM ancestor of the bar.
29
+ */
30
+ size?: 'sm' | 'md';
31
+ /**
32
+ * The visible and the announced value, given the effective value (clamped; `max` for a
33
+ * `finished` bar) and the effective `max`. Defaults to a rounded percentage.
34
+ */
35
+ formatValue?: (value: number, max: number) => string;
36
+ /** Drops the visible value. The announced one stays. */
37
+ hideValue?: boolean;
38
+ /** `selected` fills with the selected colour, the pair an app re-scopes for a chosen thing. */
39
+ tone?: 'accent' | 'selected';
40
+ /**
41
+ * The words the bar speaks, for an app that is not in English: `finished` and `error` follow the
42
+ * label in the bar's name, and `indeterminate` is the announced value of a bar with none (its
43
+ * `aria-valuetext`). Defaults `Finished`, `Error` and `indeterminate progress`; a key left out,
44
+ * or `undefined`, keeps its default.
45
+ */
46
+ statusLabels?: Partial<Record<ProgressBarWord, string>>;
47
+ }
48
+ /**
49
+ * A labelled linear meter. The bar is a display and nothing here can be focused. The fill and the
50
+ * visible value are for the eye (the value is hidden from assistive technology), and the same
51
+ * number reaches a screen reader as `aria-valuenow` and `aria-valuetext`, so the three always
52
+ * agree: the effective value is computed once, here, and Base UI is handed only that.
53
+ */
54
+ export declare function ProgressBar({ label, hideLabel, helperText, value, max, status, size, formatValue, hideValue, tone, statusLabels, }: ProgressBarProps): import("react").JSX.Element;
55
+ export {};
@@ -0,0 +1,76 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { Progress } from "@base-ui/react/progress";
3
+ import { useId } from "react";
4
+ import a11y_module from "../../styles/a11y.module.js";
5
+ import { hasContent } from "../../utils/hasContent.js";
6
+ import ProgressBar_module from "./ProgressBar.module.js";
7
+ const DEFAULT_WORDS = {
8
+ finished: 'Finished',
9
+ error: 'Error',
10
+ indeterminate: 'indeterminate progress'
11
+ };
12
+ const DEFAULT_MAX = 100;
13
+ function defaultFormatValue(value, max) {
14
+ return `${Math.round(100 * value / max)}%`;
15
+ }
16
+ function ProgressBar({ label, hideLabel = false, helperText, value, max = DEFAULT_MAX, status = 'active', size = 'md', formatValue = defaultFormatValue, hideValue = false, tone = 'accent', statusLabels }) {
17
+ const helperId = useId();
18
+ const effectiveMax = Number.isFinite(max) && max > 0 ? max : DEFAULT_MAX;
19
+ const rawValue = 'finished' === status ? effectiveMax : value;
20
+ const effectiveValue = null !== rawValue && Number.isFinite(rawValue) ? Math.min(Math.max(rawValue, 0), effectiveMax) : null;
21
+ const valueText = null === effectiveValue ? void 0 : formatValue(effectiveValue, effectiveMax);
22
+ const wordOf = (word)=>statusLabels?.[word] ?? DEFAULT_WORDS[word];
23
+ const statusWord = 'active' === status ? void 0 : wordOf(status);
24
+ const showValue = void 0 !== valueText && !hideValue;
25
+ const hasHelper = hasContent(helperText);
26
+ const labelElement = /*#__PURE__*/ jsxs(Progress.Label, {
27
+ className: hideLabel ? a11y_module.visuallyHidden : ProgressBar_module.label,
28
+ children: [
29
+ label,
30
+ void 0 === statusWord ? null : /*#__PURE__*/ jsxs(Fragment, {
31
+ children: [
32
+ ' ',
33
+ /*#__PURE__*/ jsx("span", {
34
+ className: a11y_module.visuallyHidden,
35
+ children: statusWord
36
+ })
37
+ ]
38
+ })
39
+ ]
40
+ });
41
+ return /*#__PURE__*/ jsxs(Progress.Root, {
42
+ className: ProgressBar_module.root,
43
+ "data-status": status,
44
+ "data-size": size,
45
+ "data-tone": tone,
46
+ value: effectiveValue,
47
+ max: effectiveMax,
48
+ "aria-valuetext": valueText ?? wordOf('indeterminate'),
49
+ "aria-describedby": hasHelper ? helperId : void 0,
50
+ children: [
51
+ !hideLabel || showValue ? /*#__PURE__*/ jsxs("div", {
52
+ className: ProgressBar_module.row,
53
+ children: [
54
+ labelElement,
55
+ showValue ? /*#__PURE__*/ jsx("span", {
56
+ className: ProgressBar_module.value,
57
+ "aria-hidden": "true",
58
+ children: valueText
59
+ }) : null
60
+ ]
61
+ }) : labelElement,
62
+ /*#__PURE__*/ jsx(Progress.Track, {
63
+ className: ProgressBar_module.track,
64
+ children: /*#__PURE__*/ jsx(Progress.Indicator, {
65
+ className: ProgressBar_module.indicator
66
+ })
67
+ }),
68
+ hasHelper ? /*#__PURE__*/ jsx("div", {
69
+ className: ProgressBar_module.helper,
70
+ id: helperId,
71
+ children: helperText
72
+ }) : null
73
+ ]
74
+ });
75
+ }
76
+ export { ProgressBar };
@@ -0,0 +1,12 @@
1
+ import "./ProgressBar_module.css";
2
+ const ProgressBar_module = {
3
+ root: "ui0-8-0-root-mQ6gu",
4
+ row: "ui0-8-0-row-fP05m",
5
+ label: "ui0-8-0-label-rERKj",
6
+ value: "ui0-8-0-value-v0kJr",
7
+ track: "ui0-8-0-track-kT3yt",
8
+ indicator: "ui0-8-0-indicator-Ss0J6",
9
+ slide: "ui0-8-0-slide-RfrrH",
10
+ helper: "ui0-8-0-helper-hJu00"
11
+ };
12
+ export default ProgressBar_module;