@trading-game/design-intelligence-layer 0.9.4 → 0.9.5
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/index.cjs +12 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/guides/design-system-guide/trading-game-ds-guide.md +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6015,6 +6015,11 @@ function getDecimalPlaces(n) {
|
|
|
6015
6015
|
function formatValue(value, decimalPlaces) {
|
|
6016
6016
|
return decimalPlaces > 0 ? value.toFixed(decimalPlaces) : String(value);
|
|
6017
6017
|
}
|
|
6018
|
+
var stepperSizeConfig = {
|
|
6019
|
+
sm: { container: "h-8", buttonSize: "icon-xs", iconClass: "size-3" },
|
|
6020
|
+
md: { container: "h-9", buttonSize: "icon-xs", iconClass: "size-3.5" },
|
|
6021
|
+
lg: { container: "h-11", buttonSize: "icon-sm", iconClass: "size-4" }
|
|
6022
|
+
};
|
|
6018
6023
|
function Stepper({
|
|
6019
6024
|
value: controlledValue,
|
|
6020
6025
|
defaultValue = 0,
|
|
@@ -6022,6 +6027,7 @@ function Stepper({
|
|
|
6022
6027
|
min = -Infinity,
|
|
6023
6028
|
max = Infinity,
|
|
6024
6029
|
step = 1,
|
|
6030
|
+
size = "md",
|
|
6025
6031
|
disabled,
|
|
6026
6032
|
placeholder,
|
|
6027
6033
|
className,
|
|
@@ -6029,6 +6035,7 @@ function Stepper({
|
|
|
6029
6035
|
name,
|
|
6030
6036
|
"aria-label": ariaLabel
|
|
6031
6037
|
}) {
|
|
6038
|
+
const { container, buttonSize, iconClass } = stepperSizeConfig[size];
|
|
6032
6039
|
const isControlled = controlledValue !== void 0;
|
|
6033
6040
|
const [internalValue, setInternalValue] = React10.useState(
|
|
6034
6041
|
clamp(defaultValue, min, max)
|
|
@@ -6094,17 +6101,17 @@ function Stepper({
|
|
|
6094
6101
|
{
|
|
6095
6102
|
"data-slot": "stepper",
|
|
6096
6103
|
"data-disabled": disabled || void 0,
|
|
6097
|
-
className: cn("w-32", className),
|
|
6104
|
+
className: cn("w-32", container, className),
|
|
6098
6105
|
children: [
|
|
6099
6106
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(InputGroupAddon, { align: "inline-start", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6100
6107
|
InputGroupButton,
|
|
6101
6108
|
{
|
|
6102
|
-
size:
|
|
6109
|
+
size: buttonSize,
|
|
6103
6110
|
variant: "secondary",
|
|
6104
6111
|
onClick: handleDecrement,
|
|
6105
6112
|
disabled: disabled || currentValue <= min,
|
|
6106
6113
|
"aria-label": "Decrease value",
|
|
6107
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react22.Minus, { className:
|
|
6114
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react22.Minus, { className: iconClass })
|
|
6108
6115
|
}
|
|
6109
6116
|
) }),
|
|
6110
6117
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
@@ -6134,12 +6141,12 @@ function Stepper({
|
|
|
6134
6141
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6135
6142
|
InputGroupButton,
|
|
6136
6143
|
{
|
|
6137
|
-
size:
|
|
6144
|
+
size: buttonSize,
|
|
6138
6145
|
variant: "secondary",
|
|
6139
6146
|
onClick: handleIncrement,
|
|
6140
6147
|
disabled: disabled || currentValue >= max,
|
|
6141
6148
|
"aria-label": "Increase value",
|
|
6142
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react22.Plus, { className:
|
|
6149
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react22.Plus, { className: iconClass })
|
|
6143
6150
|
}
|
|
6144
6151
|
)
|
|
6145
6152
|
] })
|