@vygruppen/spor-react 12.14.2 → 12.16.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 +10 -10
- package/.turbo/turbo-postinstall.log +2 -2
- package/CHANGELOG.md +28 -0
- package/dist/index.cjs +62 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -10
- package/dist/index.d.ts +13 -10
- package/dist/index.mjs +63 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/alert/AlertIcon.tsx +30 -15
- package/src/datepicker/CalendarCell.tsx +5 -3
- package/src/datepicker/DatePicker.tsx +2 -1
- package/src/datepicker/DateRangePicker.tsx +3 -2
- package/src/datepicker/TimePicker.tsx +4 -4
- package/src/dialog/Drawer.tsx +20 -6
- package/src/dialog/types.ts +5 -0
- package/src/input/ChoiceChip.tsx +1 -1
- package/src/input/NumericStepper.tsx +3 -3
- package/src/input/PhoneNumberInput.tsx +2 -1
- package/src/typography/Text.tsx +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @vygruppen/spor-react@12.
|
|
2
|
+
> @vygruppen/spor-react@12.16.0 build /home/runner/work/spor/spor/packages/spor-react
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
CLI Building entry: src/index.tsx, src/icons/index.tsx
|
|
@@ -11,18 +11,18 @@ CLI Cleaning output folder
|
|
|
11
11
|
ESM Build start
|
|
12
12
|
CJS Build start
|
|
13
13
|
DTS Build start
|
|
14
|
-
ESM dist/index.mjs
|
|
14
|
+
ESM dist/index.mjs 299.81 KB
|
|
15
15
|
ESM dist/icons/index.mjs 110.00 B
|
|
16
|
+
ESM dist/index.mjs.map 640.14 KB
|
|
16
17
|
ESM dist/icons/index.mjs.map 157.00 B
|
|
17
|
-
ESM
|
|
18
|
-
ESM ⚡️ Build success in 2541ms
|
|
19
|
-
CJS dist/index.cjs 320.53 KB
|
|
18
|
+
ESM ⚡️ Build success in 2526ms
|
|
20
19
|
CJS dist/icons/index.cjs 381.00 B
|
|
20
|
+
CJS dist/index.cjs 321.54 KB
|
|
21
21
|
CJS dist/icons/index.cjs.map 157.00 B
|
|
22
|
-
CJS dist/index.cjs.map
|
|
23
|
-
CJS ⚡️ Build success in
|
|
24
|
-
DTS ⚡️ Build success in
|
|
22
|
+
CJS dist/index.cjs.map 640.14 KB
|
|
23
|
+
CJS ⚡️ Build success in 2527ms
|
|
24
|
+
DTS ⚡️ Build success in 19685ms
|
|
25
25
|
DTS dist/icons/index.d.ts 44.00 B
|
|
26
|
-
DTS dist/index.d.ts 157.
|
|
26
|
+
DTS dist/index.d.ts 157.18 KB
|
|
27
27
|
DTS dist/icons/index.d.cts 44.00 B
|
|
28
|
-
DTS dist/index.d.cts 157.
|
|
28
|
+
DTS dist/index.d.cts 157.18 KB
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @vygruppen/spor-react@12.
|
|
2
|
+
> @vygruppen/spor-react@12.16.0 postinstall /home/runner/work/spor/spor/packages/spor-react
|
|
3
3
|
> chakra typegen src/theme/index.ts
|
|
4
4
|
|
|
5
|
-
[dotenv@17.2.2] injecting env (0) from .env -- tip:
|
|
5
|
+
[dotenv@17.2.2] injecting env (0) from .env -- tip: 📡 auto-backup env with Radar: https://dotenvx.com/radar
|
|
6
6
|
[90m┌[39m Chakra CLI ⚡️
|
|
7
7
|
[?25l[90m│[39m
|
|
8
8
|
[35m◒[39m Generating conditions types...
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @vygruppen/spor-react
|
|
2
2
|
|
|
3
|
+
## 12.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8865c20: ## Breaking Changes
|
|
8
|
+
- **API Consistency**: Standardized event handler naming to `onValueChange` for DatePicker, TimePicker, DateRangePicker, ChoiceChip, and NumericStepper components (previously `onChange`)
|
|
9
|
+
|
|
10
|
+
## Bug Fixes
|
|
11
|
+
- **TextInput**: Reverted color changes to restore original color styling
|
|
12
|
+
|
|
13
|
+
## Improvements
|
|
14
|
+
- **PhoneNumberInput**: Updated styling for better visual consistency
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 5eae150: Add default text color for Text component
|
|
19
|
+
|
|
20
|
+
## 12.15.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- a07b8f6: Prevent calendar cell button from performing form submittion by setting type to button.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 181fdcd: Update design of Alerts to support darkmode.
|
|
29
|
+
- b422895: Add props showText to DrawerCloseTrigger and hideHandle to DrawerContent
|
|
30
|
+
|
|
3
31
|
## 12.14.2
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -783,9 +783,9 @@ function resolveTextProps({
|
|
|
783
783
|
}
|
|
784
784
|
var Text3 = React27.forwardRef(
|
|
785
785
|
function Text4(props, ref) {
|
|
786
|
-
const { variant, lineHeight, fontSize, ...rest } = props;
|
|
786
|
+
const { variant, lineHeight, fontSize, color = "text", ...rest } = props;
|
|
787
787
|
const resolvedProps = resolveTextProps({ variant, fontSize, lineHeight });
|
|
788
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react.Text, { ...resolvedProps, ...rest, ref });
|
|
788
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Text, { ...resolvedProps, color, ...rest, ref });
|
|
789
789
|
}
|
|
790
790
|
);
|
|
791
791
|
var ClipboardIcon = React27__namespace.forwardRef((props, ref) => {
|
|
@@ -962,46 +962,56 @@ var useScrollDirection = () => {
|
|
|
962
962
|
return scrollDirection;
|
|
963
963
|
};
|
|
964
964
|
var AlertIcon = React27.forwardRef(
|
|
965
|
-
({ variant, customIcon }, ref) => {
|
|
965
|
+
({ variant, customIcon: CustomAlertIcon }, ref) => {
|
|
966
966
|
const { t } = useTranslation();
|
|
967
|
-
const Icon3 = customIcon ?? getIcon(variant);
|
|
968
967
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
969
968
|
react.Box,
|
|
970
969
|
{
|
|
971
|
-
|
|
970
|
+
asChild: true,
|
|
972
971
|
ref,
|
|
973
972
|
"aria-label": t(texts5[variant]),
|
|
974
|
-
|
|
973
|
+
children: CustomAlertIcon ? /* @__PURE__ */ jsxRuntime.jsx(CustomAlertIcon, { color: `alert.${variant}.icon` }) : /* @__PURE__ */ jsxRuntime.jsx(BaseAlertIcon, { variant })
|
|
975
974
|
}
|
|
976
975
|
);
|
|
977
976
|
}
|
|
978
977
|
);
|
|
979
978
|
AlertIcon.displayName = "AlertIcon";
|
|
980
|
-
var
|
|
979
|
+
var BaseAlertIcon = ({ variant }) => {
|
|
980
|
+
const css = {
|
|
981
|
+
"& path:first-of-type": {
|
|
982
|
+
fill: `alert.${variant}.icon`
|
|
983
|
+
},
|
|
984
|
+
"& path:not(:first-of-type)": {
|
|
985
|
+
fill: `alert.${variant}.surface`
|
|
986
|
+
}
|
|
987
|
+
};
|
|
981
988
|
switch (variant) {
|
|
982
989
|
case "info": {
|
|
983
|
-
return sporIconReact.InformationFill24Icon;
|
|
990
|
+
return /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.InformationFill24Icon, { css });
|
|
984
991
|
}
|
|
985
992
|
case "success": {
|
|
986
|
-
return sporIconReact.SuccessFill24Icon;
|
|
993
|
+
return /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.SuccessFill24Icon, { css });
|
|
987
994
|
}
|
|
988
995
|
case "important": {
|
|
989
|
-
return sporIconReact.WarningFill24Icon;
|
|
996
|
+
return /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.WarningFill24Icon, {});
|
|
990
997
|
}
|
|
991
998
|
case "alt": {
|
|
992
|
-
return sporIconReact.AltTransportFill24Icon;
|
|
999
|
+
return /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.AltTransportFill24Icon, { css });
|
|
993
1000
|
}
|
|
994
1001
|
case "error": {
|
|
995
|
-
return sporIconReact.ErrorFill24Icon;
|
|
1002
|
+
return /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.ErrorFill24Icon, { css });
|
|
996
1003
|
}
|
|
997
1004
|
case "error-secondary": {
|
|
998
|
-
return sporIconReact.ErrorOutline24Icon;
|
|
1005
|
+
return /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.ErrorOutline24Icon, { css });
|
|
999
1006
|
}
|
|
1000
1007
|
case "neutral": {
|
|
1001
|
-
return sporIconReact.QuestionFill24Icon;
|
|
1008
|
+
return /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.QuestionFill24Icon, { css });
|
|
1002
1009
|
}
|
|
1003
1010
|
case "service": {
|
|
1004
|
-
return sporIconReact.ServiceFill24Icon;
|
|
1011
|
+
return /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.ServiceFill24Icon, {});
|
|
1012
|
+
}
|
|
1013
|
+
default: {
|
|
1014
|
+
return /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.InformationFill24Icon, { css });
|
|
1005
1015
|
}
|
|
1006
1016
|
}
|
|
1007
1017
|
};
|
|
@@ -1406,6 +1416,20 @@ var FieldErrorText = React27__namespace.forwardRef((props, ref) => {
|
|
|
1406
1416
|
});
|
|
1407
1417
|
FieldErrorText.displayName = "FieldErrorText";
|
|
1408
1418
|
var FieldLabel = react.Field.Label;
|
|
1419
|
+
|
|
1420
|
+
// src/util/slugify.tsx
|
|
1421
|
+
function slugify(text, maxLength = 50) {
|
|
1422
|
+
if (!text) {
|
|
1423
|
+
return text;
|
|
1424
|
+
}
|
|
1425
|
+
if (Array.isArray(text)) {
|
|
1426
|
+
text = text.join(" ");
|
|
1427
|
+
}
|
|
1428
|
+
if (maxLength < 1) {
|
|
1429
|
+
throw new Error("The maxLength parameter must be a positive number");
|
|
1430
|
+
}
|
|
1431
|
+
return text.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").replaceAll(/[\u00C6\u00E6]/g, "ae").replaceAll(/[\u00D8\u00F8]/g, "oe").replaceAll(/[\u00C5\u00E5]/g, "aa").toLowerCase().replaceAll(/\s+/g, "-").replaceAll(/[^\w-]+/g, "").replaceAll(/--+/g, "-").replace(/^-+/, "").replace(/-+$/, "").slice(0, Math.max(0, maxLength));
|
|
1432
|
+
}
|
|
1409
1433
|
function CalendarCell({
|
|
1410
1434
|
state,
|
|
1411
1435
|
date: date$1,
|
|
@@ -1450,9 +1474,9 @@ function CalendarCell({
|
|
|
1450
1474
|
);
|
|
1451
1475
|
}, []);
|
|
1452
1476
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "td", ...cellProps, textAlign: "center", css: styles.cell, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1453
|
-
react.
|
|
1477
|
+
react.chakra.button,
|
|
1454
1478
|
{
|
|
1455
|
-
|
|
1479
|
+
type: "button",
|
|
1456
1480
|
...buttonProps,
|
|
1457
1481
|
...stateProps,
|
|
1458
1482
|
ref,
|
|
@@ -1929,6 +1953,7 @@ var DatePicker = React27.forwardRef(
|
|
|
1929
1953
|
const state = reactStately.useDatePickerState({
|
|
1930
1954
|
...props,
|
|
1931
1955
|
shouldCloseOnSelect: true,
|
|
1956
|
+
onChange: props.onValueChange,
|
|
1932
1957
|
errorMessage: errorText,
|
|
1933
1958
|
isRequired: props.isRequired ?? (chakraFieldProps == null ? void 0 : chakraFieldProps.required),
|
|
1934
1959
|
validationState: (chakraFieldProps == null ? void 0 : chakraFieldProps.invalid) ? "invalid" : "valid"
|
|
@@ -2051,7 +2076,7 @@ function RangeCalendar(props) {
|
|
|
2051
2076
|
] });
|
|
2052
2077
|
}
|
|
2053
2078
|
function DateRangePicker({
|
|
2054
|
-
variant,
|
|
2079
|
+
variant = "core",
|
|
2055
2080
|
minHeight,
|
|
2056
2081
|
startName,
|
|
2057
2082
|
endName,
|
|
@@ -2065,6 +2090,7 @@ function DateRangePicker({
|
|
|
2065
2090
|
const fieldContextPRops = react.useFieldContext();
|
|
2066
2091
|
const state = reactStately.useDateRangePickerState({
|
|
2067
2092
|
...props,
|
|
2093
|
+
onChange: props.onValueChange,
|
|
2068
2094
|
shouldCloseOnSelect: true,
|
|
2069
2095
|
isInvalid: invalid,
|
|
2070
2096
|
errorMessage: errorText,
|
|
@@ -2159,20 +2185,6 @@ function DateRangePicker({
|
|
|
2159
2185
|
] })
|
|
2160
2186
|
] }) });
|
|
2161
2187
|
}
|
|
2162
|
-
|
|
2163
|
-
// src/util/slugify.tsx
|
|
2164
|
-
function slugify(text, maxLength = 50) {
|
|
2165
|
-
if (!text) {
|
|
2166
|
-
return text;
|
|
2167
|
-
}
|
|
2168
|
-
if (Array.isArray(text)) {
|
|
2169
|
-
text = text.join(" ");
|
|
2170
|
-
}
|
|
2171
|
-
if (maxLength < 1) {
|
|
2172
|
-
throw new Error("The maxLength parameter must be a positive number");
|
|
2173
|
-
}
|
|
2174
|
-
return text.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").replaceAll(/[\u00C6\u00E6]/g, "ae").replaceAll(/[\u00D8\u00F8]/g, "oe").replaceAll(/[\u00C5\u00E5]/g, "aa").toLowerCase().replaceAll(/\s+/g, "-").replaceAll(/[^\w-]+/g, "").replaceAll(/--+/g, "-").replace(/^-+/, "").replace(/-+$/, "").slice(0, Math.max(0, maxLength));
|
|
2175
|
-
}
|
|
2176
2188
|
var TimeField = ({ state, ...props }) => {
|
|
2177
2189
|
const ref = React27.useRef(null);
|
|
2178
2190
|
const { labelProps, fieldProps } = reactAria.useTimeField(props, state, ref);
|
|
@@ -2212,7 +2224,7 @@ var TimePicker = ({
|
|
|
2212
2224
|
label: externalLabel,
|
|
2213
2225
|
value,
|
|
2214
2226
|
defaultValue = getCurrentTime(),
|
|
2215
|
-
|
|
2227
|
+
onValueChange = () => {
|
|
2216
2228
|
},
|
|
2217
2229
|
minuteInterval = 30,
|
|
2218
2230
|
disabled: isDisabledExternally = false,
|
|
@@ -2227,7 +2239,7 @@ var TimePicker = ({
|
|
|
2227
2239
|
const state = reactStately.useTimeFieldState({
|
|
2228
2240
|
value,
|
|
2229
2241
|
defaultValue,
|
|
2230
|
-
onChange,
|
|
2242
|
+
onChange: onValueChange,
|
|
2231
2243
|
locale,
|
|
2232
2244
|
isDisabled,
|
|
2233
2245
|
label,
|
|
@@ -2394,7 +2406,13 @@ var [RootDrawerProvider, useRootDrawerProps] = react.createContext({
|
|
|
2394
2406
|
});
|
|
2395
2407
|
var DrawerContent = React27.forwardRef(
|
|
2396
2408
|
(props, ref) => {
|
|
2397
|
-
const {
|
|
2409
|
+
const {
|
|
2410
|
+
children,
|
|
2411
|
+
portalled = true,
|
|
2412
|
+
portalRef,
|
|
2413
|
+
hideHandle = false,
|
|
2414
|
+
...rest
|
|
2415
|
+
} = props;
|
|
2398
2416
|
const { size, placement } = useRootDrawerProps();
|
|
2399
2417
|
const { setOpen } = react.useDialogContext();
|
|
2400
2418
|
const handlers = reactSwipeable.useSwipeable({
|
|
@@ -2407,10 +2425,11 @@ var DrawerContent = React27.forwardRef(
|
|
|
2407
2425
|
swipeDuration: 250
|
|
2408
2426
|
});
|
|
2409
2427
|
const sizeNotFull = size !== "full";
|
|
2428
|
+
const showHandle = !hideHandle;
|
|
2410
2429
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsxRuntime.jsx(react.Drawer.Positioner, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { ...handlers, width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(react.Drawer.Content, { ref, ...rest, children: [
|
|
2411
|
-
sizeNotFull && placement === "bottom" && /* @__PURE__ */ jsxRuntime.jsx(CloseDrawerLine, {}),
|
|
2430
|
+
showHandle && sizeNotFull && placement === "bottom" && /* @__PURE__ */ jsxRuntime.jsx(CloseDrawerLine, {}),
|
|
2412
2431
|
children,
|
|
2413
|
-
sizeNotFull && placement === "top" && /* @__PURE__ */ jsxRuntime.jsx(CloseDrawerLine, {})
|
|
2432
|
+
showHandle && sizeNotFull && placement === "top" && /* @__PURE__ */ jsxRuntime.jsx(CloseDrawerLine, {})
|
|
2414
2433
|
] }) }) }) });
|
|
2415
2434
|
}
|
|
2416
2435
|
);
|
|
@@ -2433,9 +2452,10 @@ var CloseDrawerLine = React27.forwardRef((props, ref) => {
|
|
|
2433
2452
|
});
|
|
2434
2453
|
CloseDrawerLine.displayName = "CloseDrawerLine";
|
|
2435
2454
|
var DrawerCloseTrigger = React27.forwardRef(function DrawerCloseTrigger2(props, ref) {
|
|
2455
|
+
const { showText = false, ...rest } = props;
|
|
2436
2456
|
const { size } = useRootDrawerProps();
|
|
2437
2457
|
const { t } = useTranslation();
|
|
2438
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react.Drawer.CloseTrigger, { ref, ...
|
|
2458
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Drawer.CloseTrigger, { ref, ...rest, asChild: true, children: showText || size === "full" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2439
2459
|
ResponsiveButton,
|
|
2440
2460
|
{
|
|
2441
2461
|
variant: "ghost",
|
|
@@ -3121,7 +3141,7 @@ var NumericStepper = React27__namespace.default.forwardRef((props, ref) => {
|
|
|
3121
3141
|
id: idProp,
|
|
3122
3142
|
value: valueProp,
|
|
3123
3143
|
defaultValue = 1,
|
|
3124
|
-
|
|
3144
|
+
onValueChange,
|
|
3125
3145
|
minValue = 0,
|
|
3126
3146
|
maxValue = 99,
|
|
3127
3147
|
disabled,
|
|
@@ -3136,7 +3156,7 @@ var NumericStepper = React27__namespace.default.forwardRef((props, ref) => {
|
|
|
3136
3156
|
const styles = recipe();
|
|
3137
3157
|
const [value, onChange] = react.useControllableState({
|
|
3138
3158
|
value: valueProp,
|
|
3139
|
-
onChange:
|
|
3159
|
+
onChange: onValueChange,
|
|
3140
3160
|
defaultValue
|
|
3141
3161
|
});
|
|
3142
3162
|
const clampedStepSize = Math.max(Math.min(stepSize, 10), 1);
|
|
@@ -3459,7 +3479,8 @@ var PhoneNumberInput = React27.forwardRef((props, ref) => {
|
|
|
3459
3479
|
value: [value.countryCode],
|
|
3460
3480
|
onValueChange: handleCountryCodeChange,
|
|
3461
3481
|
height: "100%",
|
|
3462
|
-
width: "
|
|
3482
|
+
width: "100%",
|
|
3483
|
+
minWidth: "6.25rem",
|
|
3463
3484
|
variant,
|
|
3464
3485
|
allowedCountryCodes,
|
|
3465
3486
|
"data-state": "on",
|