@eightshift/ui-components 6.0.5 → 6.0.6

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.
@@ -3167,6 +3167,10 @@ input[data-rac]::-webkit-search-cancel-button {
3167
3167
  border-radius: var(--es-radius-18);
3168
3168
  }
3169
3169
 
3170
+ :is(body, body #wpwrap) .es\:rounded-20\! {
3171
+ border-radius: var(--es-radius-20) !important;
3172
+ }
3173
+
3170
3174
  :is(body, body #wpwrap) .es\:rounded-28 {
3171
3175
  border-radius: var(--es-radius-28);
3172
3176
  }
@@ -3135,6 +3135,10 @@ button, input:where([type="button"], [type="reset"], [type="submit"]) {
3135
3135
  border-radius: var(--es-radius-18);
3136
3136
  }
3137
3137
 
3138
+ :is(body, #wpwrap #editor) .es\:rounded-20\! {
3139
+ border-radius: var(--es-radius-20) !important;
3140
+ }
3141
+
3138
3142
  :is(body, #wpwrap #editor) .es\:rounded-28 {
3139
3143
  border-radius: var(--es-radius-28);
3140
3144
  }
@@ -3620,6 +3620,10 @@ input[data-rac]::-webkit-search-cancel-button {
3620
3620
  border-radius: var(--es-radius-18);
3621
3621
  }
3622
3622
 
3623
+ .es\:rounded-20\! {
3624
+ border-radius: var(--es-radius-20) !important;
3625
+ }
3626
+
3623
3627
  .es\:rounded-28 {
3624
3628
  border-radius: var(--es-radius-28);
3625
3629
  }
