@spark-ui/components 10.17.13 → 10.18.1
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/Input-g0LpWuv0.d.mts +17 -0
- package/dist/Input-g0LpWuv0.d.ts +17 -0
- package/dist/{Input-N8AWWSmt.d.mts → InputTrailingIcon-CZD9hydv.d.ts} +14 -10
- package/dist/{Input-N8AWWSmt.d.ts → InputTrailingIcon-DzmwLGtX.d.mts} +14 -10
- package/dist/docgen.json +285 -915
- package/dist/input/index.d.mts +3 -4
- package/dist/input/index.d.ts +3 -4
- package/dist/stepper/index.d.mts +51 -54
- package/dist/stepper/index.d.ts +51 -54
- package/dist/stepper/index.js +115 -1679
- package/dist/stepper/index.js.map +1 -1
- package/dist/stepper/index.mjs +137 -201
- package/dist/stepper/index.mjs.map +1 -1
- package/dist/textarea/index.d.mts +2 -2
- package/dist/textarea/index.d.ts +2 -2
- package/package.json +5 -7
- package/dist/InputTrailingIcon-BBp7sE6D.d.mts +0 -20
- package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +0 -20
package/dist/stepper/index.mjs
CHANGED
|
@@ -1,230 +1,166 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Input,
|
|
3
|
-
InputGroup
|
|
4
|
-
} from "../chunk-QAUHPTZ2.mjs";
|
|
5
|
-
import {
|
|
6
|
-
IconButton
|
|
7
|
-
} from "../chunk-XYK6V3JF.mjs";
|
|
8
1
|
import {
|
|
9
2
|
Icon
|
|
10
3
|
} from "../chunk-UMUMFMFB.mjs";
|
|
11
|
-
import "../chunk-HEKSVWYW.mjs";
|
|
12
|
-
import "../chunk-GAK4SC2F.mjs";
|
|
13
4
|
import "../chunk-KEGAAGJW.mjs";
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import { useFormFieldControl } from "@spark-ui/components/form-field";
|
|
18
|
-
import { createContext, useContext, useRef } from "react";
|
|
5
|
+
import {
|
|
6
|
+
Slot
|
|
7
|
+
} from "../chunk-6QCEPQ3U.mjs";
|
|
19
8
|
|
|
20
|
-
// src/stepper/
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
locale = "fr",
|
|
26
|
-
...rest
|
|
27
|
-
}) => {
|
|
28
|
-
const state = useNumberFieldState({
|
|
29
|
-
...rest,
|
|
30
|
-
isDisabled: rest.disabled,
|
|
31
|
-
isReadOnly: rest.readOnly,
|
|
32
|
-
isRequired: rest.required,
|
|
33
|
-
locale
|
|
34
|
-
});
|
|
35
|
-
const { groupProps, inputProps, incrementButtonProps, decrementButtonProps } = useNumberField(
|
|
36
|
-
{
|
|
37
|
-
isWheelDisabled: false,
|
|
38
|
-
...rest,
|
|
39
|
-
isDisabled: rest.disabled,
|
|
40
|
-
isReadOnly: rest.readOnly,
|
|
41
|
-
isRequired: rest.required
|
|
42
|
-
},
|
|
43
|
-
state,
|
|
44
|
-
inputRef
|
|
45
|
-
);
|
|
46
|
-
return {
|
|
47
|
-
groupProps,
|
|
48
|
-
inputProps,
|
|
49
|
-
incrementButtonProps,
|
|
50
|
-
decrementButtonProps
|
|
51
|
-
};
|
|
52
|
-
};
|
|
9
|
+
// src/stepper/Buttons.tsx
|
|
10
|
+
import { NumberField } from "@base-ui-components/react/number-field";
|
|
11
|
+
import { Minus } from "@spark-ui/icons/Minus";
|
|
12
|
+
import { Plus } from "@spark-ui/icons/Plus";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
53
14
|
|
|
54
|
-
// src/stepper/
|
|
15
|
+
// src/stepper/useRenderSlot.tsx
|
|
55
16
|
import { jsx } from "react/jsx-runtime";
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
minValue,
|
|
84
|
-
maxValue,
|
|
85
|
-
inputRef
|
|
86
|
-
});
|
|
87
|
-
const formFieldControlProps = useFormFieldControl();
|
|
88
|
-
const isWrappedInFormField = !!formFieldControlProps.id;
|
|
89
|
-
const incrementButtonProps = {
|
|
90
|
-
..._incrementButtonProps,
|
|
91
|
-
...isWrappedInFormField && { "aria-controls": formFieldControlProps.id }
|
|
92
|
-
};
|
|
93
|
-
const decrementButtonProps = {
|
|
94
|
-
..._decrementButtonProps,
|
|
95
|
-
...isWrappedInFormField && { "aria-controls": formFieldControlProps.id }
|
|
96
|
-
};
|
|
97
|
-
const inputProps = {
|
|
98
|
-
..._inputProps,
|
|
99
|
-
...isWrappedInFormField && {
|
|
100
|
-
id: formFieldControlProps.id,
|
|
101
|
-
required: formFieldControlProps.isRequired,
|
|
102
|
-
"aria-invalid": formFieldControlProps.isInvalid ? true : void 0
|
|
17
|
+
function useRenderSlot(asChild, defaultTag) {
|
|
18
|
+
const Component = asChild ? Slot : defaultTag;
|
|
19
|
+
return asChild ? ({ ...props }) => /* @__PURE__ */ jsx(Component, { ...props }) : void 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// src/stepper/Buttons.tsx
|
|
23
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
24
|
+
var styles = cva(
|
|
25
|
+
[
|
|
26
|
+
// Base styles
|
|
27
|
+
"border-outline border-sm min-w-sz-44 text-on-surface flex cursor-pointer items-center justify-center bg-clip-padding select-none",
|
|
28
|
+
"hover:bg-neutral/dim-5",
|
|
29
|
+
// Disabled and ReadOnly styles
|
|
30
|
+
"disabled:bg-on-surface/dim-5 disabled:text-on-surface/dim-3 disabled:cursor-not-allowed",
|
|
31
|
+
"data-[disabled]:bg-on-surface/dim-5 data-[disabled]:text-on-surface/dim-3 data-[disabled]:cursor-not-allowed",
|
|
32
|
+
"data-[readonly]:bg-on-surface/dim-5 data-[readonly]:text-on-surface/dim-3 data-[readonly]:cursor-not-allowed",
|
|
33
|
+
// State styles
|
|
34
|
+
"group-data-[field-state=error]:border-error",
|
|
35
|
+
"group-data-[field-state=alert]:border-alert",
|
|
36
|
+
"group-data-[field-state=success]:border-success"
|
|
37
|
+
],
|
|
38
|
+
{
|
|
39
|
+
variants: {
|
|
40
|
+
placement: {
|
|
41
|
+
left: "rounded-l-lg",
|
|
42
|
+
right: "rounded-r-lg"
|
|
43
|
+
}
|
|
103
44
|
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
var Decrement = ({ children, className, asChild = false, ...props }) => {
|
|
48
|
+
const render = useRenderSlot(asChild, "div");
|
|
49
|
+
return /* @__PURE__ */ jsx2(
|
|
50
|
+
NumberField.Decrement,
|
|
108
51
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
children
|
|
118
|
-
}
|
|
119
|
-
)
|
|
52
|
+
"data-spark-component": "stepper-decrement-button",
|
|
53
|
+
className: styles({
|
|
54
|
+
placement: "left",
|
|
55
|
+
className
|
|
56
|
+
}),
|
|
57
|
+
render,
|
|
58
|
+
...props,
|
|
59
|
+
children: children || /* @__PURE__ */ jsx2(Icon, { children: /* @__PURE__ */ jsx2(Minus, {}) })
|
|
120
60
|
}
|
|
121
61
|
);
|
|
122
62
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
throw Error("useStepperContext must be used within a Stepper provider");
|
|
128
|
-
}
|
|
129
|
-
return context;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
// src/stepper/StepperButton.tsx
|
|
133
|
-
import { useButton } from "@react-aria/button";
|
|
134
|
-
import { Minus } from "@spark-ui/icons/Minus";
|
|
135
|
-
import { Plus } from "@spark-ui/icons/Plus";
|
|
136
|
-
import { useRef as useRef2 } from "react";
|
|
137
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
138
|
-
var IncrementButton = ({
|
|
139
|
-
children,
|
|
140
|
-
design = "ghost",
|
|
141
|
-
intent = "neutral",
|
|
142
|
-
className,
|
|
143
|
-
ref: forwardedRef,
|
|
144
|
-
...rest
|
|
145
|
-
}) => {
|
|
146
|
-
const innerRef = useRef2(null);
|
|
147
|
-
const ref = forwardedRef && typeof forwardedRef !== "function" ? forwardedRef : innerRef;
|
|
148
|
-
const { incrementButtonProps } = useStepperContext();
|
|
149
|
-
const { buttonProps } = useButton({ ...incrementButtonProps, ...rest }, ref);
|
|
150
|
-
return /* @__PURE__ */ jsx2(InputGroup.TrailingAddon, { asChild: true, "data-spark-component": "stepper-increment-button", children: /* @__PURE__ */ jsx2(
|
|
151
|
-
IconButton,
|
|
63
|
+
var Increment = ({ children, className, asChild = false, ...props }) => {
|
|
64
|
+
const render = useRenderSlot(asChild, "div");
|
|
65
|
+
return /* @__PURE__ */ jsx2(
|
|
66
|
+
NumberField.Increment,
|
|
152
67
|
{
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
68
|
+
"data-spark-component": "stepper-increment-button",
|
|
69
|
+
className: styles({
|
|
70
|
+
placement: "right",
|
|
71
|
+
className
|
|
72
|
+
}),
|
|
73
|
+
render,
|
|
74
|
+
...props,
|
|
160
75
|
children: children || /* @__PURE__ */ jsx2(Icon, { children: /* @__PURE__ */ jsx2(Plus, {}) })
|
|
161
76
|
}
|
|
162
|
-
)
|
|
77
|
+
);
|
|
163
78
|
};
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return /* @__PURE__ */ jsx2(InputGroup.LeadingAddon, { asChild: true, "data-spark-component": "stepper-decrement-button", children: /* @__PURE__ */ jsx2(
|
|
177
|
-
IconButton,
|
|
79
|
+
Decrement.displayName = "Stepper.DecrementButton";
|
|
80
|
+
Increment.displayName = "Stepper.IncrementButton";
|
|
81
|
+
|
|
82
|
+
// src/stepper/Input.tsx
|
|
83
|
+
import { NumberField as NumberField2 } from "@base-ui-components/react/number-field";
|
|
84
|
+
import { useFormFieldControl } from "@spark-ui/components/form-field";
|
|
85
|
+
import { cx } from "class-variance-authority";
|
|
86
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
87
|
+
var Input = ({ className, ...props }) => {
|
|
88
|
+
const field = useFormFieldControl();
|
|
89
|
+
return /* @__PURE__ */ jsx3(
|
|
90
|
+
NumberField2.Input,
|
|
178
91
|
{
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
92
|
+
"data-spark-component": "stepper-input",
|
|
93
|
+
className: cx(
|
|
94
|
+
// Base styles
|
|
95
|
+
"bg-surface text-on-surface h-sz-44 border-y-sm border-outline text-center",
|
|
96
|
+
"first:border-l-sm first:rounded-l-lg",
|
|
97
|
+
"last:border-r-sm last:rounded-r-lg",
|
|
98
|
+
// State styles
|
|
99
|
+
"group-data-[field-state=error]:border-error",
|
|
100
|
+
"group-data-[field-state=alert]:border-alert",
|
|
101
|
+
"group-data-[field-state=success]:border-success",
|
|
102
|
+
"",
|
|
103
|
+
// Disabled and ReadOnly styles
|
|
104
|
+
"data-[disabled]:bg-on-surface/dim-5 data-[disabled]:text-on-surface/dim-3 data-[disabled]:cursor-not-allowed",
|
|
105
|
+
"data-[readonly]:bg-on-surface/dim-5",
|
|
106
|
+
// Focus styles
|
|
107
|
+
"focus:outline-outline-high focus:z-raised focus:outline-2 focus:-outline-offset-1",
|
|
108
|
+
className
|
|
109
|
+
),
|
|
110
|
+
...field.description && { "aria-describedby": field.description },
|
|
111
|
+
...field.isRequired && { required: true },
|
|
112
|
+
...field.state === "error" && { "aria-invalid": true },
|
|
113
|
+
...props
|
|
187
114
|
}
|
|
188
|
-
)
|
|
115
|
+
);
|
|
189
116
|
};
|
|
190
|
-
|
|
191
|
-
id: "TrailingAddon"
|
|
192
|
-
});
|
|
193
|
-
var StepperDecrementButton = Object.assign(DecrementButton, {
|
|
194
|
-
id: "LeadingAddon"
|
|
195
|
-
});
|
|
196
|
-
IncrementButton.displayName = "Stepper.DecrementButton";
|
|
197
|
-
DecrementButton.displayName = "Stepper.DecrementButton";
|
|
117
|
+
Input.displayName = "Stepper.InputButton";
|
|
198
118
|
|
|
199
|
-
// src/stepper/
|
|
200
|
-
import {
|
|
201
|
-
import {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
119
|
+
// src/stepper/Root.tsx
|
|
120
|
+
import { NumberField as NumberField3 } from "@base-ui-components/react/number-field";
|
|
121
|
+
import { useFormFieldControl as useFormFieldControl2 } from "@spark-ui/components/form-field";
|
|
122
|
+
import { cx as cx2 } from "class-variance-authority";
|
|
123
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
124
|
+
var Root = ({
|
|
125
|
+
children,
|
|
126
|
+
allowWheelScrub = true,
|
|
127
|
+
state: stateProp,
|
|
128
|
+
minValue,
|
|
129
|
+
maxValue,
|
|
130
|
+
formatOptions,
|
|
131
|
+
step: stepProp,
|
|
132
|
+
className,
|
|
133
|
+
...props
|
|
134
|
+
}) => {
|
|
135
|
+
const render = useRenderSlot(true, "div");
|
|
136
|
+
const field = useFormFieldControl2();
|
|
137
|
+
const state = field.state ?? stateProp;
|
|
138
|
+
const step = stepProp == null && formatOptions?.style === "percent" ? 0.01 : stepProp;
|
|
139
|
+
return /* @__PURE__ */ jsx4(
|
|
140
|
+
NumberField3.Root,
|
|
208
141
|
{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
142
|
+
"data-spark-component": "stepper",
|
|
143
|
+
allowWheelScrub,
|
|
144
|
+
render,
|
|
145
|
+
min: minValue,
|
|
146
|
+
max: maxValue,
|
|
147
|
+
format: formatOptions,
|
|
148
|
+
step,
|
|
149
|
+
...field.id && { id: field.id },
|
|
150
|
+
...props,
|
|
151
|
+
children: /* @__PURE__ */ jsx4(NumberField3.Group, { className: cx2("group flex", className), "data-field-state": state, children })
|
|
213
152
|
}
|
|
214
153
|
);
|
|
215
154
|
};
|
|
216
|
-
|
|
217
|
-
id: "Input"
|
|
218
|
-
});
|
|
219
|
-
Input2.displayName = "Stepper.Input";
|
|
155
|
+
Root.displayName = "Stepper";
|
|
220
156
|
|
|
221
157
|
// src/stepper/index.ts
|
|
222
|
-
var
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
158
|
+
var Stepper = Object.assign(Root, { IncrementButton: Increment, DecrementButton: Decrement, Input });
|
|
159
|
+
Stepper.displayName = "Stepper";
|
|
160
|
+
Increment.displayName = "Stepper.IncrementButton";
|
|
161
|
+
Decrement.displayName = "Stepper.DecrementButton";
|
|
162
|
+
Input.displayName = "Stepper.Input";
|
|
227
163
|
export {
|
|
228
|
-
|
|
164
|
+
Stepper
|
|
229
165
|
};
|
|
230
166
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/stepper/Stepper.tsx","../../src/stepper/useStepper.ts","../../src/stepper/StepperButton.tsx","../../src/stepper/StepperInput.tsx","../../src/stepper/index.ts"],"sourcesContent":["import { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { createContext, type PropsWithChildren, RefObject, useContext, useRef } from 'react'\n\nimport { InputGroup } from '../input'\nimport type { StepperProps, UseStepperReturn } from './types'\nimport { useStepper } from './useStepper'\n\nconst StepperContext = createContext<\n (Omit<UseStepperReturn, 'groupProps'> & { inputRef: RefObject<HTMLInputElement | null> }) | null\n>(null)\n\nexport const Stepper = ({\n children,\n formatOptions,\n minValue,\n maxValue,\n ref: forwardedRef,\n ...stepperProps\n}: PropsWithChildren<StepperProps>) => {\n const inputRef = useRef<HTMLInputElement>(null)\n\n const {\n groupProps,\n inputProps: _inputProps,\n incrementButtonProps: _incrementButtonProps,\n decrementButtonProps: _decrementButtonProps,\n } = useStepper({\n ...{\n ...stepperProps,\n /**\n * To enable the possibility to init the stepper with empty (undefined) value,\n * we need to force the empty value to NaN.\n * Cf. https://github.com/adobe/react-spectrum/issues/5524\n */\n ...('value' in stepperProps && { value: stepperProps.value ?? NaN }),\n onChange: stepperProps.onValueChange,\n },\n formatOptions,\n minValue,\n maxValue,\n inputRef,\n })\n\n const formFieldControlProps = useFormFieldControl()\n const isWrappedInFormField = !!formFieldControlProps.id\n\n const incrementButtonProps = {\n ..._incrementButtonProps,\n ...(isWrappedInFormField && { 'aria-controls': formFieldControlProps.id }),\n }\n\n const decrementButtonProps = {\n ..._decrementButtonProps,\n ...(isWrappedInFormField && { 'aria-controls': formFieldControlProps.id }),\n }\n\n const inputProps = {\n ..._inputProps,\n ...(isWrappedInFormField && {\n id: formFieldControlProps.id,\n required: formFieldControlProps.isRequired,\n 'aria-invalid': formFieldControlProps.isInvalid ? true : undefined,\n }),\n }\n\n const { onValueChange: _, ...remainingStepperProps } = stepperProps\n\n return (\n <StepperContext.Provider\n value={{ incrementButtonProps, decrementButtonProps, inputProps, inputRef }}\n >\n <InputGroup\n {...remainingStepperProps}\n {...groupProps}\n data-spark-component=\"stepper\"\n ref={forwardedRef}\n >\n {children}\n </InputGroup>\n </StepperContext.Provider>\n )\n}\n\nStepper.displayName = 'Stepper'\n\nexport const useStepperContext = () => {\n const context = useContext(StepperContext)\n\n if (!context) {\n throw Error('useStepperContext must be used within a Stepper provider')\n }\n\n return context\n}\n","import { useNumberField } from '@react-aria/numberfield'\nimport { useNumberFieldState } from '@react-stately/numberfield'\n\nimport type { UseStepperArgs, UseStepperReturn } from './types'\n\nexport const useStepper = ({\n inputRef,\n locale = 'fr',\n ...rest\n}: UseStepperArgs): UseStepperReturn => {\n const state = useNumberFieldState({\n ...rest,\n isDisabled: rest.disabled,\n isReadOnly: rest.readOnly,\n isRequired: rest.required,\n locale,\n })\n\n const { groupProps, inputProps, incrementButtonProps, decrementButtonProps } = useNumberField(\n {\n isWheelDisabled: false,\n ...rest,\n isDisabled: rest.disabled,\n isReadOnly: rest.readOnly,\n isRequired: rest.required,\n },\n state,\n inputRef\n )\n\n return {\n groupProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n }\n}\n","import { useButton } from '@react-aria/button'\nimport { Minus } from '@spark-ui/icons/Minus'\nimport { Plus } from '@spark-ui/icons/Plus'\nimport { type PropsWithChildren, useRef } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { InputGroup } from '../input'\nimport { useStepperContext } from './Stepper'\nimport type { StepperButtonProps } from './types'\n\nconst IncrementButton = ({\n children,\n design = 'ghost',\n intent = 'neutral',\n className,\n ref: forwardedRef,\n ...rest\n}: PropsWithChildren<StepperButtonProps>) => {\n const innerRef = useRef<HTMLButtonElement>(null)\n const ref = forwardedRef && typeof forwardedRef !== 'function' ? forwardedRef : innerRef\n\n const { incrementButtonProps } = useStepperContext()\n const { buttonProps } = useButton({ ...incrementButtonProps, ...rest }, ref)\n\n return (\n <InputGroup.TrailingAddon asChild data-spark-component=\"stepper-increment-button\">\n <IconButton\n ref={ref}\n design={design}\n intent={intent}\n className={className}\n aria-label={buttonProps['aria-label'] as string}\n {...buttonProps}\n disabled={rest.disabled || buttonProps.disabled}\n >\n {children || (\n <Icon>\n <Plus />\n </Icon>\n )}\n </IconButton>\n </InputGroup.TrailingAddon>\n )\n}\n\nconst DecrementButton = ({\n children,\n design = 'ghost',\n intent = 'neutral',\n className,\n ref: forwardedRef,\n ...rest\n}: PropsWithChildren<StepperButtonProps>) => {\n const innerRef = useRef<HTMLButtonElement>(null)\n const ref = forwardedRef && typeof forwardedRef !== 'function' ? forwardedRef : innerRef\n\n const { decrementButtonProps } = useStepperContext()\n const { buttonProps } = useButton({ ...decrementButtonProps, ...rest }, ref)\n\n return (\n <InputGroup.LeadingAddon asChild data-spark-component=\"stepper-decrement-button\">\n <IconButton\n ref={ref}\n design={design}\n intent={intent}\n className={className}\n aria-label={buttonProps['aria-label'] as string}\n {...buttonProps}\n disabled={rest.disabled || buttonProps.disabled}\n >\n {children || (\n <Icon>\n <Minus />\n </Icon>\n )}\n </IconButton>\n </InputGroup.LeadingAddon>\n )\n}\n\nexport const StepperIncrementButton = Object.assign(IncrementButton, {\n id: 'TrailingAddon',\n})\n\nexport const StepperDecrementButton = Object.assign(DecrementButton, {\n id: 'LeadingAddon',\n})\n\nIncrementButton.displayName = 'Stepper.DecrementButton'\nDecrementButton.displayName = 'Stepper.DecrementButton'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\n\nimport { Input as SparkInput } from '../input'\nimport { useStepperContext } from './Stepper'\nimport type { StepperInputProps } from './types'\n\nconst Input = ({ ref: forwardedRef, ...props }: StepperInputProps) => {\n const { inputRef, inputProps } = useStepperContext()\n const ref = useMergeRefs(forwardedRef, inputRef)\n const { className = '', ...remainingProps } = props\n\n return (\n <SparkInput\n ref={ref}\n {...remainingProps}\n {...inputProps}\n className={`min-w-sz-56 text-center ${className}`}\n />\n )\n}\n\nexport const StepperInput = Object.assign(Input, {\n id: 'Input',\n})\n\nInput.displayName = 'Stepper.Input'\n","import { Stepper as Root } from './Stepper'\nimport {\n StepperDecrementButton as DecrementButton,\n StepperIncrementButton as IncrementButton,\n} from './StepperButton'\nimport { StepperInput as Input } from './StepperInput'\n\nexport const Stepper: typeof Root & {\n IncrementButton: typeof IncrementButton\n DecrementButton: typeof DecrementButton\n Input: typeof Input\n} = Object.assign(Root, { IncrementButton, DecrementButton, Input })\n\nStepper.displayName = 'Stepper'\nIncrementButton.displayName = 'Stepper.IncrementButton'\nDecrementButton.displayName = 'Stepper.DecrementButton'\nInput.displayName = 'Stepper.Input'\n\nexport type { StepperProps, StepperButtonProps, StepperInputProps } from './types'\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS,2BAA2B;AACpC,SAAS,eAAkD,YAAY,cAAc;;;ACDrF,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B;AAI7B,IAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA,SAAS;AAAA,EACT,GAAG;AACL,MAAwC;AACtC,QAAM,QAAQ,oBAAoB;AAAA,IAChC,GAAG;AAAA,IACH,YAAY,KAAK;AAAA,IACjB,YAAY,KAAK;AAAA,IACjB,YAAY,KAAK;AAAA,IACjB;AAAA,EACF,CAAC;AAED,QAAM,EAAE,YAAY,YAAY,sBAAsB,qBAAqB,IAAI;AAAA,IAC7E;AAAA,MACE,iBAAiB;AAAA,MACjB,GAAG;AAAA,MACH,YAAY,KAAK;AAAA,MACjB,YAAY,KAAK;AAAA,MACjB,YAAY,KAAK;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;;;ADmCM;AAhEN,IAAM,iBAAiB,cAErB,IAAI;AAEC,IAAM,UAAU,CAAC;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,KAAK;AAAA,EACL,GAAG;AACL,MAAuC;AACrC,QAAM,WAAW,OAAyB,IAAI;AAE9C,QAAM;AAAA,IACJ;AAAA,IACA,YAAY;AAAA,IACZ,sBAAsB;AAAA,IACtB,sBAAsB;AAAA,EACxB,IAAI,WAAW;AAAA,IACb,GAAG;AAAA,MACD,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMH,GAAI,WAAW,gBAAgB,EAAE,OAAO,aAAa,SAAS,IAAI;AAAA,MAClE,UAAU,aAAa;AAAA,IACzB;AAAA,IACA;AAA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N,CAAC;AAEM,IAAM,yBAAyB,OAAO,OAAO,iBAAiB;AAAA,EACnE,IAAI;AACN,CAAC;AAED,gBAAgB,cAAc;AAC9B,gBAAgB,cAAc;;;AC1F9B,SAAS,oBAAoB;AAYzB,gBAAAE,YAAA;AANJ,IAAMC,SAAQ,CAAC,EAAE,KAAK,cAAc,GAAG,MAAM,MAAyB;AACpE,QAAM,EAAE,UAAU,WAAW,IAAI,kBAAkB;AACnD,QAAM,MAAM,aAAa,cAAc,QAAQ;AAC/C,QAAM,EAAE,YAAY,IAAI,GAAG,eAAe,IAAI;AAE9C,SACE,gBAAAD;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,WAAW,2BAA2B,SAAS;AAAA;AAAA,EACjD;AAEJ;AAEO,IAAM,eAAe,OAAO,OAAOC,QAAO;AAAA,EAC/C,IAAI;AACN,CAAC;AAEDA,OAAM,cAAc;;;AClBb,IAAMC,WAIT,OAAO,OAAO,SAAM,EAAE,yCAAiB,yCAAiB,oBAAM,CAAC;AAEnEA,SAAQ,cAAc;AACtB,uBAAgB,cAAc;AAC9B,uBAAgB,cAAc;AAC9B,aAAM,cAAc;","names":["useRef","jsx","useRef","jsx","Input","Stepper"]}
|
|
1
|
+
{"version":3,"sources":["../../src/stepper/Buttons.tsx","../../src/stepper/useRenderSlot.tsx","../../src/stepper/Input.tsx","../../src/stepper/Root.tsx","../../src/stepper/index.ts"],"sourcesContent":["import { NumberField } from '@base-ui-components/react/number-field'\nimport { Minus } from '@spark-ui/icons/Minus'\nimport { Plus } from '@spark-ui/icons/Plus'\nimport { cva } from 'class-variance-authority'\nimport { ComponentProps, ReactNode } from 'react'\n\nimport { Icon } from '../icon'\nimport { useRenderSlot } from './useRenderSlot'\n\nconst styles = cva(\n [\n // Base styles\n 'border-outline border-sm min-w-sz-44 text-on-surface flex cursor-pointer items-center justify-center bg-clip-padding select-none',\n 'hover:bg-neutral/dim-5',\n // Disabled and ReadOnly styles\n 'disabled:bg-on-surface/dim-5 disabled:text-on-surface/dim-3 disabled:cursor-not-allowed',\n 'data-[disabled]:bg-on-surface/dim-5 data-[disabled]:text-on-surface/dim-3 data-[disabled]:cursor-not-allowed',\n 'data-[readonly]:bg-on-surface/dim-5 data-[readonly]:text-on-surface/dim-3 data-[readonly]:cursor-not-allowed',\n // State styles\n 'group-data-[field-state=error]:border-error',\n 'group-data-[field-state=alert]:border-alert',\n 'group-data-[field-state=success]:border-success',\n ],\n {\n variants: {\n placement: {\n left: 'rounded-l-lg',\n right: 'rounded-r-lg',\n },\n },\n }\n)\n\ninterface DecrementProps extends Omit<ComponentProps<typeof NumberField.Decrement>, 'render'> {\n children?: ReactNode\n asChild?: boolean\n}\n\ninterface IncrementProps extends Omit<ComponentProps<typeof NumberField.Increment>, 'render'> {\n children?: ReactNode\n asChild?: boolean\n}\n\nexport const Decrement = ({ children, className, asChild = false, ...props }: DecrementProps) => {\n const render = useRenderSlot(asChild, 'div')\n\n return (\n <NumberField.Decrement\n data-spark-component=\"stepper-decrement-button\"\n className={styles({\n placement: 'left',\n className,\n })}\n render={render}\n {...props}\n >\n {children || (\n <Icon>\n <Minus />\n </Icon>\n )}\n </NumberField.Decrement>\n )\n}\n\nexport const Increment = ({ children, className, asChild = false, ...props }: IncrementProps) => {\n const render = useRenderSlot(asChild, 'div')\n\n return (\n <NumberField.Increment\n data-spark-component=\"stepper-increment-button\"\n className={styles({\n placement: 'right',\n className,\n })}\n render={render}\n {...props}\n >\n {children || (\n <Icon>\n <Plus />\n </Icon>\n )}\n </NumberField.Increment>\n )\n}\n\nDecrement.displayName = 'Stepper.DecrementButton'\nIncrement.displayName = 'Stepper.IncrementButton'\n","import { Slot } from '../slot'\n\nexport function useRenderSlot(asChild: boolean, defaultTag: string) {\n const Component = asChild ? Slot : defaultTag\n\n return asChild ? ({ ...props }) => <Component {...props} /> : undefined\n}\n","import { NumberField } from '@base-ui-components/react/number-field'\nimport { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, ReactNode } from 'react'\n\ninterface Props extends Omit<ComponentProps<typeof NumberField.Input>, 'render'> {\n children?: ReactNode\n}\n\nexport const Input = ({ className, ...props }: Props) => {\n const field = useFormFieldControl()\n\n return (\n <NumberField.Input\n data-spark-component=\"stepper-input\"\n className={cx(\n // Base styles\n 'bg-surface text-on-surface h-sz-44 border-y-sm border-outline text-center',\n 'first:border-l-sm first:rounded-l-lg',\n 'last:border-r-sm last:rounded-r-lg',\n // State styles\n 'group-data-[field-state=error]:border-error',\n 'group-data-[field-state=alert]:border-alert',\n 'group-data-[field-state=success]:border-success',\n '',\n // Disabled and ReadOnly styles\n 'data-[disabled]:bg-on-surface/dim-5 data-[disabled]:text-on-surface/dim-3 data-[disabled]:cursor-not-allowed',\n 'data-[readonly]:bg-on-surface/dim-5',\n // Focus styles\n 'focus:outline-outline-high focus:z-raised focus:outline-2 focus:-outline-offset-1',\n className\n )}\n {...(field.description && { 'aria-describedby': field.description })}\n {...(field.isRequired && { required: true })}\n {...(field.state === 'error' && { 'aria-invalid': true })}\n {...props}\n />\n )\n}\n\nInput.displayName = 'Stepper.InputButton'\n","import { NumberField } from '@base-ui-components/react/number-field'\nimport { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { cx } from 'class-variance-authority'\n\nimport { StepperProps } from './types'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport const Root = ({\n children,\n allowWheelScrub = true,\n state: stateProp,\n minValue,\n maxValue,\n formatOptions,\n step: stepProp,\n className,\n ...props\n}: StepperProps) => {\n const render = useRenderSlot(true, 'div')\n\n const field = useFormFieldControl()\n const state = field.state ?? stateProp\n\n /**\n * By default, a percent format will increment in steps of 1 (100% on each increment)\n */\n const step = stepProp == null && formatOptions?.style === 'percent' ? 0.01 : stepProp\n\n return (\n <NumberField.Root\n data-spark-component=\"stepper\"\n allowWheelScrub={allowWheelScrub}\n render={render}\n min={minValue}\n max={maxValue}\n format={formatOptions}\n step={step}\n {...(field.id && { id: field.id })}\n {...props}\n >\n <NumberField.Group className={cx('group flex', className)} data-field-state={state}>\n {children}\n </NumberField.Group>\n </NumberField.Root>\n )\n}\n\nRoot.displayName = 'Stepper'\n","import { Decrement as DecrementButton, Increment as IncrementButton } from './Buttons'\nimport { Input } from './Input'\nimport { Root } from './Root'\n\nexport const Stepper: typeof Root & {\n IncrementButton: typeof IncrementButton\n DecrementButton: typeof DecrementButton\n Input: typeof Input\n} = Object.assign(Root, { IncrementButton, DecrementButton, Input })\n\nStepper.displayName = 'Stepper'\nIncrementButton.displayName = 'Stepper.IncrementButton'\nDecrementButton.displayName = 'Stepper.DecrementButton'\nInput.displayName = 'Stepper.Input'\n\nexport type { StepperProps, StepperButtonProps, StepperInputProps } from './types'\n"],"mappings":";;;;;;;;;AAAA,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,YAAY;AACrB,SAAS,WAAW;;;ACEiB;AAH9B,SAAS,cAAc,SAAkB,YAAoB;AAClE,QAAM,YAAY,UAAU,OAAO;AAEnC,SAAO,UAAU,CAAC,EAAE,GAAG,MAAM,MAAM,oBAAC,aAAW,GAAG,OAAO,IAAK;AAChE;;;ADoDU,gBAAAA,YAAA;AAjDV,IAAM,SAAS;AAAA,EACb;AAAA;AAAA,IAEE;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAYO,IAAM,YAAY,CAAC,EAAE,UAAU,WAAW,UAAU,OAAO,GAAG,MAAM,MAAsB;AAC/F,QAAM,SAAS,cAAc,SAAS,KAAK;AAE3C,SACE,gBAAAA;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACC,wBAAqB;AAAA,MACrB,WAAW,OAAO;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BAAmB;AAC5B,SAAS,uBAAAC,4BAA2B;AACpC,SAAS,MAAAC,WAAU;AAsCb,gBAAAC,YAAA;AAjCC,IAAM,OAAO,CAAC;AAAA,EACnB;AAAA,EACA,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,GAAG;AACL,MAAoB;AAClB,QAAM,SAAS,cAAc,MAAM,KAAK;AAExC,QAAM,QAAQC,qBAAoB;AAClC,QAAM,QAAQ,MAAM,SAAS;AAK7B,QAAM,OAAO,YAAY,QAAQ,eAAe,UAAU,YAAY,OAAO;AAE7E,SACE,gBAAAD;AAAA,IAACE,aAAY;AAAA,IAAZ;AAAA,MACC,wBAAqB;AAAA,MACrB;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL,KAAK;AAAA,MACL,QAAQ;AAAA,MACR;AAAA,MACC,GAAI,MAAM,MAAM,EAAE,IAAI,MAAM,GAAG;AAAA,MAC/B,GAAG;AAAA,MAEJ,0BAAAF,KAACE,aAAY,OAAZ,EAAkB,WAAWC,IAAG,cAAc,SAAS,GAAG,oBAAkB,OAC1E,UACH;AAAA;AAAA,EACF;AAEJ;AAEA,KAAK,cAAc;;;AC3CZ,IAAM,UAIT,OAAO,OAAO,MAAM,EAAE,4BAAiB,4BAAiB,MAAM,CAAC;AAEnE,QAAQ,cAAc;AACtB,UAAgB,cAAc;AAC9B,UAAgB,cAAc;AAC9B,MAAM,cAAc;","names":["jsx","NumberField","jsx","NumberField","useFormFieldControl","cx","jsx","useFormFieldControl","NumberField","cx"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ComponentPropsWithoutRef, Ref, PropsWithChildren } from 'react';
|
|
3
|
-
import { I as InputGroupProps, a as
|
|
4
|
-
import { I as
|
|
3
|
+
import { I as InputGroupProps, a as InputLeadingIconProps, b as InputTrailingIconProps } from '../InputTrailingIcon-DzmwLGtX.mjs';
|
|
4
|
+
import { I as InputProps } from '../Input-g0LpWuv0.mjs';
|
|
5
5
|
import 'class-variance-authority/types';
|
|
6
6
|
import 'class-variance-authority';
|
|
7
7
|
import '../icon/index.mjs';
|
package/dist/textarea/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ComponentPropsWithoutRef, Ref, PropsWithChildren } from 'react';
|
|
3
|
-
import { I as InputGroupProps, a as
|
|
4
|
-
import { I as
|
|
3
|
+
import { I as InputGroupProps, a as InputLeadingIconProps, b as InputTrailingIconProps } from '../InputTrailingIcon-CZD9hydv.js';
|
|
4
|
+
import { I as InputProps } from '../Input-g0LpWuv0.js';
|
|
5
5
|
import 'class-variance-authority/types';
|
|
6
6
|
import 'class-variance-authority';
|
|
7
7
|
import '../icon/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-ui/components",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.18.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Spark (Leboncoin design system) components.",
|
|
6
6
|
"exports": {
|
|
@@ -49,13 +49,11 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@base-ui-components/react": "^1.0.0-beta.3",
|
|
51
51
|
"@react-aria/button": "3.13.0",
|
|
52
|
-
"@react-aria/numberfield": "3.11.13",
|
|
53
52
|
"@react-aria/toast": "^3.0.0-beta.18",
|
|
54
|
-
"@react-stately/numberfield": "3.9.11",
|
|
55
53
|
"@react-stately/toast": "^3.0.0-beta.7",
|
|
56
|
-
"@spark-ui/hooks": "^10.
|
|
57
|
-
"@spark-ui/icons": "^10.
|
|
58
|
-
"@spark-ui/internal-utils": "^10.
|
|
54
|
+
"@spark-ui/hooks": "^10.18.1",
|
|
55
|
+
"@spark-ui/icons": "^10.18.1",
|
|
56
|
+
"@spark-ui/internal-utils": "^10.18.1",
|
|
59
57
|
"@zag-js/pagination": "1.25.0",
|
|
60
58
|
"@zag-js/react": "1.25.0",
|
|
61
59
|
"class-variance-authority": "0.7.1",
|
|
@@ -82,5 +80,5 @@
|
|
|
82
80
|
"url": "https://github.com/leboncoin/spark-web/issues?q=is%3Aopen+label%3A%22Component%3A+button%22"
|
|
83
81
|
},
|
|
84
82
|
"homepage": "https://sparkui.vercel.app",
|
|
85
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "ae59cad6c7182d318131ea4e66dfe06b7be7a5fb"
|
|
86
84
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { IconProps } from './icon/index.mjs';
|
|
3
|
-
|
|
4
|
-
type InputIconProps = IconProps;
|
|
5
|
-
|
|
6
|
-
type InputLeadingIconProps = InputIconProps;
|
|
7
|
-
declare const InputLeadingIcon: {
|
|
8
|
-
({ className, ...others }: InputLeadingIconProps): react_jsx_runtime.JSX.Element;
|
|
9
|
-
id: string;
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
type InputTrailingIconProps = InputIconProps;
|
|
14
|
-
declare const InputTrailingIcon: {
|
|
15
|
-
({ className, ...others }: InputTrailingIconProps): react_jsx_runtime.JSX.Element;
|
|
16
|
-
id: string;
|
|
17
|
-
displayName: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { type InputLeadingIconProps as I, type InputTrailingIconProps as a, InputLeadingIcon as b, InputTrailingIcon as c };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { IconProps } from './icon/index.js';
|
|
3
|
-
|
|
4
|
-
type InputIconProps = IconProps;
|
|
5
|
-
|
|
6
|
-
type InputLeadingIconProps = InputIconProps;
|
|
7
|
-
declare const InputLeadingIcon: {
|
|
8
|
-
({ className, ...others }: InputLeadingIconProps): react_jsx_runtime.JSX.Element;
|
|
9
|
-
id: string;
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
type InputTrailingIconProps = InputIconProps;
|
|
14
|
-
declare const InputTrailingIcon: {
|
|
15
|
-
({ className, ...others }: InputTrailingIconProps): react_jsx_runtime.JSX.Element;
|
|
16
|
-
id: string;
|
|
17
|
-
displayName: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { type InputLeadingIconProps as I, type InputTrailingIconProps as a, InputLeadingIcon as b, InputTrailingIcon as c };
|