@box/box-item-type-selector 0.60.0

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 (73) hide show
  1. package/LICENSE +379 -0
  2. package/README.md +47 -0
  3. package/dist/chunks/constants.js +115 -0
  4. package/dist/esm/index.js +11 -0
  5. package/dist/esm/lib/box-item-type-selector-quick-filter.js +90 -0
  6. package/dist/esm/lib/box-item-type-selector.js +81 -0
  7. package/dist/esm/lib/constants.js +8 -0
  8. package/dist/esm/lib/messages.js +74 -0
  9. package/dist/esm/lib/utils/VariantsAggregator.js +46 -0
  10. package/dist/i18n/bn-IN.js +19 -0
  11. package/dist/i18n/bn-IN.properties +34 -0
  12. package/dist/i18n/da-DK.js +19 -0
  13. package/dist/i18n/da-DK.properties +34 -0
  14. package/dist/i18n/de-DE.js +19 -0
  15. package/dist/i18n/de-DE.properties +34 -0
  16. package/dist/i18n/en-AU.js +19 -0
  17. package/dist/i18n/en-AU.properties +34 -0
  18. package/dist/i18n/en-CA.js +19 -0
  19. package/dist/i18n/en-CA.properties +34 -0
  20. package/dist/i18n/en-GB.js +19 -0
  21. package/dist/i18n/en-GB.properties +34 -0
  22. package/dist/i18n/en-US.js +19 -0
  23. package/dist/i18n/en-US.properties +34 -0
  24. package/dist/i18n/en-x-pseudo.js +19 -0
  25. package/dist/i18n/en-x-pseudo.properties +34 -0
  26. package/dist/i18n/es-419.js +19 -0
  27. package/dist/i18n/es-419.properties +34 -0
  28. package/dist/i18n/es-ES.js +19 -0
  29. package/dist/i18n/es-ES.properties +34 -0
  30. package/dist/i18n/fi-FI.js +19 -0
  31. package/dist/i18n/fi-FI.properties +34 -0
  32. package/dist/i18n/fr-CA.js +19 -0
  33. package/dist/i18n/fr-CA.properties +34 -0
  34. package/dist/i18n/fr-FR.js +19 -0
  35. package/dist/i18n/fr-FR.properties +34 -0
  36. package/dist/i18n/hi-IN.js +19 -0
  37. package/dist/i18n/hi-IN.properties +34 -0
  38. package/dist/i18n/it-IT.js +19 -0
  39. package/dist/i18n/it-IT.properties +34 -0
  40. package/dist/i18n/ja-JP.js +19 -0
  41. package/dist/i18n/ja-JP.properties +34 -0
  42. package/dist/i18n/json/src/lib/messages.json +1 -0
  43. package/dist/i18n/ko-KR.js +19 -0
  44. package/dist/i18n/ko-KR.properties +34 -0
  45. package/dist/i18n/nb-NO.js +19 -0
  46. package/dist/i18n/nb-NO.properties +34 -0
  47. package/dist/i18n/nl-NL.js +19 -0
  48. package/dist/i18n/nl-NL.properties +34 -0
  49. package/dist/i18n/pl-PL.js +19 -0
  50. package/dist/i18n/pl-PL.properties +34 -0
  51. package/dist/i18n/pt-BR.js +19 -0
  52. package/dist/i18n/pt-BR.properties +34 -0
  53. package/dist/i18n/ru-RU.js +19 -0
  54. package/dist/i18n/ru-RU.properties +34 -0
  55. package/dist/i18n/sv-SE.js +19 -0
  56. package/dist/i18n/sv-SE.properties +34 -0
  57. package/dist/i18n/tr-TR.js +19 -0
  58. package/dist/i18n/tr-TR.properties +34 -0
  59. package/dist/i18n/zh-CN.js +19 -0
  60. package/dist/i18n/zh-CN.properties +34 -0
  61. package/dist/i18n/zh-TW.js +19 -0
  62. package/dist/i18n/zh-TW.properties +34 -0
  63. package/dist/styles/box-item-type-selector-quick-filter.css +1 -0
  64. package/dist/styles/box-item-type-selector.css +1 -0
  65. package/dist/types/index.d.ts +3 -0
  66. package/dist/types/lib/box-item-type-selector-quick-filter.d.ts +12 -0
  67. package/dist/types/lib/box-item-type-selector.d.ts +3 -0
  68. package/dist/types/lib/constants.d.ts +20 -0
  69. package/dist/types/lib/messages.d.ts +88 -0
  70. package/dist/types/lib/stories/shared.d.ts +15 -0
  71. package/dist/types/lib/types.d.ts +111 -0
  72. package/dist/types/lib/utils/VariantsAggregator.d.ts +15 -0
  73. package/package.json +48 -0
