@dmsi/wedgekit-react 0.0.573 → 0.0.575

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.
Files changed (70) hide show
  1. package/dist/{chunk-NWTVBVBC.js → chunk-7T5RGDCN.js} +2 -2
  2. package/dist/{chunk-BKBJOF4J.js → chunk-FHXCCVOG.js} +1 -1
  3. package/dist/{chunk-DWKS5ZXG.js → chunk-KBHNJ5G7.js} +1 -1
  4. package/dist/{chunk-3JQPFWKR.js → chunk-LXMIQ7RM.js} +4 -4
  5. package/dist/{chunk-I5BV7UPG.js → chunk-UF5XGCSF.js} +1 -1
  6. package/dist/components/CalendarRange.cjs +2 -2
  7. package/dist/components/CalendarRange.css +21 -75
  8. package/dist/components/CalendarRange.js +5 -5
  9. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +2 -2
  10. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +21 -75
  11. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +5 -5
  12. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +2 -2
  13. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +21 -75
  14. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +5 -5
  15. package/dist/components/DataGrid/PinnedColumns.cjs +2 -2
  16. package/dist/components/DataGrid/PinnedColumns.css +21 -75
  17. package/dist/components/DataGrid/PinnedColumns.js +5 -5
  18. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +2 -2
  19. package/dist/components/DataGrid/TableBody/LoadingCell.css +21 -75
  20. package/dist/components/DataGrid/TableBody/LoadingCell.js +5 -5
  21. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +2 -2
  22. package/dist/components/DataGrid/TableBody/TableBodyRow.css +21 -75
  23. package/dist/components/DataGrid/TableBody/TableBodyRow.js +5 -5
  24. package/dist/components/DataGrid/TableBody/index.cjs +2 -2
  25. package/dist/components/DataGrid/TableBody/index.css +21 -75
  26. package/dist/components/DataGrid/TableBody/index.js +5 -5
  27. package/dist/components/DataGrid/index.cjs +2 -2
  28. package/dist/components/DataGrid/index.css +21 -75
  29. package/dist/components/DataGrid/index.js +5 -5
  30. package/dist/components/DataGrid/utils.cjs +2 -2
  31. package/dist/components/DataGrid/utils.css +21 -75
  32. package/dist/components/DataGrid/utils.js +5 -5
  33. package/dist/components/DataGridCell.cjs +2 -2
  34. package/dist/components/DataGridCell.js +3 -3
  35. package/dist/components/DateInput.cjs +2 -2
  36. package/dist/components/DateInput.css +21 -75
  37. package/dist/components/DateInput.js +5 -5
  38. package/dist/components/DateRangeInput.cjs +2 -2
  39. package/dist/components/DateRangeInput.css +21 -75
  40. package/dist/components/DateRangeInput.js +5 -5
  41. package/dist/components/FilterGroup.cjs +2 -2
  42. package/dist/components/FilterGroup.js +2 -2
  43. package/dist/components/Input.cjs +2 -2
  44. package/dist/components/Input.js +1 -1
  45. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +2 -2
  46. package/dist/components/MobileDataGrid/ColumnSelector/index.css +21 -75
  47. package/dist/components/MobileDataGrid/ColumnSelector/index.js +5 -5
  48. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +2 -2
  49. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +21 -75
  50. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +5 -5
  51. package/dist/components/MobileDataGrid/index.cjs +2 -2
  52. package/dist/components/MobileDataGrid/index.css +21 -75
  53. package/dist/components/MobileDataGrid/index.js +5 -5
  54. package/dist/components/Password.cjs +2 -2
  55. package/dist/components/Password.js +1 -1
  56. package/dist/components/Search.cjs +2 -2
  57. package/dist/components/Search.js +2 -2
  58. package/dist/components/Select.cjs +2 -2
  59. package/dist/components/Select.js +2 -2
  60. package/dist/components/Stepper.cjs +2 -2
  61. package/dist/components/Stepper.js +1 -1
  62. package/dist/components/Textarea.cjs +46 -10
  63. package/dist/components/Textarea.js +46 -10
  64. package/dist/components/Time.cjs +2 -2
  65. package/dist/components/Time.js +1 -1
  66. package/dist/components/index.cjs +2 -2
  67. package/dist/components/index.css +21 -75
  68. package/dist/components/index.js +5 -5
  69. package/dist/index.css +21 -75
  70. package/package.json +1 -1
