@vygruppen/spor-react 12.12.0 → 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 +16 -0
- package/dist/index.cjs +7 -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 +7 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/input/Input.tsx +2 -0
- 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
@@ -2793,6 +2793,7 @@ var Input = forwardRef(
|
|
2793
2793
|
helperText,
|
2794
2794
|
errorText,
|
2795
2795
|
required,
|
2796
|
+
hidden,
|
2796
2797
|
...props
|
2797
2798
|
}, ref) => {
|
2798
2799
|
const recipe = useRecipe({ key: "input" });
|
@@ -2804,6 +2805,7 @@ var Input = forwardRef(
|
|
2804
2805
|
invalid,
|
2805
2806
|
helperText,
|
2806
2807
|
required,
|
2808
|
+
hidden,
|
2807
2809
|
errorText,
|
2808
2810
|
id: props.id,
|
2809
2811
|
label: (
|
@@ -3026,7 +3028,6 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3026
3028
|
disabled,
|
3027
3029
|
withInput = true,
|
3028
3030
|
stepSize = 1,
|
3029
|
-
showZero = false,
|
3030
3031
|
ariaLabelContext = { singular: "", plural: "" },
|
3031
3032
|
...rest
|
3032
3033
|
} = props;
|
@@ -3061,8 +3062,7 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3061
3062
|
focusOnAddButton();
|
3062
3063
|
}
|
3063
3064
|
},
|
3064
|
-
|
3065
|
-
disabled,
|
3065
|
+
disabled: disabled || value <= minValue,
|
3066
3066
|
id: value <= minValue ? void 0 : idProp
|
3067
3067
|
}
|
3068
3068
|
),
|
@@ -3074,10 +3074,9 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3074
3074
|
name: nameProp,
|
3075
3075
|
value,
|
3076
3076
|
disabled,
|
3077
|
-
id:
|
3077
|
+
id: value === 0 ? void 0 : idProp,
|
3078
3078
|
css: styles.input,
|
3079
3079
|
width: `${Math.max(value.toString().length + 1, 3)}ch`,
|
3080
|
-
visibility: !showZero && value === 0 ? "hidden" : "visible",
|
3081
3080
|
"aria-live": "assertive",
|
3082
3081
|
"aria-label": ariaLabelContext.plural === "" ? "" : t(texts13.currentNumberAriaLabel(ariaLabelContext.plural)),
|
3083
3082
|
onChange: (e) => {
|
@@ -3086,7 +3085,7 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3086
3085
|
return;
|
3087
3086
|
}
|
3088
3087
|
onChange(Math.max(Math.min(numericInput, maxValue), minValue));
|
3089
|
-
if (
|
3088
|
+
if (Math.max(Math.min(numericInput, maxValue), minValue) === 0) {
|
3090
3089
|
focusOnAddButton();
|
3091
3090
|
}
|
3092
3091
|
}
|
@@ -3094,7 +3093,6 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3094
3093
|
) : /* @__PURE__ */ jsx(
|
3095
3094
|
Text3,
|
3096
3095
|
{
|
3097
|
-
visibility: !showZero && value === 0 ? "hidden" : "visible",
|
3098
3096
|
"aria-live": "assertive",
|
3099
3097
|
paddingX: "0.95rem",
|
3100
3098
|
"aria-label": ariaLabelContext.plural === "" ? "" : t(texts13.currentNumberAriaLabel(ariaLabelContext.plural)),
|
@@ -3113,8 +3111,7 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
|
|
3113
3111
|
)
|
3114
3112
|
),
|
3115
3113
|
onClick: () => onChange(Math.min(value + clampedStepSize, maxValue)),
|
3116
|
-
|
3117
|
-
disabled,
|
3114
|
+
disabled: disabled || value >= maxValue,
|
3118
3115
|
id: value >= maxValue ? void 0 : idProp
|
3119
3116
|
}
|
3120
3117
|
)
|
@@ -5496,6 +5493,7 @@ var buttonRecipe = defineRecipe({
|
|
5496
5493
|
},
|
5497
5494
|
floating: {
|
5498
5495
|
color: "floating.text",
|
5496
|
+
background: "floating.surface",
|
5499
5497
|
border: "sm",
|
5500
5498
|
borderColor: "floating.outline",
|
5501
5499
|
boxShadow: "0px 1px 3px 0px var(--spor-colors-surface-disabled, rgba(0, 0, 0, 0.10))",
|