@primer/react 0.0.0-20260615154539 → 0.0.0-20260615162155
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 +5 -20
- package/dist/ActionList/ActionList-1940009e.css +2 -0
- package/dist/ActionList/ActionList-1940009e.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +2 -2
- package/dist/ActionList/Group.d.ts +5 -0
- package/dist/ActionList/Group.d.ts.map +1 -1
- package/dist/ActionList/Group.js +5 -2
- package/dist/ActionList/Item.js +2 -3
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/List.js +16 -21
- package/dist/ActionList/Selection.js +1 -1
- package/dist/ActionList/index.d.ts.map +1 -1
- package/dist/ActionList/index.js +1 -2
- package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.js +2 -6
- package/dist/AnchoredOverlay/AnchoredOverlay-d483d670.css +2 -0
- package/dist/AnchoredOverlay/AnchoredOverlay-d483d670.css.map +1 -0
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts +2 -8
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +2 -38
- package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +1 -1
- package/dist/Autocomplete/AutocompleteInput.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteInput.js +1 -2
- package/dist/Autocomplete/AutocompleteMenu.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteMenu.js +0 -1
- package/dist/Autocomplete/AutocompleteOverlay.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteOverlay.js +0 -1
- package/dist/Avatar/Avatar-60480a38.css +2 -0
- package/dist/Avatar/Avatar-60480a38.css.map +1 -0
- package/dist/Avatar/Avatar.module.css.js +1 -1
- package/dist/Button/IconButton.d.ts.map +1 -1
- package/dist/Button/IconButton.js +2 -3
- package/dist/ConfirmationDialog/ConfirmationDialog.d.ts +9 -0
- package/dist/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
- package/dist/ConfirmationDialog/ConfirmationDialog.js +42 -1
- package/dist/Dialog/Dialog.d.ts +1 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +4 -2
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +1 -3
- package/dist/FilteredActionList/FilteredActionList.js +1 -2
- package/dist/FilteredActionList/FilteredActionListLoaders-a46a8ea4.css +2 -0
- package/dist/FilteredActionList/FilteredActionListLoaders-a46a8ea4.css.map +1 -0
- package/dist/FilteredActionList/FilteredActionListLoaders.d.ts +10 -2
- package/dist/FilteredActionList/FilteredActionListLoaders.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionListLoaders.js +13 -4
- package/dist/FilteredActionList/FilteredActionListLoaders.module.css.js +2 -2
- package/dist/FilteredActionList/index.js +1 -0
- package/dist/KeybindingHint/KeybindingHint.d.ts +14 -0
- package/dist/KeybindingHint/KeybindingHint.d.ts.map +1 -1
- package/dist/KeybindingHint/KeybindingHint.js +16 -2
- package/dist/KeybindingHint/components/Chord.d.ts +3 -0
- package/dist/KeybindingHint/components/Chord.d.ts.map +1 -1
- package/dist/KeybindingHint/components/Chord.js +21 -2
- package/dist/KeybindingHint/components/Sequence.d.ts +3 -0
- package/dist/KeybindingHint/components/Sequence.d.ts.map +1 -1
- package/dist/KeybindingHint/components/Sequence.js +5 -2
- package/dist/KeybindingHint/index.d.ts +1 -2
- package/dist/KeybindingHint/index.d.ts.map +1 -1
- package/dist/NavList/NavList.d.ts.map +1 -1
- package/dist/NavList/NavList.js +0 -4
- package/dist/Overlay/Overlay.d.ts +18 -2
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +20 -1
- package/dist/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/PageHeader/PageHeader.js +35 -63
- package/dist/Portal/Portal.d.ts +14 -0
- package/dist/Portal/Portal.d.ts.map +1 -1
- package/dist/Portal/Portal.js +46 -4
- package/dist/Portal/index.d.ts +1 -3
- package/dist/Portal/index.d.ts.map +1 -1
- package/dist/Portal/index.js +1 -0
- package/dist/Radio/Radio.js +1 -1
- package/dist/RadioGroup/RadioGroup.d.ts +6 -1
- package/dist/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup/RadioGroup.js +3 -2
- package/dist/RadioGroup/index.d.ts +1 -2
- package/dist/RadioGroup/index.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +1 -2
- package/dist/TextInput/TextInput.d.ts +0 -6
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +1 -2
- package/dist/ThemeProvider.d.ts +14 -4
- package/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/ThemeProvider.js +45 -34
- package/dist/Timeline/Timeline.d.ts +1 -1
- package/dist/Timeline/Timeline.d.ts.map +1 -1
- package/dist/Token/IssueLabelToken.d.ts.map +1 -1
- package/dist/Token/IssueLabelToken.js +1 -3
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +1 -3
- package/dist/Token/TokenBase.d.ts +5 -2
- package/dist/Token/TokenBase.d.ts.map +1 -1
- package/dist/Token/TokenBase.js +14 -3
- package/dist/Token/_RemoveTokenButton.js +1 -1
- package/dist/Tooltip/Tooltip.d.ts +3 -0
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +3 -2
- package/dist/TooltipV2/Tooltip.d.ts +3 -0
- package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
- package/dist/TooltipV2/Tooltip.js +3 -4
- package/dist/TreeView/TreeView.js +1 -1
- package/dist/UnderlineNav/UnderlineNav.d.ts +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +5 -2
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts.map +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.js +1 -2
- package/dist/experimental/SelectPanel2/index.d.ts +1 -2
- package/dist/experimental/SelectPanel2/index.d.ts.map +1 -1
- package/dist/experimental/Tabs/Tabs.d.ts +111 -3
- package/dist/experimental/Tabs/Tabs.d.ts.map +1 -1
- package/dist/experimental/Tabs/Tabs.js +237 -3
- package/dist/experimental/Tabs/index.d.ts +2 -5
- package/dist/experimental/Tabs/index.d.ts.map +1 -1
- package/dist/experimental/index.js +3 -7
- package/dist/hooks/useMedia.d.ts +24 -1
- package/dist/hooks/useMedia.d.ts.map +1 -1
- package/dist/hooks/useMedia.js +6 -15
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -7
- package/package.json +3 -1
- package/dist/ActionList/ActionList-65f7daac.css +0 -2
- package/dist/ActionList/ActionList-65f7daac.css.map +0 -1
- package/dist/ActionList/GroupContext.d.ts +0 -8
- package/dist/ActionList/GroupContext.d.ts.map +0 -1
- package/dist/ActionList/GroupContext.js +0 -8
- package/dist/AnchoredOverlay/AnchoredOverlay-83281f45.css +0 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-83281f45.css.map +0 -1
- package/dist/Avatar/Avatar-61b19061.css +0 -2
- package/dist/Avatar/Avatar-61b19061.css.map +0 -1
- package/dist/ConfirmationDialog/useConfirm.d.ts +0 -12
- package/dist/ConfirmationDialog/useConfirm.d.ts.map +0 -1
- package/dist/ConfirmationDialog/useConfirm.js +0 -44
- package/dist/Dialog/DialogContext.d.ts +0 -3
- package/dist/Dialog/DialogContext.d.ts.map +0 -1
- package/dist/Dialog/DialogContext.js +0 -5
- package/dist/FilteredActionList/FilteredActionListLoaders-bdda3d7e.css +0 -2
- package/dist/FilteredActionList/FilteredActionListLoaders-bdda3d7e.css.map +0 -1
- package/dist/FilteredActionList/constants.d.ts +0 -11
- package/dist/FilteredActionList/constants.d.ts.map +0 -1
- package/dist/FilteredActionList/constants.js +0 -13
- package/dist/KeybindingHint/components/utils.d.ts +0 -8
- package/dist/KeybindingHint/components/utils.d.ts.map +0 -1
- package/dist/KeybindingHint/components/utils.js +0 -32
- package/dist/KeybindingHint/utils.d.ts +0 -15
- package/dist/KeybindingHint/utils.d.ts.map +0 -1
- package/dist/KeybindingHint/utils.js +0 -17
- package/dist/Overlay/constants.d.ts +0 -19
- package/dist/Overlay/constants.d.ts.map +0 -1
- package/dist/Overlay/constants.js +0 -20
- package/dist/Portal/PortalContext.d.ts +0 -5
- package/dist/Portal/PortalContext.d.ts.map +0 -1
- package/dist/Portal/PortalContext.js +0 -5
- package/dist/Portal/portalRoot.d.ts +0 -11
- package/dist/Portal/portalRoot.d.ts.map +0 -1
- package/dist/Portal/portalRoot.js +0 -39
- package/dist/RadioGroup/RadioGroupContext.d.ts +0 -7
- package/dist/RadioGroup/RadioGroupContext.d.ts.map +0 -1
- package/dist/RadioGroup/RadioGroupContext.js +0 -5
- package/dist/ThemeContext.d.ts +0 -15
- package/dist/ThemeContext.d.ts.map +0 -1
- package/dist/ThemeContext.js +0 -9
- package/dist/Timeline/constants.d.ts +0 -2
- package/dist/Timeline/constants.d.ts.map +0 -1
- package/dist/Token/constants.d.ts +0 -4
- package/dist/Token/constants.d.ts.map +0 -1
- package/dist/Token/constants.js +0 -3
- package/dist/Token/utils.d.ts +0 -3
- package/dist/Token/utils.d.ts.map +0 -1
- package/dist/Token/utils.js +0 -14
- package/dist/Tooltip/TooltipContext.d.ts +0 -5
- package/dist/Tooltip/TooltipContext.d.ts.map +0 -1
- package/dist/Tooltip/TooltipContext.js +0 -5
- package/dist/TooltipV2/TooltipContext.d.ts +0 -5
- package/dist/TooltipV2/TooltipContext.d.ts.map +0 -1
- package/dist/TooltipV2/TooltipContext.js +0 -5
- package/dist/UnderlineNav/utils.d.ts +0 -3
- package/dist/UnderlineNav/utils.d.ts.map +0 -1
- package/dist/UnderlineNav/utils.js +0 -8
- package/dist/experimental/Tabs/TabsContext.d.ts +0 -3
- package/dist/experimental/Tabs/TabsContext.d.ts.map +0 -1
- package/dist/experimental/Tabs/TabsContext.js +0 -5
- package/dist/experimental/Tabs/types.d.ts +0 -107
- package/dist/experimental/Tabs/types.d.ts.map +0 -1
- package/dist/experimental/Tabs/useTab.d.ts +0 -7
- package/dist/experimental/Tabs/useTab.d.ts.map +0 -1
- package/dist/experimental/Tabs/useTab.js +0 -97
- package/dist/experimental/Tabs/useTabList.d.ts +0 -3
- package/dist/experimental/Tabs/useTabList.d.ts.map +0 -1
- package/dist/experimental/Tabs/useTabList.js +0 -100
- package/dist/experimental/Tabs/useTabPanel.d.ts +0 -4
- package/dist/experimental/Tabs/useTabPanel.d.ts.map +0 -1
- package/dist/experimental/Tabs/useTabPanel.js +0 -37
- package/dist/experimental/Tabs/useTabs.d.ts +0 -3
- package/dist/experimental/Tabs/useTabs.d.ts.map +0 -1
- package/dist/experimental/Tabs/useTabs.js +0 -12
- package/dist/hooks/MatchMedia.d.ts +0 -23
- package/dist/hooks/MatchMedia.d.ts.map +0 -1
- package/dist/hooks/MatchMediaContext.d.ts +0 -5
- package/dist/hooks/MatchMediaContext.d.ts.map +0 -1
- package/dist/hooks/MatchMediaContext.js +0 -8
- package/dist/useTheme.d.ts +0 -15
- package/dist/useTheme.d.ts.map +0 -1
- package/dist/useTheme.js +0 -16
- package/dist/utils/story-helpers.d.ts +0 -70
- package/dist/utils/story-helpers.d.ts.map +0 -1
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import { useProvidedRefOrCreate } from '../../hooks/useProvidedRefOrCreate.js';
|
|
3
|
-
|
|
4
|
-
function useTabList(props) {
|
|
5
|
-
const $ = c(9);
|
|
6
|
-
const {
|
|
7
|
-
"aria-label": ariaLabel,
|
|
8
|
-
"aria-labelledby": ariaLabelledby,
|
|
9
|
-
"aria-orientation": ariaOrientation
|
|
10
|
-
} = props;
|
|
11
|
-
const ref = useProvidedRefOrCreate(props.ref);
|
|
12
|
-
let t0;
|
|
13
|
-
if ($[0] !== ariaOrientation || $[1] !== ref) {
|
|
14
|
-
t0 = event => {
|
|
15
|
-
const {
|
|
16
|
-
current: tablist
|
|
17
|
-
} = ref;
|
|
18
|
-
if (tablist === null) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const tabs = getFocusableTabs(tablist);
|
|
22
|
-
const isVertical = ariaOrientation === "vertical";
|
|
23
|
-
const nextKey = isVertical ? "ArrowDown" : "ArrowRight";
|
|
24
|
-
const prevKey = isVertical ? "ArrowUp" : "ArrowLeft";
|
|
25
|
-
if (event.key === nextKey || event.key === prevKey || event.key === "Home" || event.key === "End") {
|
|
26
|
-
event.preventDefault();
|
|
27
|
-
event.stopPropagation();
|
|
28
|
-
}
|
|
29
|
-
if (event.key === nextKey) {
|
|
30
|
-
const selectedTabIndex = tabs.findIndex(_temp);
|
|
31
|
-
if (selectedTabIndex === -1) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const nextTabIndex = (selectedTabIndex + 1) % tabs.length;
|
|
35
|
-
tabs[nextTabIndex].focus();
|
|
36
|
-
} else {
|
|
37
|
-
if (event.key === prevKey) {
|
|
38
|
-
const selectedTabIndex_0 = tabs.findIndex(_temp2);
|
|
39
|
-
if (selectedTabIndex_0 === -1) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const nextTabIndex_0 = (tabs.length + selectedTabIndex_0 - 1) % tabs.length;
|
|
43
|
-
tabs[nextTabIndex_0].focus();
|
|
44
|
-
} else {
|
|
45
|
-
if (event.key === "Home") {
|
|
46
|
-
if (tabs[0]) {
|
|
47
|
-
tabs[0].focus();
|
|
48
|
-
}
|
|
49
|
-
} else {
|
|
50
|
-
if (event.key === "End") {
|
|
51
|
-
if (tabs.length > 0) {
|
|
52
|
-
tabs[tabs.length - 1].focus();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
$[0] = ariaOrientation;
|
|
60
|
-
$[1] = ref;
|
|
61
|
-
$[2] = t0;
|
|
62
|
-
} else {
|
|
63
|
-
t0 = $[2];
|
|
64
|
-
}
|
|
65
|
-
const onKeyDown = t0;
|
|
66
|
-
const t1 = ariaOrientation !== null && ariaOrientation !== void 0 ? ariaOrientation : "horizontal";
|
|
67
|
-
let t2;
|
|
68
|
-
if ($[3] !== ariaLabel || $[4] !== ariaLabelledby || $[5] !== onKeyDown || $[6] !== ref || $[7] !== t1) {
|
|
69
|
-
t2 = {
|
|
70
|
-
tabListProps: {
|
|
71
|
-
ref,
|
|
72
|
-
"aria-label": ariaLabel,
|
|
73
|
-
"aria-labelledby": ariaLabelledby,
|
|
74
|
-
"aria-orientation": t1,
|
|
75
|
-
role: "tablist",
|
|
76
|
-
onKeyDown
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
$[3] = ariaLabel;
|
|
80
|
-
$[4] = ariaLabelledby;
|
|
81
|
-
$[5] = onKeyDown;
|
|
82
|
-
$[6] = ref;
|
|
83
|
-
$[7] = t1;
|
|
84
|
-
$[8] = t2;
|
|
85
|
-
} else {
|
|
86
|
-
t2 = $[8];
|
|
87
|
-
}
|
|
88
|
-
return t2;
|
|
89
|
-
}
|
|
90
|
-
function _temp2(tab_0) {
|
|
91
|
-
return tab_0.getAttribute("aria-selected") === "true";
|
|
92
|
-
}
|
|
93
|
-
function _temp(tab) {
|
|
94
|
-
return tab.getAttribute("aria-selected") === "true";
|
|
95
|
-
}
|
|
96
|
-
function getFocusableTabs(tablist) {
|
|
97
|
-
return Array.from(tablist.querySelectorAll('[role="tab"]:not([aria-disabled])'));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export { useTabList };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTabPanel.d.ts","sourceRoot":"","sources":["../../../src/experimental/Tabs/useTabPanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;AAG9D,kCAAkC;AAClC,wBAAgB,WAAW,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,aAAa,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAe9F"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import { useTabs } from './useTabs.js';
|
|
3
|
-
|
|
4
|
-
/** Utility hook for tab panels */
|
|
5
|
-
function useTabPanel(props) {
|
|
6
|
-
const $ = c(5);
|
|
7
|
-
const {
|
|
8
|
-
value
|
|
9
|
-
} = props;
|
|
10
|
-
const tabs = useTabs();
|
|
11
|
-
const id = `${tabs.groupId}-panel-${value}`;
|
|
12
|
-
const tabId = `${tabs.groupId}-tab-${value}`;
|
|
13
|
-
const t0 = tabs.selectedValue === value ? "" : undefined;
|
|
14
|
-
const t1 = tabs.selectedValue !== value;
|
|
15
|
-
let t2;
|
|
16
|
-
if ($[0] !== id || $[1] !== t0 || $[2] !== t1 || $[3] !== tabId) {
|
|
17
|
-
t2 = {
|
|
18
|
-
tabPanelProps: {
|
|
19
|
-
"aria-labelledby": tabId,
|
|
20
|
-
"data-selected": t0,
|
|
21
|
-
id,
|
|
22
|
-
hidden: t1,
|
|
23
|
-
role: "tabpanel"
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
$[0] = id;
|
|
27
|
-
$[1] = t0;
|
|
28
|
-
$[2] = t1;
|
|
29
|
-
$[3] = tabId;
|
|
30
|
-
$[4] = t2;
|
|
31
|
-
} else {
|
|
32
|
-
t2 = $[4];
|
|
33
|
-
}
|
|
34
|
-
return t2;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { useTabPanel };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTabs.d.ts","sourceRoot":"","sources":["../../../src/experimental/Tabs/useTabs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAA;AAE7C,wBAAgB,OAAO,IAAI,gBAAgB,CAM1C"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
import { TabsContext } from './TabsContext.js';
|
|
3
|
-
|
|
4
|
-
function useTabs() {
|
|
5
|
-
const context = useContext(TabsContext);
|
|
6
|
-
if (context) {
|
|
7
|
-
return context;
|
|
8
|
-
}
|
|
9
|
-
throw new Error("Component must be used within a <Tabs> component");
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { useTabs };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { type MediaQueryFeatures } from './MatchMediaContext';
|
|
3
|
-
type MatchMediaProps = {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
features?: MediaQueryFeatures;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Use `MatchMedia` to emulate media conditions by passing in feature
|
|
9
|
-
* queries to the `features` prop. If a component uses `useMedia` with the
|
|
10
|
-
* feature passed in to `MatchMedia` it will force its value to match what is
|
|
11
|
-
* provided to `MatchMedia`
|
|
12
|
-
*
|
|
13
|
-
* This should be used for development and documentation only in situations
|
|
14
|
-
* where devtools cannot emulate this feature
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* <MatchMedia features={{ "(pointer: coarse)": true}}>
|
|
18
|
-
* <Children />
|
|
19
|
-
* </MatchMedia>
|
|
20
|
-
*/
|
|
21
|
-
export declare function MatchMedia({ children, features }: MatchMediaProps): React.JSX.Element;
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=MatchMedia.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MatchMedia.d.ts","sourceRoot":"","sources":["../../src/hooks/MatchMedia.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAoB,KAAK,kBAAkB,EAAC,MAAM,qBAAqB,CAAA;AAE9E,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,CAAC,EAAE,kBAAkB,CAAA;CAC9B,CAAA;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,EAAC,QAAQ,EAAE,QAA0B,EAAC,EAAE,eAAe,qBAGjF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MatchMediaContext.d.ts","sourceRoot":"","sources":["../../src/hooks/MatchMediaContext.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;CACnC,CAAA;AAKD,eAAO,MAAM,iBAAiB,6CAAwC,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createContext } from 'react';
|
|
2
|
-
|
|
3
|
-
// Used to keep track of overrides to specific media query features, this should
|
|
4
|
-
// be used for development and demo purposes to emulate specific features if
|
|
5
|
-
// unavailable through devtools
|
|
6
|
-
const MatchMediaContext = /*#__PURE__*/createContext({});
|
|
7
|
-
|
|
8
|
-
export { MatchMediaContext };
|
package/dist/useTheme.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare function useTheme(): {
|
|
3
|
-
theme?: import("./ThemeProvider").Theme;
|
|
4
|
-
colorScheme?: string;
|
|
5
|
-
colorMode?: import("./ThemeProvider").ColorModeWithAuto;
|
|
6
|
-
resolvedColorMode?: import("./ThemeProvider").ColorMode;
|
|
7
|
-
resolvedColorScheme?: string;
|
|
8
|
-
dayScheme?: string;
|
|
9
|
-
nightScheme?: string;
|
|
10
|
-
setColorMode: React.Dispatch<React.SetStateAction<import("./ThemeProvider").ColorModeWithAuto>>;
|
|
11
|
-
setDayScheme: React.Dispatch<React.SetStateAction<string>>;
|
|
12
|
-
setNightScheme: React.Dispatch<React.SetStateAction<string>>;
|
|
13
|
-
};
|
|
14
|
-
export declare function useColorSchemeVar(values: Partial<Record<string, string>>, fallback: string): string;
|
|
15
|
-
//# sourceMappingURL=useTheme.d.ts.map
|
package/dist/useTheme.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../src/useTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,wBAAgB,QAAQ;;;;;;;;;;;EAEvB;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,UAG1F"}
|
package/dist/useTheme.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ThemeContext } from './ThemeContext.js';
|
|
3
|
-
|
|
4
|
-
function useTheme() {
|
|
5
|
-
return React.useContext(ThemeContext);
|
|
6
|
-
}
|
|
7
|
-
function useColorSchemeVar(values, fallback) {
|
|
8
|
-
var _values$colorScheme;
|
|
9
|
-
const {
|
|
10
|
-
colorScheme: t0
|
|
11
|
-
} = useTheme();
|
|
12
|
-
const colorScheme = t0 === undefined ? "" : t0;
|
|
13
|
-
return (_values$colorScheme = values[colorScheme]) !== null && _values$colorScheme !== void 0 ? _values$colorScheme : fallback;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { useColorSchemeVar, useTheme };
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { CheckboxGroup, FormControl } from '../index';
|
|
3
|
-
import type { ComponentProps } from './types';
|
|
4
|
-
import type { ArgTypes } from '@storybook/react';
|
|
5
|
-
import type { InputType } from 'storybook/internal/csf';
|
|
6
|
-
import type { Icon } from '@primer/octicons-react';
|
|
7
|
-
type CheckboxOrRadioGroupWrapperArgs = ComponentProps<typeof CheckboxGroup>;
|
|
8
|
-
type CheckboxOrRadioGroupLabelArgs = ComponentProps<typeof CheckboxGroup.Label> & {
|
|
9
|
-
labelChildren?: React.ReactNode;
|
|
10
|
-
};
|
|
11
|
-
type CheckboxOrRadioGroupCaptionArgs = ComponentProps<typeof CheckboxGroup.Caption> & {
|
|
12
|
-
captionChildren?: React.ReactNode;
|
|
13
|
-
};
|
|
14
|
-
type CheckboxOrRadioGroupValidationMessageArgs = ComponentProps<typeof CheckboxGroup.Validation> & {
|
|
15
|
-
validationChildren?: React.ReactNode;
|
|
16
|
-
};
|
|
17
|
-
export type CheckboxOrRadioGroupArgs = CheckboxOrRadioGroupWrapperArgs & CheckboxOrRadioGroupLabelArgs & CheckboxOrRadioGroupCaptionArgs & CheckboxOrRadioGroupValidationMessageArgs;
|
|
18
|
-
type FormControlParentArgs = Pick<ComponentProps<typeof FormControl>, 'required' | 'disabled'>;
|
|
19
|
-
type FormControlLabelArgs = Omit<ComponentProps<typeof FormControl.Label>, 'as'> & {
|
|
20
|
-
labelChildren?: React.ReactNode;
|
|
21
|
-
};
|
|
22
|
-
type FormControlCaptionArgs = ComponentProps<typeof FormControl.Caption> & {
|
|
23
|
-
captionChildren?: React.ReactNode;
|
|
24
|
-
};
|
|
25
|
-
type FormControlValidationMessageArgs = ComponentProps<typeof FormControl.Validation> & {
|
|
26
|
-
validationChildren?: React.ReactNode;
|
|
27
|
-
};
|
|
28
|
-
export type FormControlArgs<TInputProps = unknown> = FormControlParentArgs & FormControlLabelArgs & FormControlCaptionArgs & Partial<FormControlValidationMessageArgs> & // partial because we don't pass use validation for checkbox or radio
|
|
29
|
-
TInputProps;
|
|
30
|
-
export declare const inputWrapperArgTypes: ArgTypes;
|
|
31
|
-
export declare const getTextInputArgTypes: (category?: string) => Record<string, unknown>;
|
|
32
|
-
export declare const textInputExcludedControlKeys: string[];
|
|
33
|
-
export declare const textInputWithTokensArgTypes: ArgTypes;
|
|
34
|
-
export declare const formControlArgs: {
|
|
35
|
-
required: boolean;
|
|
36
|
-
disabled: boolean;
|
|
37
|
-
labelChildren: string;
|
|
38
|
-
visuallyHidden: boolean;
|
|
39
|
-
captionChildren: string;
|
|
40
|
-
validationChildren: string;
|
|
41
|
-
variant: string;
|
|
42
|
-
};
|
|
43
|
-
export declare const formControlArgTypes: ArgTypes;
|
|
44
|
-
export declare const formControlArgTypesWithoutValidation: Partial<Record<string | number, InputType>>;
|
|
45
|
-
export declare const getFormControlArgsByChildComponent: ({ captionChildren, disabled, labelChildren, required, validationChildren, variant, visuallyHidden, }: FormControlArgs) => {
|
|
46
|
-
parentArgs: {
|
|
47
|
-
disabled: boolean | undefined;
|
|
48
|
-
required: boolean | undefined;
|
|
49
|
-
};
|
|
50
|
-
labelArgs: {
|
|
51
|
-
visuallyHidden: boolean | undefined;
|
|
52
|
-
children: React.ReactNode;
|
|
53
|
-
};
|
|
54
|
-
captionArgs: {
|
|
55
|
-
children: React.ReactNode;
|
|
56
|
-
};
|
|
57
|
-
validationArgs: {
|
|
58
|
-
children: React.ReactNode;
|
|
59
|
-
variant: import("./types/FormValidationStatus").FormValidationStatus | undefined;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
export declare const OcticonArgType: (iconList: Icon[]) => {
|
|
63
|
-
options: string[];
|
|
64
|
-
control: {
|
|
65
|
-
type: "select";
|
|
66
|
-
};
|
|
67
|
-
mapping: Record<string, Icon>;
|
|
68
|
-
};
|
|
69
|
-
export {};
|
|
70
|
-
//# sourceMappingURL=story-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"story-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/story-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAC,MAAM,UAAU,CAAA;AACxD,OAAO,KAAK,EAAC,cAAc,EAAC,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