@vygruppen/spor-react 12.12.1 → 12.13.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/.turbo/turbo-build.log +12 -12
- package/.turbo/turbo-postinstall.log +1 -1
- package/CHANGELOG.md +10 -0
- package/dist/index.cjs +5 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.mjs +5 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/input/NumericStepper.tsx +4 -14
- package/src/theme/recipes/button.ts +1 -0
package/dist/index.d.cts
CHANGED
@@ -269,6 +269,7 @@ declare const buttonRecipe: _chakra_ui_react.RecipeDefinition<{
|
|
269
269
|
};
|
270
270
|
floating: {
|
271
271
|
color: "floating.text";
|
272
|
+
background: "floating.surface";
|
272
273
|
border: "sm";
|
273
274
|
borderColor: "floating.outline";
|
274
275
|
boxShadow: "0px 1px 3px 0px var(--spor-colors-surface-disabled, rgba(0, 0, 0, 0.10))";
|
@@ -1445,8 +1446,6 @@ type NumericStepperProps = FieldBaseProps & NumericStepperVariants & {
|
|
1445
1446
|
withInput?: boolean;
|
1446
1447
|
/** The amount to increase/decrease when pressing +/- */
|
1447
1448
|
stepSize?: number;
|
1448
|
-
/** Whether to show the number input when value is zero */
|
1449
|
-
showZero?: boolean;
|
1450
1449
|
/** Name added to the aria-label of subtract and add buttons. */
|
1451
1450
|
ariaLabelContext?: {
|
1452
1451
|
singular: string;
|
@@ -1496,8 +1495,6 @@ declare const NumericStepper: React__default.ForwardRefExoticComponent<FieldBase
|
|
1496
1495
|
withInput?: boolean;
|
1497
1496
|
/** The amount to increase/decrease when pressing +/- */
|
1498
1497
|
stepSize?: number;
|
1499
|
-
/** Whether to show the number input when value is zero */
|
1500
|
-
showZero?: boolean;
|
1501
1498
|
/** Name added to the aria-label of subtract and add buttons. */
|
1502
1499
|
ariaLabelContext?: {
|
1503
1500
|
singular: string;
|
package/dist/index.d.ts
CHANGED
@@ -269,6 +269,7 @@ declare const buttonRecipe: _chakra_ui_react.RecipeDefinition<{
|
|
269
269
|
};
|
270
270
|
floating: {
|
271
271
|
color: "floating.text";
|
272
|
+
background: "floating.surface";
|
272
273
|
border: "sm";
|
273
274
|
borderColor: "floating.outline";
|
274
275
|
boxShadow: "0px 1px 3px 0px var(--spor-colors-surface-disabled, rgba(0, 0, 0, 0.10))";
|
@@ -1445,8 +1446,6 @@ type NumericStepperProps = FieldBaseProps & NumericStepperVariants & {
|
|
1445
1446
|
withInput?: boolean;
|
1446
1447
|
/** The amount to increase/decrease when pressing +/- */
|
1447
1448
|
stepSize?: number;
|
1448
|
-
/** Whether to show the number input when value is zero */
|
1449
|
-
showZero?: boolean;
|
1450
1449
|
/** Name added to the aria-label of subtract and add buttons. */
|
1451
1450
|
ariaLabelContext?: {
|
1452
1451
|
singular: string;
|
@@ -1496,8 +1495,6 @@ declare const NumericStepper: React__default.ForwardRefExoticComponent<FieldBase
|
|
1496
1495
|
withInput?: boolean;
|
1497
1496
|
/** The amount to increase/decrease when pressing +/- */
|
1498
1497
|
stepSize?: number;
|
1499
|
-
/** Whether to show the number input when value is zero */
|
1500
|
-
showZero?: boolean;
|
1501
1498
|
/** Name added to the aria-label of subtract and add buttons. */
|
1502
1499
|
ariaLabelContext?: {
|
1503
1500
|
singular: string;
|
package/dist/index.mjs
CHANGED
@@ -3028,7 +3028,6 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3028
3028
|
disabled,
|
3029
3029
|
withInput = true,
|
3030
3030
|
stepSize = 1,
|
3031
|
-
showZero = false,
|
3032
3031
|
ariaLabelContext = { singular: "", plural: "" },
|
3033
3032
|
...rest
|
3034
3033
|
} = props;
|
@@ -3063,8 +3062,7 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3063
3062
|
focusOnAddButton();
|
3064
3063
|
}
|
3065
3064
|
},
|
3066
|
-
|
3067
|
-
disabled,
|
3065
|
+
disabled: disabled || value <= minValue,
|
3068
3066
|
id: value <= minValue ? void 0 : idProp
|
3069
3067
|
}
|
3070
3068
|
),
|
@@ -3076,10 +3074,9 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3076
3074
|
name: nameProp,
|
3077
3075
|
value,
|
3078
3076
|
disabled,
|
3079
|
-
id:
|
3077
|
+
id: value === 0 ? void 0 : idProp,
|
3080
3078
|
css: styles.input,
|
3081
3079
|
width: `${Math.max(value.toString().length + 1, 3)}ch`,
|
3082
|
-
visibility: !showZero && value === 0 ? "hidden" : "visible",
|
3083
3080
|
"aria-live": "assertive",
|
3084
3081
|
"aria-label": ariaLabelContext.plural === "" ? "" : t(texts13.currentNumberAriaLabel(ariaLabelContext.plural)),
|
3085
3082
|
onChange: (e) => {
|
@@ -3088,7 +3085,7 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3088
3085
|
return;
|
3089
3086
|
}
|
3090
3087
|
onChange(Math.max(Math.min(numericInput, maxValue), minValue));
|
3091
|
-
if (
|
3088
|
+
if (Math.max(Math.min(numericInput, maxValue), minValue) === 0) {
|
3092
3089
|
focusOnAddButton();
|
3093
3090
|
}
|
3094
3091
|
}
|
@@ -3096,7 +3093,6 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3096
3093
|
) : /* @__PURE__ */ jsx(
|
3097
3094
|
Text3,
|
3098
3095
|
{
|
3099
|
-
visibility: !showZero && value === 0 ? "hidden" : "visible",
|
3100
3096
|
"aria-live": "assertive",
|
3101
3097
|
paddingX: "0.95rem",
|
3102
3098
|
"aria-label": ariaLabelContext.plural === "" ? "" : t(texts13.currentNumberAriaLabel(ariaLabelContext.plural)),
|
@@ -3115,8 +3111,7 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3115
3111
|
)
|
3116
3112
|
),
|
3117
3113
|
onClick: () => onChange(Math.min(value + clampedStepSize, maxValue)),
|
3118
|
-
|
3119
|
-
disabled,
|
3114
|
+
disabled: disabled || value >= maxValue,
|
3120
3115
|
id: value >= maxValue ? void 0 : idProp
|
3121
3116
|
}
|
3122
3117
|
)
|
@@ -5498,6 +5493,7 @@ var buttonRecipe = defineRecipe({
|
|
5498
5493
|
},
|
5499
5494
|
floating: {
|
5500
5495
|
color: "floating.text",
|
5496
|
+
background: "floating.surface",
|
5501
5497
|
border: "sm",
|
5502
5498
|
borderColor: "floating.outline",
|
5503
5499
|
boxShadow: "0px 1px 3px 0px var(--spor-colors-surface-disabled, rgba(0, 0, 0, 0.10))",
|