@@ -13,25 +13,26 @@ import {
13
13
 
14
14
  // src/components/Textarea.tsx
15
15
  import clsx from "clsx";
16
+ import { useEffect, useRef, useState } from "react";
16
17
  import { jsx, jsxs } from "react/jsx-runtime";
17
18
  var textareaBaseClass = clsx(
18
19
  "w-full min-h-19",
19
20
  "rounded-base border border-border-primary-normal bg-background-primary-normal caret-text-action-normal",
20
- "outline-transparent outline-2",
21
+ "outline-transparent outline-2 -outline-offset-2",
21
22
  componentPaddingMinusBorder,
22
23
  baseTransition
23
24
  );
24
25
  var textareaInvalidClass = clsx(
25
- "data-error:not-disabled:border-transparent data-error:not-focus:outline-border-primary-error data-error:not-focus:outline-1"
26
+ "has-[[data-error]]:border-transparent has-[[data-error]]:not-focus-within:outline-border-primary-error has-[[data-error]]:not-focus-within:outline-1"
26
27
  );
27
28
  var textareaFocusClass = clsx(
28
- "focus:border-transparent focus:outline-border-primary-focus"
29
+ "has-[[data-focus]]:border-transparent has-[[data-focus]]:outline-border-primary-focus focus-within:border-transparent focus-within:outline-border-primary-focus"
29
30
  );
30
31
  var textareaDisabledClass = clsx(
31
- "disabled:bg-background-action-secondary-disabled disabled:border-border-primary-normal"
32
+ "has-disabled:bg-background-action-secondary-disabled"
32
33
  );
33
34
  var textareaReadOnlyClass = clsx(
34
- "read-only:outline-none read-only:bg-transparent read-only:border-transparent read-only:appearance-none read-only:resize-none read-only:not-disabled:pl-0"
35
+ "has-[textarea:not(:disabled):read-only]:outline-none has-[textarea:not(:disabled):read-only]:bg-transparent has-[textarea:not(:disabled):read-only]:border-transparent has-[textarea:not(:disabled):read-only]:pl-0"
35
36
  );
36
37
  var Textarea = (_a) => {
37
38
  var _b = _a, {
@@ -39,16 +40,33 @@ var Textarea = (_a) => {
39
40
  testid,
40
41
  label,
41
42
  error,
42
- caption
43
+ caption,
44
+ selectOnFocus
43
45
  } = _b, props = __objRest(_b, [
44
46
  "id",
45
47
  "testid",
46
48
  "label",
47
49
  "error",
48
- "caption"
50
+ "caption",
51
+ "selectOnFocus"
49
52
  ]);
53
+ const [focus, setFocus] = useState(false);
54
+ const textareaRef = useRef(null);
55
+ useEffect(() => {
56
+ const textarea = textareaRef.current;
57
+ const focusHandler = () => {
58
+ textarea == null ? void 0 : textarea.select();
59
+ };
60
+ if (selectOnFocus) {
61
+ textarea == null ? void 0 : textarea.addEventListener("focus", focusHandler);
62
+ return () => {
63
+ textarea == null ? void 0 : textarea.removeEventListener("focus", focusHandler);
64
+ };
65
+ }
66
+ }, [selectOnFocus]);
50
67
  const attributes = {
51
- "data-error": error || null
68
+ "data-error": error && !focus || null,
69
+ "data-focus": focus || null
52
70
  };
53
71
  return /* @__PURE__ */ jsxs(
54
72
  "label",
@@ -78,6 +96,7 @@ var Textarea = (_a) => {
78
96
  __spreadProps(__spreadValues(__spreadValues({}, props), attributes), {
79
97
  id,
80
98
  "data-testid": testid,
99
+ ref: textareaRef,
81
100
  className: clsx(
82
101
  "disabled:text-text-primary-disabled",
83
102
  typography.paragraph,
@@ -86,10 +105,27 @@ var Textarea = (_a) => {
86
105
  textareaFocusClass,
87
106
  textareaDisabledClass,
88
107
  textareaReadOnlyClass
89
- )
108
+ ),
109
+ onFocus: (e) => {
110
+ var _a2;
111
+ (_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
112
+ setFocus(true);
113
+ },
114
+ onBlur: (e) => {
115
+ var _a2;
116
+ (_a2 = props.onBlur) == null ? void 0 : _a2.call(props, e);
117
+ setFocus(false);
118
+ }
90
119
  })
91
120
  ),
92
- caption && /* @__PURE__ */ jsx("div", { id: id ? `${id}-caption` : void 0, "data-testid": testid ? `${testid}-caption` : void 0, children: caption })
121
+ caption && /* @__PURE__ */ jsx(
122
+ "div",
123
+ {
124
+ id: id ? `${id}-caption` : void 0,
125
+ "data-testid": testid ? `${testid}-caption` : void 0,
126
+ children: caption
127
+ }
128
+ )
93
129
  ]
94
130
  }
95
131
  );
@@ -741,7 +741,7 @@ var Input = (_a) => {
741
741
  }
742
742
  return;
743
743
  }
744
- if ((variant === "percentage" || variant === "uom") && e.target.type === "number") {
744
+ if (variant === "uom" && e.target.type === "number") {
745
745
  const numeric = Number(rawValue);
746
746
  if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
747
747
  const clamped = maxNumber;
@@ -788,7 +788,7 @@ var Input = (_a) => {
788
788
  });
789
789
  onChange(syntheticEvent);
790
790
  }
791
- } else if (variant === "uom" || variant === "percentage") {
791
+ } else if (variant === "uom") {
792
792
  const formattedValue = formatDecimalValue(e.target.value, decimals);
793
793
  e.target.value = formattedValue;
794
794
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InputBase
3
- } from "../chunk-NWTVBVBC.js";
3
+ } from "../chunk-7T5RGDCN.js";
4
4
  import "../chunk-HXGJVYGQ.js";