@@ -0,0 +1,111 @@
1
+ import { MessageDescriptor } from 'react-intl';
2
+ export type BoxItemTypeSelectorProps = {
3
+ className?: string;
4
+ /**
5
+ * Callback invoked once Box Item type value changes
6
+ */
7
+ onSelectionChange: (newSelection: BoxItemSelection) => void;
8
+ /**
9
+ * Array of selected Box Item type values
10
+ */
11
+ selected: BoxItemSelection;
12
+ /**
13
+ * The optional boolean which sets the disabled state when set to true
14
+ */
15
+ disabled?: boolean;
16
+ };
17
+ export declare enum BoxParentItemValue {
18
+ Folders = "folderType",
19
+ Files = "fileType"
20
+ }
21
+ export declare const BoxParentItemTitle: {
22
+ Folders: {
23
+ defaultMessage: string;
24
+ description: string;
25
+ id: string;
26
+ };
27
+ Files: {
28
+ defaultMessage: string;
29
+ description: string;
30
+ id: string;
31
+ };
32
+ };
33
+ export declare enum BoxFileValue {
34
+ Document = "documentType",
35
+ PDF = "pdfType",
36
+ Presentation = "presentationType",
37
+ Spreadsheet = "spreadsheetType",
38
+ Image = "imageType",
39
+ Audio = "audioType",
40
+ Video = "videoType",
41
+ Drawing = "drawingType",
42
+ ThreeD = "threedType",
43
+ BoxNote = "boxnoteType",
44
+ BoxCanvas = "boxcanvasType"
45
+ }
46
+ export declare const BoxFileTitle: {
47
+ Document: {
48
+ defaultMessage: string;
49
+ description: string;
50
+ id: string;
51
+ };
52
+ PDF: {
53
+ defaultMessage: string;
54
+ description: string;
55
+ id: string;
56
+ };
57
+ Presentation: {
58
+ defaultMessage: string;
59
+ description: string;
60
+ id: string;
61
+ };
62
+ Spreadsheet: {
63
+ defaultMessage: string;
64
+ description: string;
65
+ id: string;
66
+ };
67
+ Image: {
68
+ defaultMessage: string;
69
+ description: string;
70
+ id: string;
71
+ };
72
+ Audio: {
73
+ defaultMessage: string;
74
+ description: string;
75
+ id: string;
76
+ };
77
+ Video: {
78
+ defaultMessage: string;
79
+ description: string;
80
+ id: string;
81
+ };
82
+ Drawing: {
83
+ defaultMessage: string;
84
+ description: string;
85
+ id: string;
86
+ };
87
+ ThreeD: {
88
+ defaultMessage: string;
89
+ description: string;
90
+ id: string;
91
+ };
92
+ BoxNote: {
93
+ defaultMessage: string;
94
+ description: string;
95
+ id: string;
96
+ };
97
+ BoxCanvas: {
98
+ defaultMessage: string;
99
+ description: string;
100
+ id: string;
101
+ };
102
+ };
103
+ export type ItemTypeSelector = {
104
+ children?: Array<ItemTypeSelector> | null;
105
+ icon: React.ReactElement;
106
+ value: BoxItemValue;
107
+ title: BoxItemTitle;
108
+ };
109
+ export type BoxItemValue = BoxParentItemValue | BoxFileValue;
110
+ export type BoxItemTitle = MessageDescriptor;
111
+ export type BoxItemSelection = Omit<BoxItemValue, BoxParentItemValue.Files>[];
@@ -0,0 +1,15 @@
1
+ import { default as React, CSSProperties, FunctionComponent } from 'react';
2
+ export type ComponentVariant<Props extends object> = {
3
+ props?: Partial<Props>;
4
+ ComponentTemplate?: FunctionComponent<any>;
5
+ };
6
+ export type ComponentRecord<ComponentProps> = Record<string, ComponentVariant<Partial<ComponentProps>>>;
7
+ export declare const VariantsAggregator: {
8
+ <T extends React.JSX.IntrinsicAttributes>({ defaultProps, DefaultComponentTemplate, variantsMap, containerStyle, }: {
9
+ defaultProps: T;
10
+ DefaultComponentTemplate: FunctionComponent<T>;
11
+ variantsMap: Record<string, ComponentVariant<T>>;
12
+ containerStyle?: CSSProperties;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ displayName: string;
15
+ };
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@box/box-item-type-selector",
3
+ "version": "0.60.0",
4
+ "peerDependencies": {
5
+ "@box/blueprint-web": "^7.8.0",
6
+ "@box/blueprint-web-assets": "^4.16.0",
7
+ "react": "^17.0.0 || ^18.0.0",
8
+ "react-dom": "^17.0.0 || ^18.0.0",
9
+ "react-intl": "6.4.2"
10
+ },
11
+ "devDependencies": {
12
+ "@box/blueprint-web": "^12.38.0",
13
+ "@box/blueprint-web-assets": "^4.60.0",
14
+ "@box/storybook-utils": "^0.13.14",
15
+ "react": "^18.3.0",
16
+ "react-dom": "^18.3.0",
17
+ "react-intl": "6.4.2"
18
+ },
19
+ "main": "./dist/esm/index.js",
20
+ "module": "./dist/esm/index.js",
21
+ "types": "./dist/types/index.d.ts",
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "exports": {
26
+ ".": {
27
+ "require": "./dist/esm/index.js",
28
+ "import": "./dist/esm/index.js",
29
+ "types": "./dist/types/index.d.ts"
30
+ },
31
+ "./*": {
32
+ "require": "./dist/esm/*",
33
+ "import": "./dist/esm/*",
34
+ "types": "./dist/types/*"
35
+ },
36
+ "./i18n/*": {
37
+ "require": "./dist/i18n/*",
38
+ "import": "./dist/i18n/*"
39
+ }
40
+ },
41
+ "sideEffects": [
42
+ "**/*.css"
43
+ ],
44
+ "license": "SEE LICENSE IN LICENSE",
45
+ "publishConfig": {
46
+ "access": "public"
47
+ }
48
+ }