@codecademy/gamut 67.6.4 → 67.6.5-alpha.263bae.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarChart/BarChartProvider.d.ts +19 -0
- package/dist/BarChart/BarChartProvider.js +31 -0
- package/dist/BarChart/BarRow/elements.d.ts +713 -0
- package/dist/BarChart/BarRow/elements.js +89 -0
- package/dist/BarChart/BarRow/index.d.ts +26 -0
- package/dist/BarChart/BarRow/index.js +254 -0
- package/dist/BarChart/GENERIC_EXAMPLE.d.ts +14 -0
- package/dist/BarChart/GENERIC_EXAMPLE.js +333 -0
- package/dist/BarChart/index.d.ts +4 -0
- package/dist/BarChart/index.js +158 -0
- package/dist/BarChart/layout/GridLines.d.ts +7 -0
- package/dist/BarChart/layout/GridLines.js +78 -0
- package/dist/BarChart/layout/ScaleChartHeader.d.ts +10 -0
- package/dist/BarChart/layout/ScaleChartHeader.js +89 -0
- package/dist/BarChart/layout/VerticalSpacer.d.ts +6 -0
- package/dist/BarChart/layout/VerticalSpacer.js +56 -0
- package/dist/BarChart/shared/elements.d.ts +7 -0
- package/dist/BarChart/shared/elements.js +12 -0
- package/dist/BarChart/shared/styles.d.ts +4 -0
- package/dist/BarChart/shared/styles.js +4 -0
- package/dist/BarChart/shared/translations.d.ts +17 -0
- package/dist/BarChart/shared/translations.js +16 -0
- package/dist/BarChart/shared/types.d.ts +88 -0
- package/dist/BarChart/shared/types.js +1 -0
- package/dist/BarChart/utils/hooks.d.ts +93 -0
- package/dist/BarChart/utils/hooks.js +301 -0
- package/dist/BarChart/utils/index.d.ts +86 -0
- package/dist/BarChart/utils/index.js +165 -0
- package/dist/ConnectedForm/utils.d.ts +1 -1
- package/dist/Form/SelectDropdown/styles.d.ts +1 -1
- package/dist/Form/elements/Form.d.ts +1 -1
- package/dist/Form/elements/FormGroupLabel.js +2 -2
- package/dist/Form/inputs/Select.js +6 -5
- package/dist/List/elements.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BarChartTranslations } from './shared/translations';
|
|
3
|
+
import { BarChartStyles } from './shared/types';
|
|
4
|
+
export interface BarChartContextProps {
|
|
5
|
+
minRange: number;
|
|
6
|
+
maxRange: number;
|
|
7
|
+
xScale: number;
|
|
8
|
+
unit: string;
|
|
9
|
+
styleConfig: Required<BarChartStyles>;
|
|
10
|
+
animate: boolean;
|
|
11
|
+
widestLeftLabelWidth: number | null;
|
|
12
|
+
setWidestLeftLabelWidth: (width: number) => void;
|
|
13
|
+
widestRightLabelWidth: number | null;
|
|
14
|
+
setWidestRightLabelWidth: (width: number) => void;
|
|
15
|
+
isMeasuring: boolean;
|
|
16
|
+
translations: BarChartTranslations;
|
|
17
|
+
}
|
|
18
|
+
export declare const BarChartContext: import("react").Context<BarChartContextProps>;
|
|
19
|
+
export declare const BarChartProvider: import("react").Provider<BarChartContextProps>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import { defaultBarChartTranslations } from './shared/translations';
|
|
3
|
+
const defaultStyleConfig = {
|
|
4
|
+
textColor: 'text',
|
|
5
|
+
foregroundBarColor: 'feedback-warning',
|
|
6
|
+
backgroundBarColor: 'background-primary',
|
|
7
|
+
seriesOneLabel: 'text-secondary',
|
|
8
|
+
seriesTwoLabel: 'primary'
|
|
9
|
+
};
|
|
10
|
+
export const BarChartContext = /*#__PURE__*/createContext({
|
|
11
|
+
minRange: 0,
|
|
12
|
+
maxRange: 100,
|
|
13
|
+
xScale: 10,
|
|
14
|
+
unit: '',
|
|
15
|
+
styleConfig: defaultStyleConfig,
|
|
16
|
+
animate: false,
|
|
17
|
+
widestLeftLabelWidth: null,
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
19
|
+
setWidestLeftLabelWidth: () => {
|
|
20
|
+
// No-op: default context value
|
|
21
|
+
},
|
|
22
|
+
widestRightLabelWidth: null,
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
24
|
+
setWidestRightLabelWidth: () => {
|
|
25
|
+
// No-op: default context value
|
|
26
|
+
},
|
|
27
|
+
isMeasuring: true,
|
|
28
|
+
translations: defaultBarChartTranslations
|
|
29
|
+
});
|
|
30
|
+
BarChartContext.displayName = 'BarChartContext';
|
|
31
|
+
export const BarChartProvider = BarChartContext.Provider;
|