@vygruppen/spor-react 11.1.2 → 11.1.4

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@11.1.2 build
2
+ > @vygruppen/spor-react@11.1.4 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,10 +9,10 @@
9
9
  CJS Build start
10
10
  ESM Build start
11
11
  DTS Build start
12
- CJS dist/index.js 448.88 KB
13
- CJS ⚡️ Build success in 2008ms
14
- ESM dist/index.mjs 429.38 KB
15
- ESM ⚡️ Build success in 2009ms
16
- DTS ⚡️ Build success in 16043ms
12
+ CJS dist/index.js 449.60 KB
13
+ CJS ⚡️ Build success in 1977ms
14
+ ESM dist/index.mjs 430.10 KB
15
+ ESM ⚡️ Build success in 1978ms
16
+ DTS ⚡️ Build success in 15382ms
17
17
  DTS dist/index.d.ts 343.31 KB
18
18
  DTS dist/index.d.mts 343.31 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 11.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - cd49b43: Set correct position of label for input elements that caused the dance during hydration step
8
+
9
+ ## 11.1.3
10
+
11
+ ### Patch Changes
12
+
13
+ - edb4b4d: Disable pointer-events on input labels
14
+
3
15
  ## 11.1.2
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1503,9 +1503,37 @@ var Input = react.forwardRef(
1503
1503
  "aria-labelledby": labelId,
1504
1504
  ref,
1505
1505
  overflow: "hidden",
1506
- placeholder: " "
1506
+ placeholder: " ",
1507
+ css: {
1508
+ "&::-webkit-search-cancel-button": {
1509
+ WebkitAppearance: "none"
1510
+ }
1511
+ }
1507
1512
  }
1508
- ), /* @__PURE__ */ React86__namespace.default.createElement(react.FormLabel, { htmlFor: inputId, id: labelId }, label), rightIcon && /* @__PURE__ */ React86__namespace.default.createElement(react.InputRightElement, { pointerEvents: "none" }, rightIcon));
1513
+ ), /* @__PURE__ */ React86__namespace.default.createElement(
1514
+ react.FormLabel,
1515
+ {
1516
+ htmlFor: inputId,
1517
+ id: labelId,
1518
+ pointerEvents: "none",
1519
+ sx: {
1520
+ position: "absolute",
1521
+ left: "2.6rem",
1522
+ top: "26.9%",
1523
+ fontSize: "1.13rem",
1524
+ pointerEvents: "none",
1525
+ margin: 0,
1526
+ zIndex: 2,
1527
+ "input:focus + &, input[data-has-value] + &": {
1528
+ color: "var(--chakra-colors-gray-600)"
1529
+ },
1530
+ "input[data-has-value] + &": {
1531
+ transform: "translateY(-40%) scale(0.9)"
1532
+ }
1533
+ }
1534
+ },
1535
+ label
1536
+ ), rightIcon && /* @__PURE__ */ React86__namespace.default.createElement(react.InputRightElement, { pointerEvents: "none" }, rightIcon));
1509
1537
  }
1510
1538
  );