@@ -37,7 +37,7 @@ const DraggableListItem = (props) => {
37
37
  icon,
38
38
  label,
39
39
  subtitle,
40
- className: clsx("es:mr-auto", labelContainerClassName),
40
+ className: clsx("es:mr-auto es:min-h-9", labelContainerClassName),
41
41
  iconClassName,
42
42
  labelClassName,
43
43
  subtitleClassName,
@@ -81,7 +81,7 @@ const DraggableList = (props) => {
81
81
  console.warn(__("DraggableList: 'items' are not an array or are undefined!", "eightshift-ui-components"));
82
82
  }
83
83
  const items = fixIds(rawItems ?? [], itemIdBase);
84
- if (hidden) {
84
+ if (hidden || !items?.length) {
85
85
  return null;
86
86
  }
87
87
  return /* @__PURE__ */ jsx(
@@ -162,7 +162,7 @@ const AsyncMultiSelect = (props) => {
162
162
  return;
163
163
  }
164
164
  const selectedValues = [...selected].map((item) => {
165
- const option = list.items.find((option2) => option2.value === item) || value.find((option2) => option2.value === item);
165
+ const option = list?.items?.find((option2) => option2.value === item) || value.find((option2) => option2.value === item);
166
166
  if (!option) {
167
167
  return null;
168
168
  }
@@ -259,7 +259,7 @@ const AsyncMultiSelect = (props) => {
259
259
  {
260
260
  selectionMode: "multiple",
261
261
  isDisabled: disabled,
262
- value: currentValueKeys,
262
+ value: currentValueKeys ?? [],
263
263
  onChange: (selected) => handleSelectionChange(selected),
264
264
  placeholder,
265
265
  ...rest,
@@ -354,14 +354,14 @@ const AsyncMultiSelect = (props) => {
354
354
  slot: null
355
355
  },
356
356
  className: "es:grid es:grid-cols-1 es:grid-rows-[auto_minmax(0,1fr)] es:p-0!",
357
- wrapperClassName: "es:w-72 es:px-1.5 es:h-fit es:from-surface-300/35 es:to-surface-300/35 es:overflow-clip",
358
- hidden: noReorder || disabled || value?.length < 2,
357
+ wrapperClassName: "es:w-72 es:px-1.5 es:h-fit es:from-surface-300/35 es:to-surface-300/35 es:overflow-clip es:rounded-20!",
358
+ hidden: noReorder || disabled || (value ?? [])?.length < 2,
359
359
  children: [
360
- /* @__PURE__ */ jsx("span", { className: 'es:text-lg es:mx-auto es:my-1 es:font-variation-["wdth"_140,"wght"_320] es:text-surface-600', children: __("Item order", "eightshift-ui-components") }),
360
+ /* @__PURE__ */ jsx("span", { className: 'es:text-base es:mx-auto es:my-1 es:font-variation-["wdth"_140,"wght"_320] es:text-surface-600', children: __("Item order", "eightshift-ui-components") }),
361
361
  /* @__PURE__ */ jsx(
362
362
  DraggableList,
363
363
  {
364
- items: value,
364
+ items: value ?? [],
365
365
  onChange: (value2) => {
366
366
  handleSelectionChange(new Set(value2?.map((item) => item?.value ?? item)));
367
367
  },
@@ -383,7 +383,7 @@ const AsyncMultiSelect = (props) => {
383
383
  iconClassName: "es:pointer-events-none es:select-none",
384
384
  labelClassName: "es:line-clamp-1",
385
385
  subtitleClassName: "es:line-clamp-1",
386
- className: clsx("es:min-h-8 es:flex es:items-center es:justify-between", realItem?.icon ? "es:pl-1" : "es:pl-2")
386
+ className: clsx("es:flex es:items-center es:justify-between", realItem?.icon ? "es:pl-1" : "es:pl-2")
387
387
  }
388
388
  );
389
389
  }
@@ -468,7 +468,7 @@ const AsyncMultiSelect = (props) => {
468
468
  $eed445e0843c11d0$export$41f133550aa26f48,
469
469
  {
470
470
  className: clsx("es:space-y-0.75 es:p-1.5 es:pt-0 es:any-focus:outline-hidden es:h-full es:overflow-y-auto es:rounded-t-xl", list?.isLoading && "es:hidden"),
471
- items: list.items,
471
+ items: list?.items ?? [],
472
472
  selectedKeys: list.selectedKeys,
473
473
  selectionMode: "multiple",
474
474
  selectionBehavior: "toggle",
@@ -308,14 +308,14 @@ const MultiSelect = (props) => {
308
308
  slot: null
309
309
  },
310
310
  className: "es:grid es:grid-cols-1 es:grid-rows-[auto_minmax(0,1fr)] es:p-0!",
311
- wrapperClassName: "es:w-72 es:px-1.5 es:h-fit es:from-surface-300/35 es:to-surface-300/35 es:overflow-clip",
311
+ wrapperClassName: "es:w-72 es:px-1.5 es:h-fit es:from-surface-300/35 es:to-surface-300/35 es:overflow-clip es:rounded-20!",
312
312
  hidden: noReorder || disabled || currentValue?.length < 2,
313
313
  children: [
314
- /* @__PURE__ */ jsx("span", { className: 'es:text-lg es:mx-auto es:my-1 es:font-variation-["wdth"_140,"wght"_320] es:text-surface-600', children: __("Item order", "eightshift-ui-components") }),
314
+ /* @__PURE__ */ jsx("span", { className: 'es:text-base es:mx-auto es:my-1 es:font-variation-["wdth"_140,"wght"_320] es:text-surface-600', children: __("Item order", "eightshift-ui-components") }),
315
315
  /* @__PURE__ */ jsx(
316
316
  DraggableList,
317
317
  {
318
- items: simpleValue ? value.map((item) => options.find((option) => option.value === item)) : value,
318
+ items: simpleValue ? value?.map((item) => options.find((option) => option.value === item)) ?? [] : value ?? [],
319
319
  onChange: (value2) => {
320
320
  handleSelectionChange(new Set(value2?.map((item) => item?.value ?? item)));
321
321
  },
@@ -333,7 +333,7 @@ const MultiSelect = (props) => {
333
333
  iconClassName: "es:pointer-events-none es:select-none",
334
334
  labelClassName: "es:line-clamp-1",
335
335
  subtitleClassName: "es:line-clamp-1",
336
- className: clsx("es:min-h-8 es:flex es:items-center es:justify-between", realItem?.icon ? "es:pl-1" : "es:pl-2")
336
+ className: clsx("es:min-h-9 es:flex es:items-center es:justify-between", realItem?.icon ? "es:pl-1" : "es:pl-2")
337
337
  }
338
338
  );
339
339
  }
@@ -7,7 +7,7 @@ import { BaseControl } from "../base-control/base-control.js";
7
7
  import { icons } from "../../icons/icons.js";
8
8
  import { getColumnConfigOutputText } from "./utils.js";
9
9
  import { c as clsx } from "../../clsx-DgYk2OaC.js";
10
- import { A as AnimatePresence, m as motion } from "../../proxy-0B6wWuDe.js";
10
+ import { A as AnimatePresence, m as motion } from "../../proxy-DkQpcQgI.js";
11
11
  /**
12
12
  * A two-thumb slider for selecting a range of columns.
13
13
  *
@@ -6,7 +6,7 @@ import { c as clsx } from "../../clsx-DgYk2OaC.js";
6
6
  import { NumberPicker } from "../number-picker/number-picker.js";
7
7
  import { generateMarkers, generateGridTemplate } from "./utils.js";
8
8
  import { HStack } from "../layout/hstack.js";
9
- import { A as AnimatePresence, m as motion } from "../../proxy-0B6wWuDe.js";
9
+ import { A as AnimatePresence, m as motion } from "../../proxy-DkQpcQgI.js";
10
10
  /**
11
11
  * A single/multi-thumb slider component.
12
12
  *
@@ -460,6 +460,9 @@ const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /* @__PURE__ */ $f39a9eba43920
460
460
  * @param {string} [props.className] - Classes to pass to the tabs container.
461
461
  * @param {TabsType} [props.type='underline'] - Design of the tabs.
462
462
  * @param {boolean} [props.flat] - If `true`, component will look more flat. Useful for nested layer of controls.
463
+ * @param {string} [props.defaultSelectedKey] - **(uncontrolled mode)** The initial selected tab ID.
464
+ * @param {string} [props.selectedKey] - **(controlled mode)** The selected tab ID.
465
+ * @param {Function} [props.onSelectionChange] - Handler that is called when the selection changes. `(key: string) => void`.
463
466
  * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
464
467
  *
465
468
  * @returns {JSX.Element} The Tabs component.
@@ -487,6 +490,7 @@ const Tabs2 = (props) => {
487
490
  let tabPanelCounter = 1;
488
491
  let tabCounter = 1;
489
492
  const preparedChildren = Array.isArray(children) ? children : [children];
493
+ let realTabIds = preparedChildren?.[0]?.props?.children?.map((tab, i) => tab?.props?.id ?? `tab-${baseId}-${i + 1}`);
490
494
  const childrenWithIds = preparedChildren.reduce((acc, child, index) => {
491
495
  if (child.type.displayName === "TabList") {
492
496
  const childItems = Array.isArray(child?.props?.children) ? child?.props?.children : [child?.props?.children].filter(Boolean);
@@ -504,7 +508,7 @@ const Tabs2 = (props) => {
504
508
  },
505
509
  childItems?.map(
506
510
  (innerChild, i) => cloneElement(innerChild, {
507
- id: `tab-${baseId}-${i + 1}`,
511
+ id: innerChild?.props?.id ?? realTabIds?.[i] ?? `tab-${baseId}-${i + 1}`,
508
512
  key: i,
509
513
  isParentVertical: vertical,
510
514
  type,
@@ -518,7 +522,7 @@ const Tabs2 = (props) => {
518
522
  return [
519
523
  ...acc,
520
524
  cloneElement(child, {
521
- id: `tab-${baseId}-${tabPanelCounter++}`,
525
+ id: realTabIds?.[tabPanelCounter++ - 1] ?? `tab-${baseId}-${tabPanelCounter++}`,
522
526
  key: index,
523
527
  className: child.props.className,
524
528
  flat,
@@ -678,6 +682,7 @@ TabList2.displayName = "TabList";
678
682
  * @param {boolean} [props.invisible] - If `true`, the tab is disabled and not rendered, but is not unmounted from the DOM.
679
683
  * @param {string} [props.label] - Tab label. **Note**: overrides inner items!
680
684
  * @param {string} [props.subtitle] - Tab subtitle. **Note**: overrides inner items!
685
+ * @param {string} [props.id] - The tab unique identifier.
681
686
  *
682
687
  * @returns {JSX.Element} The Tab component.
683
688
  *
@@ -3402,8 +3402,10 @@ const icons = {
3402
3402
  /* @__PURE__ */ jsx("rect", { x: "1", y: "7", width: "7", height: "12", rx: "1.5", fill: "currentColor" })
3403
3403
  ] }),
3404
3404
  reorder: /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", width: "20", height: "20", fill: "none", children: [
3405
- /* @__PURE__ */ jsx("path", { stroke: "currentColor", strokeLinecap: "round", d: "M2.5 5.5h15m-15 3h15m-15 3h15m-15 3h15", fill: "none" }),
3406
- /* @__PURE__ */ jsx("path", { d: "M12.148 3H7.852a.5.5 0 0 1-.326-.88L9.675.28a.5.5 0 0 1 .65 0l2.149 1.841a.5.5 0 0 1-.326.88Zm0 14H7.852a.5.5 0 0 0-.326.88l2.149 1.841a.5.5 0 0 0 .65 0l2.149-1.841a.5.5 0 0 0-.326-.88Z", fill: "currentColor" })
3405
+ /* @__PURE__ */ jsx("path", { stroke: "currentColor", strokeLinecap: "round", d: "M2.5 5.5h15", fill: "none" }),
3406
+ /* @__PURE__ */ jsx("path", { d: "M17.5 8a.5.5 0 0 1 0 1h-15a.5.5 0 0 1 0-1h15Zm0 3a.5.5 0 0 1 0 1h-15a.5.5 0 0 1 0-1h15Z", fill: "currentColor" }),
3407
+ /* @__PURE__ */ jsx("path", { stroke: "currentColor", strokeLinecap: "round", d: "M2.5 14.5h15", fill: "none" }),
3408
+ /* @__PURE__ */ jsx("path", { d: "M12.5 3h-5a.5.5 0 0 1-.3-.9L9.7.225a.5.5 0 0 1 .6 0L12.8 2.1a.5.5 0 0 1-.3.9Zm0 14h-5a.5.5 0 0 0-.3.9l2.5 1.875a.5.5 0 0 0 .6 0l2.5-1.875a.5.5 0 0 0-.3-.9Z", fill: "currentColor" })
3407
3409
  ] }),
3408
3410
  loaderAlt: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", width: "20", height: "20", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M10 19v-2m-9-7h2m13.367 6.367-1.414-1.414m-11.32 1.414 1.414-1.414M10 3V1m7 9h2M5.047 5.047 3.633 3.633m11.32 1.414 1.414-1.414M10 17v-1.555M3 10h1.555m10.396 4.951-1.1-1.1m-8.803 1.1 1.1-1.1M10 4.556V3m5.444 7H17M6.147 6.147l-1.1-1.1m8.806 1.1 1.1-1.1", stroke: "currentColor", strokeLinecap: "round", fill: "none" }) })
3409
3411
  };
@@ -6184,6 +6184,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
6184
6184
  this.treeScale = { x: 1, y: 1 };
6185
6185
  this.eventHandlers = /* @__PURE__ */ new Map();
6186
6186
  this.hasTreeAnimated = false;
6187
+ this.layoutVersion = 0;
6187
6188
  this.updateScheduled = false;
6188
6189
  this.scheduleUpdate = () => this.update();
6189
6190
  this.projectionUpdateScheduled = false;
@@ -6201,6 +6202,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
6201
6202
  this.nodes.forEach(cleanDirtyNodes);
6202
6203
  };
6203
6204
  this.resolvedRelativeTargetAt = 0;
6205
+ this.linkedParentVersion = 0;
6204
6206
  this.hasProjected = false;
6205
6207
  this.isVisible = true;
6206
6208
  this.animationProgress = 0;
@@ -6456,6 +6458,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
6456
6458
  }
6457
6459
  const prevLayout = this.layout;
6458
6460
  this.layout = this.measure(false);
6461
+ this.layoutVersion++;
6459
6462
  this.layoutCorrected = createBox();
6460
6463
  this.isLayoutDirty = false;
6461
6464
  this.projectionDelta = void 0;
@@ -6623,17 +6626,15 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
6623
6626
  if (!this.layout || !(layout2 || layoutId))
6624
6627
  return;
6625
6628
  this.resolvedRelativeTargetAt = frameData.timestamp;
6629
+ const relativeParent = this.getClosestProjectingParent();
6630
+ if (relativeParent && this.linkedParentVersion !== relativeParent.layoutVersion && !relativeParent.options.layoutRoot) {
6631
+ this.removeRelativeTarget();
6632
+ }
6626
6633
  if (!this.targetDelta && !this.relativeTarget) {
6627
- const relativeParent = this.getClosestProjectingParent();
6628
- if (relativeParent && relativeParent.layout && this.animationProgress !== 1) {
6629
- this.relativeParent = relativeParent;
6630
- this.forceRelativeParentToResolveTarget();
6631
- this.relativeTarget = createBox();
6632
- this.relativeTargetOrigin = createBox();
6633
- calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);
6634
- copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
6634
+ if (relativeParent && relativeParent.layout) {
6635
+ this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox);
6635
6636
  } else {
6636
- this.relativeParent = this.relativeTarget = void 0;
6637
+ this.removeRelativeTarget();
6637
6638
  }
6638
6639
  }
6639
6640
  if (!this.relativeTarget && !this.targetDelta)
@@ -6657,14 +6658,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
6657
6658
  }
6658
6659
  if (this.attemptToResolveRelativeTarget) {
6659
6660
  this.attemptToResolveRelativeTarget = false;
6660
- const relativeParent = this.getClosestProjectingParent();
6661
6661
  if (relativeParent && Boolean(relativeParent.resumingFrom) === Boolean(this.resumingFrom) && !relativeParent.options.layoutScroll && relativeParent.target && this.animationProgress !== 1) {
6662
- this.relativeParent = relativeParent;
6663
- this.forceRelativeParentToResolveTarget();
6664
- this.relativeTarget = createBox();
6665
- this.relativeTargetOrigin = createBox();
6666
- calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);
6667
- copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
6662
+ this.createRelativeTarget(relativeParent, this.target, relativeParent.target);
6668
6663
  } else {
6669
6664
  this.relativeParent = this.relativeTarget = void 0;
6670
6665
  }
@@ -6683,6 +6678,18 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
6683
6678
  isProjecting() {
6684
6679
  return Boolean((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout);
6685
6680
  }
6681
+ createRelativeTarget(relativeParent, layout2, parentLayout) {
6682
+ this.relativeParent = relativeParent;
6683
+ this.linkedParentVersion = relativeParent.layoutVersion;
6684
+ this.forceRelativeParentToResolveTarget();
6685
+ this.relativeTarget = createBox();
6686
+ this.relativeTargetOrigin = createBox();
6687
+ calcRelativePosition(this.relativeTargetOrigin, layout2, parentLayout);
6688
+ copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
6689
+ }
6690
+ removeRelativeTarget() {
6691
+ this.relativeParent = this.relativeTarget = void 0;
6692
+ }
6686
6693
  calcProjection() {
6687
6694
  const lead = this.getLead();
6688
6695
  const isShared = Boolean(this.resumingFrom) || this !== lead;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eightshift/ui-components",
3
- "version": "6.0.5",
3
+ "version": "6.0.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -88,7 +88,7 @@
88
88
  "just-throttle": "^4.2.0",
89
89
  "lightningcss": "^1.30.2",
90
90
  "postcss": "^8.5.6",
91
- "prettier": "^3.7.0",
91
+ "prettier": "^3.7.3",
92
92
  "prettier-plugin-tailwindcss": "^0.7.1",
93
93
  "react": "^18.3.1",
94
94
  "react-aria": "^3.44.0",
@@ -101,12 +101,12 @@
101
101
  "tailwindcss": "^4.1.17",
102
102
  "tailwindcss-motion": "^1.1.1",
103
103
  "tailwindcss-react-aria-components": "^2.0.1",
104
- "vite": "^7.2.4",
104
+ "vite": "^7.2.6",
105
105
  "vite-plugin-lib-inject-css": "^2.2.2"
106
106
  },
107
107
  "dependencies": {
108
108
  "@fontsource-variable/geist-mono": "^5.2.7",
109
109
  "@fontsource-variable/roboto-flex": "^5.2.8",
110
- "motion": "^12.23.24"
110
+ "motion": "^12.23.25"
111
111
  }
112
112
  }