5
5
  import {
6
6
  findDocumentRoot
@@ -2030,7 +2030,7 @@ var Input = (_a) => {
2030
2030
  }
2031
2031
  return;
2032
2032
  }
2033
- if ((variant === "percentage" || variant === "uom") && e.target.type === "number") {
2033
+ if (variant === "uom" && e.target.type === "number") {
2034
2034
  const numeric = Number(rawValue);
2035
2035
  if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
2036
2036
  const clamped = maxNumber;
@@ -2077,7 +2077,7 @@ var Input = (_a) => {
2077
2077
  });
2078
2078
  onChange(syntheticEvent);
2079
2079
  }
2080
- } else if (variant === "uom" || variant === "percentage") {
2080
+ } else if (variant === "uom") {
2081
2081
  const formattedValue = formatDecimalValue(e.target.value, decimals);
2082
2082
  e.target.value = formattedValue;
2083
2083
  }
@@ -3044,39 +3044,6 @@
3044
3044
  background-color: var(--color-background-grouped-secondary-normal);
3045
3045
  }
3046
3046
  }
3047
- .read-only\:resize-none {
3048
- &:read-only {
3049
- resize: none;
3050
- }
3051
- }
3052
- .read-only\:appearance-none {
3053
- &:read-only {
3054
- appearance: none;
3055
- }
3056
- }
3057
- .read-only\:border-transparent {
3058
- &:read-only {
3059
- border-color: transparent;
3060
- }
3061
- }
3062
- .read-only\:bg-transparent {
3063
- &:read-only {
3064
- background-color: transparent;
3065
- }
3066
- }
3067
- .read-only\:outline-none {
3068
- &:read-only {
3069
- --tw-outline-style: none;
3070
- outline-style: none;
3071
- }
3072
- }
3073
- .read-only\:not-disabled\:pl-0 {
3074
- &:read-only {
3075
- &:not(*:disabled) {
3076
- padding-left: calc(var(--spacing) * 0);
3077
- }
3078
- }
3079
- }
3080
3047
  .focus-within\:\!z-10 {
3081
3048
  &:focus-within {
3082
3049
  z-index: 10 !important;
@@ -3325,11 +3292,6 @@
3325
3292
  border-color: var(--color-border-action-hover);
3326
3293
  }
3327
3294
  }
