@x-plat/design-system 0.14.16 → 0.14.18

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.
@@ -103,9 +103,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
103
103
  const sizeRef = import_react.default.useRef(null);
104
104
  const scrollParentRef = import_react.default.useRef(null);
105
105
  const placedRef = import_react.default.useRef(false);
106
+ const frozenMaxRef = import_react.default.useRef(void 0);
106
107
  const calculatePosition = import_react.default.useCallback((remeasure = false) => {
107
108
  const pop = popRef.current;
108
109
  if (!triggerRef.current || !pop) return;
110
+ if (remeasure) frozenMaxRef.current = void 0;
109
111
  if (remeasure || !sizeRef.current) {
110
112
  sizeRef.current = {
111
113
  w: pop.offsetWidth,
@@ -127,12 +129,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
127
129
  };
128
130
  const first = !placedRef.current;
129
131
  if (first) pop.style.transition = "none";
130
- const { direction: next, top, left, over, maxHeight } = computePlacement(
132
+ const frozen = frozenMaxRef.current;
133
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
134
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
131
135
  triggerRect,
132
136
  popW,
133
- popH,
137
+ effectiveH,
134
138
  clip
135
139
  );
140
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
141
+ const maxHeight = frozenMaxRef.current;
136
142
  pop.style.top = `${top + window.scrollY}px`;
137
143
  pop.style.left = `${left + window.scrollX}px`;
138
144
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -151,6 +157,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
151
157
  sizeRef.current = null;
152
158
  scrollParentRef.current = null;
153
159
  placedRef.current = false;
160
+ frozenMaxRef.current = void 0;
154
161
  return;
155
162
  }
156
163
  if (triggerRef.current) {
@@ -67,9 +67,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
67
67
  const sizeRef = React.useRef(null);
68
68
  const scrollParentRef = React.useRef(null);
69
69
  const placedRef = React.useRef(false);
70
+ const frozenMaxRef = React.useRef(void 0);
70
71
  const calculatePosition = React.useCallback((remeasure = false) => {
71
72
  const pop = popRef.current;
72
73
  if (!triggerRef.current || !pop) return;
74
+ if (remeasure) frozenMaxRef.current = void 0;
73
75
  if (remeasure || !sizeRef.current) {
74
76
  sizeRef.current = {
75
77
  w: pop.offsetWidth,
@@ -91,12 +93,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
91
93
  };
92
94
  const first = !placedRef.current;
93
95
  if (first) pop.style.transition = "none";
94
- const { direction: next, top, left, over, maxHeight } = computePlacement(
96
+ const frozen = frozenMaxRef.current;
97
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
98
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
95
99
  triggerRect,
96
100
  popW,
97
- popH,
101
+ effectiveH,
98
102
  clip
99
103
  );
104
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
105
+ const maxHeight = frozenMaxRef.current;
100
106
  pop.style.top = `${top + window.scrollY}px`;
101
107
  pop.style.left = `${left + window.scrollX}px`;
102
108
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -115,6 +121,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
115
121
  sizeRef.current = null;
116
122
  scrollParentRef.current = null;
117
123
  placedRef.current = false;
124
+ frozenMaxRef.current = void 0;
118
125
  return;
119
126
  }
120
127
  if (triggerRef.current) {
@@ -103,9 +103,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
103
103
  const sizeRef = import_react.default.useRef(null);
104
104
  const scrollParentRef = import_react.default.useRef(null);
105
105
  const placedRef = import_react.default.useRef(false);
106
+ const frozenMaxRef = import_react.default.useRef(void 0);
106
107
  const calculatePosition = import_react.default.useCallback((remeasure = false) => {
107
108
  const pop = popRef.current;
108
109
  if (!triggerRef.current || !pop) return;
110
+ if (remeasure) frozenMaxRef.current = void 0;
109
111
  if (remeasure || !sizeRef.current) {
110
112
  sizeRef.current = {
111
113
  w: pop.offsetWidth,
@@ -127,12 +129,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
127
129
  };
128
130
  const first = !placedRef.current;
129
131
  if (first) pop.style.transition = "none";
130
- const { direction: next, top, left, over, maxHeight } = computePlacement(
132
+ const frozen = frozenMaxRef.current;
133
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
134
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
131
135
  triggerRect,
132
136
  popW,
133
- popH,
137
+ effectiveH,
134
138
  clip
135
139
  );
140
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
141
+ const maxHeight = frozenMaxRef.current;
136
142
  pop.style.top = `${top + window.scrollY}px`;
137
143
  pop.style.left = `${left + window.scrollX}px`;
138
144
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -151,6 +157,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
151
157
  sizeRef.current = null;
152
158
  scrollParentRef.current = null;
153
159
  placedRef.current = false;
160
+ frozenMaxRef.current = void 0;
154
161
  return;
155
162
  }
156
163
  if (triggerRef.current) {
@@ -67,9 +67,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
67
67
  const sizeRef = React.useRef(null);
68
68
  const scrollParentRef = React.useRef(null);
69
69
  const placedRef = React.useRef(false);
70
+ const frozenMaxRef = React.useRef(void 0);
70
71
  const calculatePosition = React.useCallback((remeasure = false) => {
71
72
  const pop = popRef.current;
72
73
  if (!triggerRef.current || !pop) return;
74
+ if (remeasure) frozenMaxRef.current = void 0;
73
75
  if (remeasure || !sizeRef.current) {
74
76
  sizeRef.current = {
75
77
  w: pop.offsetWidth,
@@ -91,12 +93,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
91
93
  };
92
94
  const first = !placedRef.current;
93
95
  if (first) pop.style.transition = "none";
94
- const { direction: next, top, left, over, maxHeight } = computePlacement(
96
+ const frozen = frozenMaxRef.current;
97
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
98
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
95
99
  triggerRect,
96
100
  popW,
97
- popH,
101
+ effectiveH,
98
102
  clip
99
103
  );
104
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
105
+ const maxHeight = frozenMaxRef.current;
100
106
  pop.style.top = `${top + window.scrollY}px`;
101
107
  pop.style.left = `${left + window.scrollX}px`;
102
108
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -115,6 +121,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
115
121
  sizeRef.current = null;
116
122
  scrollParentRef.current = null;
117
123
  placedRef.current = false;
124
+ frozenMaxRef.current = void 0;
118
125
  return;
119
126
  }
120
127
  if (triggerRef.current) {
@@ -104,9 +104,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
104
104
  const sizeRef = import_react.default.useRef(null);
105
105
  const scrollParentRef = import_react.default.useRef(null);
106
106
  const placedRef = import_react.default.useRef(false);
107
+ const frozenMaxRef = import_react.default.useRef(void 0);
107
108
  const calculatePosition = import_react.default.useCallback((remeasure = false) => {
108
109
  const pop = popRef.current;
109
110
  if (!triggerRef.current || !pop) return;
111
+ if (remeasure) frozenMaxRef.current = void 0;
110
112
  if (remeasure || !sizeRef.current) {
111
113
  sizeRef.current = {
112
114
  w: pop.offsetWidth,
@@ -128,12 +130,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
128
130
  };
129
131
  const first = !placedRef.current;
130
132
  if (first) pop.style.transition = "none";
131
- const { direction: next, top, left, over, maxHeight } = computePlacement(
133
+ const frozen = frozenMaxRef.current;
134
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
135
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
132
136
  triggerRect,
133
137
  popW,
134
- popH,
138
+ effectiveH,
135
139
  clip
136
140
  );
141
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
142
+ const maxHeight = frozenMaxRef.current;
137
143
  pop.style.top = `${top + window.scrollY}px`;
138
144
  pop.style.left = `${left + window.scrollX}px`;
139
145
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -152,6 +158,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
152
158
  sizeRef.current = null;
153
159
  scrollParentRef.current = null;
154
160
  placedRef.current = false;
161
+ frozenMaxRef.current = void 0;
155
162
  return;
156
163
  }
157
164
  if (triggerRef.current) {
@@ -1322,7 +1329,9 @@ var SelectItem = (props) => {
1322
1329
  {
1323
1330
  className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
1324
1331
  onClick: handleClick,
1325
- role: "menuitem",
1332
+ role: "option",
1333
+ "aria-selected": isSelected,
1334
+ "aria-disabled": disabled || void 0,
1326
1335
  tabIndex: disabled ? void 0 : 0,
1327
1336
  onKeyDown: (e) => {
1328
1337
  if (e.key === "Enter" || e.key === " ") {
@@ -67,9 +67,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
67
67
  const sizeRef = React.useRef(null);
68
68
  const scrollParentRef = React.useRef(null);
69
69
  const placedRef = React.useRef(false);
70
+ const frozenMaxRef = React.useRef(void 0);
70
71
  const calculatePosition = React.useCallback((remeasure = false) => {
71
72
  const pop = popRef.current;
72
73
  if (!triggerRef.current || !pop) return;
74
+ if (remeasure) frozenMaxRef.current = void 0;
73
75
  if (remeasure || !sizeRef.current) {
74
76
  sizeRef.current = {
75
77
  w: pop.offsetWidth,
@@ -91,12 +93,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
91
93
  };
92
94
  const first = !placedRef.current;
93
95
  if (first) pop.style.transition = "none";
94
- const { direction: next, top, left, over, maxHeight } = computePlacement(
96
+ const frozen = frozenMaxRef.current;
97
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
98
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
95
99
  triggerRect,
96
100
  popW,
97
- popH,
101
+ effectiveH,
98
102
  clip
99
103
  );
104
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
105
+ const maxHeight = frozenMaxRef.current;
100
106
  pop.style.top = `${top + window.scrollY}px`;
101
107
  pop.style.left = `${left + window.scrollX}px`;
102
108
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -115,6 +121,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
115
121
  sizeRef.current = null;
116
122
  scrollParentRef.current = null;
117
123
  placedRef.current = false;
124
+ frozenMaxRef.current = void 0;
118
125
  return;
119
126
  }
120
127
  if (triggerRef.current) {
@@ -1285,7 +1292,9 @@ var SelectItem = (props) => {
1285
1292
  {
1286
1293
  className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
1287
1294
  onClick: handleClick,
1288
- role: "menuitem",
1295
+ role: "option",
1296
+ "aria-selected": isSelected,
1297
+ "aria-disabled": disabled || void 0,
1289
1298
  tabIndex: disabled ? void 0 : 0,
1290
1299
  onKeyDown: (e) => {
1291
1300
  if (e.key === "Enter" || e.key === " ") {
@@ -103,9 +103,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
103
103
  const sizeRef = import_react.default.useRef(null);
104
104
  const scrollParentRef = import_react.default.useRef(null);
105
105
  const placedRef = import_react.default.useRef(false);
106
+ const frozenMaxRef = import_react.default.useRef(void 0);
106
107
  const calculatePosition = import_react.default.useCallback((remeasure = false) => {
107
108
  const pop = popRef.current;
108
109
  if (!triggerRef.current || !pop) return;
110
+ if (remeasure) frozenMaxRef.current = void 0;
109
111
  if (remeasure || !sizeRef.current) {
110
112
  sizeRef.current = {
111
113
  w: pop.offsetWidth,
@@ -127,12 +129,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
127
129
  };
128
130
  const first = !placedRef.current;
129
131
  if (first) pop.style.transition = "none";
130
- const { direction: next, top, left, over, maxHeight } = computePlacement(
132
+ const frozen = frozenMaxRef.current;
133
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
134
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
131
135
  triggerRect,
132
136
  popW,
133
- popH,
137
+ effectiveH,
134
138
  clip
135
139
  );
140
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
141
+ const maxHeight = frozenMaxRef.current;
136
142
  pop.style.top = `${top + window.scrollY}px`;
137
143
  pop.style.left = `${left + window.scrollX}px`;
138
144
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -151,6 +157,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
151
157
  sizeRef.current = null;
152
158
  scrollParentRef.current = null;
153
159
  placedRef.current = false;
160
+ frozenMaxRef.current = void 0;
154
161
  return;
155
162
  }
156
163
  if (triggerRef.current) {
@@ -67,9 +67,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
67
67
  const sizeRef = React.useRef(null);
68
68
  const scrollParentRef = React.useRef(null);
69
69
  const placedRef = React.useRef(false);
70
+ const frozenMaxRef = React.useRef(void 0);
70
71
  const calculatePosition = React.useCallback((remeasure = false) => {
71
72
  const pop = popRef.current;
72
73
  if (!triggerRef.current || !pop) return;
74
+ if (remeasure) frozenMaxRef.current = void 0;
73
75
  if (remeasure || !sizeRef.current) {
74
76
  sizeRef.current = {
75
77
  w: pop.offsetWidth,
@@ -91,12 +93,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
91
93
  };
92
94
  const first = !placedRef.current;
93
95
  if (first) pop.style.transition = "none";
94
- const { direction: next, top, left, over, maxHeight } = computePlacement(
96
+ const frozen = frozenMaxRef.current;
97
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
98
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
95
99
  triggerRect,
96
100
  popW,
97
- popH,
101
+ effectiveH,
98
102
  clip
99
103
  );
104
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
105
+ const maxHeight = frozenMaxRef.current;
100
106
  pop.style.top = `${top + window.scrollY}px`;
101
107
  pop.style.left = `${left + window.scrollX}px`;
102
108
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -115,6 +121,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
115
121
  sizeRef.current = null;
116
122
  scrollParentRef.current = null;
117
123
  placedRef.current = false;
124
+ frozenMaxRef.current = void 0;
118
125
  return;
119
126
  }
120
127
  if (triggerRef.current) {
@@ -3289,9 +3289,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3289
3289
  const sizeRef = import_react10.default.useRef(null);
3290
3290
  const scrollParentRef = import_react10.default.useRef(null);
3291
3291
  const placedRef = import_react10.default.useRef(false);
3292
+ const frozenMaxRef = import_react10.default.useRef(void 0);
3292
3293
  const calculatePosition = import_react10.default.useCallback((remeasure = false) => {
3293
3294
  const pop = popRef.current;
3294
3295
  if (!triggerRef.current || !pop) return;
3296
+ if (remeasure) frozenMaxRef.current = void 0;
3295
3297
  if (remeasure || !sizeRef.current) {
3296
3298
  sizeRef.current = {
3297
3299
  w: pop.offsetWidth,
@@ -3313,12 +3315,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3313
3315
  };
3314
3316
  const first = !placedRef.current;
3315
3317
  if (first) pop.style.transition = "none";
3316
- const { direction: next, top, left, over, maxHeight } = computePlacement(
3318
+ const frozen = frozenMaxRef.current;
3319
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
3320
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
3317
3321
  triggerRect,
3318
3322
  popW,
3319
- popH,
3323
+ effectiveH,
3320
3324
  clip
3321
3325
  );
3326
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
3327
+ const maxHeight = frozenMaxRef.current;
3322
3328
  pop.style.top = `${top + window.scrollY}px`;
3323
3329
  pop.style.left = `${left + window.scrollX}px`;
3324
3330
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -3337,6 +3343,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3337
3343
  sizeRef.current = null;
3338
3344
  scrollParentRef.current = null;
3339
3345
  placedRef.current = false;
3346
+ frozenMaxRef.current = void 0;
3340
3347
  return;
3341
3348
  }
3342
3349
  if (triggerRef.current) {
@@ -6293,7 +6300,9 @@ var SelectItem = (props) => {
6293
6300
  {
6294
6301
  className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
6295
6302
  onClick: handleClick,
6296
- role: "menuitem",
6303
+ role: "option",
6304
+ "aria-selected": isSelected,
6305
+ "aria-disabled": disabled || void 0,
6297
6306
  tabIndex: disabled ? void 0 : 0,
6298
6307
  onKeyDown: (e) => {
6299
6308
  if (e.key === "Enter" || e.key === " ") {
@@ -3187,9 +3187,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3187
3187
  const sizeRef = React10.useRef(null);
3188
3188
  const scrollParentRef = React10.useRef(null);
3189
3189
  const placedRef = React10.useRef(false);
3190
+ const frozenMaxRef = React10.useRef(void 0);
3190
3191
  const calculatePosition = React10.useCallback((remeasure = false) => {
3191
3192
  const pop = popRef.current;
3192
3193
  if (!triggerRef.current || !pop) return;
3194
+ if (remeasure) frozenMaxRef.current = void 0;
3193
3195
  if (remeasure || !sizeRef.current) {
3194
3196
  sizeRef.current = {
3195
3197
  w: pop.offsetWidth,
@@ -3211,12 +3213,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3211
3213
  };
3212
3214
  const first = !placedRef.current;
3213
3215
  if (first) pop.style.transition = "none";
3214
- const { direction: next, top, left, over, maxHeight } = computePlacement(
3216
+ const frozen = frozenMaxRef.current;
3217
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
3218
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
3215
3219
  triggerRect,
3216
3220
  popW,
3217
- popH,
3221
+ effectiveH,
3218
3222
  clip
3219
3223
  );
3224
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
3225
+ const maxHeight = frozenMaxRef.current;
3220
3226
  pop.style.top = `${top + window.scrollY}px`;
3221
3227
  pop.style.left = `${left + window.scrollX}px`;
3222
3228
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -3235,6 +3241,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3235
3241
  sizeRef.current = null;
3236
3242
  scrollParentRef.current = null;
3237
3243
  placedRef.current = false;
3244
+ frozenMaxRef.current = void 0;
3238
3245
  return;
3239
3246
  }
3240
3247
  if (triggerRef.current) {
@@ -6191,7 +6198,9 @@ var SelectItem = (props) => {
6191
6198
  {
6192
6199
  className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
6193
6200
  onClick: handleClick,
6194
- role: "menuitem",
6201
+ role: "option",
6202
+ "aria-selected": isSelected,
6203
+ "aria-disabled": disabled || void 0,
6195
6204
  tabIndex: disabled ? void 0 : 0,
6196
6205
  onKeyDown: (e) => {
6197
6206
  if (e.key === "Enter" || e.key === " ") {
package/dist/index.cjs CHANGED
@@ -7701,9 +7701,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7701
7701
  const sizeRef = import_react10.default.useRef(null);
7702
7702
  const scrollParentRef = import_react10.default.useRef(null);
7703
7703
  const placedRef = import_react10.default.useRef(false);
7704
+ const frozenMaxRef = import_react10.default.useRef(void 0);
7704
7705
  const calculatePosition = import_react10.default.useCallback((remeasure = false) => {
7705
7706
  const pop = popRef.current;
7706
7707
  if (!triggerRef.current || !pop) return;
7708
+ if (remeasure) frozenMaxRef.current = void 0;
7707
7709
  if (remeasure || !sizeRef.current) {
7708
7710
  sizeRef.current = {
7709
7711
  w: pop.offsetWidth,
@@ -7725,12 +7727,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7725
7727
  };
7726
7728
  const first = !placedRef.current;
7727
7729
  if (first) pop.style.transition = "none";
7728
- const { direction: next, top, left, over, maxHeight } = computePlacement(
7730
+ const frozen = frozenMaxRef.current;
7731
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
7732
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
7729
7733
  triggerRect,
7730
7734
  popW,
7731
- popH,
7735
+ effectiveH,
7732
7736
  clip
7733
7737
  );
7738
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
7739
+ const maxHeight = frozenMaxRef.current;
7734
7740
  pop.style.top = `${top + window.scrollY}px`;
7735
7741
  pop.style.left = `${left + window.scrollX}px`;
7736
7742
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -7749,6 +7755,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7749
7755
  sizeRef.current = null;
7750
7756
  scrollParentRef.current = null;
7751
7757
  placedRef.current = false;
7758
+ frozenMaxRef.current = void 0;
7752
7759
  return;
7753
7760
  }
7754
7761
  if (triggerRef.current) {
@@ -10705,7 +10712,9 @@ var SelectItem = (props) => {
10705
10712
  {
10706
10713
  className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
10707
10714
  onClick: handleClick,
10708
- role: "menuitem",
10715
+ role: "option",
10716
+ "aria-selected": isSelected,
10717
+ "aria-disabled": disabled || void 0,
10709
10718
  tabIndex: disabled ? void 0 : 0,
10710
10719
  onKeyDown: (e) => {
10711
10720
  if (e.key === "Enter" || e.key === " ") {
package/dist/index.js CHANGED
@@ -7290,9 +7290,11 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7290
7290
  const sizeRef = React10.useRef(null);
7291
7291
  const scrollParentRef = React10.useRef(null);
7292
7292
  const placedRef = React10.useRef(false);
7293
+ const frozenMaxRef = React10.useRef(void 0);
7293
7294
  const calculatePosition = React10.useCallback((remeasure = false) => {
7294
7295
  const pop = popRef.current;
7295
7296
  if (!triggerRef.current || !pop) return;
7297
+ if (remeasure) frozenMaxRef.current = void 0;
7296
7298
  if (remeasure || !sizeRef.current) {
7297
7299
  sizeRef.current = {
7298
7300
  w: pop.offsetWidth,
@@ -7314,12 +7316,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7314
7316
  };
7315
7317
  const first = !placedRef.current;
7316
7318
  if (first) pop.style.transition = "none";
7317
- const { direction: next, top, left, over, maxHeight } = computePlacement(
7319
+ const frozen = frozenMaxRef.current;
7320
+ const effectiveH = frozen == null ? popH : Math.min(popH, frozen);
7321
+ const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
7318
7322
  triggerRect,
7319
7323
  popW,
7320
- popH,
7324
+ effectiveH,
7321
7325
  clip
7322
7326
  );
7327
+ if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
7328
+ const maxHeight = frozenMaxRef.current;
7323
7329
  pop.style.top = `${top + window.scrollY}px`;
7324
7330
  pop.style.left = `${left + window.scrollX}px`;
7325
7331
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
@@ -7338,6 +7344,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7338
7344
  sizeRef.current = null;
7339
7345
  scrollParentRef.current = null;
7340
7346
  placedRef.current = false;
7347
+ frozenMaxRef.current = void 0;
7341
7348
  return;
7342
7349
  }
7343
7350
  if (triggerRef.current) {
@@ -10294,7 +10301,9 @@ var SelectItem = (props) => {
10294
10301
  {
10295
10302
  className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
10296
10303
  onClick: handleClick,
10297
- role: "menuitem",
10304
+ role: "option",
10305
+ "aria-selected": isSelected,
10306
+ "aria-disabled": disabled || void 0,
10298
10307
  tabIndex: disabled ? void 0 : 0,
10299
10308
  onKeyDown: (e) => {
10300
10309
  if (e.key === "Enter" || e.key === " ") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-plat/design-system",
3
- "version": "0.14.16",
3
+ "version": "0.14.18",
4
4
  "description": "XPLAT UI Design System",
5
5
  "author": "XPLAT WOONG",
6
6
  "main": "dist/index.cjs",