1511
1539
  var InputLeftElement2 = react.forwardRef(
@@ -1731,7 +1759,7 @@ var PasswordInput = react.forwardRef(
1731
1759
  const formControlProps = react.useFormControlContext();
1732
1760
  const autoGeneratedId = `password-input-${React86.useId()}`;
1733
1761
  const inputId = id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? autoGeneratedId;
1734
- return /* @__PURE__ */ React86__namespace.default.createElement(react.InputGroup, { position: "relative" }, leftIcon && /* @__PURE__ */ React86__namespace.default.createElement(InputLeftElement2, null, leftIcon), /* @__PURE__ */ React86__namespace.default.createElement(
1762
+ return /* @__PURE__ */ React86__namespace.default.createElement(react.InputGroup, { position: "relative" }, leftIcon && /* @__PURE__ */ React86__namespace.default.createElement(InputLeftElement2, { pointerEvents: "none" }, leftIcon), /* @__PURE__ */ React86__namespace.default.createElement(
1735
1763
  react.Input,
1736
1764
  {
1737
1765
  ...props,
@@ -1900,7 +1928,7 @@ var SearchInput = react.forwardRef(
1900
1928
  const autoGeneratedId = React86.useId();
1901
1929
  const inputId = props.id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? autoGeneratedId;
1902
1930
  const { outerProps, innerProps } = getOuterProps(props);
1903
- return /* @__PURE__ */ React86__namespace.default.createElement(react.InputGroup, { position: "relative", ...outerProps }, /* @__PURE__ */ React86__namespace.default.createElement(InputLeftElement2, null, /* @__PURE__ */ React86__namespace.default.createElement(sporIconReact.SearchOutline24Icon, null)), /* @__PURE__ */ React86__namespace.default.createElement(
1931
+ return /* @__PURE__ */ React86__namespace.default.createElement(react.InputGroup, { position: "relative", ...outerProps }, /* @__PURE__ */ React86__namespace.default.createElement(InputLeftElement2, { pointerEvents: "none" }, /* @__PURE__ */ React86__namespace.default.createElement(sporIconReact.SearchOutline24Icon, null)), /* @__PURE__ */ React86__namespace.default.createElement(
1904
1932
  react.Input,
1905
1933
  {
1906
1934
  paddingLeft: 7,
@@ -1992,7 +2020,15 @@ var Textarea = react.forwardRef((props, ref) => {
1992
2020
  const formControlProps = react.useFormControlContext();
1993
2021
  const fallbackId = `textarea-${React86.useId()}`;
1994
2022
  const inputId = props.id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? fallbackId;
1995
- return /* @__PURE__ */ React86__namespace.default.createElement(react.InputGroup, { position: "relative", ...spacingProps }, /* @__PURE__ */ React86__namespace.default.createElement(react.Textarea, { ...rest, id: inputId, ref, placeholder: " " }), label && /* @__PURE__ */ React86__namespace.default.createElement(react.FormLabel, { htmlFor: inputId, id: `${inputId}-label` }, label));
2023
+ return /* @__PURE__ */ React86__namespace.default.createElement(react.InputGroup, { position: "relative", ...spacingProps }, /* @__PURE__ */ React86__namespace.default.createElement(react.Textarea, { ...rest, id: inputId, ref, placeholder: " " }), label && /* @__PURE__ */ React86__namespace.default.createElement(
2024
+ react.FormLabel,
2025
+ {
2026
+ htmlFor: inputId,
2027
+ id: `${inputId}-label`,
2028
+ pointerEvents: "none"
2029
+ },
2030
+ label
2031
+ ));
1996
2032
  });
1997
2033
  function getSpacingProps(props) {
1998
2034
  const {
package/dist/index.mjs CHANGED
@@ -1483,9 +1483,37 @@ var Input = forwardRef(
1483
1483
  "aria-labelledby": labelId,
1484
1484
  ref,
1485
1485
  overflow: "hidden",
1486
- placeholder: " "
1486
+ placeholder: " ",
1487
+ css: {
1488
+ "&::-webkit-search-cancel-button": {
1489
+ WebkitAppearance: "none"
1490
+ }
1491
+ }
1487
1492
  }
1488
- ), /* @__PURE__ */ React86__default.createElement(FormLabel$1, { htmlFor: inputId, id: labelId }, label), rightIcon && /* @__PURE__ */ React86__default.createElement(InputRightElement, { pointerEvents: "none" }, rightIcon));
1493
+ ), /* @__PURE__ */ React86__default.createElement(
1494
+ FormLabel$1,
1495
+ {
1496
+ htmlFor: inputId,
1497
+ id: labelId,
1498
+ pointerEvents: "none",
1499
+ sx: {
1500
+ position: "absolute",
1501
+ left: "2.6rem",
1502
+ top: "26.9%",
1503
+ fontSize: "1.13rem",
1504
+ pointerEvents: "none",
1505
+ margin: 0,
1506
+ zIndex: 2,
1507
+ "input:focus + &, input[data-has-value] + &": {
1508
+ color: "var(--chakra-colors-gray-600)"
1509
+ },
1510
+ "input[data-has-value] + &": {
1511
+ transform: "translateY(-40%) scale(0.9)"
1512
+ }
1513
+ }
1514
+ },
1515
+ label
1516
+ ), rightIcon && /* @__PURE__ */ React86__default.createElement(InputRightElement, { pointerEvents: "none" }, rightIcon));
1489
1517
  }
1490
1518
  );
1491
1519
  var InputLeftElement2 = forwardRef(
@@ -1711,7 +1739,7 @@ var PasswordInput = forwardRef(
1711
1739
  const formControlProps = useFormControlContext();
1712
1740
  const autoGeneratedId = `password-input-${useId()}`;
1713
1741
  const inputId = id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? autoGeneratedId;
1714
- return /* @__PURE__ */ React86__default.createElement(InputGroup, { position: "relative" }, leftIcon && /* @__PURE__ */ React86__default.createElement(InputLeftElement2, null, leftIcon), /* @__PURE__ */ React86__default.createElement(
1742
+ return /* @__PURE__ */ React86__default.createElement(InputGroup, { position: "relative" }, leftIcon && /* @__PURE__ */ React86__default.createElement(InputLeftElement2, { pointerEvents: "none" }, leftIcon), /* @__PURE__ */ React86__default.createElement(
1715
1743
  Input$1,
1716
1744
  {
1717
1745
  ...props,
@@ -1880,7 +1908,7 @@ var SearchInput = forwardRef(
1880
1908
  const autoGeneratedId = useId();
1881
1909
  const inputId = props.id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? autoGeneratedId;
1882
1910
  const { outerProps, innerProps } = getOuterProps(props);
1883
- return /* @__PURE__ */ React86__default.createElement(InputGroup, { position: "relative", ...outerProps }, /* @__PURE__ */ React86__default.createElement(InputLeftElement2, null, /* @__PURE__ */ React86__default.createElement(SearchOutline24Icon, null)), /* @__PURE__ */ React86__default.createElement(
1911
+ return /* @__PURE__ */ React86__default.createElement(InputGroup, { position: "relative", ...outerProps }, /* @__PURE__ */ React86__default.createElement(InputLeftElement2, { pointerEvents: "none" }, /* @__PURE__ */ React86__default.createElement(SearchOutline24Icon, null)), /* @__PURE__ */ React86__default.createElement(
1884
1912
  Input$1,
1885
1913
  {
1886
1914
  paddingLeft: 7,
@@ -1972,7 +2000,15 @@ var Textarea = forwardRef((props, ref) => {
1972
2000
  const formControlProps = useFormControlContext();
1973
2001
  const fallbackId = `textarea-${useId()}`;
1974
2002
  const inputId = props.id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? fallbackId;
1975
- return /* @__PURE__ */ React86__default.createElement(InputGroup, { position: "relative", ...spacingProps }, /* @__PURE__ */ React86__default.createElement(Textarea$1, { ...rest, id: inputId, ref, placeholder: " " }), label && /* @__PURE__ */ React86__default.createElement(FormLabel$1, { htmlFor: inputId, id: `${inputId}-label` }, label));
2003
+ return /* @__PURE__ */ React86__default.createElement(InputGroup, { position: "relative", ...spacingProps }, /* @__PURE__ */ React86__default.createElement(Textarea$1, { ...rest, id: inputId, ref, placeholder: " " }), label && /* @__PURE__ */ React86__default.createElement(
2004
+ FormLabel$1,
2005
+ {
2006
+ htmlFor: inputId,
2007
+ id: `${inputId}-label`,
2008
+ pointerEvents: "none"
2009
+ },
2010
+ label
2011
+ ));
1976
2012
  });
1977
2013
  function getSpacingProps(props) {
1978
2014
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "11.1.2",
3
+ "version": "11.1.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -60,8 +60,33 @@ export const Input = forwardRef<InputProps, "input">(
60
60
  ref={ref}
61
61
  overflow="hidden"
62
62
  placeholder=" " // This is needed to make the label work as expected
63
+ css={{
64
+ "&::-webkit-search-cancel-button": {
65
+ WebkitAppearance: "none",
66
+ },
67
+ }}
63
68
  />
64
- <FormLabel htmlFor={inputId} id={labelId}>
69
+
70
+ <FormLabel
71
+ htmlFor={inputId}
72
+ id={labelId}
73
+ pointerEvents="none"
74
+ sx={{
75
+ position: "absolute",
76
+ left: "2.6rem",
77
+ top: "26.9%",
78
+ fontSize: "1.13rem",
79
+ pointerEvents: "none",
80
+ margin: 0,
81
+ zIndex: 2,
82
+ "input:focus + &, input[data-has-value] + &": {
83
+ color: "var(--chakra-colors-gray-600)",
84
+ },
85
+ "input[data-has-value] + &": {
86
+ transform: "translateY(-40%) scale(0.9)",
87
+ },
88
+ }}
89
+ >
65
90
  {label}
66
91
  </FormLabel>
67
92
  {rightIcon && (
@@ -25,7 +25,9 @@ export const PasswordInput = forwardRef<PasswordInputProps, "input">(
25
25
  const inputId = id ?? formControlProps?.id ?? autoGeneratedId;
26
26
  return (
27
27
  <InputGroup position="relative">
28
- {leftIcon && <InputLeftElement>{leftIcon}</InputLeftElement>}
28
+ {leftIcon && (
29
+ <InputLeftElement pointerEvents="none">{leftIcon}</InputLeftElement>
30
+ )}
29
31
  <ChakraInput
30
32
  {...props}
31
33
  id={inputId}
@@ -39,7 +39,7 @@ export const SearchInput = forwardRef<SearchInputProps, "input">(
39
39
 
40
40
  return (
41
41
  <InputGroup position="relative" {...outerProps}>
42
- <InputLeftElement>
42
+ <InputLeftElement pointerEvents="none">
43
43
  <SearchOutline24Icon />
44
44
  </InputLeftElement>
45
45
  <ChakraInput
@@ -35,7 +35,11 @@ export const Textarea = forwardRef<TextareaProps, "textarea">((props, ref) => {
35
35
  <InputGroup position="relative" {...spacingProps}>
36
36
  <ChakraTextarea {...rest} id={inputId} ref={ref} placeholder=" " />
37
37
  {label && (
38
- <FormLabel htmlFor={inputId} id={`${inputId}-label`}>
38
+ <FormLabel
39
+ htmlFor={inputId}
40
+ id={`${inputId}-label`}
41
+ pointerEvents="none"
42
+ >
39
43
  {label}
40
44
  </FormLabel>
41
45
  )}