3328
- .focus\:border-transparent {
3329
- &:focus {
3330
- border-color: transparent;
3331
- }
3332
- }
3333
3295
  .focus\:bg-background-action-critical-primary-hover {
3334
3296
  &:focus {
3335
3297
  background-color: var(--color-background-action-critical-primary-hover);
@@ -3382,11 +3344,6 @@
3382
3344
  outline-offset: calc(2px * -1);
3383
3345
  }
3384
3346
  }
3385
- .focus\:outline-border-primary-focus {
3386
- &:focus {
3387
- outline-color: var(--color-border-primary-focus);
3388
- }
3389
- }
3390
3347
  .focus\:outline-neutral-300 {
3391
3348
  &:focus {
3392
3349
  outline-color: var(--color-neutral-300);
@@ -3600,11 +3557,6 @@
3600
3557
  border-color: var(--color-border-action-disabled);
3601
3558
  }
3602
3559
  }
3603
- .disabled\:border-border-primary-normal {
3604
- &:disabled {
3605
- border-color: var(--color-border-primary-normal);
3606
- }
3607
- }
3608
3560
  .disabled\:border-transparent {
3609
3561
  &:disabled {
3610
3562
  border-color: transparent;
@@ -3635,11 +3587,6 @@
3635
3587
  background-color: var(--color-background-action-primary-disabled);
3636
3588
  }
3637
3589
  }
3638
- .disabled\:bg-background-action-secondary-disabled {
3639
- &:disabled {
3640
- background-color: var(--color-background-action-secondary-disabled);
3641
- }
3642
- }
3643
3590
  .disabled\:bg-neutral-200 {
3644
3591
  &:disabled {
3645
3592
  background-color: var(--color-neutral-200);
@@ -3756,6 +3703,27 @@
3756
3703
  outline-style: none;
3757
3704
  }
3758
3705
  }
3706
+ .has-\[textarea\:not\(\:disabled\)\:read-only\]\:border-transparent {
3707
+ &:has(*:is(textarea:not(:disabled):read-only)) {
3708
+ border-color: transparent;
3709
+ }
3710
+ }
3711
+ .has-\[textarea\:not\(\:disabled\)\:read-only\]\:bg-transparent {
3712
+ &:has(*:is(textarea:not(:disabled):read-only)) {
3713
+ background-color: transparent;
3714
+ }
3715
+ }
3716
+ .has-\[textarea\:not\(\:disabled\)\:read-only\]\:pl-0 {
3717
+ &:has(*:is(textarea:not(:disabled):read-only)) {
3718
+ padding-left: calc(var(--spacing) * 0);
3719
+ }
3720
+ }
3721
+ .has-\[textarea\:not\(\:disabled\)\:read-only\]\:outline-none {
3722
+ &:has(*:is(textarea:not(:disabled):read-only)) {
3723
+ --tw-outline-style: none;
3724
+ outline-style: none;
3725
+ }
3726
+ }
3759
3727
  .data-active\:border-transparent {
3760
3728
  &[data-active] {
3761
3729
  border-color: transparent;
@@ -3781,28 +3749,6 @@
3781
3749
  border-color: var(--color-border-primary-normal);
3782
3750
  }
3783
3751
  }
