@primer/react 0.0.0-20260527210202 → 0.0.0-20260527232058
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -13
- package/dist/Timeline/{Timeline-05decc91.css → Timeline-c5e15bf9.css} +2 -2
- package/dist/Timeline/Timeline-c5e15bf9.css.map +1 -0
- package/dist/Timeline/Timeline.d.ts +8 -0
- package/dist/Timeline/Timeline.d.ts.map +1 -1
- package/dist/Timeline/Timeline.js +43 -1
- package/dist/Timeline/Timeline.module.css.js +2 -2
- package/dist/Timeline/index.d.ts +1 -1
- package/dist/Timeline/index.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.d.ts +2 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +123 -263
- package/dist/UnderlineNav/UnderlineNavContext.d.ts +10 -1
- package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavContext.js +2 -0
- package/dist/UnderlineNav/UnderlineNavItem.d.ts +1 -3
- package/dist/UnderlineNav/UnderlineNavItem.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavItem.js +22 -7
- package/dist/UnderlineNav/types.d.ts +5 -1
- package/dist/UnderlineNav/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/generated/components.json +8 -0
- package/package.json +1 -1
- package/dist/Timeline/Timeline-05decc91.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260527232058
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fake entry to force publishing
|
|
8
|
+
|
|
9
|
+
## 38.26.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
6
12
|
|
|
@@ -13,6 +19,8 @@
|
|
|
13
19
|
- Add `asSlot(component, slotSource)` helper: a typed utility that copies a `__SLOT__` marker from a source slot component onto a wrapper component, replacing the cast-heavy `(Wrapper as typeof Wrapper & {__SLOT__?: symbol}).__SLOT__ = Source.__SLOT__` pattern.
|
|
14
20
|
- Add a dev-mode warning in `useSlots` when a child's `displayName` matches a slot component's `displayName` but the child is missing the `__SLOT__` marker — a common footgun when wrapping slot components.
|
|
15
21
|
|
|
22
|
+
- [#7886](https://github.com/primer/react/pull/7886) [`64dfbd3`](https://github.com/primer/react/commit/64dfbd307314d4c52c2072d0f72611a5da3e6739) Thanks [@janmaarten-a11y](https://github.com/janmaarten-a11y)! - Add `Timeline.Actions` sub-component for rendering action buttons, links, SHAs, status labels, and similar right-aligned content on a `Timeline.Item`. Renders as a horizontal flex row pushed to the right edge of the item with `gap: 8px` between children and `min-height` matching the badge so contents vertically center against it.
|
|
23
|
+
|
|
16
24
|
### Patch Changes
|
|
17
25
|
|
|
18
26
|
- [#7864](https://github.com/primer/react/pull/7864) [`e7205ea`](https://github.com/primer/react/commit/e7205ea51b02fb1b7ac9de2df122f7ba67ebe078) Thanks [@mattcosta7](https://github.com/mattcosta7)! - Eliminate nested-update cascades in `useFocus`, `PageLayout.Pane`, and
|
|
@@ -36,18 +44,6 @@
|
|
|
36
44
|
|
|
37
45
|
- [#7878](https://github.com/primer/react/pull/7878) [`8c468fd`](https://github.com/primer/react/commit/8c468fd28322456f48601f9cbf6226fc4c35b661) Thanks [@mattcosta7](https://github.com/mattcosta7)! - FilteredActionList: Guard against `undefined` items in the virtualizer's `getItemKey` callback to prevent a crash when `@tanstack/react-virtual` invokes it with an index whose item was just removed (e.g. when filtering shrinks the items list).
|
|
38
46
|
|
|
39
|
-
- Fake entry to force publishing
|
|
40
|
-
|
|
41
|
-
- [#7875](https://github.com/primer/react/pull/7875) [`1fcc071`](https://github.com/primer/react/commit/1fcc071865a6b9b06988a84864f20a3faa9d523d) Thanks [@mattcosta7](https://github.com/mattcosta7)! - UnderlineNav: Re-architect item measurement to remove a cascading render on
|
|
42
|
-
mount. Each `UnderlineNav.Item` no longer dispatches measurement setState calls
|
|
43
|
-
back into its parent via context; `UnderlineNav` now walks its rendered items
|
|
44
|
-
in a single layout effect and stores widths in refs. Overflow state is
|
|
45
|
-
consolidated into one `useState` object (one commit per change), the context
|
|
46
|
-
value is memoized, `UnderlineNav.Item` is wrapped in `React.memo`, and the
|
|
47
|
-
external-`aria-current` swap was moved out of render-phase setState into a
|
|
48
|
-
layout effect. Behavior is unchanged for consumers, but the initial mount and
|
|
49
|
-
overflow-state transitions produce far fewer per-item renders.
|
|
50
|
-
|
|
51
47
|
- [#7876](https://github.com/primer/react/pull/7876) [`980e94c`](https://github.com/primer/react/commit/980e94cc1de7807bb2b3fc4dd006ea8dbf3e8303) Thanks [@mattcosta7](https://github.com/mattcosta7)! - UnderlinePanels: Eliminate the empty-tablist frame on mount and the cascading
|
|
52
48
|
re-render when icons toggle. Tabs and panels are now derived in render
|
|
53
49
|
(previously stored in state synced via `useEffect`), the list width is kept
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.prc-Timeline-Timeline-awSoC{display:flex;flex-direction:column}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=start]),.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=both])) .prc-Timeline-TimelineItem-QwDVH:first-child{padding-top:0}:is(:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=start]),.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=both])) .prc-Timeline-TimelineItem-QwDVH:first-child):where([data-condensed]):before{top:var(--base-size-12,.75rem)}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=end]),.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=both])) .prc-Timeline-TimelineItem-QwDVH:last-child{padding-bottom:0}:is(:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=end]),.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=both])) .prc-Timeline-TimelineItem-QwDVH:last-child):where([data-condensed]):before{height:var(--base-size-12,.75rem)}.prc-Timeline-TimelineItem-QwDVH{display:flex;margin-left:var(--base-size-16,1rem);padding:var(--base-size-16,1rem) 0;position:relative}.prc-Timeline-TimelineItem-QwDVH:before{background-color:var(--borderColor-muted,#d1d9e0b3);bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:2px}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]){padding-bottom:0;padding-top:var(--base-size-4,.25rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]):last-child{padding-bottom:var(--base-size-16,1rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]) .prc-Timeline-TimelineBadge-u0qSm{background-color:var(--bgColor-default,#fff);border:0;color:var(--fgColor-muted,#59636e);height:16px;margin-bottom:var(--base-size-8,.5rem);margin-top:var(--base-size-8,.5rem)}.prc-Timeline-TimelineBadgeWrapper-SZw4k{position:relative;z-index:1}.prc-Timeline-TimelineBadge-u0qSm{align-items:center;background-color:var(--timelineBadge-bgColor,#f6f8fa);border-color:var(--bgColor-default,#fff);border-radius:50%;border-style:solid;border-width:var(--borderWidth-thick,.125rem);color:var(--fgColor-muted,#59636e);display:flex;flex-shrink:0;height:32px;justify-content:center;margin-left:-15px;margin-right:var(--base-size-8,.5rem);overflow:hidden;width:32px}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant]){color:var(--fgColor-onEmphasis,#fff)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=accent]){background-color:var(--bgColor-accent-emphasis,#0969da)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=success]){background-color:var(--bgColor-success-emphasis,#1f883d)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=attention]){background-color:var(--bgColor-attention-emphasis,#9a6700)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=severe]){background-color:var(--bgColor-severe-emphasis,#bc4c00)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=danger]){background-color:var(--bgColor-danger-emphasis,#cf222e)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=done]){background-color:var(--bgColor-done-emphasis,#8250df)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=open]){background-color:var(--bgColor-open-emphasis,#1f883d)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=closed]){background-color:var(--bgColor-closed-emphasis,#cf222e)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=sponsors]){background-color:var(--bgColor-sponsors-emphasis,#bf3989)}.prc-Timeline-TimelineBody-tjOtb{color:var(--fgColor-muted,#59636e);flex:auto;font-size:var(--text-body-size-medium,.875rem);margin-top:calc(var(--base-size-4,.25rem) + 1px);max-width:100%;min-width:0}.prc-Timeline-TimelineBreak-X8eti{background-color:var(--bgColor-default,#fff);border:0;border-top:var(--borderWidth-thicker,.25rem) solid var(--borderColor-default,#d1d9e0);height:var(--base-size-24,1.5rem);margin:0;margin-bottom:calc(var(--base-size-16,1rem)*-1);margin-left:0;position:relative;z-index:1}.prc-Timeline-TimelineBreak-X8eti:has(+[data-condensed]){margin-bottom:calc(var(--base-size-12,.75rem)*-1)}
|
|
2
|
-
/*# sourceMappingURL=Timeline-
|
|
1
|
+
.prc-Timeline-Timeline-awSoC{display:flex;flex-direction:column}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=start]),.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=both])) .prc-Timeline-TimelineItem-QwDVH:first-child{padding-top:0}:is(:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=start]),.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=both])) .prc-Timeline-TimelineItem-QwDVH:first-child):where([data-condensed]):before{top:var(--base-size-12,.75rem)}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=end]),.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=both])) .prc-Timeline-TimelineItem-QwDVH:last-child{padding-bottom:0}:is(:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=end]),.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar=both])) .prc-Timeline-TimelineItem-QwDVH:last-child):where([data-condensed]):before{height:var(--base-size-12,.75rem)}.prc-Timeline-TimelineItem-QwDVH{display:flex;margin-left:var(--base-size-16,1rem);padding:var(--base-size-16,1rem) 0;position:relative}.prc-Timeline-TimelineItem-QwDVH:before{background-color:var(--borderColor-muted,#d1d9e0b3);bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:2px}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]){padding-bottom:0;padding-top:var(--base-size-4,.25rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]):last-child{padding-bottom:var(--base-size-16,1rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]) .prc-Timeline-TimelineBadge-u0qSm{background-color:var(--bgColor-default,#fff);border:0;color:var(--fgColor-muted,#59636e);height:16px;margin-bottom:var(--base-size-8,.5rem);margin-top:var(--base-size-8,.5rem)}.prc-Timeline-TimelineBadgeWrapper-SZw4k{position:relative;z-index:1}.prc-Timeline-TimelineBadge-u0qSm{align-items:center;background-color:var(--timelineBadge-bgColor,#f6f8fa);border-color:var(--bgColor-default,#fff);border-radius:50%;border-style:solid;border-width:var(--borderWidth-thick,.125rem);color:var(--fgColor-muted,#59636e);display:flex;flex-shrink:0;height:32px;justify-content:center;margin-left:-15px;margin-right:var(--base-size-8,.5rem);overflow:hidden;width:32px}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant]){color:var(--fgColor-onEmphasis,#fff)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=accent]){background-color:var(--bgColor-accent-emphasis,#0969da)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=success]){background-color:var(--bgColor-success-emphasis,#1f883d)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=attention]){background-color:var(--bgColor-attention-emphasis,#9a6700)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=severe]){background-color:var(--bgColor-severe-emphasis,#bc4c00)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=danger]){background-color:var(--bgColor-danger-emphasis,#cf222e)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=done]){background-color:var(--bgColor-done-emphasis,#8250df)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=open]){background-color:var(--bgColor-open-emphasis,#1f883d)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=closed]){background-color:var(--bgColor-closed-emphasis,#cf222e)}.prc-Timeline-TimelineBadge-u0qSm:where([data-variant=sponsors]){background-color:var(--bgColor-sponsors-emphasis,#bf3989)}.prc-Timeline-TimelineBody-tjOtb{color:var(--fgColor-muted,#59636e);flex:auto;font-size:var(--text-body-size-medium,.875rem);margin-top:calc(var(--base-size-4,.25rem) + 1px);max-width:100%;min-width:0}.prc-Timeline-TimelineBreak-X8eti{background-color:var(--bgColor-default,#fff);border:0;border-top:var(--borderWidth-thicker,.25rem) solid var(--borderColor-default,#d1d9e0);height:var(--base-size-24,1.5rem);margin:0;margin-bottom:calc(var(--base-size-16,1rem)*-1);margin-left:0;position:relative;z-index:1}.prc-Timeline-TimelineBreak-X8eti:has(+[data-condensed]){margin-bottom:calc(var(--base-size-12,.75rem)*-1)}.prc-Timeline-TimelineItemActions-56Y7h{align-items:center;align-self:flex-start;display:flex;flex-shrink:0;gap:var(--base-size-8,.5rem);margin-left:auto;min-height:var(--base-size-32,2rem)}
|
|
2
|
+
/*# sourceMappingURL=Timeline-c5e15bf9.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Timeline/Timeline.module.css.js"],"names":[],"mappings":"AAAA,6BACE,YAAa,CACb,qBAuBF,CAnBI,6KACE,aAKF,CAHE,iNACE,8BACF,CAMF,0KACE,gBAKF,CAHE,8MACE,iCACF,CAKN,iCAEE,YAAa,CAEb,oCAAgC,CADhC,kCAA8B,CAF9B,iBAkCF,CA7BE,wCASE,mDAA0C,CAN1C,QAAS,CAIT,UAAW,CAFX,aAAc,CADd,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAIN,SAIF,CAEA,yDAEE,gBAAiB,CADjB,qCAeF,CAZE,oEACE,uCACF,CAEA,2FAKE,4CAAwC,CACxC,QAAS,CAFT,kCAA2B,CAH3B,WAAY,CAEZ,sCAAiC,CADjC,mCAKF,CAIJ,yCACE,iBAAkB,CAClB,SACF,CAEA,kCAkBE,kBAAmB,CANnB,qDAA8C,CAE9C,wCAAoC,CAGpC,iBAAkB,CAFlB,kBAAmB,CACnB,6CAAsC,CAPtC,kCAA2B,CAR3B,YAAa,CAMb,aAAc,CAJd,WAAY,CAgBZ,sBAAuB,CAbvB,iBAAkB,CAFlB,qCAAgC,CAIhC,eAAgB,CANhB,UA0DF,CAvCE,wDACE,oCACF,CAEA,+DACE,uDACF,CAEA,gEACE,wDACF,CAEA,kEACE,0DACF,CAEA,+DACE,uDACF,CAEA,+DACE,uDACF,CAEA,6DACE,qDACF,CAEA,6DACE,qDACF,CAEA,+DACE,uDACF,CAEA,iEACE,yDACF,CAGF,iCAME,kCAA2B,CAC3B,SAAU,CAFV,8CAAuC,CADvC,gDAA0C,CAF1C,cAAe,CADf,WAOF,CAEA,kCAOE,4CAAwC,CACxC,QAAS,CACT,qFAAuE,CANvE,iCAA2B,CAC3B,QAAS,CACT,+CAA6C,CAC7C,aAAc,CALd,iBAAkB,CAClB,SAaF,CAHE,yDACE,iDACF,CAGF,wCAEE,kBAAmB,CACnB,qBAAsB,CAFtB,YAAa,CAOb,aAAc,CADd,4BAAuB,CADvB,gBAAiB,CADjB,mCAIF","file":"Timeline-c5e15bf9.css","sourcesContent":[".Timeline {\n display: flex;\n flex-direction: column;\n\n &:where([data-clip-sidebar='start']),\n &:where([data-clip-sidebar='both']) {\n .TimelineItem:first-child {\n padding-top: 0;\n\n &:where([data-condensed])::before {\n top: var(--base-size-12);\n }\n }\n }\n\n &:where([data-clip-sidebar='end']),\n &:where([data-clip-sidebar='both']) {\n .TimelineItem:last-child {\n padding-bottom: 0;\n\n &:where([data-condensed])::before {\n height: var(--base-size-12);\n }\n }\n }\n}\n\n.TimelineItem {\n position: relative;\n display: flex;\n padding: var(--base-size-16) 0;\n margin-left: var(--base-size-16);\n\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: block;\n width: 2px;\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-muted);\n }\n\n &:where([data-condensed]) {\n padding-top: var(--base-size-4);\n padding-bottom: 0;\n\n &:last-child {\n padding-bottom: var(--base-size-16);\n }\n\n .TimelineBadge {\n height: 16px;\n margin-top: var(--base-size-8);\n margin-bottom: var(--base-size-8);\n color: var(--fgColor-muted);\n background-color: var(--bgColor-default);\n border: 0;\n }\n }\n}\n\n.TimelineBadgeWrapper {\n position: relative;\n z-index: 1;\n}\n\n.TimelineBadge {\n display: flex;\n width: 32px;\n height: 32px;\n margin-right: var(--base-size-8);\n /* stylelint-disable-next-line primer/spacing */\n margin-left: -15px;\n flex-shrink: 0;\n overflow: hidden;\n color: var(--fgColor-muted);\n\n /* TODOl not quite sure if this is the correct migration for this line */\n background-color: var(--timelineBadge-bgColor);\n /* stylelint-disable-next-line primer/colors */\n border-color: var(--bgColor-default);\n border-style: solid;\n border-width: var(--borderWidth-thick);\n border-radius: 50%;\n align-items: center;\n justify-content: center;\n\n &:where([data-variant]) {\n color: var(--fgColor-onEmphasis);\n }\n\n &:where([data-variant='accent']) {\n background-color: var(--bgColor-accent-emphasis);\n }\n\n &:where([data-variant='success']) {\n background-color: var(--bgColor-success-emphasis);\n }\n\n &:where([data-variant='attention']) {\n background-color: var(--bgColor-attention-emphasis);\n }\n\n &:where([data-variant='severe']) {\n background-color: var(--bgColor-severe-emphasis);\n }\n\n &:where([data-variant='danger']) {\n background-color: var(--bgColor-danger-emphasis);\n }\n\n &:where([data-variant='done']) {\n background-color: var(--bgColor-done-emphasis);\n }\n\n &:where([data-variant='open']) {\n background-color: var(--bgColor-open-emphasis);\n }\n\n &:where([data-variant='closed']) {\n background-color: var(--bgColor-closed-emphasis);\n }\n\n &:where([data-variant='sponsors']) {\n background-color: var(--bgColor-sponsors-emphasis);\n }\n}\n\n.TimelineBody {\n min-width: 0;\n max-width: 100%;\n /* stylelint-disable-next-line primer/spacing */\n margin-top: calc(var(--base-size-4) + 1px);\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n flex: auto;\n}\n\n.TimelineBreak {\n position: relative;\n z-index: 1;\n height: var(--base-size-24);\n margin: 0;\n margin-bottom: calc(-1 * var(--base-size-16));\n margin-left: 0;\n background-color: var(--bgColor-default);\n border: 0;\n border-top: var(--borderWidth-thicker) solid var(--borderColor-default);\n\n /* stylelint-disable-next-line selector-pseudo-class-disallowed-list -- scoped to CSS Module, audited (github/github-ui#17224) */\n &:has(+ [data-condensed]) {\n margin-bottom: calc(-1 * var(--base-size-12));\n }\n}\n\n.TimelineItemActions {\n display: flex;\n align-items: center;\n align-self: flex-start;\n /* Match the badge wrapper height (32px in both default and condensed) so contents vertically center against the badge */\n min-height: var(--base-size-32);\n margin-left: auto;\n gap: var(--base-size-8);\n flex-shrink: 0;\n}\n"]}
|
|
@@ -28,6 +28,10 @@ export type TimelineBreakProps = {
|
|
|
28
28
|
/** Class name for custom styling */
|
|
29
29
|
className?: string;
|
|
30
30
|
} & React.ComponentPropsWithoutRef<'div'>;
|
|
31
|
+
export type TimelineActionsProps = {
|
|
32
|
+
/** Class name for custom styling */
|
|
33
|
+
className?: string;
|
|
34
|
+
} & React.ComponentPropsWithoutRef<'div'>;
|
|
31
35
|
declare const _default: React.ForwardRefExoticComponent<StyledTimelineProps & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>> & {
|
|
32
36
|
Item: React.ForwardRefExoticComponent<StyledTimelineItemProps & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
37
|
Badge: {
|
|
@@ -42,6 +46,10 @@ declare const _default: React.ForwardRefExoticComponent<StyledTimelineProps & Om
|
|
|
42
46
|
/** Class name for custom styling */
|
|
43
47
|
className?: string;
|
|
44
48
|
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
49
|
+
Actions: React.ForwardRefExoticComponent<{
|
|
50
|
+
/** Class name for custom styling */
|
|
51
|
+
className?: string;
|
|
52
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
45
53
|
};
|
|
46
54
|
export default _default;
|
|
47
55
|
//# sourceMappingURL=Timeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/Timeline/Timeline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,KAAK,mBAAmB,GAAG;IAAC,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,CAAA;AAEjG,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAsBvF,KAAK,uBAAuB,GAAG;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,CAAA;AAExE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAEhG,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAiB/F,MA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,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAiB/F,MAAM,MAAM,oBAAoB,GAC5B,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,QAAQ,GACR,UAAU,CAAA;AAEd,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qCAAqC;IACrC,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAYzC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAQzC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAQzC,MAAM,MAAM,oBAAoB,GAAG;IACjC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;;;;2CAnCc,kBAAkB;;;;QAWvE,oCAAoC;oBACxB,MAAM;;;QAUlB,oCAAoC;oBACxB,MAAM;;;QAUlB,oCAAoC;oBACxB,MAAM;;;AASpB,wBAME"}
|
|
@@ -248,11 +248,53 @@ const TimelineBreak = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
|
248
248
|
return t2;
|
|
249
249
|
});
|
|
250
250
|
TimelineBreak.displayName = 'TimelineBreak';
|
|
251
|
+
const TimelineActions = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
252
|
+
const $ = c(9);
|
|
253
|
+
let className;
|
|
254
|
+
let props;
|
|
255
|
+
if ($[0] !== t0) {
|
|
256
|
+
({
|
|
257
|
+
className,
|
|
258
|
+
...props
|
|
259
|
+
} = t0);
|
|
260
|
+
$[0] = t0;
|
|
261
|
+
$[1] = className;
|
|
262
|
+
$[2] = props;
|
|
263
|
+
} else {
|
|
264
|
+
className = $[1];
|
|
265
|
+
props = $[2];
|
|
266
|
+
}
|
|
267
|
+
let t1;
|
|
268
|
+
if ($[3] !== className) {
|
|
269
|
+
t1 = clsx(className, classes.TimelineItemActions);
|
|
270
|
+
$[3] = className;
|
|
271
|
+
$[4] = t1;
|
|
272
|
+
} else {
|
|
273
|
+
t1 = $[4];
|
|
274
|
+
}
|
|
275
|
+
let t2;
|
|
276
|
+
if ($[5] !== forwardRef || $[6] !== props || $[7] !== t1) {
|
|
277
|
+
t2 = /*#__PURE__*/jsx("div", {
|
|
278
|
+
...props,
|
|
279
|
+
className: t1,
|
|
280
|
+
ref: forwardRef
|
|
281
|
+
});
|
|
282
|
+
$[5] = forwardRef;
|
|
283
|
+
$[6] = props;
|
|
284
|
+
$[7] = t1;
|
|
285
|
+
$[8] = t2;
|
|
286
|
+
} else {
|
|
287
|
+
t2 = $[8];
|
|
288
|
+
}
|
|
289
|
+
return t2;
|
|
290
|
+
});
|
|
291
|
+
TimelineActions.displayName = 'Timeline.Actions';
|
|
251
292
|
var Timeline_default = Object.assign(Timeline, {
|
|
252
293
|
Item: TimelineItem,
|
|
253
294
|
Badge: TimelineBadge,
|
|
254
295
|
Body: TimelineBody,
|
|
255
|
-
Break: TimelineBreak
|
|
296
|
+
Break: TimelineBreak,
|
|
297
|
+
Actions: TimelineActions
|
|
256
298
|
});
|
|
257
299
|
|
|
258
300
|
export { Timeline_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './Timeline-
|
|
1
|
+
import './Timeline-c5e15bf9.css';
|
|
2
2
|
|
|
3
|
-
var classes = {"Timeline":"prc-Timeline-Timeline-awSoC","TimelineItem":"prc-Timeline-TimelineItem-QwDVH","TimelineBadge":"prc-Timeline-TimelineBadge-u0qSm","TimelineBadgeWrapper":"prc-Timeline-TimelineBadgeWrapper-SZw4k","TimelineBody":"prc-Timeline-TimelineBody-tjOtb","TimelineBreak":"prc-Timeline-TimelineBreak-X8eti"};
|
|
3
|
+
var classes = {"Timeline":"prc-Timeline-Timeline-awSoC","TimelineItem":"prc-Timeline-TimelineItem-QwDVH","TimelineBadge":"prc-Timeline-TimelineBadge-u0qSm","TimelineBadgeWrapper":"prc-Timeline-TimelineBadgeWrapper-SZw4k","TimelineBody":"prc-Timeline-TimelineBody-tjOtb","TimelineBreak":"prc-Timeline-TimelineBreak-X8eti","TimelineItemActions":"prc-Timeline-TimelineItemActions-56Y7h"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|
package/dist/Timeline/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default } from './Timeline';
|
|
2
|
-
export type { TimelineProps, TimelineItemsProps, TimelineItemProps, TimelineBadgeVariant, TimelineBadgeProps, TimelineBodyProps, TimelineBreakProps, } from './Timeline';
|
|
2
|
+
export type { TimelineProps, TimelineItemsProps, TimelineItemProps, TimelineBadgeVariant, TimelineBadgeProps, TimelineBodyProps, TimelineBreakProps, TimelineActionsProps, } from './Timeline';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Timeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Timeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,YAAY,CAAA"}
|
|
@@ -15,5 +15,7 @@ export type UnderlineNavProps = {
|
|
|
15
15
|
*/
|
|
16
16
|
variant?: 'inset' | 'flush';
|
|
17
17
|
};
|
|
18
|
+
export declare const MORE_BTN_WIDTH = 86;
|
|
19
|
+
export declare const getValidChildren: (children: React.ReactNode) => React.ReactElement<any>[];
|
|
18
20
|
export declare const UnderlineNav: React.ForwardRefExoticComponent<UnderlineNavProps & React.RefAttributes<unknown>>;
|
|
19
21
|
//# sourceMappingURL=UnderlineNav.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkD,MAAM,OAAO,CAAA;AAoBtE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,cAAc,KAAK,CAAA;AAwEhC,eAAO,MAAM,gBAAgB,GAAI,UAAU,KAAK,CAAC,SAAS,KAEgC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAChH,CAAA;AAgCD,eAAO,MAAM,YAAY,mFA0SxB,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React, { forwardRef, useRef, useState, useCallback
|
|
1
|
+
import React, { forwardRef, useRef, useState, useCallback } from 'react';
|
|
2
2
|
import { useDevOnlyEffect } from '../internal/hooks/useDevOnlyEffect.js';
|
|
3
3
|
import { UnderlineNavContext } from './UnderlineNavContext.js';
|
|
4
4
|
import { useResizeObserver } from '../hooks/useResizeObserver.js';
|
|
5
|
-
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
6
5
|
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
7
|
-
import {
|
|
6
|
+
import { dividerStyles, baseMenuMinWidth, menuItemStyles } from './styles.js';
|
|
8
7
|
import { UnderlineWrapper, UnderlineItemList, LoadingCounter, GAP } from '../internal/components/UnderlineTabbedInterface.js';
|
|
9
8
|
import { TriangleDownIcon } from '@primer/octicons-react';
|
|
10
9
|
import { useOnEscapePress } from '../hooks/useOnEscapePress.js';
|
|
@@ -23,19 +22,19 @@ import CounterLabel from '../CounterLabel/CounterLabel.js';
|
|
|
23
22
|
const MORE_BTN_WIDTH = 86;
|
|
24
23
|
// The height is needed to make sure we don't have a layout shift when the more button is the only item in the nav.
|
|
25
24
|
const MORE_BTN_HEIGHT = 45;
|
|
26
|
-
const
|
|
25
|
+
const overflowEffect = (navWidth, moreMenuWidth, childArray, childWidthArray, noIconChildWidthArray, updateListAndMenu) => {
|
|
27
26
|
let iconsVisible = true;
|
|
28
|
-
if (
|
|
29
|
-
|
|
27
|
+
if (childWidthArray.length === 0) {
|
|
28
|
+
updateListAndMenu({
|
|
30
29
|
items: childArray,
|
|
31
|
-
menuItems: []
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
menuItems: []
|
|
31
|
+
}, iconsVisible, false);
|
|
32
|
+
return;
|
|
34
33
|
}
|
|
35
|
-
const numberOfItemsPossible = calculatePossibleItems(
|
|
36
|
-
const numberOfItemsWithoutIconPossible = calculatePossibleItems(
|
|
34
|
+
const numberOfItemsPossible = calculatePossibleItems(childWidthArray, navWidth);
|
|
35
|
+
const numberOfItemsWithoutIconPossible = calculatePossibleItems(noIconChildWidthArray, navWidth);
|
|
37
36
|
// We need to take more menu width into account when calculating the number of items possible
|
|
38
|
-
const numberOfItemsPossibleWithMoreMenu = calculatePossibleItems(
|
|
37
|
+
const numberOfItemsPossibleWithMoreMenu = calculatePossibleItems(noIconChildWidthArray, navWidth, moreMenuWidth || MORE_BTN_WIDTH);
|
|
39
38
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
39
|
const items = [];
|
|
41
40
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -78,27 +77,26 @@ const computeOverflow = (navWidth, moreMenuWidth, childArray, childWidths, noIco
|
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
|
-
|
|
80
|
+
updateListAndMenu({
|
|
82
81
|
items,
|
|
83
|
-
menuItems
|
|
84
|
-
|
|
85
|
-
};
|
|
82
|
+
menuItems
|
|
83
|
+
}, iconsVisible, true);
|
|
86
84
|
};
|
|
87
85
|
const getValidChildren = children => {
|
|
88
86
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
89
87
|
return React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child));
|
|
90
88
|
};
|
|
91
|
-
const calculatePossibleItems = (
|
|
89
|
+
const calculatePossibleItems = (childWidthArray, navWidth, moreMenuWidth = 0) => {
|
|
92
90
|
const widthToFit = navWidth - moreMenuWidth;
|
|
93
|
-
let breakpoint =
|
|
91
|
+
let breakpoint = childWidthArray.length; // assume all items will fit
|
|
94
92
|
let sumsOfChildWidth = 0;
|
|
95
|
-
for (const [index,
|
|
96
|
-
|
|
97
|
-
const width = (_widthMap$get = widthMap.get(String(child.key))) !== null && _widthMap$get !== void 0 ? _widthMap$get : 0;
|
|
98
|
-
sumsOfChildWidth = sumsOfChildWidth + width + GAP;
|
|
93
|
+
for (const [index, childWidth] of childWidthArray.entries()) {
|
|
94
|
+
sumsOfChildWidth = sumsOfChildWidth + childWidth.width + GAP;
|
|
99
95
|
if (sumsOfChildWidth > widthToFit) {
|
|
100
96
|
breakpoint = index;
|
|
101
97
|
break;
|
|
98
|
+
} else {
|
|
99
|
+
continue;
|
|
102
100
|
}
|
|
103
101
|
}
|
|
104
102
|
return breakpoint;
|
|
@@ -125,6 +123,7 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
125
123
|
className,
|
|
126
124
|
children
|
|
127
125
|
}, forwardedRef) => {
|
|
126
|
+
var _listRef$current2;
|
|
128
127
|
const backupRef = useRef(null);
|
|
129
128
|
const navRef = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
|
|
130
129
|
const listRef = useRef(null);
|
|
@@ -133,70 +132,32 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
133
132
|
const containerRef = React.useRef(null);
|
|
134
133
|
const disclosureWidgetId = useId();
|
|
135
134
|
const [isWidgetOpen, setIsWidgetOpen] = useState(false);
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const
|
|
135
|
+
const [iconsVisible, setIconsVisible] = useState(true);
|
|
136
|
+
const [childWidthArray, setChildWidthArray] = useState([]);
|
|
137
|
+
const [noIconChildWidthArray, setNoIconChildWidthArray] = useState([]);
|
|
138
|
+
// Track whether the initial overflow calculation is complete to prevent CLS
|
|
139
|
+
const [isOverflowMeasured, setIsOverflowMeasured] = useState(false);
|
|
141
140
|
const validChildren = getValidChildren(children);
|
|
142
|
-
// Stable signature of the children list — when it changes we re-run the
|
|
143
|
-
// measurement pass with all items rendered (with icons) in the list. The
|
|
144
|
-
// delimiter is U+0000 (NUL) because React rejects NUL inside element keys,
|
|
145
|
-
// so consumer-provided keys cannot collide with the separator.
|
|
146
|
-
const childrenKey = validChildren.map(c => String(c.key)).join('\u0000');
|
|
147
|
-
|
|
148
|
-
// Single consolidated overflow state. Bundling `items`, `menuItems`,
|
|
149
|
-
// `iconsVisible`, `measured`, and `childrenKey` together means every
|
|
150
|
-
// overflow update — measurement, swap, resize, or children-change reset —
|
|
151
|
-
// is exactly one setState call (one commit), instead of fanning out to
|
|
152
|
-
// multiple back-to-back commits.
|
|
153
141
|
|
|
154
|
-
|
|
142
|
+
// Responsive props object manages which items are in the list and which items are in the menu.
|
|
143
|
+
const [responsiveProps, setResponsiveProps] = useState({
|
|
155
144
|
items: validChildren,
|
|
156
|
-
menuItems: []
|
|
157
|
-
|
|
158
|
-
measured: false,
|
|
159
|
-
childrenKey
|
|
160
|
-
}));
|
|
161
|
-
|
|
162
|
-
// Derived-state reset: when the children list changes, push everything back into
|
|
163
|
-
// the list (with icons) so the next layout effect can measure all items in one
|
|
164
|
-
// pass. This is React's recommended "store information from previous renders"
|
|
165
|
-
// pattern — calling setState during render lets React discard the in-progress
|
|
166
|
-
// render and re-render immediately with the reset state, before paint.
|
|
167
|
-
if (overflowState.childrenKey !== childrenKey) {
|
|
168
|
-
setOverflowState({
|
|
169
|
-
items: validChildren,
|
|
170
|
-
menuItems: [],
|
|
171
|
-
iconsVisible: true,
|
|
172
|
-
measured: false,
|
|
173
|
-
childrenKey
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Build a key-indexed view of validChildren once per render so the listItems /
|
|
178
|
-
// menuItems prop-refresh below is O(N) instead of O(N^2) via Array.prototype.find.
|
|
179
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
180
|
-
const validChildrenByKey = new Map();
|
|
181
|
-
for (const c of validChildren) validChildrenByKey.set(String(c.key), c);
|
|
182
|
-
const {
|
|
183
|
-
iconsVisible,
|
|
184
|
-
measured: isOverflowMeasured
|
|
185
|
-
} = overflowState;
|
|
145
|
+
menuItems: []
|
|
146
|
+
});
|
|
186
147
|
|
|
187
148
|
// Make sure to have the fresh props data for list items when children are changed (keeping aria-current up-to-date)
|
|
188
|
-
const listItems =
|
|
189
|
-
var
|
|
190
|
-
return (
|
|
149
|
+
const listItems = responsiveProps.items.map(item => {
|
|
150
|
+
var _validChildren$find;
|
|
151
|
+
return (_validChildren$find = validChildren.find(child => child.key === item.key)) !== null && _validChildren$find !== void 0 ? _validChildren$find : item;
|
|
191
152
|
});
|
|
192
153
|
|
|
193
154
|
// Make sure to have the fresh props data for menu items when children are changed (keeping aria-current up-to-date)
|
|
194
|
-
const menuItems =
|
|
195
|
-
var
|
|
196
|
-
return (
|
|
155
|
+
const menuItems = responsiveProps.menuItems.map(menuItem => {
|
|
156
|
+
var _validChildren$find2;
|
|
157
|
+
return (_validChildren$find2 = validChildren.find(child => child.key === menuItem.key)) !== null && _validChildren$find2 !== void 0 ? _validChildren$find2 : menuItem;
|
|
197
158
|
});
|
|
198
159
|
// This is the case where the viewport is too narrow to show any list item with the more menu. In this case, we only show the dropdown
|
|
199
|
-
const onlyMenuVisible =
|
|
160
|
+
const onlyMenuVisible = responsiveProps.items.length === 0;
|
|
200
161
|
useDevOnlyEffect(() => {
|
|
201
162
|
// Address illegal state where there are multiple items that have `aria-current='page'` attribute
|
|
202
163
|
const activeElements = validChildren.filter(child => {
|
|
@@ -205,145 +166,66 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
205
166
|
!(activeElements.length <= 1) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Only one current element is allowed') : invariant(false) : void 0;
|
|
206
167
|
!ariaLabel ? process.env.NODE_ENV !== "production" ? invariant(false, 'Use the `aria-label` prop to provide an accessible label for assistive technology') : invariant(false) : void 0;
|
|
207
168
|
}, [validChildren, ariaLabel]);
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const getItemNoIconWidth = item => {
|
|
214
|
-
var _noIconChildWidthsRef;
|
|
215
|
-
return (_noIconChildWidthsRef = noIconChildWidthsRef.current.get(String(item.key))) !== null && _noIconChildWidthsRef !== void 0 ? _noIconChildWidthsRef : 0;
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
// Pure: returns the {items, menuItems} that result from promoting
|
|
219
|
-
// `prospectiveListItem` (currently at position `indexOfProspectiveListItem`
|
|
220
|
-
// in `currentMenuItems`) into `currentItems`. Does not call setState.
|
|
221
|
-
const computeSwap = (currentItems, currentMenuItems, prospectiveListItem, indexOfProspectiveListItem) => {
|
|
169
|
+
function getItemsWidth(itemText) {
|
|
170
|
+
var _noIconChildWidthArra, _noIconChildWidthArra2;
|
|
171
|
+
return (_noIconChildWidthArra = (_noIconChildWidthArra2 = noIconChildWidthArray.find(item => item.text === itemText)) === null || _noIconChildWidthArra2 === void 0 ? void 0 : _noIconChildWidthArra2.width) !== null && _noIconChildWidthArra !== void 0 ? _noIconChildWidthArra : 0;
|
|
172
|
+
}
|
|
173
|
+
const swapMenuItemWithListItem = (prospectiveListItem, indexOfProspectiveListItem, event, callback) => {
|
|
222
174
|
var _navRef$current$getBo, _navRef$current, _listRef$current$getB, _listRef$current;
|
|
223
|
-
|
|
175
|
+
// get the selected menu item's width
|
|
176
|
+
const widthToFitIntoList = getItemsWidth(prospectiveListItem.props.children);
|
|
177
|
+
// Check if there is any empty space on the right side of the list
|
|
224
178
|
const availableSpace = ((_navRef$current$getBo = (_navRef$current = navRef.current) === null || _navRef$current === void 0 ? void 0 : _navRef$current.getBoundingClientRect().width) !== null && _navRef$current$getBo !== void 0 ? _navRef$current$getBo : 0) - ((_listRef$current$getB = (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.getBoundingClientRect().width) !== null && _listRef$current$getB !== void 0 ? _listRef$current$getB : 0);
|
|
225
179
|
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if (widthToFitIntoList < widthToSwap + availableSpace) {
|
|
233
|
-
breakpoint = index;
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
const indexToSliceAt = currentItems.length - 1 - breakpoint;
|
|
238
|
-
const itemsLeftInList = currentItems.slice(0, indexToSliceAt);
|
|
180
|
+
// Calculate how many items need to be pulled in to the menu to make room for the selected menu item
|
|
181
|
+
// I.e. if we need to pull 2 items in (index 0 and index 1), breakpoint (index) will return 1.
|
|
182
|
+
const index = getBreakpointForItemSwapping(widthToFitIntoList, availableSpace);
|
|
183
|
+
const indexToSliceAt = responsiveProps.items.length - 1 - index;
|
|
184
|
+
// Form the new list of items
|
|
185
|
+
const itemsLeftInList = [...responsiveProps.items].slice(0, indexToSliceAt);
|
|
239
186
|
const updatedItemList = [...itemsLeftInList, prospectiveListItem];
|
|
240
|
-
|
|
241
|
-
const
|
|
187
|
+
// Form the new menu items
|
|
188
|
+
const itemsToAddToMenu = [...responsiveProps.items].slice(indexToSliceAt);
|
|
189
|
+
const updatedMenuItems = [...menuItems];
|
|
190
|
+
// Add itemsToAddToMenu array's items to the menu at the index of the prospectiveListItem and remove 1 count of items (prospectiveListItem)
|
|
242
191
|
updatedMenuItems.splice(indexOfProspectiveListItem, 1, ...itemsToAddToMenu);
|
|
243
|
-
|
|
192
|
+
callback({
|
|
244
193
|
items: updatedItemList,
|
|
245
194
|
menuItems: updatedMenuItems
|
|
246
|
-
};
|
|
195
|
+
}, false, true);
|
|
247
196
|
};
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
// Single combined layout effect that performs measurement (when needed) and
|
|
260
|
-
// the external-aria-current promotion (when needed), then commits at most
|
|
261
|
-
// one setOverflowState per pass. Replaces the previous two effects (each of
|
|
262
|
-
// which produced its own commit) and removes the render-phase setState that
|
|
263
|
-
// the original component used to do the same swap from inside menuItems.map.
|
|
264
|
-
//
|
|
265
|
-
// Why no deps array: the swap branch depends on `aria-current` which lives
|
|
266
|
-
// on item props (not on `overflowState`); a deps-driven effect would not
|
|
267
|
-
// notice prop-only changes without rebuilding a signature. The body
|
|
268
|
-
// short-circuits cheaply on every render where neither pass needs to run.
|
|
269
|
-
useIsomorphicLayoutEffect(() => {
|
|
270
|
-
var _next;
|
|
271
|
-
const listEl = listRef.current;
|
|
272
|
-
const navEl = navRef.current;
|
|
273
|
-
if (!listEl || !navEl) return;
|
|
274
|
-
let next = null;
|
|
275
|
-
|
|
276
|
-
// Pass 1: measurement (runs once after each remeasure trigger).
|
|
277
|
-
if (!isOverflowMeasured) {
|
|
278
|
-
var _moreMenuRef$current$, _moreMenuRef$current;
|
|
279
|
-
const widths = new Map();
|
|
280
|
-
const noIconWidths = new Map();
|
|
281
|
-
const itemEls = listEl.querySelectorAll('[data-underlinenav-item="true"]');
|
|
282
|
-
|
|
283
|
-
// The N-th [data-underlinenav-item] element corresponds to validChildren[N]
|
|
284
|
-
// because the measurement pass runs only when all items are in the list,
|
|
285
|
-
// in render order. Pair them up positionally so we can key widths by the
|
|
286
|
-
// element's React key.
|
|
287
|
-
const upToBoundary = Math.min(itemEls.length, validChildren.length);
|
|
288
|
-
for (let index = 0; index < upToBoundary; index++) {
|
|
289
|
-
const liEl = itemEls[index];
|
|
290
|
-
const linkEl = liEl.querySelector('a, button');
|
|
291
|
-
if (!linkEl) continue;
|
|
292
|
-
const child = validChildren[index];
|
|
293
|
-
const key = String(child.key);
|
|
294
|
-
const domRect = linkEl.getBoundingClientRect();
|
|
295
|
-
const iconEl = linkEl.querySelector('[data-component="icon"]');
|
|
296
|
-
let iconWidthWithMargin = 0;
|
|
297
|
-
if (iconEl) {
|
|
298
|
-
const style = getComputedStyle(iconEl);
|
|
299
|
-
iconWidthWithMargin = iconEl.getBoundingClientRect().width + (parseFloat(style.marginRight) || 0) + (parseFloat(style.marginLeft) || 0);
|
|
300
|
-
}
|
|
301
|
-
widths.set(key, domRect.width);
|
|
302
|
-
noIconWidths.set(key, domRect.width - iconWidthWithMargin);
|
|
197
|
+
// How many items do we need to pull in to the menu to make room for the selected menu item.
|
|
198
|
+
function getBreakpointForItemSwapping(widthToFitIntoList, availableSpace) {
|
|
199
|
+
let widthToSwap = 0;
|
|
200
|
+
let breakpoint = 0;
|
|
201
|
+
for (const [index, item] of [...responsiveProps.items].reverse().entries()) {
|
|
202
|
+
widthToSwap += getItemsWidth(item.props.children);
|
|
203
|
+
if (widthToFitIntoList < widthToSwap + availableSpace) {
|
|
204
|
+
breakpoint = index;
|
|
205
|
+
break;
|
|
303
206
|
}
|
|
304
|
-
childWidthsRef.current = widths;
|
|
305
|
-
noIconChildWidthsRef.current = noIconWidths;
|
|
306
|
-
const navWidth = navEl.getBoundingClientRect().width;
|
|
307
|
-
if (navWidth === 0) return;
|
|
308
|
-
const moreMenuWidth = (_moreMenuRef$current$ = (_moreMenuRef$current = moreMenuRef.current) === null || _moreMenuRef$current === void 0 ? void 0 : _moreMenuRef$current.getBoundingClientRect().width) !== null && _moreMenuRef$current$ !== void 0 ? _moreMenuRef$current$ : 0;
|
|
309
|
-
const result = computeOverflow(navWidth, moreMenuWidth, validChildren, widths, noIconWidths);
|
|
310
|
-
next = {
|
|
311
|
-
items: result.items,
|
|
312
|
-
menuItems: result.menuItems,
|
|
313
|
-
iconsVisible: result.iconsVisible,
|
|
314
|
-
measured: true,
|
|
315
|
-
childrenKey: overflowState.childrenKey
|
|
316
|
-
};
|
|
317
207
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
// O(N) and ran inside a .map() — quadratic on every commit).
|
|
326
|
-
const freshMenuItems = considered.menuItems.map(item => {
|
|
327
|
-
var _validChildrenByKey$g3;
|
|
328
|
-
return (_validChildrenByKey$g3 = validChildrenByKey.get(String(item.key))) !== null && _validChildrenByKey$g3 !== void 0 ? _validChildrenByKey$g3 : item;
|
|
329
|
-
});
|
|
330
|
-
const indexOfCurrent = freshMenuItems.findIndex(item => {
|
|
331
|
-
const c = item.props['aria-current'];
|
|
332
|
-
return Boolean(c) && c !== 'false';
|
|
333
|
-
});
|
|
334
|
-
if (indexOfCurrent !== -1) {
|
|
335
|
-
const swap = computeSwap(considered.items, freshMenuItems, freshMenuItems[indexOfCurrent], indexOfCurrent);
|
|
336
|
-
next = {
|
|
337
|
-
items: swap.items,
|
|
338
|
-
menuItems: swap.menuItems,
|
|
339
|
-
iconsVisible: false,
|
|
340
|
-
measured: true,
|
|
341
|
-
childrenKey: considered.childrenKey
|
|
342
|
-
};
|
|
343
|
-
}
|
|
208
|
+
return breakpoint;
|
|
209
|
+
}
|
|
210
|
+
const updateListAndMenu = useCallback((props, displayIcons, overflowMeasured) => {
|
|
211
|
+
setResponsiveProps(props);
|
|
212
|
+
setIconsVisible(displayIcons);
|
|
213
|
+
if (overflowMeasured) {
|
|
214
|
+
setIsOverflowMeasured(true);
|
|
344
215
|
}
|
|
345
|
-
|
|
346
|
-
|
|
216
|
+
}, []);
|
|
217
|
+
const setChildrenWidth = useCallback(size => {
|
|
218
|
+
setChildWidthArray(arr => {
|
|
219
|
+
const newArr = [...arr, size];
|
|
220
|
+
return newArr;
|
|
221
|
+
});
|
|
222
|
+
}, []);
|
|
223
|
+
const setNoIconChildrenWidth = useCallback(size => {
|
|
224
|
+
setNoIconChildWidthArray(arr => {
|
|
225
|
+
const newArr = [...arr, size];
|
|
226
|
+
return newArr;
|
|
227
|
+
});
|
|
228
|
+
}, []);
|
|
347
229
|
const closeOverlay = React.useCallback(() => {
|
|
348
230
|
setIsWidgetOpen(false);
|
|
349
231
|
}, [setIsWidgetOpen]);
|
|
@@ -370,66 +252,36 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
370
252
|
ignoreClickRefs: [moreMenuBtnRef]
|
|
371
253
|
});
|
|
372
254
|
useResizeObserver(resizeObserverEntries => {
|
|
373
|
-
var _moreMenuRef$current
|
|
255
|
+
var _moreMenuRef$current$, _moreMenuRef$current;
|
|
374
256
|
const navWidth = resizeObserverEntries[0].contentRect.width;
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
const result = computeOverflow(navWidth, moreMenuWidth, validChildren, childWidthsRef.current, noIconChildWidthsRef.current);
|
|
378
|
-
setOverflowState(prev => ({
|
|
379
|
-
items: result.items,
|
|
380
|
-
menuItems: result.menuItems,
|
|
381
|
-
iconsVisible: result.iconsVisible,
|
|
382
|
-
measured: childWidthsRef.current.size > 0 || prev.measured,
|
|
383
|
-
childrenKey: prev.childrenKey
|
|
384
|
-
}));
|
|
257
|
+
const moreMenuWidth = (_moreMenuRef$current$ = (_moreMenuRef$current = moreMenuRef.current) === null || _moreMenuRef$current === void 0 ? void 0 : _moreMenuRef$current.getBoundingClientRect().width) !== null && _moreMenuRef$current$ !== void 0 ? _moreMenuRef$current$ : 0;
|
|
258
|
+
navWidth !== 0 && overflowEffect(navWidth, moreMenuWidth, validChildren, childWidthArray, noIconChildWidthArray, updateListAndMenu);
|
|
385
259
|
}, navRef);
|
|
386
260
|
|
|
387
|
-
//
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
// This used to be computed inline during render by reading
|
|
393
|
-
// containerRef.current / listRef.current — refs are mutable and unsafe to
|
|
394
|
-
// read during render under concurrent rendering (the first render saw null
|
|
395
|
-
// refs and fell through to the unanchored fallback; subsequent renders
|
|
396
|
-
// anchored differently, producing a perceptible reflow).
|
|
397
|
-
const [menuAnchorLeft, setMenuAnchorLeft] = useState(undefined);
|
|
398
|
-
useIsomorphicLayoutEffect(() => {
|
|
399
|
-
const container = containerRef.current;
|
|
400
|
-
const list = listRef.current;
|
|
401
|
-
if (!container || !list) return;
|
|
402
|
-
if (list.clientWidth >= baseMenuMinWidth) {
|
|
403
|
-
if (menuAnchorLeft !== undefined) setMenuAnchorLeft(undefined);
|
|
404
|
-
return;
|
|
405
|
-
}
|
|
261
|
+
// Compute menuInlineStyles if needed
|
|
262
|
+
let menuInlineStyles = {
|
|
263
|
+
...baseMenuInlineStyles
|
|
264
|
+
};
|
|
265
|
+
if (containerRef.current && listRef.current) {
|
|
406
266
|
const {
|
|
407
267
|
left
|
|
408
|
-
} = getAnchoredPosition(
|
|
268
|
+
} = getAnchoredPosition(containerRef.current, listRef.current, {
|
|
409
269
|
align: 'start',
|
|
410
270
|
side: 'outside-bottom'
|
|
411
271
|
});
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
const contextValue = useMemo(() => ({
|
|
419
|
-
loadingCounters,
|
|
420
|
-
iconsVisible
|
|
421
|
-
}), [loadingCounters, iconsVisible]);
|
|
422
|
-
const menuStyle = menuAnchorLeft !== undefined ? {
|
|
423
|
-
...baseMenuInlineStyles,
|
|
424
|
-
right: undefined,
|
|
425
|
-
left: menuAnchorLeft,
|
|
426
|
-
display: isWidgetOpen ? 'block' : 'none'
|
|
427
|
-
} : {
|
|
428
|
-
...baseMenuInlineStyles,
|
|
429
|
-
display: isWidgetOpen ? 'block' : 'none'
|
|
430
|
-
};
|
|
272
|
+
menuInlineStyles = {
|
|
273
|
+
...baseMenuInlineStyles,
|
|
274
|
+
right: undefined,
|
|
275
|
+
left
|
|
276
|
+
};
|
|
277
|
+
}
|
|
431
278
|
return /*#__PURE__*/jsxs(UnderlineNavContext.Provider, {
|
|
432
|
-
value:
|
|
279
|
+
value: {
|
|
280
|
+
setChildrenWidth,
|
|
281
|
+
setNoIconChildrenWidth,
|
|
282
|
+
loadingCounters,
|
|
283
|
+
iconsVisible
|
|
284
|
+
},
|
|
433
285
|
children: [ariaLabel && /*#__PURE__*/jsx(VisuallyHidden, {
|
|
434
286
|
as: "h2",
|
|
435
287
|
children: `${ariaLabel} navigation`
|
|
@@ -476,23 +328,31 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
476
328
|
selectionVariant: "single",
|
|
477
329
|
ref: containerRef,
|
|
478
330
|
id: disclosureWidgetId,
|
|
479
|
-
style:
|
|
331
|
+
style: {
|
|
332
|
+
...((_listRef$current2 = listRef.current) !== null && _listRef$current2 !== void 0 && _listRef$current2.clientWidth && listRef.current.clientWidth >= baseMenuMinWidth ? baseMenuInlineStyles : menuInlineStyles),
|
|
333
|
+
display: isWidgetOpen ? 'block' : 'none'
|
|
334
|
+
},
|
|
480
335
|
children: menuItems.map((menuItem, index) => {
|
|
481
336
|
const {
|
|
482
337
|
children: menuItemChildren,
|
|
483
338
|
counter,
|
|
484
|
-
|
|
485
|
-
// directly from item.props (not via these destructured locals).
|
|
486
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
487
|
-
'aria-current': _ariaCurrent,
|
|
339
|
+
'aria-current': ariaCurrent,
|
|
488
340
|
onSelect,
|
|
489
341
|
...menuItemProps
|
|
490
342
|
} = menuItem.props;
|
|
343
|
+
|
|
344
|
+
// This logic is used to pop the selected item out of the menu and into the list when the navigation is control externally
|
|
345
|
+
if (Boolean(ariaCurrent) && ariaCurrent !== 'false') {
|
|
346
|
+
const event = new MouseEvent('click');
|
|
347
|
+
!onlyMenuVisible && swapMenuItemWithListItem(menuItem, index,
|
|
348
|
+
// @ts-ignore - not a big deal because it is internally creating an event but ask help
|
|
349
|
+
event, updateListAndMenu);
|
|
350
|
+
}
|
|
491
351
|
return /*#__PURE__*/jsx(ActionList.LinkItem, {
|
|
492
352
|
style: menuItemStyles,
|
|
493
353
|
onClick: event => {
|
|
494
354
|
// When there are no items in the list, do not run the swap function as we want to keep everything in the menu.
|
|
495
|
-
!onlyMenuVisible && swapMenuItemWithListItem(menuItem, index);
|
|
355
|
+
!onlyMenuVisible && swapMenuItemWithListItem(menuItem, index, event, updateListAndMenu);
|
|
496
356
|
closeOverlay();
|
|
497
357
|
focusOnMoreMenuBtn();
|
|
498
358
|
// fire onSelect event that comes from the UnderlineNav.Item (if it is defined)
|
|
@@ -508,7 +368,7 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
508
368
|
})
|
|
509
369
|
})]
|
|
510
370
|
})
|
|
511
|
-
},
|
|
371
|
+
}, menuItemChildren);
|
|
512
372
|
})
|
|
513
373
|
})]
|
|
514
374
|
})]
|
|
@@ -518,4 +378,4 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
518
378
|
});
|
|
519
379
|
UnderlineNav.displayName = 'UnderlineNav';
|
|
520
380
|
|
|
521
|
-
export { UnderlineNav };
|
|
381
|
+
export { MORE_BTN_WIDTH, UnderlineNav, getValidChildren };
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare const UnderlineNavContext: React.Context<{
|
|
3
|
+
setChildrenWidth: React.Dispatch<{
|
|
4
|
+
text: string;
|
|
5
|
+
width: number;
|
|
6
|
+
}>;
|
|
7
|
+
setNoIconChildrenWidth: React.Dispatch<{
|
|
8
|
+
text: string;
|
|
9
|
+
width: number;
|
|
10
|
+
}>;
|
|
2
11
|
loadingCounters: boolean;
|
|
3
12
|
iconsVisible: boolean;
|
|
4
13
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNavContext.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UnderlineNavContext.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,eAAO,MAAM,mBAAmB;sBACZ,KAAK,CAAC,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;4BACvC,KAAK,CAAC,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;qBACpD,OAAO;kBACV,OAAO;EAMrB,CAAA"}
|
|
@@ -43,7 +43,5 @@ export type UnderlineNavItemProps = {
|
|
|
43
43
|
*/
|
|
44
44
|
counter?: number | string;
|
|
45
45
|
} & LinkProps;
|
|
46
|
-
declare const
|
|
47
|
-
export declare const UnderlineNavItem: typeof UnderlineNavItemImpl;
|
|
48
|
-
export {};
|
|
46
|
+
export declare const UnderlineNavItem: PolymorphicForwardRefComponent<"a", UnderlineNavItemProps>;
|
|
49
47
|
//# sourceMappingURL=UnderlineNavItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNavItem.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAC3D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"UnderlineNavItem.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAC3D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAO/F,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,CAAC,CAAA;CACjF,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAExG;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;IAE5F;;;OAGG;IAEH,IAAI,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAEnE;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAElC;;QAEI;IACJ,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,GAAG,CAAA;IAE5B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B,GAAG,SAAS,CAAA;AAEb,eAAO,MAAM,gBAAgB,EAgFxB,8BAA8B,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { forwardRef, useRef, useContext } from 'react';
|
|
2
2
|
import { UnderlineNavContext } from './UnderlineNavContext.js';
|
|
3
|
+
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
3
4
|
import { UnderlineItem } from '../internal/components/UnderlineTabbedInterface.js';
|
|
4
5
|
import classes from './UnderlineNavItem.module.css.js';
|
|
5
6
|
import { jsx } from 'react/jsx-runtime';
|
|
6
7
|
|
|
7
|
-
const
|
|
8
|
+
const UnderlineNavItem = /*#__PURE__*/forwardRef(({
|
|
8
9
|
as: Component = 'a',
|
|
9
10
|
href = '#',
|
|
10
11
|
children,
|
|
@@ -18,9 +19,28 @@ const UnderlineNavItemImpl = /*#__PURE__*/forwardRef(({
|
|
|
18
19
|
const backupRef = useRef(null);
|
|
19
20
|
const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
|
|
20
21
|
const {
|
|
22
|
+
setChildrenWidth,
|
|
23
|
+
setNoIconChildrenWidth,
|
|
21
24
|
loadingCounters,
|
|
22
25
|
iconsVisible
|
|
23
26
|
} = useContext(UnderlineNavContext);
|
|
27
|
+
useIsomorphicLayoutEffect(() => {
|
|
28
|
+
if (ref.current) {
|
|
29
|
+
const domRect = ref.current.getBoundingClientRect();
|
|
30
|
+
const icon = Array.from(ref.current.children).find(child => child.getAttribute('data-component') === 'icon');
|
|
31
|
+
const content = Array.from(ref.current.children).find(child => child.getAttribute('data-component') === 'text');
|
|
32
|
+
const text = content.textContent;
|
|
33
|
+
const iconWidthWithMargin = icon ? icon.getBoundingClientRect().width + Number(getComputedStyle(icon).marginRight.slice(0, -2)) + Number(getComputedStyle(icon).marginLeft.slice(0, -2)) : 0;
|
|
34
|
+
setChildrenWidth({
|
|
35
|
+
text,
|
|
36
|
+
width: domRect.width
|
|
37
|
+
});
|
|
38
|
+
setNoIconChildrenWidth({
|
|
39
|
+
text,
|
|
40
|
+
width: domRect.width - iconWidthWithMargin
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}, [ref, setChildrenWidth, setNoIconChildrenWidth]);
|
|
24
44
|
const keyDownHandler = React.useCallback(event => {
|
|
25
45
|
if ((event.key === ' ' || event.key === 'Enter') && !event.defaultPrevented && typeof onSelect === 'function') {
|
|
26
46
|
onSelect(event);
|
|
@@ -33,7 +53,6 @@ const UnderlineNavItemImpl = /*#__PURE__*/forwardRef(({
|
|
|
33
53
|
}, [onSelect]);
|
|
34
54
|
return /*#__PURE__*/jsx("li", {
|
|
35
55
|
className: classes.UnderlineNavItem,
|
|
36
|
-
"data-underlinenav-item": "true",
|
|
37
56
|
children: /*#__PURE__*/jsx(UnderlineItem, {
|
|
38
57
|
ref: ref,
|
|
39
58
|
as: Component,
|
|
@@ -50,10 +69,6 @@ const UnderlineNavItemImpl = /*#__PURE__*/forwardRef(({
|
|
|
50
69
|
})
|
|
51
70
|
});
|
|
52
71
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// Memoized so that re-renders of UnderlineNav (e.g. when overflow state changes)
|
|
56
|
-
// do not re-render every item when the consumer-provided children haven't changed.
|
|
57
|
-
const UnderlineNavItem = /*#__PURE__*/React.memo(UnderlineNavItemImpl);
|
|
72
|
+
UnderlineNavItem.displayName = 'UnderlineNavItem';
|
|
58
73
|
|
|
59
74
|
export { UnderlineNavItem };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type ChildSize = {
|
|
2
|
+
text: string;
|
|
3
|
+
width: number;
|
|
4
|
+
};
|
|
5
|
+
export type ChildWidthArray = Array<ChildSize>;
|
|
2
6
|
export type ResponsiveProps = {
|
|
3
7
|
items: Array<React.ReactElement<any>>;
|
|
4
8
|
menuItems: Array<React.ReactElement<any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,CAAA;AAC9C,MAAM,MAAM,eAAe,GAAG;IAE5B,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAA;IAErC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAA;CAC1C,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -122,7 +122,7 @@ export type { TextInputWithTokensProps } from './TextInputWithTokens';
|
|
|
122
122
|
export { default as Text } from './Text';
|
|
123
123
|
export type { TextProps } from './Text';
|
|
124
124
|
export { default as Timeline } from './Timeline';
|
|
125
|
-
export type { TimelineProps, TimelineBadgeVariant, TimelineBadgeProps, TimelineBodyProps, TimelineBreakProps, TimelineItemsProps, TimelineItemProps, } from './Timeline';
|
|
125
|
+
export type { TimelineProps, TimelineActionsProps, TimelineBadgeVariant, TimelineBadgeProps, TimelineBodyProps, TimelineBreakProps, TimelineItemsProps, TimelineItemProps, } from './Timeline';
|
|
126
126
|
export { default as Token, IssueLabelToken } from './Token';
|
|
127
127
|
export type { TokenProps, IssueLabelTokenProps } from './Token';
|
|
128
128
|
export { Tooltip } from './TooltipV2';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,OAAO,IAAI,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAC,MAAM,SAAS,CAAA;AACrF,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,cAAc,CAAA;AAClD,YAAY,EAAC,eAAe,EAAC,MAAM,cAAc,CAAA;AACjD,OAAO,EAAC,OAAO,IAAI,aAAa,EAAE,QAAQ,EAAE,iBAAiB,EAAC,MAAM,iBAAiB,CAAA;AACrF,YAAY,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAA;AAGvD,cAAc,UAAU,CAAA;AACxB,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,cAAc,CAAA;AACrB,OAAO,EAA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,EAAC,MAAM,YAAY,CAAA;AACnC,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAA;AAC9D,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAC/C,YAAY,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAA;AAEzD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,YAAY,EAAC,iBAAiB,EAAE,qBAAqB,EAAC,MAAM,gBAAgB,CAAA;AAE5E,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,YAAY,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAE/C,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAA;AAC7B,YAAY,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,SAAS,CAAA;AAEvD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,YAAY,EACV,eAAe,EACf,UAAU,IAAI,oBAAoB,EAClC,YAAY,IAAI,sBAAsB,EACtC,cAAc,IAAI,wBAAwB,EAC1C,iBAAiB,IAAI,2BAA2B,GACjD,MAAM,cAAc,CAAA;AAErB,OAAO,EAAC,WAAW,EAAC,MAAM,YAAY,CAAA;AACtC,YAAY,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAA"}
|
|
@@ -8062,6 +8062,10 @@
|
|
|
8062
8062
|
{
|
|
8063
8063
|
"id": "components-timeline-features--with-inline-links",
|
|
8064
8064
|
"code": "() => (\n <Timeline>\n <Timeline.Item>\n <Timeline.Badge>\n <Octicon icon={GitCommitIcon} aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Link href=\"#\" className={classes.LinkWithBoldStyle} muted>\n Monalisa\n </Link>\n enabled auto-merge (squash)\n </Timeline.Body>\n </Timeline.Item>\n </Timeline>\n)"
|
|
8065
|
+
},
|
|
8066
|
+
{
|
|
8067
|
+
"id": "components-timeline-features--with-actions",
|
|
8068
|
+
"code": "() => (\n <div\n className={classes.RealisticTimeline}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest('a')) e.preventDefault()\n }}\n >\n <Timeline>\n <Timeline.Item>\n <Timeline.Badge variant=\"done\">\n <Octicon icon={GitMergeIcon} aria-label=\"Merged\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Link href=\"#\" className={classes.LinkWithBoldStyle} muted>\n Monalisa\n </Link>\n merged via the queue into <BranchName href=\"#\">main</BranchName> with\n commit{' '}\n <Link href=\"#\" className={classes.CommitSha}>\n 01e49tb\n </Link>{' '}\n <Link href=\"#\" className={classes.Timestamp} muted>\n just now\n </Link>\n <div className={classes.ChecksSubline}>28 checks passed</div>\n </Timeline.Body>\n <Timeline.Actions>\n <Button size=\"small\">View details</Button>\n <Button size=\"small\">Revert</Button>\n </Timeline.Actions>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge>\n <Octicon icon={RepoPushIcon} aria-label=\"Force-push\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Link href=\"#\" className={classes.LinkWithBoldStyle} muted>\n Monalisa\n </Link>\n force-pushed the <BranchName href=\"#\">main</BranchName> branch from{' '}\n <Link href=\"#\" className={classes.CommitSha}>\n 01e49tb\n </Link>{' '}\n to{' '}\n <Link href=\"#\" className={classes.CommitSha}>\n 02f50uc\n </Link>{' '}\n <Link href=\"#\" className={classes.Timestamp} muted>\n 2 hours ago\n </Link>\n </Timeline.Body>\n <Timeline.Actions>\n <Button size=\"small\">Compare</Button>\n </Timeline.Actions>\n </Timeline.Item>\n <Timeline.Item condensed>\n <Timeline.Badge>\n <Octicon icon={GitCommitIcon} aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Link href=\"#\" muted>\n Update README.md\n </Link>\n </Timeline.Body>\n <Timeline.Actions>\n <Label className={classes.SignatureLabelVerified}>Verified</Label>\n <Octicon\n icon={CheckIcon}\n className={classes.IconSuccess}\n aria-label=\"All checks passed\"\n />\n <Link href=\"#\" className={classes.ShaLink} muted>\n 3fbdc0\n </Link>\n </Timeline.Actions>\n </Timeline.Item>\n <Timeline.Item condensed>\n <Timeline.Badge>\n <Octicon icon={GitCommitIcon} aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Link href=\"#\" muted>\n Initial commit\n </Link>\n </Timeline.Body>\n <Timeline.Actions>\n <Label>Unverified</Label>\n <Octicon\n icon={XIcon}\n className={classes.IconDanger}\n aria-label=\"Some checks failed\"\n />\n <Link href=\"#\" className={classes.ShaLink} muted>\n 3fbdc0\n </Link>\n </Timeline.Actions>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge>\n <Octicon icon={CrossReferenceIcon} aria-label=\"Cross-reference\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Avatar\n src=\"https://avatars.githubusercontent.com/u/92997159?v=4\"\n size={20}\n className={classes.InlineAvatar}\n />\n <Link href=\"#\" className={classes.LinkWithBoldStyle} muted>\n Monalisa\n </Link>\n mentioned this pull request{' '}\n <Link href=\"#\" className={classes.Timestamp} muted>\n just now\n </Link>\n <div className={classes.CrossReferenceRow}>\n <div className={classes.CrossReferenceContent}>\n <div className={classes.CrossReferenceTitle}>\n <Link href=\"#\" className={classes.CrossReferenceLink}>\n <span className={classes.CrossReferenceName}>\n Fix positioning of Autocomplete overlay menu\n </span>{' '}\n <span className={classes.CrossReferenceNumber}>\n primer/react#7431\n </span>\n </Link>\n </div>\n <div className={classes.CrossReferenceTaskline}>\n <Octicon icon={TasklistIcon} size={16} />\n 17 tasks\n </div>\n </div>\n <div className={classes.CrossReferenceActions}>\n <Octicon\n icon={LockIcon}\n size={16}\n className={classes.CrossReferenceMeta}\n />\n <StateLabel status=\"pullOpened\" size=\"medium\">\n Open\n </StateLabel>\n </div>\n </div>\n </Timeline.Body>\n </Timeline.Item>\n </Timeline>\n </div>\n)"
|
|
8065
8069
|
}
|
|
8066
8070
|
],
|
|
8067
8071
|
"importPath": "@primer/react",
|
|
@@ -8100,6 +8104,10 @@
|
|
|
8100
8104
|
{
|
|
8101
8105
|
"name": "Timeline.Break",
|
|
8102
8106
|
"props": []
|
|
8107
|
+
},
|
|
8108
|
+
{
|
|
8109
|
+
"name": "Timeline.Actions",
|
|
8110
|
+
"props": []
|
|
8103
8111
|
}
|
|
8104
8112
|
]
|
|
8105
8113
|
},
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Timeline/Timeline.module.css.js"],"names":[],"mappings":"AAAA,6BACE,YAAa,CACb,qBAuBF,CAnBI,6KACE,aAKF,CAHE,iNACE,8BACF,CAMF,0KACE,gBAKF,CAHE,8MACE,iCACF,CAKN,iCAEE,YAAa,CAEb,oCAAgC,CADhC,kCAA8B,CAF9B,iBAkCF,CA7BE,wCASE,mDAA0C,CAN1C,QAAS,CAIT,UAAW,CAFX,aAAc,CADd,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAIN,SAIF,CAEA,yDAEE,gBAAiB,CADjB,qCAeF,CAZE,oEACE,uCACF,CAEA,2FAKE,4CAAwC,CACxC,QAAS,CAFT,kCAA2B,CAH3B,WAAY,CAEZ,sCAAiC,CADjC,mCAKF,CAIJ,yCACE,iBAAkB,CAClB,SACF,CAEA,kCAkBE,kBAAmB,CANnB,qDAA8C,CAE9C,wCAAoC,CAGpC,iBAAkB,CAFlB,kBAAmB,CACnB,6CAAsC,CAPtC,kCAA2B,CAR3B,YAAa,CAMb,aAAc,CAJd,WAAY,CAgBZ,sBAAuB,CAbvB,iBAAkB,CAFlB,qCAAgC,CAIhC,eAAgB,CANhB,UA0DF,CAvCE,wDACE,oCACF,CAEA,+DACE,uDACF,CAEA,gEACE,wDACF,CAEA,kEACE,0DACF,CAEA,+DACE,uDACF,CAEA,+DACE,uDACF,CAEA,6DACE,qDACF,CAEA,6DACE,qDACF,CAEA,+DACE,uDACF,CAEA,iEACE,yDACF,CAGF,iCAME,kCAA2B,CAC3B,SAAU,CAFV,8CAAuC,CADvC,gDAA0C,CAF1C,cAAe,CADf,WAOF,CAEA,kCAOE,4CAAwC,CACxC,QAAS,CACT,qFAAuE,CANvE,iCAA2B,CAC3B,QAAS,CACT,+CAA6C,CAC7C,aAAc,CALd,iBAAkB,CAClB,SAaF,CAHE,yDACE,iDACF","file":"Timeline-05decc91.css","sourcesContent":[".Timeline {\n display: flex;\n flex-direction: column;\n\n &:where([data-clip-sidebar='start']),\n &:where([data-clip-sidebar='both']) {\n .TimelineItem:first-child {\n padding-top: 0;\n\n &:where([data-condensed])::before {\n top: var(--base-size-12);\n }\n }\n }\n\n &:where([data-clip-sidebar='end']),\n &:where([data-clip-sidebar='both']) {\n .TimelineItem:last-child {\n padding-bottom: 0;\n\n &:where([data-condensed])::before {\n height: var(--base-size-12);\n }\n }\n }\n}\n\n.TimelineItem {\n position: relative;\n display: flex;\n padding: var(--base-size-16) 0;\n margin-left: var(--base-size-16);\n\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: block;\n width: 2px;\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-muted);\n }\n\n &:where([data-condensed]) {\n padding-top: var(--base-size-4);\n padding-bottom: 0;\n\n &:last-child {\n padding-bottom: var(--base-size-16);\n }\n\n .TimelineBadge {\n height: 16px;\n margin-top: var(--base-size-8);\n margin-bottom: var(--base-size-8);\n color: var(--fgColor-muted);\n background-color: var(--bgColor-default);\n border: 0;\n }\n }\n}\n\n.TimelineBadgeWrapper {\n position: relative;\n z-index: 1;\n}\n\n.TimelineBadge {\n display: flex;\n width: 32px;\n height: 32px;\n margin-right: var(--base-size-8);\n /* stylelint-disable-next-line primer/spacing */\n margin-left: -15px;\n flex-shrink: 0;\n overflow: hidden;\n color: var(--fgColor-muted);\n\n /* TODOl not quite sure if this is the correct migration for this line */\n background-color: var(--timelineBadge-bgColor);\n /* stylelint-disable-next-line primer/colors */\n border-color: var(--bgColor-default);\n border-style: solid;\n border-width: var(--borderWidth-thick);\n border-radius: 50%;\n align-items: center;\n justify-content: center;\n\n &:where([data-variant]) {\n color: var(--fgColor-onEmphasis);\n }\n\n &:where([data-variant='accent']) {\n background-color: var(--bgColor-accent-emphasis);\n }\n\n &:where([data-variant='success']) {\n background-color: var(--bgColor-success-emphasis);\n }\n\n &:where([data-variant='attention']) {\n background-color: var(--bgColor-attention-emphasis);\n }\n\n &:where([data-variant='severe']) {\n background-color: var(--bgColor-severe-emphasis);\n }\n\n &:where([data-variant='danger']) {\n background-color: var(--bgColor-danger-emphasis);\n }\n\n &:where([data-variant='done']) {\n background-color: var(--bgColor-done-emphasis);\n }\n\n &:where([data-variant='open']) {\n background-color: var(--bgColor-open-emphasis);\n }\n\n &:where([data-variant='closed']) {\n background-color: var(--bgColor-closed-emphasis);\n }\n\n &:where([data-variant='sponsors']) {\n background-color: var(--bgColor-sponsors-emphasis);\n }\n}\n\n.TimelineBody {\n min-width: 0;\n max-width: 100%;\n /* stylelint-disable-next-line primer/spacing */\n margin-top: calc(var(--base-size-4) + 1px);\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n flex: auto;\n}\n\n.TimelineBreak {\n position: relative;\n z-index: 1;\n height: var(--base-size-24);\n margin: 0;\n margin-bottom: calc(-1 * var(--base-size-16));\n margin-left: 0;\n background-color: var(--bgColor-default);\n border: 0;\n border-top: var(--borderWidth-thicker) solid var(--borderColor-default);\n\n /* stylelint-disable-next-line selector-pseudo-class-disallowed-list -- scoped to CSS Module, audited (github/github-ui#17224) */\n &:has(+ [data-condensed]) {\n margin-bottom: calc(-1 * var(--base-size-12));\n }\n}\n"]}
|