@box/box-item-type-selector 2.1.34 → 2.1.36

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,77 +1 @@
1
- import { t as e } from "./box-item-type-selector.js";
2
- import t from "../esm/lib/messages.js";
3
- import { n } from "./constants.js";
4
- import { Button as r, FilterChip as i, Popover as a, useBlueprintModernization as o } from "@box/blueprint-web";
5
- import s from "clsx";
6
- import c from "react";
7
- import { useIntl as l } from "react-intl";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
- import { FileDefault as f } from "@box/blueprint-web-assets/icons/Line";
10
- import { File as p } from "@box/blueprint-web-assets/icons/Medium";
11
- import '../styles/box-item-type-selector-quick-filter.css';var m = {
12
- itemTypeSelectorQuickFilterPopoverContainer: "_itemTypeSelectorQuickFilterPopoverContainer_10sjf_1",
13
- popoverMainContent: "_popoverMainContent_10sjf_4",
14
- boxItemTypeSelectorQuickFilter: "_boxItemTypeSelectorQuickFilter_10sjf_8",
15
- popoverFooterInline: "_popoverFooterInline_10sjf_11"
16
- }, h = () => n.reduce((e, t) => e + (t.children ? t.children.length : 1), 0), g = (e) => n.map((t) => t.children ? t.children.every((t) => e.includes(t.value)) ? t.title : t.children.filter((t) => e.includes(t.value)).map((e) => e.title) : e.includes(t.value) ? t.title : []).flat(), _ = (e, t) => e.length === t.length ? e.every((e) => t.includes(e)) : !1, v = h();
17
- function y(n) {
18
- let { allowAllOptionsSelect: h = !1, applyButtonType: y = "button", autoFocus: b, selected: x, onApply: S, onFocus: C, className: w } = n, T = l(), [E, D] = c.useState(x), { enableModernizedComponents: O } = o();
19
- c.useEffect(() => {
20
- D(x);
21
- }, [x]);
22
- let k = () => {
23
- let e = g(x), n = e.length;
24
- return n ? n === 1 ? T.formatMessage(e[0]) : T.formatMessage(t.multipleFiles, {
25
- count: n - 1,
26
- fileType: T.formatMessage(e[0])
27
- }) : T.formatMessage(t.fileTypeLabelDropdown);
28
- }, A = () => {
29
- !h && E.length === v ? (D([]), S([])) : S(E);
30
- }, j = O ? p : f;
31
- return /* @__PURE__ */ u("div", {
32
- className: s(w, m.boxItemTypeSelectorQuickFilterContainer),
33
- children: /* @__PURE__ */ d(a.Root, {
34
- modal: !1,
35
- children: [/* @__PURE__ */ u(a.Trigger, { children: /* @__PURE__ */ d(i.TriggerChip, {
36
- autoFocus: b,
37
- onClick: () => D(x),
38
- onFocus: C,
39
- selected: !!x.length,
40
- value: "trigger-chip",
41
- children: [
42
- /* @__PURE__ */ u(i.Icon, { icon: j }),
43
- /* @__PURE__ */ u(i.Label, { children: k() }),
44
- /* @__PURE__ */ u(i.DropdownIndicator, {})
45
- ]
46
- }) }), /* @__PURE__ */ d(a.ContentContainer, {
47
- align: "start",
48
- className: m.itemTypeSelectorQuickFilterPopoverContainer,
49
- children: [/* @__PURE__ */ u(a.MainContent, {
50
- className: m.popoverMainContent,
51
- children: /* @__PURE__ */ u(e, {
52
- className: m.boxItemTypeSelectorQuickFilter,
53
- onSelectionChange: D,
54
- selected: E
55
- })
56
- }), /* @__PURE__ */ d(a.Footer, {
57
- className: m.popoverFooterInline,
58
- children: [/* @__PURE__ */ u(r, {
59
- disabled: !E.length,
60
- onClick: () => D([]),
61
- size: "small",
62
- variant: "secondary",
63
- children: T.formatMessage(t.clear)
64
- }), /* @__PURE__ */ u(a.Close, { children: /* @__PURE__ */ u(r, {
65
- disabled: _(E, x),
66
- onClick: A,
67
- size: "small",
68
- type: y,
69
- variant: "primary",
70
- children: T.formatMessage(t.apply)
71
- }) })]
72
- })]
73
- })]
74
- })
75
- });
76
- }
77
- export { y as t };
1
+ import{t as BoxItemTypeSelector}from"./box-item-type-selector.js";import messages from"../esm/lib/messages.js";import{n as boxItemTypeMapping}from"./constants.js";import{Button,FilterChip,Popover,useBlueprintModernization}from"@box/blueprint-web";import clsx from"clsx";import React from"react";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import{FileDefault}from"@box/blueprint-web-assets/icons/Line";import{File}from"@box/blueprint-web-assets/icons/Medium";import '../styles/box-item-type-selector-quick-filter.css';var box_item_type_selector_quick_filter_module_default={itemTypeSelectorQuickFilterPopoverContainer:`_itemTypeSelectorQuickFilterPopoverContainer_10sjf_1`,popoverMainContent:`_popoverMainContent_10sjf_4`,boxItemTypeSelectorQuickFilter:`_boxItemTypeSelectorQuickFilter_10sjf_8`,popoverFooterInline:`_popoverFooterInline_10sjf_11`},getSelectableItemTypeCount=()=>boxItemTypeMapping.reduce((count,i)=>count+(i.children?i.children.length:1),0),getSelectedFilterChipLabels=selected=>boxItemTypeMapping.map(parentItem=>parentItem.children?parentItem.children.every(c=>selected.includes(c.value))?parentItem.title:parentItem.children.filter(c=>selected.includes(c.value)).map(c=>c.title):selected.includes(parentItem.value)?parentItem.title:[]).flat(),hasSameSelection=(oldSelection,newSelection)=>oldSelection.length===newSelection.length?oldSelection.every(item=>newSelection.includes(item)):!1,selectableItemTypeCount=getSelectableItemTypeCount();function BoxItemTypeSelectorQuickFilter(props){let{allowAllOptionsSelect=!1,applyButtonType=`button`,autoFocus,selected,onApply,onFocus,className}=props,intl=useIntl(),[popoverSelection,setPopoverSelection]=React.useState(selected),{enableModernizedComponents}=useBlueprintModernization();React.useEffect(()=>{setPopoverSelection(selected)},[selected]);let renderFilterChipLabel=()=>{let selectedFilterChipLabels=getSelectedFilterChipLabels(selected),selectedLength=selectedFilterChipLabels.length;return selectedLength?selectedLength===1?intl.formatMessage(selectedFilterChipLabels[0]):intl.formatMessage(messages.multipleFiles,{count:selectedLength-1,fileType:intl.formatMessage(selectedFilterChipLabels[0])}):intl.formatMessage(messages.fileTypeLabelDropdown)},handleApply=()=>{!allowAllOptionsSelect&&popoverSelection.length===selectableItemTypeCount?(setPopoverSelection([]),onApply([])):onApply(popoverSelection)},FileIcon=enableModernizedComponents?File:FileDefault;return jsx(`div`,{className:clsx(className,box_item_type_selector_quick_filter_module_default.boxItemTypeSelectorQuickFilterContainer),children:jsxs(Popover.Root,{modal:!1,children:[jsx(Popover.Trigger,{children:jsxs(FilterChip.TriggerChip,{autoFocus,onClick:()=>setPopoverSelection(selected),onFocus,selected:!!selected.length,value:`trigger-chip`,children:[jsx(FilterChip.Icon,{icon:FileIcon}),jsx(FilterChip.Label,{children:renderFilterChipLabel()}),jsx(FilterChip.DropdownIndicator,{})]})}),jsxs(Popover.ContentContainer,{align:`start`,className:box_item_type_selector_quick_filter_module_default.itemTypeSelectorQuickFilterPopoverContainer,children:[jsx(Popover.MainContent,{className:box_item_type_selector_quick_filter_module_default.popoverMainContent,children:jsx(BoxItemTypeSelector,{className:box_item_type_selector_quick_filter_module_default.boxItemTypeSelectorQuickFilter,onSelectionChange:setPopoverSelection,selected:popoverSelection})}),jsxs(Popover.Footer,{className:box_item_type_selector_quick_filter_module_default.popoverFooterInline,children:[jsx(Button,{disabled:!popoverSelection.length,onClick:()=>setPopoverSelection([]),size:`small`,variant:`secondary`,children:intl.formatMessage(messages.clear)}),jsx(Popover.Close,{children:jsx(Button,{disabled:hasSameSelection(popoverSelection,selected),onClick:handleApply,size:`small`,type:applyButtonType,variant:`primary`,children:intl.formatMessage(messages.apply)})})]})]})]})})}export{BoxItemTypeSelectorQuickFilter as t};
@@ -1,66 +1 @@
1
- import { n as e, t } from "./constants.js";
2
- import { Checkbox as n, Text as r } from "@box/blueprint-web";
3
- import i from "clsx";
4
- import { forwardRef as a, useCallback as o } from "react";
5
- import { useIntl as s } from "react-intl";
6
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
- import '../styles/box-item-type-selector.css';var u = {
8
- boxItemTypeSelectorContainer: "_boxItemTypeSelectorContainer_8fq6i_1",
9
- parentItemTypeSelectorContainer: "_parentItemTypeSelectorContainer_8fq6i_5",
10
- itemTypeSelector: "_itemTypeSelector_8fq6i_15",
11
- selectorLabel: "_selectorLabel_8fq6i_21",
12
- disabled: "_disabled_8fq6i_28",
13
- childItemTypeSelectorContainer: "_childItemTypeSelectorContainer_8fq6i_31"
14
- }, d = (e, t) => {
15
- let n = [...t];
16
- return e.forEach((e) => {
17
- n.includes(e.value) || n.push(e.value);
18
- }), n;
19
- }, f = (e, t) => {
20
- let n = [...t];
21
- return e.forEach((e) => {
22
- let t = n.indexOf(e.value);
23
- t >= 0 && n.splice(t, 1);
24
- }), n;
25
- }, p = (e, t, n) => {
26
- let r = [...n];
27
- return e ? r.push(t) : r = r.filter((e) => e !== t), r;
28
- }, m = /*#__PURE__*/ a((a, m) => {
29
- let { className: h, onSelectionChange: g, selected: _, disabled: v = !1, ...y } = a, { formatMessage: b } = s(), x = (e) => e.children ? e.children.every((e) => _.includes(e.value)) ? !0 : e.children.every((e) => !_.includes(e.value)) ? !1 : t : _.includes(e.value), S = o((e, t) => {
30
- let n = [..._];
31
- n = t.children ? e ? d(t.children, n) : f(t.children, n) : p(e, t.value, n), g(n);
32
- }, [g, _]), C = (e) => /* @__PURE__ */ l("span", {
33
- className: i(u.selectorLabel, { [u.disabled]: v }),
34
- children: [e.icon, /* @__PURE__ */ c(r, {
35
- as: "span",
36
- children: b(e.title)
37
- })]
38
- });
39
- return /* @__PURE__ */ c("div", {
40
- ref: m,
41
- className: i(h, u.boxItemTypeSelectorContainer),
42
- ...y,
43
- children: /* @__PURE__ */ c("ul", { children: e.map((e) => /* @__PURE__ */ l("li", {
44
- className: i(u.parentItemTypeSelectorContainer),
45
- children: [/* @__PURE__ */ c(n.Item, {
46
- checked: x(e),
47
- className: i(u.itemTypeSelector),
48
- disabled: v,
49
- label: C(e),
50
- onCheckedChange: (t) => S(t, e),
51
- value: e.value
52
- }, `box-item-type-selector-${e.value}`), e.children && /* @__PURE__ */ c("ul", {
53
- className: i(u.childItemTypeSelectorContainer),
54
- children: e.children.map((e) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c(n.Item, {
55
- checked: x(e),
56
- className: i(u.itemTypeSelector),
57
- disabled: v,
58
- label: C(e),
59
- onCheckedChange: (t) => S(t, e),
60
- value: e.value
61
- }) }, `box-item-type-selector-${e.value}`))
62
- })]
63
- }, `parent-item-type-selector-container-${e.value}`)) })
64
- });
65
- });
66
- export { m as t };
1
+ import{n as boxItemTypeMapping,t as INDETERMINATE}from"./constants.js";import{Checkbox,Text}from"@box/blueprint-web";import clsx from"clsx";import{forwardRef,useCallback}from"react";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import '../styles/box-item-type-selector.css';var box_item_type_selector_module_default={boxItemTypeSelectorContainer:`_boxItemTypeSelectorContainer_8fq6i_1`,parentItemTypeSelectorContainer:`_parentItemTypeSelectorContainer_8fq6i_5`,itemTypeSelector:`_itemTypeSelector_8fq6i_15`,selectorLabel:`_selectorLabel_8fq6i_21`,disabled:`_disabled_8fq6i_28`,childItemTypeSelectorContainer:`_childItemTypeSelectorContainer_8fq6i_31`},addRemainingChildrenItemsToSelectedItems=(children,selected)=>{let newSelected=[...selected];return children.forEach(i=>{newSelected.includes(i.value)||newSelected.push(i.value)}),newSelected},removeChildrenItemsFromSelectedItems=(children,selected)=>{let newSelected=[...selected];return children.forEach(i=>{let index=newSelected.indexOf(i.value);index>=0&&newSelected.splice(index,1)}),newSelected},handleItemWithNoChildrenSelection=(newState,itemValue,selected)=>{let newSelected=[...selected];return newState?newSelected.push(itemValue):newSelected=newSelected.filter(i=>i!==itemValue),newSelected},BoxItemTypeSelector=forwardRef((props,forwardedRef)=>{let{className,onSelectionChange,selected,disabled=!1,...rest}=props,{formatMessage}=useIntl(),determineCheckedValue=item=>item.children?item.children.every(c=>selected.includes(c.value))?!0:item.children.every(c=>!selected.includes(c.value))?!1:INDETERMINATE:selected.includes(item.value),handleCheckedChange=useCallback((newState,item)=>{let newSelected=[...selected];newSelected=item.children?newState?addRemainingChildrenItemsToSelectedItems(item.children,newSelected):removeChildrenItemsFromSelectedItems(item.children,newSelected):handleItemWithNoChildrenSelection(newState,item.value,newSelected),onSelectionChange(newSelected)},[onSelectionChange,selected]),renderLabel=item=>jsxs(`span`,{className:clsx(box_item_type_selector_module_default.selectorLabel,{[box_item_type_selector_module_default.disabled]:disabled}),children:[item.icon,jsx(Text,{as:`span`,children:formatMessage(item.title)})]});return jsx(`div`,{ref:forwardedRef,className:clsx(className,box_item_type_selector_module_default.boxItemTypeSelectorContainer),...rest,children:jsx(`ul`,{children:boxItemTypeMapping.map(parent=>jsxs(`li`,{className:clsx(box_item_type_selector_module_default.parentItemTypeSelectorContainer),children:[jsx(Checkbox.Item,{checked:determineCheckedValue(parent),className:clsx(box_item_type_selector_module_default.itemTypeSelector),disabled,label:renderLabel(parent),onCheckedChange:newState=>handleCheckedChange(newState,parent),value:parent.value},`box-item-type-selector-${parent.value}`),parent.children&&jsx(`ul`,{className:clsx(box_item_type_selector_module_default.childItemTypeSelectorContainer),children:parent.children.map(child=>jsx(`li`,{children:jsx(Checkbox.Item,{checked:determineCheckedValue(child),className:clsx(box_item_type_selector_module_default.itemTypeSelector),disabled,label:renderLabel(child),onCheckedChange:newState=>handleCheckedChange(newState,child),value:child.value})},`box-item-type-selector-${child.value}`))})]},`parent-item-type-selector-container-${parent.value}`))})})});export{BoxItemTypeSelector as t};
@@ -1,91 +1 @@
1
- import e from "../esm/lib/messages.js";
2
- import { FileAudio as t, FileBoxNote as n, FileCanvas as r, FileDocs as i, FileImage as a, FilePdf as o, FilePresentation as s, FileSpreadsheet as c, FileThreeD as l, FileVector as u, FileVideo as d } from "@box/blueprint-web-assets/icons/Content";
3
- import { FileDefault as f, Folder as p } from "@box/blueprint-web-assets/icons/Fill";
4
- import { jsx as m } from "react/jsx-runtime";
5
- var h = /* @__PURE__ */ function(e) {
6
- return e.Folders = "folderType", e.Files = "fileType", e;
7
- }({}), g = {
8
- Folders: e.folderType,
9
- Files: e.fileType
10
- }, _ = /* @__PURE__ */ function(e) {
11
- return e.Document = "documentType", e.PDF = "pdfType", e.Presentation = "presentationType", e.Spreadsheet = "spreadsheetType", e.Image = "imageType", e.Audio = "audioType", e.Video = "videoType", e.Drawing = "drawingType", e.ThreeD = "threedType", e.BoxNote = "boxnoteType", e.BoxCanvas = "boxcanvasType", e;
12
- }({}), v = {
13
- Document: e.documentType,
14
- PDF: e.pdfType,
15
- Presentation: e.presentationType,
16
- Spreadsheet: e.spreadsheetType,
17
- Image: e.imageType,
18
- Audio: e.audioType,
19
- Video: e.videoType,
20
- Drawing: e.drawingType,
21
- ThreeD: e.threedType,
22
- BoxNote: e.boxnoteType,
23
- BoxCanvas: e.boxcanvasType
24
- }, y = "indeterminate", b = [{
25
- children: null,
26
- icon: /* @__PURE__ */ m(p, { role: "presentation" }),
27
- value: h.Folders,
28
- title: g.Folders
29
- }, {
30
- children: [
31
- {
32
- icon: /* @__PURE__ */ m(n, { role: "presentation" }),
33
- value: _.BoxNote,
34
- title: v.BoxNote
35
- },
36
- {
37
- icon: /* @__PURE__ */ m(r, { role: "presentation" }),
38
- value: _.BoxCanvas,
39
- title: v.BoxCanvas
40
- },
41
- {
42
- icon: /* @__PURE__ */ m(o, { role: "presentation" }),
43
- value: _.PDF,
44
- title: v.PDF
45
- },
46
- {
47
- icon: /* @__PURE__ */ m(i, { role: "presentation" }),
48
- value: _.Document,
49
- title: v.Document
50
- },
51
- {
52
- icon: /* @__PURE__ */ m(c, { role: "presentation" }),
53
- value: _.Spreadsheet,
54
- title: v.Spreadsheet
55
- },
56
- {
57
- icon: /* @__PURE__ */ m(s, { role: "presentation" }),
58
- value: _.Presentation,
59
- title: v.Presentation
60
- },
61
- {
62
- icon: /* @__PURE__ */ m(a, { role: "presentation" }),
63
- value: _.Image,
64
- title: v.Image
65
- },
66
- {
67
- icon: /* @__PURE__ */ m(t, { role: "presentation" }),
68
- value: _.Audio,
69
- title: v.Audio
70
- },
71
- {
72
- icon: /* @__PURE__ */ m(d, { role: "presentation" }),
73
- value: _.Video,
74
- title: v.Video
75
- },
76
- {
77
- icon: /* @__PURE__ */ m(u, { role: "presentation" }),
78
- value: _.Drawing,
79
- title: v.Drawing
80
- },
81
- {
82
- icon: /* @__PURE__ */ m(l, { role: "presentation" }),
83
- value: _.ThreeD,
84
- title: v.ThreeD
85
- }
86
- ],
87
- icon: /* @__PURE__ */ m(f, { role: "presentation" }),
88
- value: h.Files,
89
- title: g.Files
90
- }];
91
- export { g as a, _ as i, b as n, h as o, v as r, y as t };
1
+ import messages from"../esm/lib/messages.js";import{FileAudio,FileBoxNote,FileCanvas,FileDocs,FileImage,FilePdf,FilePresentation,FileSpreadsheet,FileThreeD,FileVector,FileVideo}from"@box/blueprint-web-assets/icons/Content";import{FileDefault,Folder}from"@box/blueprint-web-assets/icons/Fill";import{jsx}from"react/jsx-runtime";var BoxParentItemValue=function(BoxParentItemValue){return BoxParentItemValue.Folders=`folderType`,BoxParentItemValue.Files=`fileType`,BoxParentItemValue}({}),BoxParentItemTitle={Folders:messages.folderType,Files:messages.fileType},BoxFileValue=function(BoxFileValue){return BoxFileValue.Document=`documentType`,BoxFileValue.PDF=`pdfType`,BoxFileValue.Presentation=`presentationType`,BoxFileValue.Spreadsheet=`spreadsheetType`,BoxFileValue.Image=`imageType`,BoxFileValue.Audio=`audioType`,BoxFileValue.Video=`videoType`,BoxFileValue.Drawing=`drawingType`,BoxFileValue.ThreeD=`threedType`,BoxFileValue.BoxNote=`boxnoteType`,BoxFileValue.BoxCanvas=`boxcanvasType`,BoxFileValue}({}),BoxFileTitle={Document:messages.documentType,PDF:messages.pdfType,Presentation:messages.presentationType,Spreadsheet:messages.spreadsheetType,Image:messages.imageType,Audio:messages.audioType,Video:messages.videoType,Drawing:messages.drawingType,ThreeD:messages.threedType,BoxNote:messages.boxnoteType,BoxCanvas:messages.boxcanvasType},INDETERMINATE=`indeterminate`,boxItemTypeMapping=[{children:null,icon:jsx(Folder,{role:`presentation`}),value:BoxParentItemValue.Folders,title:BoxParentItemTitle.Folders},{children:[{icon:jsx(FileBoxNote,{role:`presentation`}),value:BoxFileValue.BoxNote,title:BoxFileTitle.BoxNote},{icon:jsx(FileCanvas,{role:`presentation`}),value:BoxFileValue.BoxCanvas,title:BoxFileTitle.BoxCanvas},{icon:jsx(FilePdf,{role:`presentation`}),value:BoxFileValue.PDF,title:BoxFileTitle.PDF},{icon:jsx(FileDocs,{role:`presentation`}),value:BoxFileValue.Document,title:BoxFileTitle.Document},{icon:jsx(FileSpreadsheet,{role:`presentation`}),value:BoxFileValue.Spreadsheet,title:BoxFileTitle.Spreadsheet},{icon:jsx(FilePresentation,{role:`presentation`}),value:BoxFileValue.Presentation,title:BoxFileTitle.Presentation},{icon:jsx(FileImage,{role:`presentation`}),value:BoxFileValue.Image,title:BoxFileTitle.Image},{icon:jsx(FileAudio,{role:`presentation`}),value:BoxFileValue.Audio,title:BoxFileTitle.Audio},{icon:jsx(FileVideo,{role:`presentation`}),value:BoxFileValue.Video,title:BoxFileTitle.Video},{icon:jsx(FileVector,{role:`presentation`}),value:BoxFileValue.Drawing,title:BoxFileTitle.Drawing},{icon:jsx(FileThreeD,{role:`presentation`}),value:BoxFileValue.ThreeD,title:BoxFileTitle.ThreeD}],icon:jsx(FileDefault,{role:`presentation`}),value:BoxParentItemValue.Files,title:BoxParentItemTitle.Files}];export{BoxParentItemTitle as a,BoxFileValue as i,boxItemTypeMapping as n,BoxParentItemValue as o,BoxFileTitle as r,INDETERMINATE as t};
package/dist/esm/index.js CHANGED
@@ -1,4 +1 @@
1
- import { t as e } from "../chunks/box-item-type-selector.js";
2
- import { a as t, i as n, o as r, r as i } from "../chunks/constants.js";
3
- import { t as a } from "../chunks/box-item-type-selector-quick-filter.js";
4
- export { i as BoxFileTitle, n as BoxFileValue, e as BoxItemTypeSelector, a as BoxItemTypeSelectorQuickFilter, t as BoxParentItemTitle, r as BoxParentItemValue };
1
+ import{t as BoxItemTypeSelector}from"../chunks/box-item-type-selector.js";import{a as BoxParentItemTitle,i as BoxFileValue,o as BoxParentItemValue,r as BoxFileTitle}from"../chunks/constants.js";import{t as BoxItemTypeSelectorQuickFilter}from"../chunks/box-item-type-selector-quick-filter.js";export{BoxFileTitle,BoxFileValue,BoxItemTypeSelector,BoxItemTypeSelectorQuickFilter,BoxParentItemTitle,BoxParentItemValue};
@@ -1,2 +1 @@
1
- import { t as e } from "../../chunks/box-item-type-selector-quick-filter.js";
2
- export { e as BoxItemTypeSelectorQuickFilter, e as default };
1
+ import{t as BoxItemTypeSelectorQuickFilter}from"../../chunks/box-item-type-selector-quick-filter.js";export{BoxItemTypeSelectorQuickFilter,BoxItemTypeSelectorQuickFilter as default};
@@ -1,2 +1 @@
1
- import { t as e } from "../../chunks/box-item-type-selector.js";
2
- export { e as BoxItemTypeSelector, e as default };
1
+ import{t as BoxItemTypeSelector}from"../../chunks/box-item-type-selector.js";export{BoxItemTypeSelector,BoxItemTypeSelector as default};
@@ -1,2 +1 @@
1
- import { n as e, t } from "../../chunks/constants.js";
2
- export { t as INDETERMINATE, e as boxItemTypeMapping };
1
+ import{n as boxItemTypeMapping,t as INDETERMINATE}from"../../chunks/constants.js";export{INDETERMINATE,boxItemTypeMapping};
@@ -1,72 +1 @@
1
- import { defineMessages as e } from "react-intl";
2
- var t = e({
3
- apply: {
4
- id: "groupSharedFeatures.boxItemTypeSelector.quickFilter.apply",
5
- defaultMessage: "Apply"
6
- },
7
- audioType: {
8
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType",
9
- defaultMessage: "Audio"
10
- },
11
- boxcanvasType: {
12
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType",
13
- defaultMessage: "Box Canvas"
14
- },
15
- boxnoteType: {
16
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType",
17
- defaultMessage: "Box Note"
18
- },
19
- clear: {
20
- id: "groupSharedFeatures.boxItemTypeSelector.quickFilter.clear",
21
- defaultMessage: "Clear"
22
- },
23
- documentType: {
24
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType",
25
- defaultMessage: "Document"
26
- },
27
- drawingType: {
28
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType",
29
- defaultMessage: "Drawing"
30
- },
31
- fileTypeLabelDropdown: {
32
- id: "groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown",
33
- defaultMessage: "File Type"
34
- },
35
- fileType: {
36
- id: "groupSharedFeatures.boxItemTypeSelector.itemType.fileType",
37
- defaultMessage: "Files"
38
- },
39
- folderType: {
40
- id: "groupSharedFeatures.boxItemTypeSelector.itemType.folderType",
41
- defaultMessage: "Folders"
42
- },
43
- imageType: {
44
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType",
45
- defaultMessage: "Image"
46
- },
47
- multipleFiles: {
48
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.multipleFiles",
49
- defaultMessage: "{fileType} +{count}"
50
- },
51
- pdfType: {
52
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.pdfType",
53
- defaultMessage: "PDF"
54
- },
55
- presentationType: {
56
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType",
57
- defaultMessage: "Presentation"
58
- },
59
- spreadsheetType: {
60
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType",
61
- defaultMessage: "Spreadsheet"
62
- },
63
- threedType: {
64
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.threedType",
65
- defaultMessage: "3D"
66
- },
67
- videoType: {
68
- id: "groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType",
69
- defaultMessage: "Video"
70
- }
71
- });
72
- export { t as default };
1
+ import{defineMessages}from"react-intl";var messages=defineMessages({apply:{id:`groupSharedFeatures.boxItemTypeSelector.quickFilter.apply`,defaultMessage:`Apply`},audioType:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType`,defaultMessage:`Audio`},boxcanvasType:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType`,defaultMessage:`Box Canvas`},boxnoteType:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType`,defaultMessage:`Box Note`},clear:{id:`groupSharedFeatures.boxItemTypeSelector.quickFilter.clear`,defaultMessage:`Clear`},documentType:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType`,defaultMessage:`Document`},drawingType:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType`,defaultMessage:`Drawing`},fileTypeLabelDropdown:{id:`groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown`,defaultMessage:`File Type`},fileType:{id:`groupSharedFeatures.boxItemTypeSelector.itemType.fileType`,defaultMessage:`Files`},folderType:{id:`groupSharedFeatures.boxItemTypeSelector.itemType.folderType`,defaultMessage:`Folders`},imageType:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType`,defaultMessage:`Image`},multipleFiles:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.multipleFiles`,defaultMessage:`{fileType} +{count}`},pdfType:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.pdfType`,defaultMessage:`PDF`},presentationType:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType`,defaultMessage:`Presentation`},spreadsheetType:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType`,defaultMessage:`Spreadsheet`},threedType:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.threedType`,defaultMessage:`3D`},videoType:{id:`groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType`,defaultMessage:`Video`}});export{messages as default};
@@ -1,27 +1 @@
1
- import { Text as e } from "@box/blueprint-web";
2
- import { Fragment as t } from "react";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- var i = ({ defaultProps: i, DefaultComponentTemplate: a, variantsMap: o, containerStyle: s }) => {
5
- let c = Object.entries(o);
6
- return /* @__PURE__ */ n("div", {
7
- style: {
8
- display: "grid",
9
- gridTemplateColumns: "auto auto",
10
- alignItems: "baseline",
11
- gap: "64px 12px",
12
- ...s
13
- },
14
- children: c.map(([o, { props: s = {}, ComponentTemplate: c }]) => /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(e, {
15
- as: "span",
16
- color: "textOnLightSecondary",
17
- style: { textTransform: "uppercase" },
18
- variant: "bodyDefaultBold",
19
- children: o
20
- }), /* @__PURE__ */ n("div", { children: n(c || a, {
21
- ...i,
22
- ...s
23
- }) })] }, o))
24
- });
25
- };
26
- i.displayName = "variants";
27
- export { i as VariantsAggregator };
1
+ import{Text}from"@box/blueprint-web";import{Fragment}from"react";import{jsx,jsxs}from"react/jsx-runtime";var VariantsAggregator=({defaultProps,DefaultComponentTemplate,variantsMap,containerStyle})=>{let variantsArray=Object.entries(variantsMap);return jsx(`div`,{style:{display:`grid`,gridTemplateColumns:`auto auto`,alignItems:`baseline`,gap:`64px 12px`,...containerStyle},children:variantsArray.map(([variant,{props={},ComponentTemplate}])=>jsxs(Fragment,{children:[jsx(Text,{as:`span`,color:`textOnLightSecondary`,style:{textTransform:`uppercase`},variant:`bodyDefaultBold`,children:variant}),jsx(`div`,{children:jsx(ComponentTemplate||DefaultComponentTemplate,{...defaultProps,...props})})]},variant))})};VariantsAggregator.displayName=`variants`;export{VariantsAggregator};
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@box/box-item-type-selector",
3
- "version": "2.1.34",
3
+ "version": "2.1.36",
4
4
  "peerDependencies": {
5
- "@box/blueprint-web": "^16.12.1",
6
- "@box/blueprint-web-assets": "^5.5.8",
5
+ "@box/blueprint-web": "^16.13.1",
6
+ "@box/blueprint-web-assets": "^5.5.10",
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": "^16.12.1",
13
- "@box/blueprint-web-assets": "^5.5.8",
14
- "@box/storybook-utils": "^1.1.32",
12
+ "@box/blueprint-web": "^16.13.1",
13
+ "@box/blueprint-web-assets": "^5.5.10",
14
+ "@box/storybook-utils": "^1.1.34",
15
15
  "react": "^18.3.0",
16
16
  "react-dom": "^18.3.0",
17
17
  "react-intl": "^6.4.2"