@primer/react 0.0.0-20260325182738 → 0.0.0-20260325190039
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 +10 -27
- package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.js +2 -1
- package/dist/Button/{ButtonBase-4da3fa22.css → ButtonBase-6659abcf.css} +2 -2
- package/dist/Button/ButtonBase-6659abcf.css.map +1 -0
- package/dist/Button/ButtonBase.js +1 -1
- package/dist/Button/ButtonBase.module.css.js +2 -2
- package/dist/Dialog/{Dialog-f9bb927a.css → Dialog-2de477b3.css} +2 -2
- package/dist/Dialog/Dialog-2de477b3.css.map +1 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +19 -35
- package/dist/Dialog/Dialog.module.css.js +2 -2
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +2 -0
- package/dist/FeatureFlags/FeatureFlags.d.ts +6 -0
- package/dist/FeatureFlags/FeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/FeatureFlags.js +41 -32
- package/dist/FilteredActionList/FilteredActionList-02db90c6.css +2 -0
- package/dist/FilteredActionList/FilteredActionList-02db90c6.css.map +1 -0
- package/dist/FilteredActionList/FilteredActionList.module.css.js +1 -1
- package/dist/Link/{Link-ba423096.css → Link-968346ff.css} +2 -2
- package/dist/Link/Link-968346ff.css.map +1 -0
- package/dist/Link/Link.js +1 -2
- package/dist/Link/Link.module.css.js +1 -1
- package/dist/SelectPanel/SelectPanel.d.ts +2 -2
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +0 -2
- package/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/ThemeProvider.js +161 -104
- package/dist/Timeline/Timeline-19bef8c5.css +2 -0
- package/dist/Timeline/Timeline-19bef8c5.css.map +1 -0
- package/dist/Timeline/Timeline.d.ts +1 -1
- package/dist/Timeline/Timeline.d.ts.map +1 -1
- package/dist/Timeline/Timeline.js +14 -27
- package/dist/Timeline/Timeline.module.css.js +1 -1
- package/generated/components.json +2 -16
- package/package.json +1 -1
- package/dist/Button/ButtonBase-4da3fa22.css.map +0 -1
- package/dist/Dialog/Dialog-f9bb927a.css.map +0 -1
- package/dist/FilteredActionList/FilteredActionList-6808e67a.css +0 -2
- package/dist/FilteredActionList/FilteredActionList-6808e67a.css.map +0 -1
- package/dist/Link/Link-ba423096.css.map +0 -1
- package/dist/Timeline/Timeline-4d67684a.css +0 -2
- package/dist/Timeline/Timeline-4d67684a.css.map +0 -1
|
@@ -1,40 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useContext } from 'react';
|
|
1
|
+
import { useContext, useMemo } from 'react';
|
|
3
2
|
import { FeatureFlagContext } from './FeatureFlagContext.js';
|
|
4
3
|
import { FeatureFlagScope } from './FeatureFlagScope.js';
|
|
4
|
+
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Ref count for data-dialog-scroll-optimized attribute management.
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This is temporary infrastructure while we feature flag the CSS :has()
|
|
11
|
+
* performance optimization (primer_react_css_has_selector_perf). Once the flag
|
|
12
|
+
* is removed and the optimization is the default behavior, this ref counting
|
|
13
|
+
* can be removed - the attribute can simply always be present.
|
|
14
|
+
*
|
|
15
|
+
* @internal - Not part of the public API
|
|
16
|
+
*/
|
|
17
|
+
let dialogScrollOptimizedCount = 0;
|
|
18
|
+
function FeatureFlags({
|
|
19
|
+
children,
|
|
20
|
+
flags
|
|
21
|
+
}) {
|
|
13
22
|
const parentFeatureFlags = useContext(FeatureFlagContext);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
return t2;
|
|
23
|
+
const value = useMemo(() => {
|
|
24
|
+
const scope = FeatureFlagScope.merge(parentFeatureFlags, FeatureFlagScope.create(flags));
|
|
25
|
+
return scope;
|
|
26
|
+
}, [parentFeatureFlags, flags]);
|
|
27
|
+
const isOptimizationEnabled = value.enabled('primer_react_css_has_selector_perf');
|
|
28
|
+
|
|
29
|
+
// Set body attribute for CSS :has() optimization when flag is enabled
|
|
30
|
+
useIsomorphicLayoutEffect(() => {
|
|
31
|
+
if (isOptimizationEnabled) {
|
|
32
|
+
dialogScrollOptimizedCount++;
|
|
33
|
+
document.body.setAttribute('data-dialog-scroll-optimized', '');
|
|
34
|
+
return () => {
|
|
35
|
+
dialogScrollOptimizedCount--;
|
|
36
|
+
if (dialogScrollOptimizedCount === 0) {
|
|
37
|
+
document.body.removeAttribute('data-dialog-scroll-optimized');
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}, [isOptimizationEnabled]);
|
|
42
|
+
return /*#__PURE__*/jsx(FeatureFlagContext.Provider, {
|
|
43
|
+
value: value,
|
|
44
|
+
children: children
|
|
45
|
+
});
|
|
38
46
|
}
|
|
47
|
+
FeatureFlags.displayName = "FeatureFlags";
|
|
39
48
|
|
|
40
49
|
export { FeatureFlags };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-FilteredActionList-Root-QgIk1{display:flex;flex-direction:column;overflow:hidden}.prc-FilteredActionList-Header-y6ihu{box-shadow:0 1px 0 var(--borderColor-default,var(--color-border-default));z-index:1}.prc-FilteredActionList-Container-647gF{display:flex;flex-grow:1;height:100%;overflow:auto}.prc-FilteredActionList-Container-647gF .prc-FilteredActionList-ActionListItem-RSinr:not(:focus,[data-is-active-descendant],[data-active],[data-input-focused]){contain-intrinsic-size:auto 32px;content-visibility:auto}.prc-FilteredActionList-ActionList-3-Bxb{flex-grow:1}.prc-FilteredActionList-ActionListItem-RSinr:focus{background:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg))}.prc-FilteredActionList-ActionListItem-RSinr:focus:after{background:var(--borderColor-accent-emphasis,var(--color-accent-emphasis));border-radius:var(--borderRadius-medium,.375rem);content:"";height:calc(100% - var(--base-size-8,.5rem));left:calc(var(--base-size-8,.5rem)*-1);position:absolute;top:var(--base-size-4,.25rem);width:var(--base-size-4,.25rem)}.prc-FilteredActionList-ActionListItem-RSinr:where([data-input-focused]):where([data-first-child]){background:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg))}.prc-FilteredActionList-ActionListItem-RSinr:where([data-input-focused]):where([data-first-child]):after{background:var(--borderColor-accent-emphasis,var(--color-accent-emphasis));border-radius:var(--borderRadius-medium,.375rem);content:"";height:calc(100% - var(--base-size-8,.5rem));left:calc(var(--base-size-8,.5rem)*-1);position:absolute;top:var(--base-size-4,.25rem);width:var(--base-size-4,.25rem)}@media screen and (max-width:calc(48rem - 0.02px)){@supports (-webkit-touch-callout:none){.prc-FilteredActionList-FullScreenTextInput-CJvWO{font-size:var(--text-title-size-small,1rem)}}}.prc-FilteredActionList-SelectAllContainer-X2ij0{align-items:center;background:var(--bgColor-muted,var(--color-canvas-subtle));border-bottom:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,var(--color-border-default));display:flex;padding-block:var(--base-size-4,.25rem);padding-inline:var(--base-size-16,1rem)}.prc-FilteredActionList-SelectAllCheckbox-Axs5l{margin:var(--base-size-4,.25rem) var(--base-size-8,.5rem) calc(var(--base-size-4,.25rem) - 1px) 0}.prc-FilteredActionList-SelectAllLabel-Bi-PZ{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-medium,.875rem)}
|
|
2
|
+
/*# sourceMappingURL=FilteredActionList-02db90c6.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/FilteredActionList/FilteredActionList.module.css.js","../../postcss-preset-primer/src/mixins/activeIndicatorLine.css"],"names":[],"mappings":"AAAA,mCACE,YAAa,CACb,qBAAsB,CACtB,eACF,CAEA,qCAEE,yEAA8C,CAC9C,SACF,CAEA,wCACE,YAAa,CAGb,WAAY,CAFZ,WAAY,CACZ,aAUF,CAJE,gKAEE,gCAAiC,CADjC,uBAEF,CAGF,yCACE,WACF,CAEA,mDACE,wGAKF,CAHE,yDC1BA,0EAA8C,CAC9C,gDAAyC,CAHzC,UAAW,CADX,4CAAuC,CAFvC,sCAAmC,CAFnC,iBAAkB,CAClB,6BAAuB,CAEvB,+BDgCA,CAGF,mGACE,wGAKF,CAHE,yGClCA,0EAA8C,CAC9C,gDAAyC,CAHzC,UAAW,CADX,4CAAuC,CAFvC,sCAAmC,CAFnC,iBAAkB,CAClB,6BAAuB,CAEvB,+BDwCA,CAIA,mDAEE,uCAHJ,kDAIM,2CAGN,CAFI,CACF,CAGF,iDAEE,kBAAmB,CAGnB,0DAAgC,CAChC,2GAAuE,CALvE,YAAa,CAEb,uCAAiC,CACjC,uCAGF,CAEA,gDAGE,iGACF,CAEA,6CAEE,gDAA2B,CAD3B,8CAEF","file":"FilteredActionList-02db90c6.css","sourcesContent":[".Root {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n.Header {\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 0 1px 0 var(--borderColor-default);\n z-index: 1;\n}\n\n.Container {\n display: flex;\n height: 100%;\n overflow: auto;\n flex-grow: 1;\n\n /* Allow the browser to skip rendering for off-screen items, reducing style recalc and layout costs in long lists.\n Exclude items that show the active indicator line, as content-visibility: auto applies paint containment\n which clips the absolutely-positioned ::after pseudo-element that renders outside the item bounds. */\n & .ActionListItem:not(:focus, [data-is-active-descendant], [data-active], [data-input-focused]) {\n content-visibility: auto;\n contain-intrinsic-size: auto 32px;\n }\n}\n\n.ActionList {\n flex-grow: 1;\n}\n\n.ActionListItem:focus {\n background: var(--control-transparent-bgColor-selected);\n\n &::after {\n @mixin activeIndicatorLine;\n }\n}\n\n.ActionListItem:where([data-input-focused]):where([data-first-child]) {\n background: var(--control-transparent-bgColor-selected);\n\n &::after {\n @mixin activeIndicatorLine;\n }\n}\n\n.FullScreenTextInput {\n @media screen and (--viewportRange-narrow) {\n /* Ensures inputs don't zoom on mobile iPhone but are body-font size on iPad */\n @supports (-webkit-touch-callout: none) {\n font-size: var(--text-title-size-small);\n }\n }\n}\n\n.SelectAllContainer {\n display: flex;\n align-items: center;\n padding-block: var(--base-size-4);\n padding-inline: var(--base-size-16);\n background: var(--bgColor-muted);\n border-bottom: var(--borderWidth-thin) solid var(--borderColor-default);\n}\n\n.SelectAllCheckbox {\n /* -1px hack to offset 1px border-bottom causing uneven alignment */\n /* stylelint-disable-next-line primer/spacing */\n margin: var(--base-size-4) var(--base-size-8) calc(var(--base-size-4) - 1px) 0;\n}\n\n.SelectAllLabel {\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n}\n","@define-mixin activeIndicatorLine {\n position: absolute;\n top: var(--base-size-4);\n left: calc(-1 * var(--base-size-8));\n width: var(--base-size-4);\n height: calc(100% - var(--base-size-8));\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background: var(--borderColor-accent-emphasis);\n border-radius: var(--borderRadius-medium);\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './FilteredActionList-
|
|
1
|
+
import './FilteredActionList-02db90c6.css';
|
|
2
2
|
|
|
3
3
|
var classes = {"Root":"prc-FilteredActionList-Root-QgIk1","Header":"prc-FilteredActionList-Header-y6ihu","Container":"prc-FilteredActionList-Container-647gF","ActionListItem":"prc-FilteredActionList-ActionListItem-RSinr","ActionList":"prc-FilteredActionList-ActionList-3-Bxb","FullScreenTextInput":"prc-FilteredActionList-FullScreenTextInput-CJvWO","SelectAllContainer":"prc-FilteredActionList-SelectAllContainer-X2ij0","SelectAllCheckbox":"prc-FilteredActionList-SelectAllCheckbox-Axs5l","SelectAllLabel":"prc-FilteredActionList-SelectAllLabel-Bi-PZ"};
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:where(.prc-Link-Link-9ZwDx){color:var(--fgColor-accent,var(--color-accent-fg));-webkit-text-decoration:none;text-decoration:none;text-underline-offset:.05rem}:where(.prc-Link-Link-9ZwDx):is(button){appearance:none;background-color:transparent;border:0;cursor:pointer;display:inline-block;font-size:inherit;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}:where(.prc-Link-Link-9ZwDx):hover{-webkit-text-decoration:underline;text-decoration:underline}[data-a11y-link-underlines=true] :where(.prc-Link-Link-9ZwDx):where([data-inline=true]){-webkit-text-decoration:underline;text-decoration:underline}:
|
|
2
|
-
/*# sourceMappingURL=Link-
|
|
1
|
+
:where(.prc-Link-Link-9ZwDx){color:var(--fgColor-accent,var(--color-accent-fg));-webkit-text-decoration:none;text-decoration:none;text-underline-offset:.05rem}:where(.prc-Link-Link-9ZwDx):is(button){appearance:none;background-color:transparent;border:0;cursor:pointer;display:inline-block;font-size:inherit;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}:where(.prc-Link-Link-9ZwDx):hover{-webkit-text-decoration:underline;text-decoration:underline}[data-a11y-link-underlines=true] :where(.prc-Link-Link-9ZwDx):where([data-inline=true]){-webkit-text-decoration:underline;text-decoration:underline}:where(.prc-Link-Link-9ZwDx):where([data-muted=true]){color:var(--fgColor-muted,var(--color-fg-muted))}:where(.prc-Link-Link-9ZwDx):where([data-muted=true]):hover{color:var(--fgColor-accent,var(--color-accent-fg));-webkit-text-decoration:none;text-decoration:none}
|
|
2
|
+
/*# sourceMappingURL=Link-968346ff.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Link/Link.module.css.js"],"names":[],"mappings":"AAAA,6BACE,kDAA4B,CAC5B,4BAAqB,CAArB,oBAAqB,CACrB,4BAkCF,CA/BE,wCASE,eAAgB,CAFhB,4BAA6B,CAC7B,QAAS,CAHT,cAAe,CAJf,oBAAqB,CAErB,iBAAkB,CADlB,SAAU,CAIV,wBAAiB,CAAjB,gBAAiB,CAFjB,kBAMF,CAEA,mCACE,iCAA0B,CAA1B,yBACF,CAKA,wFACE,iCAA0B,CAA1B,yBACF,CAEA,sDACE,gDAMF,CAJE,4DACE,kDAA4B,CAC5B,4BAAqB,CAArB,oBACF","file":"Link-968346ff.css","sourcesContent":[":where(.Link) {\n color: var(--fgColor-accent);\n text-decoration: none;\n text-underline-offset: 0.05rem;\n\n /* Reset for button tags */\n &:is(button) {\n display: inline-block;\n padding: 0;\n font-size: inherit;\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n background-color: transparent;\n border: 0;\n appearance: none;\n }\n\n &:hover {\n text-decoration: underline;\n }\n\n /*\n Inline links (inside a text block) should have underline based on accessibility setting set in data-attribute\n */\n [data-a11y-link-underlines='true'] &:where([data-inline='true']) {\n text-decoration: underline;\n }\n\n &:where([data-muted='true']) {\n color: var(--fgColor-muted);\n\n &:hover {\n color: var(--fgColor-accent);\n text-decoration: none;\n }\n }\n}\n"]}
|
package/dist/Link/Link.js
CHANGED
|
@@ -10,7 +10,6 @@ const UnwrappedLink = (props, ref) => {
|
|
|
10
10
|
as: Component = 'a',
|
|
11
11
|
className,
|
|
12
12
|
inline,
|
|
13
|
-
muted,
|
|
14
13
|
hoverColor,
|
|
15
14
|
...restProps
|
|
16
15
|
} = props;
|
|
@@ -33,7 +32,7 @@ const UnwrappedLink = (props, ref) => {
|
|
|
33
32
|
}
|
|
34
33
|
return /*#__PURE__*/jsx(Component, {
|
|
35
34
|
className: clsx(className, classes.Link),
|
|
36
|
-
"data-muted": muted,
|
|
35
|
+
"data-muted": restProps.muted,
|
|
37
36
|
"data-inline": inline,
|
|
38
37
|
"data-hover-color": hoverColor,
|
|
39
38
|
...restProps,
|
|
@@ -63,8 +63,8 @@ type SelectPanelVariantProps = {
|
|
|
63
63
|
variant: 'modal';
|
|
64
64
|
onCancel: () => void;
|
|
65
65
|
};
|
|
66
|
-
export type SelectPanelProps = SelectPanelBaseProps & Omit<FilteredActionListProps, 'selectionVariant' | 'variant' | 'message'> & Pick<AnchoredOverlayProps, 'open' | 'height' | 'width' | 'align'
|
|
67
|
-
declare function Panel({ open, onOpenChange, renderAnchor, anchorRef: externalAnchorRef, placeholder, placeholderText, inputLabel, selected, title, subtitle, onSelectedChange, filterValue: externalFilterValue, onFilterChange: externalOnFilterChange, items, footer, textInputProps, overlayProps, loading, initialLoadingType, className, height, width, id, message, notice, onCancel, variant, secondaryAction, showSelectedOptionsFirst, disableFullscreenOnNarrow, align, showSelectAll, focusPrependedElements, virtualized,
|
|
66
|
+
export type SelectPanelProps = SelectPanelBaseProps & Omit<FilteredActionListProps, 'selectionVariant' | 'variant' | 'message'> & Pick<AnchoredOverlayProps, 'open' | 'height' | 'width' | 'align'> & AnchoredOverlayWrapperAnchorProps & (SelectPanelSingleSelection | SelectPanelMultiSelection) & SelectPanelVariantProps;
|
|
67
|
+
declare function Panel({ open, onOpenChange, renderAnchor, anchorRef: externalAnchorRef, placeholder, placeholderText, inputLabel, selected, title, subtitle, onSelectedChange, filterValue: externalFilterValue, onFilterChange: externalOnFilterChange, items, footer, textInputProps, overlayProps, loading, initialLoadingType, className, height, width, id, message, notice, onCancel, variant, secondaryAction, showSelectedOptionsFirst, disableFullscreenOnNarrow, align, showSelectAll, focusPrependedElements, virtualized, ...listProps }: SelectPanelProps): JSX.Element;
|
|
68
68
|
declare const SecondaryButton: React.FC<ButtonProps>;
|
|
69
69
|
declare const SecondaryLink: React.FC<LinkButtonProps & ButtonProps>;
|
|
70
70
|
export declare const SelectPanel: typeof Panel & {
|
|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BAAgB,GAAG,GAAG,CAAC,OAAO,CA2yBhC;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAM1C,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,GAAG,WAAW,CAM1D,CAAA;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;CAItB,CAAA"}
|
|
@@ -113,7 +113,6 @@ function Panel({
|
|
|
113
113
|
showSelectAll = false,
|
|
114
114
|
focusPrependedElements,
|
|
115
115
|
virtualized,
|
|
116
|
-
displayInViewport,
|
|
117
116
|
...listProps
|
|
118
117
|
}) {
|
|
119
118
|
var _listProps$groupMetad;
|
|
@@ -679,7 +678,6 @@ function Panel({
|
|
|
679
678
|
className: classes.Overlay,
|
|
680
679
|
displayCloseButton: showXCloseIcon,
|
|
681
680
|
closeButtonProps: closeButtonProps,
|
|
682
|
-
displayInViewport: displayInViewport,
|
|
683
681
|
children: /*#__PURE__*/jsxs("div", {
|
|
684
682
|
className: classes.Wrapper,
|
|
685
683
|
"data-variant": variant,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,gBAAgB,QAAQ,CAAA;AAKrC,MAAM,MAAM,KAAK,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,CAAA;AACxC,KAAK,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;AACnD,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,CAAC,EAAE,iBAAiB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAA;AA2CD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CA6E/E,CAAA;AAED,wBAAgB,QAAQ;YAvHd,KAAK;kBACC,MAAM;gBACR,iBAAiB;wBACT,SAAS;0BACP,MAAM;gBAChB,MAAM;kBACJ,MAAM;kBACN,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;kBACvD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;oBAC1C,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;EAgH7D;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,UAG1F;AAqED,eAAe,aAAa,CAAA"}
|
package/dist/ThemeProvider.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
4
3
|
import theme from './theme.js';
|
|
5
4
|
import deepmerge from 'deepmerge';
|
|
6
5
|
import { useSyncedState } from './hooks/useSyncedState.js';
|
|
@@ -20,71 +19,113 @@ const ThemeContext = /*#__PURE__*/React.createContext({
|
|
|
20
19
|
});
|
|
21
20
|
|
|
22
21
|
// inspired from __NEXT_DATA__, we use application/json to avoid CSRF policy with inline scripts
|
|
22
|
+
const serverHandoffCache = new Map();
|
|
23
23
|
const getServerHandoff = id => {
|
|
24
|
+
const cached = serverHandoffCache.get(id);
|
|
25
|
+
if (cached !== undefined) return cached;
|
|
24
26
|
try {
|
|
25
27
|
var _document$getElementB;
|
|
26
28
|
const serverData = (_document$getElementB = document.getElementById(`__PRIMER_DATA_${id}__`)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.textContent;
|
|
27
|
-
if (serverData)
|
|
29
|
+
if (serverData) {
|
|
30
|
+
const parsed = JSON.parse(serverData);
|
|
31
|
+
serverHandoffCache.set(id, parsed);
|
|
32
|
+
return parsed;
|
|
33
|
+
}
|
|
28
34
|
} catch (_error) {
|
|
29
35
|
// if document/element does not exist or JSON is invalid, suppress error
|
|
30
36
|
}
|
|
31
|
-
|
|
37
|
+
const empty = {};
|
|
38
|
+
serverHandoffCache.set(id, empty);
|
|
39
|
+
return empty;
|
|
32
40
|
};
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
...props
|
|
36
|
-
}) => {
|
|
41
|
+
const emptySubscribe = () => () => {};
|
|
42
|
+
const ThemeProvider = t0 => {
|
|
37
43
|
var _ref, _props$colorMode, _ref2, _props$dayScheme, _ref3, _props$nightScheme;
|
|
38
|
-
|
|
44
|
+
const $ = c(42);
|
|
45
|
+
let children;
|
|
46
|
+
let props;
|
|
47
|
+
if ($[0] !== t0) {
|
|
48
|
+
({
|
|
49
|
+
children,
|
|
50
|
+
...props
|
|
51
|
+
} = t0);
|
|
52
|
+
$[0] = t0;
|
|
53
|
+
$[1] = children;
|
|
54
|
+
$[2] = props;
|
|
55
|
+
} else {
|
|
56
|
+
children = $[1];
|
|
57
|
+
props = $[2];
|
|
58
|
+
}
|
|
39
59
|
const {
|
|
40
60
|
theme: fallbackTheme,
|
|
41
61
|
colorMode: fallbackColorMode,
|
|
42
62
|
dayScheme: fallbackDayScheme,
|
|
43
63
|
nightScheme: fallbackNightScheme
|
|
44
64
|
} = useTheme();
|
|
45
|
-
|
|
46
|
-
// Initialize state
|
|
47
65
|
const theme$1 = fallbackTheme !== null && fallbackTheme !== void 0 ? fallbackTheme : theme;
|
|
48
66
|
const uniqueDataId = useId();
|
|
49
|
-
const {
|
|
50
|
-
resolvedServerColorMode
|
|
51
|
-
} = getServerHandoff(uniqueDataId);
|
|
52
|
-
const resolvedColorModePassthrough = React.useRef(resolvedServerColorMode);
|
|
53
67
|
const [colorMode, setColorMode] = useSyncedState((_ref = (_props$colorMode = props.colorMode) !== null && _props$colorMode !== void 0 ? _props$colorMode : fallbackColorMode) !== null && _ref !== void 0 ? _ref : defaultColorMode);
|
|
54
68
|
const [dayScheme, setDayScheme] = useSyncedState((_ref2 = (_props$dayScheme = props.dayScheme) !== null && _props$dayScheme !== void 0 ? _props$dayScheme : fallbackDayScheme) !== null && _ref2 !== void 0 ? _ref2 : defaultDayScheme);
|
|
55
69
|
const [nightScheme, setNightScheme] = useSyncedState((_ref3 = (_props$nightScheme = props.nightScheme) !== null && _props$nightScheme !== void 0 ? _props$nightScheme : fallbackNightScheme) !== null && _ref3 !== void 0 ? _ref3 : defaultNightScheme);
|
|
56
70
|
const systemColorMode = useSystemColorMode();
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
let t1;
|
|
72
|
+
if ($[3] !== colorMode || $[4] !== systemColorMode) {
|
|
73
|
+
t1 = resolveColorMode(colorMode, systemColorMode);
|
|
74
|
+
$[3] = colorMode;
|
|
75
|
+
$[4] = systemColorMode;
|
|
76
|
+
$[5] = t1;
|
|
77
|
+
} else {
|
|
78
|
+
t1 = $[5];
|
|
79
|
+
}
|
|
80
|
+
const clientColorMode = t1;
|
|
81
|
+
let t2;
|
|
82
|
+
if ($[6] !== clientColorMode) {
|
|
83
|
+
t2 = () => clientColorMode;
|
|
84
|
+
$[6] = clientColorMode;
|
|
85
|
+
$[7] = t2;
|
|
86
|
+
} else {
|
|
87
|
+
t2 = $[7];
|
|
88
|
+
}
|
|
89
|
+
let t3;
|
|
90
|
+
if ($[8] !== clientColorMode || $[9] !== uniqueDataId) {
|
|
91
|
+
t3 = () => {
|
|
92
|
+
var _getServerHandoff$res;
|
|
93
|
+
return (_getServerHandoff$res = getServerHandoff(uniqueDataId).resolvedServerColorMode) !== null && _getServerHandoff$res !== void 0 ? _getServerHandoff$res : clientColorMode;
|
|
94
|
+
};
|
|
95
|
+
$[8] = clientColorMode;
|
|
96
|
+
$[9] = uniqueDataId;
|
|
97
|
+
$[10] = t3;
|
|
98
|
+
} else {
|
|
99
|
+
t3 = $[10];
|
|
100
|
+
}
|
|
101
|
+
const resolvedColorMode = React.useSyncExternalStore(emptySubscribe, t2, t3);
|
|
102
|
+
let t4;
|
|
103
|
+
if ($[11] !== dayScheme || $[12] !== nightScheme || $[13] !== resolvedColorMode) {
|
|
104
|
+
t4 = chooseColorScheme(resolvedColorMode, dayScheme, nightScheme);
|
|
105
|
+
$[11] = dayScheme;
|
|
106
|
+
$[12] = nightScheme;
|
|
107
|
+
$[13] = resolvedColorMode;
|
|
108
|
+
$[14] = t4;
|
|
109
|
+
} else {
|
|
110
|
+
t4 = $[14];
|
|
111
|
+
}
|
|
112
|
+
const colorScheme = t4;
|
|
113
|
+
let t5;
|
|
114
|
+
if ($[15] !== colorScheme || $[16] !== theme$1) {
|
|
115
|
+
t5 = applyColorScheme(theme$1, colorScheme);
|
|
116
|
+
$[15] = colorScheme;
|
|
117
|
+
$[16] = theme$1;
|
|
118
|
+
$[17] = t5;
|
|
119
|
+
} else {
|
|
120
|
+
t5 = $[17];
|
|
121
|
+
}
|
|
60
122
|
const {
|
|
61
123
|
resolvedTheme,
|
|
62
124
|
resolvedColorScheme
|
|
63
|
-
} =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const resolvedColorModeOnClient = resolveColorMode(colorMode, systemColorMode);
|
|
68
|
-
if (resolvedColorModePassthrough.current) {
|
|
69
|
-
// if the resolved color mode passed on from the server is not the resolved color mode on client, change it!
|
|
70
|
-
if (resolvedColorModePassthrough.current !== resolvedColorModeOnClient) {
|
|
71
|
-
window.setTimeout(() => {
|
|
72
|
-
// use ReactDOM.flushSync to prevent automatic batching of state updates since React 18
|
|
73
|
-
// ref: https://github.com/reactwg/react-18/discussions/21
|
|
74
|
-
ReactDOM.flushSync(() => {
|
|
75
|
-
// override colorMode to whatever is resolved on the client to get a re-render
|
|
76
|
-
setColorMode(resolvedColorModeOnClient);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// immediately after that, set the colorMode to what the user passed to respond to system color mode changes
|
|
80
|
-
setColorMode(colorMode);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
resolvedColorModePassthrough.current = null;
|
|
84
|
-
}
|
|
85
|
-
}, [colorMode, systemColorMode, setColorMode]);
|
|
86
|
-
return /*#__PURE__*/jsx(ThemeContext.Provider, {
|
|
87
|
-
value: {
|
|
125
|
+
} = t5;
|
|
126
|
+
let t6;
|
|
127
|
+
if ($[18] !== colorMode || $[19] !== colorScheme || $[20] !== dayScheme || $[21] !== nightScheme || $[22] !== resolvedColorMode || $[23] !== resolvedColorScheme || $[24] !== resolvedTheme || $[25] !== setColorMode || $[26] !== setDayScheme || $[27] !== setNightScheme) {
|
|
128
|
+
t6 = {
|
|
88
129
|
theme: resolvedTheme,
|
|
89
130
|
colorScheme,
|
|
90
131
|
colorMode,
|
|
@@ -95,24 +136,72 @@ const ThemeProvider = ({
|
|
|
95
136
|
setColorMode,
|
|
96
137
|
setDayScheme,
|
|
97
138
|
setNightScheme
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
139
|
+
};
|
|
140
|
+
$[18] = colorMode;
|
|
141
|
+
$[19] = colorScheme;
|
|
142
|
+
$[20] = dayScheme;
|
|
143
|
+
$[21] = nightScheme;
|
|
144
|
+
$[22] = resolvedColorMode;
|
|
145
|
+
$[23] = resolvedColorScheme;
|
|
146
|
+
$[24] = resolvedTheme;
|
|
147
|
+
$[25] = setColorMode;
|
|
148
|
+
$[26] = setDayScheme;
|
|
149
|
+
$[27] = setNightScheme;
|
|
150
|
+
$[28] = t6;
|
|
151
|
+
} else {
|
|
152
|
+
t6 = $[28];
|
|
153
|
+
}
|
|
154
|
+
const contextValue = t6;
|
|
155
|
+
const t7 = colorMode === "auto" ? "auto" : colorScheme.includes("dark") ? "dark" : "light";
|
|
156
|
+
let t8;
|
|
157
|
+
if ($[29] !== props.preventSSRMismatch || $[30] !== resolvedColorMode || $[31] !== uniqueDataId) {
|
|
158
|
+
t8 = props.preventSSRMismatch ? /*#__PURE__*/jsx("script", {
|
|
159
|
+
type: "application/json",
|
|
160
|
+
id: `__PRIMER_DATA_${uniqueDataId}__`,
|
|
161
|
+
dangerouslySetInnerHTML: {
|
|
162
|
+
__html: JSON.stringify({
|
|
163
|
+
resolvedServerColorMode: resolvedColorMode
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
}) : null;
|
|
167
|
+
$[29] = props.preventSSRMismatch;
|
|
168
|
+
$[30] = resolvedColorMode;
|
|
169
|
+
$[31] = uniqueDataId;
|
|
170
|
+
$[32] = t8;
|
|
171
|
+
} else {
|
|
172
|
+
t8 = $[32];
|
|
173
|
+
}
|
|
174
|
+
let t9;
|
|
175
|
+
if ($[33] !== children || $[34] !== dayScheme || $[35] !== nightScheme || $[36] !== t7 || $[37] !== t8) {
|
|
176
|
+
t9 = /*#__PURE__*/jsxs("div", {
|
|
177
|
+
"data-color-mode": t7,
|
|
101
178
|
"data-light-theme": dayScheme,
|
|
102
179
|
"data-dark-theme": nightScheme,
|
|
103
|
-
children: [children,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
180
|
+
children: [children, t8]
|
|
181
|
+
});
|
|
182
|
+
$[33] = children;
|
|
183
|
+
$[34] = dayScheme;
|
|
184
|
+
$[35] = nightScheme;
|
|
185
|
+
$[36] = t7;
|
|
186
|
+
$[37] = t8;
|
|
187
|
+
$[38] = t9;
|
|
188
|
+
} else {
|
|
189
|
+
t9 = $[38];
|
|
190
|
+
}
|
|
191
|
+
let t10;
|
|
192
|
+
if ($[39] !== contextValue || $[40] !== t9) {
|
|
193
|
+
t10 = /*#__PURE__*/jsx(ThemeContext.Provider, {
|
|
194
|
+
value: contextValue,
|
|
195
|
+
children: t9
|
|
196
|
+
});
|
|
197
|
+
$[39] = contextValue;
|
|
198
|
+
$[40] = t9;
|
|
199
|
+
$[41] = t10;
|
|
200
|
+
} else {
|
|
201
|
+
t10 = $[41];
|
|
202
|
+
}
|
|
203
|
+
return t10;
|
|
114
204
|
};
|
|
115
|
-
ThemeProvider.displayName = "ThemeProvider";
|
|
116
205
|
function useTheme() {
|
|
117
206
|
return React.useContext(ThemeContext);
|
|
118
207
|
}
|
|
@@ -124,57 +213,25 @@ function useColorSchemeVar(values, fallback) {
|
|
|
124
213
|
const colorScheme = t0 === undefined ? "" : t0;
|
|
125
214
|
return (_values$colorScheme = values[colorScheme]) !== null && _values$colorScheme !== void 0 ? _values$colorScheme : fallback;
|
|
126
215
|
}
|
|
216
|
+
function subscribeToSystemColorMode(callback) {
|
|
217
|
+
var _window, _window$matchMedia;
|
|
218
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
219
|
+
const media = (_window = window) === null || _window === void 0 ? void 0 : (_window$matchMedia = _window.matchMedia) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.call(_window, '(prefers-color-scheme: dark)');
|
|
220
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
221
|
+
media === null || media === void 0 ? void 0 : media.addEventListener('change', callback);
|
|
222
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
223
|
+
return () => media === null || media === void 0 ? void 0 : media.removeEventListener('change', callback);
|
|
224
|
+
}
|
|
127
225
|
function useSystemColorMode() {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
133
|
-
t0 = () => {
|
|
134
|
-
var _window, _window$matchMedia;
|
|
135
|
-
const media = (_window = window) === null || _window === void 0 ? void 0 : (_window$matchMedia = _window.matchMedia) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.call(_window, "(prefers-color-scheme: dark)");
|
|
136
|
-
const matchesMediaToColorMode = function matchesMediaToColorMode(matches) {
|
|
137
|
-
return matches ? "night" : "day";
|
|
138
|
-
};
|
|
139
|
-
const handleChange = function handleChange(event) {
|
|
140
|
-
const isNight = event.matches;
|
|
141
|
-
setSystemColorMode(matchesMediaToColorMode(isNight));
|
|
142
|
-
};
|
|
143
|
-
if (media) {
|
|
144
|
-
const isNight_0 = media.matches;
|
|
145
|
-
setSystemColorMode(matchesMediaToColorMode(isNight_0));
|
|
146
|
-
if (media.addEventListener !== undefined) {
|
|
147
|
-
media.addEventListener("change", handleChange);
|
|
148
|
-
return function cleanup() {
|
|
149
|
-
media.removeEventListener("change", handleChange);
|
|
150
|
-
};
|
|
151
|
-
} else {
|
|
152
|
-
if (media.addListener !== undefined) {
|
|
153
|
-
media.addListener(handleChange);
|
|
154
|
-
return function cleanup() {
|
|
155
|
-
media.removeListener(handleChange);
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
t1 = [];
|
|
162
|
-
$[0] = t0;
|
|
163
|
-
$[1] = t1;
|
|
164
|
-
} else {
|
|
165
|
-
t0 = $[0];
|
|
166
|
-
t1 = $[1];
|
|
167
|
-
}
|
|
168
|
-
React.useEffect(t0, t1);
|
|
169
|
-
return systemColorMode;
|
|
226
|
+
return React.useSyncExternalStore(subscribeToSystemColorMode, getSystemColorMode, _temp);
|
|
227
|
+
}
|
|
228
|
+
function _temp() {
|
|
229
|
+
return "day";
|
|
170
230
|
}
|
|
171
231
|
function getSystemColorMode() {
|
|
172
|
-
var
|
|
232
|
+
var _window2, _window2$matchMedia, _window2$matchMedia$c;
|
|
173
233
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
174
|
-
|
|
175
|
-
return 'night';
|
|
176
|
-
}
|
|
177
|
-
return 'day';
|
|
234
|
+
return (_window2 = window) !== null && _window2 !== void 0 && (_window2$matchMedia = _window2.matchMedia) !== null && _window2$matchMedia !== void 0 && (_window2$matchMedia$c = _window2$matchMedia.call(_window2, '(prefers-color-scheme: dark)')) !== null && _window2$matchMedia$c !== void 0 && _window2$matchMedia$c.matches ? 'night' : 'day';
|
|
178
235
|
}
|
|
179
236
|
function resolveColorMode(colorMode, systemColorMode) {
|
|
180
237
|
switch (colorMode) {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-Timeline-Timeline-awSoC{display:flex;flex-direction:column}.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child{padding-top:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child):where([data-condensed]):before{top:var(--base-size-12,.75rem)}.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:last-child{padding-bottom:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .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,var(--color-border-muted));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,var(--color-canvas-default));border:0;color:var(--fgColor-muted,var(--color-fg-muted));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,var(--color-timeline-badge-bg));border-color:var(--bgColor-default,var(--color-canvas-default));border-radius:50%;border-style:solid;border-width:var(--borderWidth-thick,.125rem);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,.prc-Timeline-TimelineBody-tjOtb{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-Timeline-TimelineBody-tjOtb{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,var(--color-canvas-default));border:0;border-top:var(--borderWidth-thicker,.25rem) solid var(--borderColor-default,var(--color-border-default));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-19bef8c5.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Timeline/Timeline.module.css.js"],"names":[],"mappings":"AAAA,6BACE,YAAa,CACb,qBAmBF,CAhBI,qGACE,aAKF,CAHE,yIACE,8BACF,CAGF,oGACE,gBAKF,CAHE,wIACE,iCACF,CAKN,iCAEE,YAAa,CAEb,oCAAgC,CADhC,kCAA8B,CAF9B,iBAkCF,CA7BE,wCASE,mEAA0C,CAN1C,QAAS,CAIT,UAAW,CAFX,aAAc,CADd,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAIN,SAIF,CAEA,yDAEE,gBAAiB,CADjB,qCAeF,CAZE,oEACE,uCACF,CAEA,2FAKE,mEAAwC,CACxC,QAAS,CAFT,gDAA2B,CAH3B,WAAY,CAEZ,sCAAiC,CADjC,mCAKF,CAIJ,yCACE,iBAAkB,CAClB,SACF,CAEA,kCAkBE,kBAAmB,CANnB,4EAA8C,CAE9C,+DAAoC,CAGpC,iBAAkB,CAFlB,kBAAmB,CACnB,6CAAsC,CAftC,YAAa,CAMb,aAAc,CAJd,WAAY,CAgBZ,sBAAuB,CAbvB,iBAAkB,CAFlB,qCAAgC,CAIhC,eAAgB,CANhB,UAkBF,CAEA,mEAbE,gDAqBF,CARA,iCAOE,SAAU,CAFV,8CAAuC,CADvC,gDAA0C,CAF1C,cAAe,CADf,WAOF,CAEA,kCAOE,mEAAwC,CACxC,QAAS,CACT,yGAAuE,CANvE,iCAA2B,CAC3B,QAAS,CACT,+CAA6C,CAC7C,aAAc,CALd,iBAAkB,CAClB,SAYF,CAHE,yDACE,iDACF","file":"Timeline-19bef8c5.css","sourcesContent":[".Timeline {\n display: flex;\n flex-direction: column;\n\n &:where([data-clip-sidebar]) {\n .TimelineItem:first-child {\n padding-top: 0;\n\n &:where([data-condensed])::before {\n top: var(--base-size-12);\n }\n }\n\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\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 &:has(+ [data-condensed]) {\n margin-bottom: calc(-1 * var(--base-size-12));\n }\n}\n"]}
|
|
@@ -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,
|
|
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,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,CAAA;AAEtE,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAevF,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,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,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;;;;kCAxBK,kBAAkB;;;;QAW9D,oCAAoC;oBACxB,MAAM;;;QAUlB,oCAAoC;oBACxB,MAAM;;;AASpB,wBAKE"}
|
|
@@ -4,13 +4,8 @@ import React from 'react';
|
|
|
4
4
|
import classes from './Timeline.module.css.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
function resolveClipSidebar(clipSidebar) {
|
|
8
|
-
if (clipSidebar === true || clipSidebar === 'both') return 'both';
|
|
9
|
-
if (clipSidebar === 'start' || clipSidebar === 'end') return clipSidebar;
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
7
|
const Timeline = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
13
|
-
const $ = c(
|
|
8
|
+
const $ = c(11);
|
|
14
9
|
let className;
|
|
15
10
|
let clipSidebar;
|
|
16
11
|
let props;
|
|
@@ -30,37 +25,29 @@ const Timeline = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
|
30
25
|
props = $[3];
|
|
31
26
|
}
|
|
32
27
|
let t1;
|
|
33
|
-
if ($[4] !==
|
|
34
|
-
t1 =
|
|
35
|
-
$[4] =
|
|
28
|
+
if ($[4] !== className) {
|
|
29
|
+
t1 = clsx(className, classes.Timeline);
|
|
30
|
+
$[4] = className;
|
|
36
31
|
$[5] = t1;
|
|
37
32
|
} else {
|
|
38
33
|
t1 = $[5];
|
|
39
34
|
}
|
|
40
|
-
const
|
|
41
|
-
let t2;
|
|
42
|
-
if ($[6] !== className) {
|
|
43
|
-
t2 = clsx(className, classes.Timeline);
|
|
44
|
-
$[6] = className;
|
|
45
|
-
$[7] = t2;
|
|
46
|
-
} else {
|
|
47
|
-
t2 = $[7];
|
|
48
|
-
}
|
|
35
|
+
const t2 = clipSidebar ? "" : undefined;
|
|
49
36
|
let t3;
|
|
50
|
-
if ($[
|
|
37
|
+
if ($[6] !== forwardRef || $[7] !== props || $[8] !== t1 || $[9] !== t2) {
|
|
51
38
|
t3 = /*#__PURE__*/jsx("div", {
|
|
52
39
|
...props,
|
|
53
|
-
className:
|
|
40
|
+
className: t1,
|
|
54
41
|
ref: forwardRef,
|
|
55
|
-
"data-clip-sidebar":
|
|
42
|
+
"data-clip-sidebar": t2
|
|
56
43
|
});
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
44
|
+
$[6] = forwardRef;
|
|
45
|
+
$[7] = props;
|
|
46
|
+
$[8] = t1;
|
|
47
|
+
$[9] = t2;
|
|
48
|
+
$[10] = t3;
|
|
62
49
|
} else {
|
|
63
|
-
t3 = $[
|
|
50
|
+
t3 = $[10];
|
|
64
51
|
}
|
|
65
52
|
return t3;
|
|
66
53
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './Timeline-
|
|
1
|
+
import './Timeline-19bef8c5.css';
|
|
2
2
|
|
|
3
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"};
|
|
4
4
|
|