3784
- .data-error\:not-focus\:outline-1 {
3785
- &[data-error] {
3786
- &:not(*:focus) {
3787
- outline-style: var(--tw-outline-style);
3788
- outline-width: 1px;
3789
- }
3790
- }
3791
- }
3792
- .data-error\:not-focus\:outline-border-primary-error {
3793
- &[data-error] {
3794
- &:not(*:focus) {
3795
- outline-color: var(--color-border-primary-error);
3796
- }
3797
- }
3798
- }
3799
- .data-error\:not-disabled\:border-transparent {
3800
- &[data-error] {
3801
- &:not(*:disabled) {
3802
- border-color: transparent;
3803
- }
3804
- }
3805
- }
3806
3752
  .data-selected\:border-transparent {
3807
3753
  &[data-selected] {
3808
3754
  border-color: transparent;
@@ -2,7 +2,7 @@ import {
2
2
  DataGrid,
3
3
  DateInput,
4
4
  MobileDataGrid
5
- } from "../chunk-3JQPFWKR.js";
5
+ } from "../chunk-LXMIQ7RM.js";
6
6
  import "../chunk-CJ7V4X6B.js";
7
7
  import "../chunk-M7INAUAJ.js";
8
8
  import "../chunk-7ZCXZDJD.js";
@@ -26,7 +26,7 @@ import "../chunk-AT4AWD6B.js";
26
26
  import "../chunk-EWGHVZL5.js";
27
27
  import {
28
28
  Select
29
- } from "../chunk-I5BV7UPG.js";
29
+ } from "../chunk-UF5XGCSF.js";
30
30
  import {
31
31
  SimpleTable
32
32
  } from "../chunk-63WMDTVQ.js";
@@ -64,7 +64,7 @@ import {
64
64
  DataGridCell,
65
65
  DragAlongCell,
66
66
  DraggableCellHeader
67
- } from "../chunk-DWKS5ZXG.js";
67
+ } from "../chunk-KBHNJ5G7.js";
68
68
  import {
69
69
  Menu
70
70
  } from "../chunk-BU5QGYOC.js";
@@ -74,10 +74,10 @@ import {
74
74
  } from "../chunk-GTJADN2C.js";
75
75
  import {
76
76
  Search
77
- } from "../chunk-BKBJOF4J.js";
77
+ } from "../chunk-FHXCCVOG.js";
78
78
  import {
79
79
  Input
80
- } from "../chunk-NWTVBVBC.js";
80
+ } from "../chunk-7T5RGDCN.js";
81
81
  import {
82
82
  Label
83
83
  } from "../chunk-HXGJVYGQ.js";
package/dist/index.css CHANGED
@@ -3022,39 +3022,6 @@
3022
3022
  background-color: var(--color-background-grouped-secondary-normal);
3023
3023
  }
3024
3024
  }
3025
- .read-only\:resize-none {
3026
- &:read-only {
3027
- resize: none;
3028
- }
3029
- }
3030
- .read-only\:appearance-none {
3031
- &:read-only {
3032
- appearance: none;
3033
- }
3034
- }
3035
- .read-only\:border-transparent {
3036
- &:read-only {
3037
- border-color: transparent;
3038
- }
3039
- }
3040
- .read-only\:bg-transparent {
3041
- &:read-only {
3042
- background-color: transparent;
3043
- }
3044
- }
3045
- .read-only\:outline-none {
3046
- &:read-only {
3047
- --tw-outline-style: none;
3048
- outline-style: none;
3049
- }
3050
- }
3051
- .read-only\:not-disabled\:pl-0 {
3052
- &:read-only {
3053
- &:not(*:disabled) {
3054
- padding-left: calc(var(--spacing) * 0);
3055
- }
3056
- }
3057
- }
3058
3025
  .focus-within\:\!z-10 {
3059
3026
  &:focus-within {
3060
3027
  z-index: 10 !important;
@@ -3303,11 +3270,6 @@
3303
3270
  border-color: var(--color-border-action-hover);
3304
3271
  }
3305
3272
  }
