@redsift/design-system 11.6.0-muiv5-alpha.5 → 11.6.0-muiv5-alpha.7
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/_internal/Alert2.js +182 -39
- package/_internal/AppBar.js +240 -29
- package/_internal/AppContainer.js +132 -86
- package/_internal/AppContent.js +84 -17
- package/_internal/Badge2.js +137 -4
- package/_internal/BreadcrumbItem.js +85 -3
- package/_internal/Breadcrumbs2.js +86 -21
- package/_internal/Button2.js +81 -20
- package/_internal/ButtonGroup.js +165 -25
- package/_internal/ButtonLink.js +74 -18
- package/_internal/Card2.js +151 -29
- package/_internal/CardActions.js +38 -3
- package/_internal/CardBody.js +36 -3
- package/_internal/CardHeader.js +77 -3
- package/_internal/Checkbox2.js +234 -58
- package/_internal/CheckboxGroup.js +182 -4
- package/_internal/ConditionalWrapper.js +11 -12
- package/_internal/DetailedCard.js +6912 -48
- package/_internal/DetailedCardCollapsibleSectionItems.js +58 -3
- package/_internal/DetailedCardHeader.js +61 -3
- package/_internal/DetailedCardSection.js +166 -3
- package/_internal/DetailedCardSectionItem.js +88 -3
- package/_internal/Flexbox2.js +85 -22
- package/_internal/Grid2.js +87 -24
- package/_internal/GridItem.js +34 -3
- package/_internal/Heading2.js +107 -3
- package/_internal/Icon2.js +206 -5
- package/_internal/IconButton.js +71 -3
- package/_internal/IconButtonLink.js +65 -18
- package/_internal/Item2.js +390 -73
- package/_internal/Link2.js +56 -15
- package/_internal/LinkButton.js +56 -13
- package/_internal/Number2.js +103 -61
- package/_internal/NumberField.js +3959 -65
- package/_internal/Pill2.js +400 -4
- package/_internal/ProgressBar.js +61 -18
- package/_internal/Radio2.js +227 -56
- package/_internal/RadioGroup.js +170 -4
- package/_internal/Shield2.js +220 -4
- package/_internal/SideNavigationMenu.js +586 -4
- package/_internal/SideNavigationMenuItem.js +299 -4
- package/_internal/Skeleton2.js +36 -9
- package/_internal/SkeletonCircle.js +52 -3
- package/_internal/SkeletonText.js +71 -3
- package/_internal/Spinner2.js +319 -29
- package/_internal/Switch2.js +310 -56
- package/_internal/SwitchGroup.js +182 -4
- package/_internal/Text2.js +45 -3
- package/_internal/TextArea.js +430 -20
- package/_internal/TextField.js +463 -19
- package/_internal/alert.js +2 -5
- package/_internal/app-bar.js +2 -8
- package/_internal/app-container.js +3 -9
- package/_internal/app-content.js +2 -5
- package/_internal/app-side-panel.js +3 -11
- package/_internal/badge.js +2 -6
- package/_internal/breadcrumb-item.js +1 -4
- package/_internal/breadcrumbs.js +2 -6
- package/_internal/button-group.js +2 -5
- package/_internal/button-link.js +2 -8
- package/_internal/button.js +3 -8
- package/_internal/card-actions.js +1 -4
- package/_internal/card-body.js +1 -4
- package/_internal/card-header.js +1 -8
- package/_internal/card.js +2 -11
- package/_internal/checkbox-group.js +2 -6
- package/_internal/checkbox.js +2 -6
- package/_internal/colors.js +87 -91
- package/_internal/conditional-wrapper.js +2 -2
- package/_internal/detailed-card-collapsible-section-items.js +1 -3
- package/_internal/detailed-card-header.js +1 -7
- package/_internal/detailed-card-section-item.js +1 -10
- package/_internal/detailed-card-section.js +1 -6
- package/_internal/detailed-card.js +2 -16
- package/_internal/flexbox.js +2 -5
- package/_internal/focus-within-group.js +3 -3
- package/_internal/fonts.js +4 -6
- package/_internal/gradient-border.js +35 -16
- package/_internal/grid-item.js +1 -4
- package/_internal/grid.js +2 -6
- package/_internal/heading.js +2 -6
- package/_internal/icon-button-link.js +2 -8
- package/_internal/icon-button.js +2 -6
- package/_internal/icon.js +2 -6
- package/_internal/item.js +2 -8
- package/_internal/link-button.js +2 -8
- package/_internal/link.js +3 -8
- package/_internal/listbox.js +3 -6
- package/_internal/number-field.js +2 -9
- package/_internal/number.js +2 -7
- package/_internal/pill.js +2 -6
- package/_internal/progress-bar.js +2 -5
- package/_internal/radio-group.js +2 -6
- package/_internal/radio.js +2 -6
- package/_internal/shared.js +2 -5
- package/_internal/shield.js +2 -6
- package/_internal/side-navigation-menu-bar.js +3 -9
- package/_internal/side-navigation-menu-item.js +2 -8
- package/_internal/side-navigation-menu.js +2 -8
- package/_internal/skeleton-circle.js +1 -6
- package/_internal/skeleton-text.js +2 -6
- package/_internal/skeleton.js +1 -7
- package/_internal/spinner.js +2 -5
- package/_internal/styles.js +235 -17
- package/_internal/styles2.js +44 -280
- package/_internal/switch-group.js +2 -6
- package/_internal/switch.js +2 -6
- package/_internal/text-area.js +2 -9
- package/_internal/text-field.js +2 -10
- package/_internal/text.js +2 -6
- package/_internal/theme.js +1 -3
- package/_internal/types.js +7 -31
- package/_internal/types2.js +18 -29
- package/_internal/types3.js +15 -18
- package/_internal/useAppSidePanel.js +331 -6
- package/_internal/useFocusOnList.js +502 -44
- package/_internal/useListboxItem.js +120 -23
- package/_internal/useSideNavigationMenuBar.js +371 -7
- package/_internal/useTheme.js +10 -8
- package/index.d.ts +4667 -0
- package/index.js +523 -1674
- package/package.json +2 -2
- package/_internal/SideNavigationMenuBar.js +0 -9
- package/_internal/helpers.js +0 -23
- package/_internal/types10.js +0 -20
- package/_internal/types11.js +0 -27
- package/_internal/types12.js +0 -35
- package/_internal/types13.js +0 -143
- package/_internal/types14.js +0 -11
- package/_internal/types15.js +0 -62
- package/_internal/types16.js +0 -56
- package/_internal/types17.js +0 -57
- package/_internal/types18.js +0 -40
- package/_internal/types19.js +0 -101
- package/_internal/types20.js +0 -47
- package/_internal/types21.js +0 -68
- package/_internal/types22.js +0 -52
- package/_internal/types23.js +0 -174
- package/_internal/types24.js +0 -18
- package/_internal/types25.js +0 -12
- package/_internal/types26.js +0 -36
- package/_internal/types27.js +0 -72
- package/_internal/types28.js +0 -73
- package/_internal/types29.js +0 -99
- package/_internal/types4.js +0 -67
- package/_internal/types5.js +0 -11
- package/_internal/types6.js +0 -11
- package/_internal/types7.js +0 -28
- package/_internal/types8.js +0 -72
- package/_internal/types9.js +0 -16
package/_internal/Number2.js
CHANGED
|
@@ -1,69 +1,111 @@
|
|
|
1
|
-
import { b as
|
|
2
|
-
import {
|
|
1
|
+
import { b as _objectWithoutProperties, _ as _objectSpread2, c as _extends } from './_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { S as StyledText } from './styles5.js';
|
|
6
|
+
import { u as useNumberFormatter } from './useNumberFormatter.js';
|
|
7
|
+
import { u as useTheme } from './useTheme.js';
|
|
3
8
|
|
|
4
|
-
interface NumberFormatOptions {
|
|
5
|
-
}
|
|
6
9
|
/**
|
|
7
|
-
* Component
|
|
10
|
+
* Component style.
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/** Only used when notation is 'compact'. */
|
|
15
|
-
compactDisplay?: 'short' | 'long';
|
|
16
|
-
/** The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as "USD" for the US dollar, "EUR" for the euro, or "CNY" for the Chinese RMB */
|
|
17
|
-
currency?: string;
|
|
18
|
-
/** How to display the currency in currency formatting. */
|
|
19
|
-
currencyDisplay?: 'symbol' | 'narrowSymbol' | 'code' | 'name';
|
|
20
|
-
/** In many locales, accounting format means to wrap the number with parentheses instead of appending a minus sign. */
|
|
21
|
-
currencySign?: 'standard' | 'accounting';
|
|
22
|
-
/** The locale matching algorithm to use. */
|
|
23
|
-
localeMatcher?: 'best fit' | 'lookup';
|
|
24
|
-
/** The formatting that should be displayed for the number. */
|
|
25
|
-
notation?: 'standard' | 'scientific' | 'engineering' | 'compact';
|
|
26
|
-
/** Overrides default numbering system for the current locale. */
|
|
27
|
-
numberingSystem?: string;
|
|
28
|
-
/** When to display the sign for the number. */
|
|
29
|
-
signDisplay?: 'auto' | 'always' | 'exceptZero' | 'never';
|
|
30
|
-
/** The unit to use in unit formatting. */
|
|
31
|
-
unit?: string;
|
|
32
|
-
/** The unit formatting style to use in unit formatting. */
|
|
33
|
-
unitDisplay?: 'long' | 'short' | 'narrow';
|
|
34
|
-
/** Whether to use grouping separators. */
|
|
35
|
-
useGrouping?: boolean;
|
|
36
|
-
/** Options for rounding modes. */
|
|
37
|
-
roundingMode?: 'ceil' | 'floor' | 'expand' | 'trunc' | 'halfCeil' | 'halfFloor' | 'halfExpand' | 'halfTrunc' | 'halfEven';
|
|
38
|
-
/** Specify how rounding conflicts will be resolved. */
|
|
39
|
-
roundingPriority?: 'auto' | 'morePrecision' | 'lessPrecision';
|
|
40
|
-
/** Specifies the rounding-increment precision. */
|
|
41
|
-
roundingIncrement?: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000;
|
|
42
|
-
/** A string expressing the strategy for displaying trailing zeros on whole numbers. */
|
|
43
|
-
trailingZeroDisplay?: 'auto' | 'stripIfInteger';
|
|
44
|
-
/** The minimum number of integer digits to use. A value with a smaller number of integer digits than this number will be left-padded with zeros (to the specified length) when formatted. */
|
|
45
|
-
minimumIntegerDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
46
|
-
/** The minimum number of fraction digits to use. */
|
|
47
|
-
minimumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
48
|
-
/** The maximum number of fraction digits to use. */
|
|
49
|
-
maximumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
50
|
-
/** The minimum number of significant digits to use. */
|
|
51
|
-
minimumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
52
|
-
/** The maximum number of significant digits to use. */
|
|
53
|
-
maximumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
54
|
-
}
|
|
55
|
-
type StyledNumberProps = Omit<NumberProps, 'as' | 'color' | 'fontFamily' | 'fontSize' | 'value' | 'variant'> & {
|
|
56
|
-
$color: NumberProps['color'];
|
|
57
|
-
$fontFamily: NumberProps['fontFamily'];
|
|
58
|
-
$fontSize: NumberProps['fontSize'];
|
|
59
|
-
$fontWeight: NumberProps['fontWeight'];
|
|
60
|
-
$variant: NumberProps['variant'];
|
|
61
|
-
$theme: NumberProps['theme'];
|
|
62
|
-
};
|
|
12
|
+
const StyledNumber = styled(StyledText)``;
|
|
13
|
+
|
|
14
|
+
const _excluded = ["as", "className", "color", "compactDisplay", "currency", "currencyDisplay", "currencySign", "fontSize", "fontFamily", "fontWeight", "lineHeight", "localeMatcher", "maximumFractionDigits", "maximumSignificantDigits", "minimumFractionDigits", "minimumIntegerDigits", "minimumSignificantDigits", "notation", "noWrap", "numberingSystem", "roundingIncrement", "roundingMode", "roundingPriority", "signDisplay", "theme", "trailingZeroDisplay", "type", "unit", "unitDisplay", "useGrouping", "value", "variant"];
|
|
15
|
+
const COMPONENT_NAME = 'Number';
|
|
16
|
+
const CLASSNAME = 'redsift-number';
|
|
63
17
|
|
|
64
18
|
/**
|
|
65
19
|
* The Number component.
|
|
66
20
|
*/
|
|
67
|
-
|
|
21
|
+
const Number = /*#__PURE__*/forwardRef((props, ref) => {
|
|
22
|
+
const {
|
|
23
|
+
as,
|
|
24
|
+
className,
|
|
25
|
+
color,
|
|
26
|
+
compactDisplay = 'short',
|
|
27
|
+
currency,
|
|
28
|
+
currencyDisplay = 'symbol',
|
|
29
|
+
currencySign = 'standard',
|
|
30
|
+
fontSize,
|
|
31
|
+
fontFamily,
|
|
32
|
+
fontWeight,
|
|
33
|
+
lineHeight,
|
|
34
|
+
localeMatcher = 'best fit',
|
|
35
|
+
maximumFractionDigits,
|
|
36
|
+
maximumSignificantDigits,
|
|
37
|
+
minimumFractionDigits,
|
|
38
|
+
minimumIntegerDigits,
|
|
39
|
+
minimumSignificantDigits,
|
|
40
|
+
notation = 'standard',
|
|
41
|
+
noWrap,
|
|
42
|
+
numberingSystem,
|
|
43
|
+
roundingIncrement,
|
|
44
|
+
roundingMode = 'halfExpand',
|
|
45
|
+
roundingPriority = 'auto',
|
|
46
|
+
signDisplay = 'auto',
|
|
47
|
+
theme: propsTheme,
|
|
48
|
+
trailingZeroDisplay = 'auto',
|
|
49
|
+
type = 'decimal',
|
|
50
|
+
unit,
|
|
51
|
+
unitDisplay = 'short',
|
|
52
|
+
useGrouping,
|
|
53
|
+
value,
|
|
54
|
+
variant
|
|
55
|
+
} = props,
|
|
56
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
57
|
+
const formatter = useNumberFormatter(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
58
|
+
compactDisplay,
|
|
59
|
+
currency,
|
|
60
|
+
currencyDisplay,
|
|
61
|
+
currencySign,
|
|
62
|
+
localeMatcher
|
|
63
|
+
}, maximumFractionDigits !== undefined && {
|
|
64
|
+
maximumFractionDigits
|
|
65
|
+
}), maximumSignificantDigits !== undefined && {
|
|
66
|
+
maximumSignificantDigits
|
|
67
|
+
}), minimumFractionDigits !== undefined && {
|
|
68
|
+
minimumFractionDigits
|
|
69
|
+
}), minimumIntegerDigits !== undefined && {
|
|
70
|
+
minimumIntegerDigits
|
|
71
|
+
}), minimumSignificantDigits !== undefined && {
|
|
72
|
+
minimumSignificantDigits
|
|
73
|
+
}), {}, {
|
|
74
|
+
notation,
|
|
75
|
+
numberingSystem,
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
roundingIncrement,
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
roundingMode,
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
roundingPriority,
|
|
82
|
+
signDisplay,
|
|
83
|
+
style: type,
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
trailingZeroDisplay,
|
|
86
|
+
unit,
|
|
87
|
+
unitDisplay,
|
|
88
|
+
useGrouping
|
|
89
|
+
}));
|
|
90
|
+
const theme = useTheme(propsTheme);
|
|
91
|
+
return /*#__PURE__*/React__default.createElement(StyledNumber, _extends({
|
|
92
|
+
as: as
|
|
93
|
+
}, forwardedProps, {
|
|
94
|
+
$as: as,
|
|
95
|
+
className: classNames(Number.className, className),
|
|
96
|
+
ref: ref,
|
|
97
|
+
$color: color,
|
|
98
|
+
$lineHeight: lineHeight,
|
|
99
|
+
$fontSize: fontSize,
|
|
100
|
+
$fontFamily: fontFamily,
|
|
101
|
+
$fontWeight: fontWeight,
|
|
102
|
+
$noWrap: noWrap,
|
|
103
|
+
$theme: theme,
|
|
104
|
+
$variant: variant
|
|
105
|
+
}), formatter.format(value));
|
|
106
|
+
});
|
|
107
|
+
Number.className = CLASSNAME;
|
|
108
|
+
Number.displayName = COMPONENT_NAME;
|
|
68
109
|
|
|
69
|
-
export {
|
|
110
|
+
export { Number as N };
|
|
111
|
+
//# sourceMappingURL=Number2.js.map
|