@box/box-item-type-selector 1.30.1 → 1.30.3

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,72 +1,72 @@
1
- import { Checkbox as f, Text as I } from "@box/blueprint-web";
1
+ import { Checkbox as f, Text as S } from "@box/blueprint-web";
2
2
  import d from "clsx";
3
- import { forwardRef as S, useCallback as T } from "react";
3
+ import { forwardRef as T, useCallback as b } from "react";
4
4
  import { useIntl as v } from "react-intl";
5
5
  import { b as _, I as x } from "../../chunks/constants.js";
6
- import { jsx as a, jsxs as b } from "react/jsx-runtime";
7
- import '../../styles/box-item-type-selector.css';const k = "_boxItemTypeSelectorContainer_kpwbf_2", w = "_parentItemTypeSelectorContainer_kpwbf_6", N = "_itemTypeSelector_kpwbf_16", g = "_selectorLabel_kpwbf_22", E = "_disabled_kpwbf_36", L = "_childItemTypeSelectorContainer_kpwbf_39", i = {
8
- boxItemTypeSelectorContainer: k,
9
- parentItemTypeSelectorContainer: w,
10
- itemTypeSelector: N,
11
- selectorLabel: g,
12
- disabled: E,
13
- childItemTypeSelectorContainer: L
14
- }, M = (s, o) => {
6
+ import { jsx as s, jsxs as y } from "react/jsx-runtime";
7
+ import '../../styles/box-item-type-selector.css';const N = "_boxItemTypeSelectorContainer_9ahmf_2", k = "_parentItemTypeSelectorContainer_9ahmf_6", g = "_itemTypeSelector_9ahmf_16", E = "_selectorLabel_9ahmf_22", L = "_disabled_9ahmf_36", w = "_childItemTypeSelectorContainer_9ahmf_39", i = {
8
+ boxItemTypeSelectorContainer: N,
9
+ parentItemTypeSelectorContainer: k,
10
+ itemTypeSelector: g,
11
+ selectorLabel: E,
12
+ disabled: L,
13
+ childItemTypeSelectorContainer: w
14
+ }, M = (a, o) => {
15
15
  const r = [...o];
16
- return s.forEach((l) => {
16
+ return a.forEach((l) => {
17
17
  r.includes(l.value) || r.push(l.value);
18
18
  }), r;
19
- }, R = (s, o) => {
19
+ }, R = (a, o) => {
20
20
  const r = [...o];
21
- return s.forEach((l) => {
21
+ return a.forEach((l) => {
22
22
  const n = r.indexOf(l.value);
23
23
  n >= 0 && r.splice(n, 1);
24
24
  }), r;
25
- }, $ = (s, o, r) => {
25
+ }, $ = (a, o, r) => {
26
26
  let l = [...r];
27
- return s ? l.push(o) : l = l.filter((n) => n !== o), l;
28
- }, W = /* @__PURE__ */ S((s, o) => {
27
+ return a ? l.push(o) : l = l.filter((n) => n !== o), l;
28
+ }, W = /* @__PURE__ */ T((a, o) => {
29
29
  const {
30
30
  className: r,
31
31
  onSelectionChange: l,
32
32
  selected: n,
33
33
  disabled: m = !1,
34
- ...y
35
- } = s, C = v(), p = (e) => e.children ? e.children.every((t) => n.includes(t.value)) ? !0 : e.children.every((t) => !n.includes(t.value)) ? !1 : x : n.includes(e.value), h = T((e, t) => {
34
+ ...C
35
+ } = a, I = v(), h = (e) => e.children ? e.children.every((t) => n.includes(t.value)) ? !0 : e.children.every((t) => !n.includes(t.value)) ? !1 : x : n.includes(e.value), p = b((e, t) => {
36
36
  let c = [...n];
37
37
  t.children ? e ? c = M(t.children, c) : c = R(t.children, c) : c = $(e, t.value, c), l(c);
38
- }, [l, n]), u = (e) => /* @__PURE__ */ b("span", {
38
+ }, [l, n]), u = (e) => /* @__PURE__ */ y("span", {
39
39
  className: d(i.selectorLabel, {
40
40
  [i.disabled]: m
41
41
  }),
42
- children: [e.icon, /* @__PURE__ */ a(I, {
42
+ children: [e.icon, /* @__PURE__ */ s(S, {
43
43
  as: "span",
44
- children: C.formatMessage(e.title)
44
+ children: I.formatMessage(e.title)
45
45
  })]
46
46
  });
47
- return /* @__PURE__ */ a("div", {
47
+ return /* @__PURE__ */ s("div", {
48
48
  ref: o,
49
49
  className: d(r, i.boxItemTypeSelectorContainer),
50
- ...y,
51
- children: /* @__PURE__ */ a("ul", {
52
- children: _.map((e) => /* @__PURE__ */ b("li", {
50
+ ...C,
51
+ children: /* @__PURE__ */ s("ul", {
52
+ children: _.map((e) => /* @__PURE__ */ y("li", {
53
53
  className: d(i.parentItemTypeSelectorContainer),
54
- children: [/* @__PURE__ */ a(f.Item, {
55
- checked: p(e),
54
+ children: [/* @__PURE__ */ s(f.Item, {
55
+ checked: h(e),
56
56
  className: d(i.itemTypeSelector),
57
57
  disabled: m,
58
58
  label: u(e),
59
- onCheckedChange: (t) => h(t, e),
59
+ onCheckedChange: (t) => p(t, e),
60
60
  value: e.value
61
- }, `box-item-type-selector-${e.value}`), e.children && /* @__PURE__ */ a("ul", {
61
+ }, `box-item-type-selector-${e.value}`), e.children && /* @__PURE__ */ s("ul", {
62
62
  className: d(i.childItemTypeSelectorContainer),
63
- children: e.children.map((t) => /* @__PURE__ */ a("li", {
64
- children: /* @__PURE__ */ a(f.Item, {
65
- checked: p(t),
63
+ children: e.children.map((t) => /* @__PURE__ */ s("li", {
64
+ children: /* @__PURE__ */ s(f.Item, {
65
+ checked: h(t),
66
66
  className: d(i.itemTypeSelector),
67
67
  disabled: m,
68
68
  label: u(t),
69
- onCheckedChange: (c) => h(c, t),
69
+ onCheckedChange: (c) => p(c, t),
70
70
  value: t.value
71
71
  })
72
72
  }, `box-item-type-selector-${t.value}`))
@@ -1 +1 @@
1
- ._boxItemTypeSelectorContainer_kpwbf_2{display:flex;flex-direction:column}._boxItemTypeSelectorContainer_kpwbf_2 ._parentItemTypeSelectorContainer_kpwbf_6{display:flex;flex-direction:column;min-height:0}@container (min-width: 374px){._boxItemTypeSelectorContainer_kpwbf_2 ._parentItemTypeSelectorContainer_kpwbf_6{max-height:255px}}._boxItemTypeSelectorContainer_kpwbf_2 ._itemTypeSelector_kpwbf_16{margin:var(--space-1) 0}._boxItemTypeSelectorContainer_kpwbf_2 ._itemTypeSelector_kpwbf_16 label{gap:var(--space-2)}._boxItemTypeSelectorContainer_kpwbf_2 ._selectorLabel_kpwbf_22{font-weight:var(--body-default-font-weight);font-size:var(--body-default-font-size);font-family:var(--body-default-font-family);line-height:var(--body-default-line-height);letter-spacing:var(--body-default-letter-spacing);text-transform:var(--body-default-text-case);text-decoration:var(--body-default-text-decoration);display:flex}._boxItemTypeSelectorContainer_kpwbf_2 ._selectorLabel_kpwbf_22 svg{margin-inline-end:var(--space-2);font-size:var(--size-5)}._boxItemTypeSelectorContainer_kpwbf_2 ._selectorLabel_kpwbf_22._disabled_kpwbf_36{opacity:60%}._boxItemTypeSelectorContainer_kpwbf_2 ._childItemTypeSelectorContainer_kpwbf_39{margin-inline-start:var(--space-7);display:flex;flex-direction:column;flex-wrap:wrap;min-height:0}._boxItemTypeSelectorContainer_kpwbf_2 ul,._boxItemTypeSelectorContainer_kpwbf_2 li{display:contents;margin:0;padding:0}
1
+ ._boxItemTypeSelectorContainer_9ahmf_2{display:flex;flex-direction:column}._boxItemTypeSelectorContainer_9ahmf_2 ._parentItemTypeSelectorContainer_9ahmf_6{display:flex;flex-direction:column;min-height:0}@container (min-width: 374px){._boxItemTypeSelectorContainer_9ahmf_2 ._parentItemTypeSelectorContainer_9ahmf_6{max-height:255px}}._boxItemTypeSelectorContainer_9ahmf_2 ._itemTypeSelector_9ahmf_16{margin:var(--space-1) 0}._boxItemTypeSelectorContainer_9ahmf_2 ._itemTypeSelector_9ahmf_16 label{gap:var(--space-2)}._boxItemTypeSelectorContainer_9ahmf_2 ._selectorLabel_9ahmf_22{font-weight:var(--body-default-font-weight);font-size:var(--body-default-font-size);font-family:var(--body-default-font-family);line-height:var(--body-default-line-height);letter-spacing:var(--body-default-letter-spacing);text-transform:var(--body-default-text-case);text-decoration:var(--body-default-text-decoration);display:flex}._boxItemTypeSelectorContainer_9ahmf_2 ._selectorLabel_9ahmf_22 svg{margin-inline-end:var(--space-2);font-size:var(--size-5)}._boxItemTypeSelectorContainer_9ahmf_2 ._selectorLabel_9ahmf_22._disabled_9ahmf_36{opacity:60%}._boxItemTypeSelectorContainer_9ahmf_2 ._childItemTypeSelectorContainer_9ahmf_39{margin-inline-start:var(--space-7);display:flex;flex-flow:column wrap;min-height:0}._boxItemTypeSelectorContainer_9ahmf_2 ul,._boxItemTypeSelectorContainer_9ahmf_2 li{display:contents;margin:0;padding:0}
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@box/box-item-type-selector",
3
- "version": "1.30.1",
3
+ "version": "1.30.3",
4
4
  "peerDependencies": {
5
- "@box/blueprint-web": "^12.134.2",
6
- "@box/blueprint-web-assets": "^4.101.0",
5
+ "@box/blueprint-web": "^12.135.1",
6
+ "@box/blueprint-web-assets": "^4.101.2",
7
7
  "react": "^17.0.0 || ^18.0.0",
8
8
  "react-dom": "^17.0.0 || ^18.0.0",
9
9
  "react-intl": "6.4.2"
10
10
  },
11
11
  "devDependencies": {
12
- "@box/blueprint-web": "^12.134.2",
13
- "@box/blueprint-web-assets": "^4.101.0",
14
- "@box/storybook-utils": "^0.16.37",
12
+ "@box/blueprint-web": "^12.135.1",
13
+ "@box/blueprint-web-assets": "^4.101.2",
14
+ "@box/storybook-utils": "^0.16.39",
15
15
  "react": "^18.3.0",
16
16
  "react-dom": "^18.3.0",
17
17
  "react-intl": "6.4.2"