3306
- .focus\:border-transparent {
3307
- &:focus {
3308
- border-color: transparent;
3309
- }
3310
- }
3311
3273
  .focus\:bg-background-action-critical-primary-hover {
3312
3274
  &:focus {
3313
3275
  background-color: var(--color-background-action-critical-primary-hover);
@@ -3360,11 +3322,6 @@
3360
3322
  outline-offset: calc(2px * -1);
3361
3323
  }
3362
3324
  }
3363
- .focus\:outline-border-primary-focus {
3364
- &:focus {
3365
- outline-color: var(--color-border-primary-focus);
3366
- }
3367
- }
3368
3325
  .focus\:outline-neutral-300 {
3369
3326
  &:focus {
3370
3327
  outline-color: var(--color-neutral-300);
@@ -3578,11 +3535,6 @@
3578
3535
  border-color: var(--color-border-action-disabled);
3579
3536
  }
3580
3537
  }
3581
- .disabled\:border-border-primary-normal {
3582
- &:disabled {
3583
- border-color: var(--color-border-primary-normal);
3584
- }
3585
- }
3586
3538
  .disabled\:border-transparent {
3587
3539
  &:disabled {
3588
3540
  border-color: transparent;
@@ -3613,11 +3565,6 @@
3613
3565
  background-color: var(--color-background-action-primary-disabled);
3614
3566
  }
3615
3567
  }
3616
- .disabled\:bg-background-action-secondary-disabled {
3617
- &:disabled {
3618
- background-color: var(--color-background-action-secondary-disabled);
3619
- }
3620
- }
3621
3568
  .disabled\:bg-neutral-200 {
3622
3569
  &:disabled {
3623
3570
  background-color: var(--color-neutral-200);
@@ -3734,6 +3681,27 @@
3734
3681
  outline-style: none;
3735
3682
  }
3736
3683
  }
3684
+ .has-\[textarea\:not\(\:disabled\)\:read-only\]\:border-transparent {
3685
+ &:has(*:is(textarea:not(:disabled):read-only)) {
3686
+ border-color: transparent;
3687
+ }
3688
+ }
3689
+ .has-\[textarea\:not\(\:disabled\)\:read-only\]\:bg-transparent {
3690
+ &:has(*:is(textarea:not(:disabled):read-only)) {
3691
+ background-color: transparent;
3692
+ }
3693
+ }
3694
+ .has-\[textarea\:not\(\:disabled\)\:read-only\]\:pl-0 {
3695
+ &:has(*:is(textarea:not(:disabled):read-only)) {
3696
+ padding-left: calc(var(--spacing) * 0);
3697
+ }
3698
+ }
3699
+ .has-\[textarea\:not\(\:disabled\)\:read-only\]\:outline-none {
3700
+ &:has(*:is(textarea:not(:disabled):read-only)) {
3701
+ --tw-outline-style: none;
3702
+ outline-style: none;
3703
+ }
3704
+ }
3737
3705
  .data-active\:border-transparent {
3738
3706
  &[data-active] {
3739
3707
  border-color: transparent;
@@ -3759,28 +3727,6 @@
3759
3727
  border-color: var(--color-border-primary-normal);
3760
3728
  }
3761
3729
  }
3762
- .data-error\:not-focus\:outline-1 {
3763
- &[data-error] {
3764
- &:not(*:focus) {
3765
- outline-style: var(--tw-outline-style);
3766
- outline-width: 1px;
3767
- }
3768
- }
3769
- }
3770
- .data-error\:not-focus\:outline-border-primary-error {
3771
- &[data-error] {
3772
- &:not(*:focus) {
3773
- outline-color: var(--color-border-primary-error);
3774
- }
3775
- }
3776
- }
3777
- .data-error\:not-disabled\:border-transparent {
3778
- &[data-error] {
3779
- &:not(*:disabled) {
3780
- border-color: transparent;
3781
- }
3782
- }
3783
- }
3784
3730
  .data-selected\:border-transparent {
3785
3731
  &[data-selected] {
3786
3732
  border-color: transparent;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.573",
4
+ "version": "0.0.575",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",