@codecademy/gamut 68.1.5-alpha.fbf911.0 → 68.2.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/LICENSE +21 -0
- package/dist/Alert/Alert.d.ts +1 -0
- package/dist/Alert/elements.d.ts +18 -17
- package/dist/Alert/variants.d.ts +2 -1
- package/dist/Anchor/index.d.ts +15 -15
- package/dist/Animation/ExpandInCollapseOut.d.ts +1 -0
- package/dist/AppWrapper/index.d.ts +3 -2
- package/dist/Badge/index.d.ts +3 -2
- package/dist/BarChart/BarChartProvider.d.ts +19 -0
- package/dist/BarChart/BarChartProvider.js +27 -0
- package/dist/BarChart/BarRow/ValueLabelsContent.d.ts +7 -0
- package/dist/BarChart/BarRow/ValueLabelsContent.js +34 -0
- package/dist/BarChart/BarRow/elements.d.ts +959 -0
- package/dist/BarChart/BarRow/elements.js +110 -0
- package/dist/BarChart/BarRow/index.d.ts +6 -0
- package/dist/BarChart/BarRow/index.js +231 -0
- package/dist/BarChart/SortSelect/index.d.ts +15 -0
- package/dist/BarChart/SortSelect/index.js +18 -0
- package/dist/BarChart/index.d.ts +4 -0
- package/dist/BarChart/index.js +136 -0
- package/dist/BarChart/layout/GridLines.d.ts +3 -0
- package/dist/BarChart/layout/GridLines.js +69 -0
- package/dist/BarChart/layout/LabelSpacer.d.ts +6 -0
- package/dist/BarChart/layout/LabelSpacer.js +56 -0
- package/dist/BarChart/layout/ScaleChartHeader.d.ts +3 -0
- package/dist/BarChart/layout/ScaleChartHeader.js +87 -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 +69 -0
- package/dist/BarChart/shared/translations.js +57 -0
- package/dist/BarChart/shared/types.d.ts +100 -0
- package/dist/BarChart/shared/types.js +1 -0
- package/dist/BarChart/utils/hooks.d.ts +89 -0
- package/dist/BarChart/utils/hooks.js +281 -0
- package/dist/BarChart/utils/index.d.ts +56 -0
- package/dist/BarChart/utils/index.js +122 -0
- package/dist/Box/Box.d.ts +3 -2
- package/dist/Box/FlexBox.d.ts +3 -2
- package/dist/Box/GridBox.d.ts +3 -2
- package/dist/Box/props.d.ts +3 -3
- package/dist/Button/CTAButton.d.ts +9 -8
- package/dist/Button/FillButton.d.ts +18 -17
- package/dist/Button/IconButton.d.ts +19 -19
- package/dist/Button/StrokeButton.d.ts +18 -17
- package/dist/Button/TextButton.d.ts +18 -17
- package/dist/Button/shared/InlineIconButton.d.ts +13 -12
- package/dist/Button/shared/styles.d.ts +15 -10
- package/dist/Button/shared/variants.d.ts +6 -6
- package/dist/ButtonBase/ButtonBase.d.ts +9 -7
- package/dist/Card/elements.d.ts +4 -2
- package/dist/Card/styles.d.ts +2 -2
- package/dist/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.d.ts +1 -0
- package/dist/ConnectedForm/utils.d.ts +6 -6
- package/dist/ContentContainer/index.d.ts +4 -3
- package/dist/DataList/Tables/Rows/elements.d.ts +2 -1
- package/dist/DataList/hooks/useListControls.d.ts +2 -1
- package/dist/DataList/hooks/useListState.d.ts +1 -0
- package/dist/Disclosure/elements.d.ts +58 -57
- package/dist/Disclosure/helpers.d.ts +4 -4
- package/dist/Disclosure/types.d.ts +1 -0
- package/dist/Drawer/index.d.ts +1 -0
- package/dist/FeatureShimmer/index.d.ts +1 -0
- package/dist/Form/SelectDropdown/elements/constants.d.ts +1 -0
- package/dist/Form/SelectDropdown/elements/containers.d.ts +1 -0
- package/dist/Form/SelectDropdown/styles.d.ts +2 -2
- package/dist/Form/SelectDropdown/utils.d.ts +2 -2
- package/dist/Form/__fixtures__/utils.d.ts +1 -0
- package/dist/Form/elements/Form.d.ts +4 -4
- package/dist/Form/elements/FormError.d.ts +1 -1
- package/dist/Form/elements/FormGroup.d.ts +4 -4
- package/dist/Form/elements/FormGroupDescription.d.ts +4 -3
- package/dist/Form/elements/FormGroupLabel.d.ts +2 -2
- package/dist/Form/elements/FormGroupLabel.js +2 -2
- package/dist/Form/inputs/Input.d.ts +8 -4
- package/dist/Form/inputs/Radio.d.ts +8 -8
- package/dist/Form/inputs/Select.d.ts +2 -2
- package/dist/Form/inputs/Select.js +6 -5
- package/dist/Form/inputs/TextArea.d.ts +2 -2
- package/dist/Form/styles/Checkbox-styles.d.ts +16 -8
- package/dist/Form/styles/Radio-styles.d.ts +8 -4
- package/dist/Form/styles/shared-system-props.d.ts +12 -7
- package/dist/GridForm/GridFormButtons/index.d.ts +18 -18
- package/dist/GridForm/GridFormInputGroup/__fixtures__/assertions.d.ts +2 -2
- package/dist/GridForm/GridFormSections/GridFormSectionBreak.d.ts +2 -2
- package/dist/HiddenText/index.d.ts +3 -2
- package/dist/InternalFloatingCard/InternalFloatingCard.d.ts +3 -3
- package/dist/Layout/Column.d.ts +4 -3
- package/dist/Layout/LayoutGrid.d.ts +3 -2
- package/dist/List/ListProvider.d.ts +1 -0
- package/dist/List/elements.d.ts +40 -28
- package/dist/List/hooks.d.ts +1 -0
- package/dist/Menu/Menu.d.ts +3 -2
- package/dist/Menu/MenuContext.d.ts +1 -0
- package/dist/Menu/elements.d.ts +11 -11
- package/dist/Modals/elements.d.ts +4 -3
- package/dist/Pagination/AnimatedPaginationButtons.d.ts +37 -3
- package/dist/Pagination/EllipsisButton.d.ts +52 -19
- package/dist/Pagination/PaginationButton.d.ts +30 -30
- package/dist/Pagination/styles.d.ts +4 -4
- package/dist/Pagination/utils.d.ts +5 -5
- package/dist/Popover/Popover.d.ts +1 -0
- package/dist/Popover/elements.d.ts +17 -16
- package/dist/Popover/styles/base.d.ts +2 -2
- package/dist/Popover/styles/beak.d.ts +1 -1
- package/dist/Popover/styles/variants.d.ts +6 -6
- package/dist/Popover/utils.d.ts +1 -1
- package/dist/PopoverContainer/hooks.d.ts +2 -2
- package/dist/PopoverContainer/utils.d.ts +1 -1
- package/dist/SkipToContent/index.d.ts +2 -2
- package/dist/Tabs/TabButton.d.ts +10 -9
- package/dist/Tabs/TabNav.d.ts +3 -2
- package/dist/Tabs/TabNavLink.d.ts +8 -8
- package/dist/Tabs/TabPanels.d.ts +3 -2
- package/dist/Tabs/TabProvider.d.ts +1 -0
- package/dist/Tabs/styles.d.ts +2 -2
- package/dist/Tag/elements.d.ts +42 -41
- package/dist/Tag/styles.d.ts +22 -12
- package/dist/Tip/InfoTip/InfoTipButton.d.ts +20 -20
- package/dist/Tip/InfoTip/index.d.ts +1 -0
- package/dist/Tip/InfoTip/styles.d.ts +11 -8
- package/dist/Tip/PreviewTip/elements.d.ts +17 -16
- package/dist/Tip/PreviewTip/utils.d.ts +1 -1
- package/dist/Tip/ToolTip/elements.d.ts +4 -3
- package/dist/Tip/ToolTip/index.d.ts +1 -0
- package/dist/Tip/__tests__/helpers.d.ts +4 -4
- package/dist/Tip/shared/InlineTip.d.ts +1 -0
- package/dist/Tip/shared/elements.d.ts +20 -19
- package/dist/Tip/shared/styles/composeVariantsUtils.d.ts +2 -2
- package/dist/Tip/shared/styles/styles.d.ts +4 -4
- package/dist/Tip/shared/utils.d.ts +1 -0
- package/dist/Toggle/elements.d.ts +12 -11
- package/dist/Toggle/utils.d.ts +1 -1
- package/dist/Typography/Text.d.ts +9 -8
- package/dist/Video/lib/ReactPlayer.d.ts +3 -2
- package/dist/Video/lib/VideoLayout.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/types.d.ts +1 -0
- package/package.json +8 -7
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { isColorAlias, useColorModes } from '@codecademy/gamut-styles';
|
|
2
|
+
import { getContrast } from 'polished';
|
|
3
|
+
import { useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { BarChartContext, defaultStyleConfig } from '../BarChartProvider';
|
|
5
|
+
import { calculatePositionPercent, getLabel, sortBars } from './index';
|
|
6
|
+
/**
|
|
7
|
+
* Hook that calculates label positions for a given maxScaleValue and tickCount (scale min is always 0).
|
|
8
|
+
* Returns an array of { value, positionPercent } objects.
|
|
9
|
+
*/
|
|
10
|
+
export const useLabelPositions = ({
|
|
11
|
+
maxScaleValue,
|
|
12
|
+
tickCount
|
|
13
|
+
}) => {
|
|
14
|
+
return useMemo(() => Array.from({
|
|
15
|
+
length: tickCount
|
|
16
|
+
}, (_, i) => {
|
|
17
|
+
const value = getLabel({
|
|
18
|
+
labelIndex: i,
|
|
19
|
+
maxScaleValue,
|
|
20
|
+
tickCount
|
|
21
|
+
});
|
|
22
|
+
const positionPercent = calculatePositionPercent({
|
|
23
|
+
value,
|
|
24
|
+
maxScaleValue
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
value,
|
|
28
|
+
positionPercent
|
|
29
|
+
};
|
|
30
|
+
}), [maxScaleValue, tickCount]);
|
|
31
|
+
};
|
|
32
|
+
export const useBarChartContext = () => {
|
|
33
|
+
return useContext(BarChartContext);
|
|
34
|
+
};
|
|
35
|
+
export const useBarChart = ({
|
|
36
|
+
maxScaleValue,
|
|
37
|
+
scaleInterval,
|
|
38
|
+
unit = '',
|
|
39
|
+
styleConfig,
|
|
40
|
+
animate = false,
|
|
41
|
+
barCount = 0,
|
|
42
|
+
translations
|
|
43
|
+
}) => {
|
|
44
|
+
const [widestCategoryLabelWidth, setWidestCategoryLabelWidthState] = useState(null);
|
|
45
|
+
const [widestTotalValueLabelWidth, setWidestTotalValueLabelWidthState] = useState(null);
|
|
46
|
+
const [isMeasuring, setIsMeasuring] = useState(true);
|
|
47
|
+
const measuredCountRef = useRef(0);
|
|
48
|
+
const maxCategoryLabelWidthRef = useRef(0);
|
|
49
|
+
const maxTotalValueLabelWidthRef = useRef(0);
|
|
50
|
+
const setWidestCategoryLabelWidth = useCallback(width => {
|
|
51
|
+
if (width > maxCategoryLabelWidthRef.current) {
|
|
52
|
+
maxCategoryLabelWidthRef.current = width;
|
|
53
|
+
setWidestCategoryLabelWidthState(width);
|
|
54
|
+
}
|
|
55
|
+
measuredCountRef.current += 1;
|
|
56
|
+
// Only stop measuring when we've received measurements from all bars
|
|
57
|
+
if (measuredCountRef.current >= barCount * 2 && barCount > 0) {
|
|
58
|
+
setIsMeasuring(false);
|
|
59
|
+
}
|
|
60
|
+
}, [barCount]);
|
|
61
|
+
const setWidestTotalValueLabelWidth = useCallback(width => {
|
|
62
|
+
if (width > maxTotalValueLabelWidthRef.current) {
|
|
63
|
+
maxTotalValueLabelWidthRef.current = width;
|
|
64
|
+
setWidestTotalValueLabelWidthState(width);
|
|
65
|
+
}
|
|
66
|
+
measuredCountRef.current += 1;
|
|
67
|
+
// Only stop measuring when we've received measurements from all bars (category + total value)
|
|
68
|
+
if (measuredCountRef.current >= barCount * 2 && barCount > 0) {
|
|
69
|
+
setIsMeasuring(false);
|
|
70
|
+
}
|
|
71
|
+
}, [barCount]);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (barCount > 0) {
|
|
74
|
+
measuredCountRef.current = 0;
|
|
75
|
+
maxCategoryLabelWidthRef.current = 0;
|
|
76
|
+
maxTotalValueLabelWidthRef.current = 0;
|
|
77
|
+
setIsMeasuring(true);
|
|
78
|
+
}
|
|
79
|
+
}, [barCount]);
|
|
80
|
+
return useMemo(() => ({
|
|
81
|
+
maxScaleValue,
|
|
82
|
+
scaleInterval: scaleInterval ?? Math.ceil(maxScaleValue / 5),
|
|
83
|
+
unit,
|
|
84
|
+
styleConfig: {
|
|
85
|
+
...defaultStyleConfig,
|
|
86
|
+
...styleConfig
|
|
87
|
+
},
|
|
88
|
+
animate,
|
|
89
|
+
widestCategoryLabelWidth,
|
|
90
|
+
setWidestCategoryLabelWidth,
|
|
91
|
+
widestTotalValueLabelWidth,
|
|
92
|
+
setWidestTotalValueLabelWidth,
|
|
93
|
+
isMeasuring,
|
|
94
|
+
translations
|
|
95
|
+
}), [maxScaleValue, scaleInterval, unit, styleConfig, animate, widestCategoryLabelWidth, setWidestCategoryLabelWidth, widestTotalValueLabelWidth, setWidestTotalValueLabelWidth, isMeasuring, translations]);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Hook that returns a function to get the highest contrast border color
|
|
100
|
+
* (white or navy-900) for a given background color.
|
|
101
|
+
*
|
|
102
|
+
* Similar to the Background component, this resolves color aliases and
|
|
103
|
+
* compares contrast ratios to determine the best border color.
|
|
104
|
+
*
|
|
105
|
+
* @returns A function that takes a background color and returns either 'white' or 'navy-900'
|
|
106
|
+
*/
|
|
107
|
+
export const useBarBorderColor = () => {
|
|
108
|
+
const [, activeColors,, getColorValue] = useColorModes();
|
|
109
|
+
const getBorderColor = useCallback(bg => {
|
|
110
|
+
/** If a color alias was used then look up the true color key from the active mode */
|
|
111
|
+
const trueColor = isColorAlias(activeColors, bg) ? activeColors[bg] : bg;
|
|
112
|
+
const backgroundColor = getColorValue(trueColor);
|
|
113
|
+
const whiteContrast = getContrast(getColorValue('white'), backgroundColor);
|
|
114
|
+
const navyContrast = getContrast(getColorValue('navy-900'), backgroundColor);
|
|
115
|
+
return whiteContrast > navyContrast ? 'white' : 'navy-900';
|
|
116
|
+
}, [activeColors, getColorValue]);
|
|
117
|
+
return getBorderColor;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Generic hook for measuring element width and reporting to a callback.
|
|
122
|
+
* Used internally by useMeasureCategoryLabelWidth and useMeasureTotalValueLabelWidth.
|
|
123
|
+
*/
|
|
124
|
+
const useMeasureWidth = ({
|
|
125
|
+
ref,
|
|
126
|
+
onMeasure,
|
|
127
|
+
isMeasuring
|
|
128
|
+
}) => {
|
|
129
|
+
const hasMeasuredRef = useRef(false);
|
|
130
|
+
|
|
131
|
+
// Reset measurement flag when a new measurement cycle starts
|
|
132
|
+
const prevIsMeasuringRef = useRef(isMeasuring);
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
if (isMeasuring && !prevIsMeasuringRef.current) {
|
|
135
|
+
// New measurement cycle started
|
|
136
|
+
hasMeasuredRef.current = false;
|
|
137
|
+
}
|
|
138
|
+
prevIsMeasuringRef.current = isMeasuring;
|
|
139
|
+
}, [isMeasuring]);
|
|
140
|
+
useLayoutEffect(() => {
|
|
141
|
+
if (!ref.current || hasMeasuredRef.current || !isMeasuring) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const element = ref.current;
|
|
145
|
+
const width = element?.getBoundingClientRect()?.width;
|
|
146
|
+
if (width > 0) {
|
|
147
|
+
onMeasure(width);
|
|
148
|
+
hasMeasuredRef.current = true;
|
|
149
|
+
}
|
|
150
|
+
}, [ref, onMeasure, isMeasuring]);
|
|
151
|
+
};
|
|
152
|
+
export const useMeasureCategoryLabelWidth = ({
|
|
153
|
+
ref
|
|
154
|
+
}) => {
|
|
155
|
+
const {
|
|
156
|
+
setWidestCategoryLabelWidth,
|
|
157
|
+
isMeasuring
|
|
158
|
+
} = useBarChartContext();
|
|
159
|
+
useMeasureWidth({
|
|
160
|
+
ref,
|
|
161
|
+
onMeasure: setWidestCategoryLabelWidth,
|
|
162
|
+
isMeasuring
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
export const useMeasureTotalValueLabelWidth = ({
|
|
166
|
+
ref
|
|
167
|
+
}) => {
|
|
168
|
+
const {
|
|
169
|
+
setWidestTotalValueLabelWidth,
|
|
170
|
+
isMeasuring
|
|
171
|
+
} = useBarChartContext();
|
|
172
|
+
useMeasureWidth({
|
|
173
|
+
ref,
|
|
174
|
+
onMeasure: setWidestTotalValueLabelWidth,
|
|
175
|
+
isMeasuring
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Hook that manages bar sorting state and provides memoized sorted bars.
|
|
180
|
+
* Supports predefined sort options (via string literals) and custom sort functions.
|
|
181
|
+
* Only returns selectProps if sortFns is provided.
|
|
182
|
+
*/
|
|
183
|
+
export const useBarChartSort = ({
|
|
184
|
+
bars,
|
|
185
|
+
sortFns,
|
|
186
|
+
translations
|
|
187
|
+
}) => {
|
|
188
|
+
// Build options map and custom sort map from sortFns array
|
|
189
|
+
const {
|
|
190
|
+
allSortOptions,
|
|
191
|
+
customSortMap,
|
|
192
|
+
defaultSortValue
|
|
193
|
+
} = useMemo(() => {
|
|
194
|
+
if (!sortFns || sortFns.length === 0) {
|
|
195
|
+
return {
|
|
196
|
+
allSortOptions: null,
|
|
197
|
+
customSortMap: new Map(),
|
|
198
|
+
defaultSortValue: 'none'
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
const options = {};
|
|
202
|
+
const customMap = new Map();
|
|
203
|
+
const availableValues = [];
|
|
204
|
+
sortFns.forEach(item => {
|
|
205
|
+
if (typeof item === 'string') {
|
|
206
|
+
if (item === 'alphabetically') {
|
|
207
|
+
options['label-asc'] = translations.sortOptions.labelAsc;
|
|
208
|
+
options['label-desc'] = translations.sortOptions.labelDesc;
|
|
209
|
+
availableValues.push('label-asc', 'label-desc');
|
|
210
|
+
} else if (item === 'numerically') {
|
|
211
|
+
options['value-asc'] = translations.sortOptions.valueAsc;
|
|
212
|
+
options['value-desc'] = translations.sortOptions.valueDesc;
|
|
213
|
+
availableValues.push('value-asc', 'value-desc');
|
|
214
|
+
} else if (item === 'none') {
|
|
215
|
+
options.none = translations.sortOptions.none;
|
|
216
|
+
availableValues.push('none');
|
|
217
|
+
}
|
|
218
|
+
} else {
|
|
219
|
+
// CustomSortOption
|
|
220
|
+
options[item.value] = item.label;
|
|
221
|
+
customMap.set(item.value, item.sortFn);
|
|
222
|
+
availableValues.push(item.value);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
// Default to "none" if available, otherwise first option
|
|
227
|
+
const defaultVal = availableValues.includes('none') ? 'none' : availableValues[0] || 'none';
|
|
228
|
+
return {
|
|
229
|
+
allSortOptions: options,
|
|
230
|
+
customSortMap: customMap,
|
|
231
|
+
defaultSortValue: defaultVal
|
|
232
|
+
};
|
|
233
|
+
}, [sortFns, translations]);
|
|
234
|
+
const [sortValue, setSortValue] = useState(defaultSortValue);
|
|
235
|
+
|
|
236
|
+
// Update sortValue when defaultSortValue changes (e.g., when sortFns changes)
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
setSortValue(defaultSortValue);
|
|
239
|
+
}, [defaultSortValue]);
|
|
240
|
+
const sortedBars = useMemo(() => {
|
|
241
|
+
// Check if current selection is a custom sort function
|
|
242
|
+
const customSortFn = customSortMap.get(sortValue);
|
|
243
|
+
if (customSortFn) {
|
|
244
|
+
return customSortFn([...bars]);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Otherwise use predefined sort options
|
|
248
|
+
if (sortValue === 'none') {
|
|
249
|
+
return bars;
|
|
250
|
+
}
|
|
251
|
+
const [sortBy, order] = sortValue.split('-');
|
|
252
|
+
const sortByValue = sortBy;
|
|
253
|
+
const orderValue = order === 'desc' ? 'descending' : 'ascending';
|
|
254
|
+
return sortBars({
|
|
255
|
+
bars: bars,
|
|
256
|
+
sortBy: sortByValue,
|
|
257
|
+
order: orderValue
|
|
258
|
+
});
|
|
259
|
+
}, [bars, sortValue, customSortMap]);
|
|
260
|
+
const onSortChange = useCallback(value => {
|
|
261
|
+
setSortValue(value);
|
|
262
|
+
}, []);
|
|
263
|
+
const selectProps = useMemo(() => {
|
|
264
|
+
if (!allSortOptions) {
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
return {
|
|
268
|
+
options: allSortOptions,
|
|
269
|
+
value: sortValue,
|
|
270
|
+
onChange: e => {
|
|
271
|
+
onSortChange(e.target.value);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
}, [sortValue, onSortChange, allSortOptions]);
|
|
275
|
+
return {
|
|
276
|
+
sortedBars,
|
|
277
|
+
sortValue,
|
|
278
|
+
onSortChange,
|
|
279
|
+
selectProps
|
|
280
|
+
};
|
|
281
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BarChartTranslations } from '../shared/translations';
|
|
2
|
+
import { BarChartUnit, BarProps, MaxScaleValue, ScaleTickCount } from '../shared/types';
|
|
3
|
+
export declare const calculatePercent: ({ value, total, }: {
|
|
4
|
+
value: number;
|
|
5
|
+
total: number;
|
|
6
|
+
}) => number;
|
|
7
|
+
export declare const calculateBarWidth: ({ value, maxScaleValue, }: {
|
|
8
|
+
value: number;
|
|
9
|
+
maxScaleValue: MaxScaleValue;
|
|
10
|
+
}) => number;
|
|
11
|
+
/**
|
|
12
|
+
* Formats a numeric value with optional unit for bar chart labels.
|
|
13
|
+
*/
|
|
14
|
+
export declare const formatValueWithUnit: ({ value, unit, locale, }: {
|
|
15
|
+
value: number;
|
|
16
|
+
unit: string;
|
|
17
|
+
locale?: string | undefined;
|
|
18
|
+
}) => string;
|
|
19
|
+
export declare const formatNumberUnitCompact: ({ num, locale, }: {
|
|
20
|
+
num: number;
|
|
21
|
+
locale?: string | undefined;
|
|
22
|
+
}) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Sort bars based on sortBy and order configuration
|
|
25
|
+
*/
|
|
26
|
+
export declare const sortBars: <T extends BarProps>({ bars, sortBy, order, }: {
|
|
27
|
+
bars: T[];
|
|
28
|
+
sortBy: 'label' | 'value' | 'none';
|
|
29
|
+
order: 'ascending' | 'descending';
|
|
30
|
+
}) => T[];
|
|
31
|
+
/**
|
|
32
|
+
* Returns the accessibility summary for a bar row. The summary is used as aria-label on the row's link/button when interactive, or as screenreader-only text when not. Summaries come from stackedBarSummary (stacked rows) or singleValueBarSummary (single-value rows), with default implementations when not overridden.
|
|
33
|
+
*/
|
|
34
|
+
export declare const getValuesSummary: ({ seriesOneValue, seriesTwoValue, unit, categoryLabel, translations, }: Pick<BarProps, "categoryLabel" | "seriesOneValue" | "seriesTwoValue"> & Required<Pick<BarChartUnit, "unit">> & {
|
|
35
|
+
translations: BarChartTranslations;
|
|
36
|
+
}) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Calculates the value for a given label position (scale min is always 0).
|
|
39
|
+
*/
|
|
40
|
+
export declare const getLabel: ({ tickCount, labelIndex, maxScaleValue, }: {
|
|
41
|
+
tickCount: ScaleTickCount;
|
|
42
|
+
labelIndex: number;
|
|
43
|
+
maxScaleValue: MaxScaleValue;
|
|
44
|
+
}) => number;
|
|
45
|
+
/**
|
|
46
|
+
* Calculates the percentage position for a given value within 0–maxScaleValue range.
|
|
47
|
+
* Returns a value between 0 and 100 representing the position percentage.
|
|
48
|
+
*/
|
|
49
|
+
export declare const calculatePositionPercent: ({ value, maxScaleValue, }: {
|
|
50
|
+
value: number;
|
|
51
|
+
maxScaleValue: MaxScaleValue;
|
|
52
|
+
}) => number;
|
|
53
|
+
/**
|
|
54
|
+
* Generates a stable key for a bar row (for React list keys).
|
|
55
|
+
*/
|
|
56
|
+
export declare const getBarRowKey: (bar: Pick<BarProps, 'categoryLabel' | 'seriesOneValue' | 'seriesTwoValue'>, index: number) => string;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { getDefaultSingleValueBarSummary, getDefaultStackedBarSummary } from '../shared/translations';
|
|
2
|
+
export const calculatePercent = ({
|
|
3
|
+
value,
|
|
4
|
+
total
|
|
5
|
+
}) => {
|
|
6
|
+
return value / total * 100;
|
|
7
|
+
};
|
|
8
|
+
export const calculateBarWidth = ({
|
|
9
|
+
value,
|
|
10
|
+
maxScaleValue
|
|
11
|
+
}) => {
|
|
12
|
+
const adjustedValue = Math.max(0, Math.min(maxScaleValue, value));
|
|
13
|
+
return Math.floor(calculatePercent({
|
|
14
|
+
value: adjustedValue,
|
|
15
|
+
total: maxScaleValue
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Formats a numeric value with optional unit for bar chart labels.
|
|
21
|
+
*/
|
|
22
|
+
export const formatValueWithUnit = ({
|
|
23
|
+
value,
|
|
24
|
+
unit,
|
|
25
|
+
locale = 'en'
|
|
26
|
+
}) => {
|
|
27
|
+
const formatted = Intl.NumberFormat(locale).format(value);
|
|
28
|
+
return unit ? `${formatted} ${unit}` : formatted;
|
|
29
|
+
};
|
|
30
|
+
export const formatNumberUnitCompact = ({
|
|
31
|
+
num,
|
|
32
|
+
locale = 'en'
|
|
33
|
+
}) => Intl.NumberFormat(locale, {
|
|
34
|
+
notation: 'compact',
|
|
35
|
+
compactDisplay: 'short'
|
|
36
|
+
}).format(num);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Sort bars based on sortBy and order configuration
|
|
40
|
+
*/
|
|
41
|
+
export const sortBars = ({
|
|
42
|
+
bars,
|
|
43
|
+
sortBy,
|
|
44
|
+
order
|
|
45
|
+
}) => {
|
|
46
|
+
if (sortBy === 'none' || !sortBy) {
|
|
47
|
+
return bars;
|
|
48
|
+
}
|
|
49
|
+
const sorted = [...bars].sort((a, b) => {
|
|
50
|
+
if (sortBy === 'label') {
|
|
51
|
+
return a.categoryLabel.localeCompare(b.categoryLabel);
|
|
52
|
+
}
|
|
53
|
+
const aValue = a.seriesTwoValue ?? a.seriesOneValue;
|
|
54
|
+
const bValue = b.seriesTwoValue ?? b.seriesOneValue;
|
|
55
|
+
return aValue - bValue;
|
|
56
|
+
});
|
|
57
|
+
return order === 'descending' ? sorted.reverse() : sorted;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Returns the accessibility summary for a bar row. The summary is used as aria-label on the row's link/button when interactive, or as screenreader-only text when not. Summaries come from stackedBarSummary (stacked rows) or singleValueBarSummary (single-value rows), with default implementations when not overridden.
|
|
62
|
+
*/
|
|
63
|
+
export const getValuesSummary = ({
|
|
64
|
+
seriesOneValue,
|
|
65
|
+
seriesTwoValue,
|
|
66
|
+
unit,
|
|
67
|
+
categoryLabel,
|
|
68
|
+
translations
|
|
69
|
+
}) => {
|
|
70
|
+
const {
|
|
71
|
+
locale
|
|
72
|
+
} = translations;
|
|
73
|
+
const singleValueCtx = {
|
|
74
|
+
value: seriesOneValue,
|
|
75
|
+
unit,
|
|
76
|
+
locale,
|
|
77
|
+
categoryLabel
|
|
78
|
+
};
|
|
79
|
+
if (seriesTwoValue !== undefined) {
|
|
80
|
+
const gained = seriesTwoValue - seriesOneValue;
|
|
81
|
+
const stackedCtx = {
|
|
82
|
+
categoryLabel,
|
|
83
|
+
seriesOneValue,
|
|
84
|
+
seriesTwoValue,
|
|
85
|
+
unit,
|
|
86
|
+
locale,
|
|
87
|
+
gained
|
|
88
|
+
};
|
|
89
|
+
return (translations.accessibility.stackedBarSummary ?? getDefaultStackedBarSummary)(stackedCtx);
|
|
90
|
+
}
|
|
91
|
+
return (translations.accessibility.singleValueBarSummary ?? getDefaultSingleValueBarSummary)(singleValueCtx);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Calculates the value for a given label position (scale min is always 0).
|
|
96
|
+
*/
|
|
97
|
+
export const getLabel = ({
|
|
98
|
+
tickCount,
|
|
99
|
+
labelIndex,
|
|
100
|
+
maxScaleValue
|
|
101
|
+
}) => {
|
|
102
|
+
if (tickCount <= 1) return maxScaleValue;
|
|
103
|
+
const incrementalDecimal = labelIndex / (tickCount - 1);
|
|
104
|
+
return Math.floor(incrementalDecimal * maxScaleValue);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Calculates the percentage position for a given value within 0–maxScaleValue range.
|
|
109
|
+
* Returns a value between 0 and 100 representing the position percentage.
|
|
110
|
+
*/
|
|
111
|
+
export const calculatePositionPercent = ({
|
|
112
|
+
value,
|
|
113
|
+
maxScaleValue
|
|
114
|
+
}) => {
|
|
115
|
+
if (maxScaleValue === 0) return 0;
|
|
116
|
+
return value / maxScaleValue * 100;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Generates a stable key for a bar row (for React list keys).
|
|
121
|
+
*/
|
|
122
|
+
export const getBarRowKey = (bar, index) => bar.categoryLabel && bar.seriesOneValue ? `${bar.categoryLabel}-${bar.seriesOneValue}-${bar.seriesTwoValue ?? ''}-${index}` : String(index);
|
package/dist/Box/Box.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { BoxProps } from './props';
|
|
2
3
|
export declare const Box: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
theme?: import("@emotion/react").Theme;
|
|
4
|
-
as?:
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
6
|
} & BoxProps, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | keyof import("react").ClassAttributes<HTMLDivElement> | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">, {}>;
|
|
6
7
|
export type { BoxProps } from './props';
|
package/dist/Box/FlexBox.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FlexBoxProps } from './props';
|
|
2
3
|
export declare const FlexBox: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
theme?: import("@emotion/react").Theme;
|
|
4
|
-
as?:
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
6
|
} & FlexBoxProps, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | keyof import("react").ClassAttributes<HTMLDivElement> | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">, {}>;
|
|
6
7
|
export type { FlexBoxProps } from './props';
|
package/dist/Box/GridBox.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { GridBoxProps } from './props';
|
|
2
3
|
export declare const GridBox: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
theme?: import("@emotion/react").Theme;
|
|
4
|
-
as?:
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
6
|
} & GridBoxProps, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | keyof import("react").ClassAttributes<HTMLDivElement> | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">, {}>;
|
package/dist/Box/props.d.ts
CHANGED
|
@@ -748,13 +748,13 @@ export declare const boxProps: import("@codecademy/variance/dist/types/config").
|
|
|
748
748
|
};
|
|
749
749
|
}>>]>>;
|
|
750
750
|
export declare const sharedStates: (props: Partial<Record<"fit" | "context" | "no-select", boolean>> & {
|
|
751
|
-
theme?: import("@emotion/react").Theme;
|
|
751
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
752
752
|
}) => import("@codecademy/variance").CSSObject;
|
|
753
753
|
export declare const flexStates: (props: Partial<Record<"center" | "inline" | "column" | "row" | "wrap", boolean>> & {
|
|
754
|
-
theme?: import("@emotion/react").Theme;
|
|
754
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
755
755
|
}) => import("@codecademy/variance").CSSObject;
|
|
756
756
|
export declare const gridStates: (props: Partial<Record<"center" | "fitContent", boolean>> & {
|
|
757
|
-
theme?: import("@emotion/react").Theme;
|
|
757
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
758
758
|
}) => import("@codecademy/variance").CSSObject;
|
|
759
759
|
export interface BoxProps extends StyleProps<typeof boxProps>, StyleProps<typeof sharedStates>, WithChildrenProp {
|
|
760
760
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const CTAButton: import("@emotion/styled").StyledComponent<(((Omit<{
|
|
2
|
-
theme?: import("@emotion/react").Theme;
|
|
3
|
-
as?:
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
4
5
|
} & {
|
|
5
|
-
theme?: import("@emotion/react").Theme;
|
|
6
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
6
7
|
} & Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "disabled" | "name" | "form" | "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "type" | keyof import("react").ClassAttributes<HTMLButtonElement> | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value">, "ref"> | Omit<{
|
|
7
|
-
theme?: import("@emotion/react").Theme;
|
|
8
|
-
as?:
|
|
8
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
9
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
10
|
} & {
|
|
10
|
-
theme?: import("@emotion/react").Theme;
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
11
12
|
} & Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "disabled" | "name" | "form" | "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "type" | keyof import("react").ClassAttributes<HTMLButtonElement> | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value"> & Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "media" | "target" | "type" | "href" | keyof import("react").ClassAttributes<HTMLAnchorElement> | "download" | "hrefLang" | "ping" | "referrerPolicy">, "ref">) & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>) & {
|
|
12
|
-
theme?: import("@emotion/react").Theme;
|
|
13
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
13
14
|
}) & import("./shared").ButtonBaseProps & {
|
|
14
|
-
variant?: "primary";
|
|
15
|
+
variant?: "primary" | undefined;
|
|
15
16
|
}, {}, {}>;
|