@procore/core-react 11.8.0-rc.6 → 11.8.0-rc.9

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 (120) hide show
  1. package/dist/Field/Field.d.ts +12 -0
  2. package/dist/Field/Field.js +50 -0
  3. package/dist/Field/Field.js.map +1 -0
  4. package/dist/Field/Field.styles.d.ts +3 -0
  5. package/dist/Field/Field.styles.js +11 -0
  6. package/dist/Field/Field.styles.js.map +1 -0
  7. package/dist/Field/index.d.ts +1 -0
  8. package/dist/Field/index.js +2 -0
  9. package/dist/Field/index.js.map +1 -0
  10. package/dist/Form/Form.js +6 -3
  11. package/dist/Form/Form.js.map +1 -1
  12. package/dist/Form/Form.styles.d.ts +5 -2
  13. package/dist/Form/Form.styles.js +6 -4
  14. package/dist/Form/Form.styles.js.map +1 -1
  15. package/dist/Semantic/Semantic.d.ts +4 -0
  16. package/dist/Semantic/Semantic.js +5 -1
  17. package/dist/Semantic/Semantic.js.map +1 -1
  18. package/dist/Semantic/Semantic.styles.d.ts +9 -0
  19. package/dist/Semantic/Semantic.styles.js +26 -8
  20. package/dist/Semantic/Semantic.styles.js.map +1 -1
  21. package/dist/Semantic/index.d.ts +1 -1
  22. package/dist/Semantic/index.js +1 -1
  23. package/dist/Semantic/index.js.map +1 -1
  24. package/dist/SuperSelect/SuperSelect.components.d.ts +36 -0
  25. package/dist/SuperSelect/SuperSelect.components.js +249 -0
  26. package/dist/SuperSelect/SuperSelect.components.js.map +1 -0
  27. package/dist/SuperSelect/SuperSelect.d.ts +142 -46
  28. package/dist/SuperSelect/SuperSelect.js +50 -203
  29. package/dist/SuperSelect/SuperSelect.js.map +1 -1
  30. package/dist/SuperSelect/SuperSelect.presets.d.ts +2 -0
  31. package/dist/SuperSelect/SuperSelect.presets.js +104 -0
  32. package/dist/SuperSelect/SuperSelect.presets.js.map +1 -0
  33. package/dist/SuperSelect/SuperSelect.styles.d.ts +61 -26
  34. package/dist/SuperSelect/SuperSelect.styles.js +127 -25
  35. package/dist/SuperSelect/SuperSelect.styles.js.map +1 -1
  36. package/dist/SuperSelect/SuperSelect.types.d.ts +19 -61
  37. package/dist/SuperSelect/SuperSelect.types.js.map +1 -1
  38. package/dist/SuperSelect/useSuperSelect.d.ts +417 -47
  39. package/dist/SuperSelect/useSuperSelect.js +230 -116
  40. package/dist/SuperSelect/useSuperSelect.js.map +1 -1
  41. package/dist/Typography/Typography.styles.d.ts +1 -2
  42. package/dist/Typography/Typography.styles.js +6 -3
  43. package/dist/Typography/Typography.styles.js.map +1 -1
  44. package/dist/Typography/Typography.types.d.ts +1 -1
  45. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  46. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +22 -22
  47. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  48. package/dist/_typedoc/Banner/Banner.types.json +13 -13
  49. package/dist/_typedoc/Box/Box.types.json +68 -68
  50. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  51. package/dist/_typedoc/Button/Button.types.json +11 -11
  52. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  53. package/dist/_typedoc/Card/Card.types.json +6 -6
  54. package/dist/_typedoc/Checkbox/Checkbox.types.json +7 -7
  55. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  56. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  57. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  58. package/dist/_typedoc/DetailPage/DetailPage.types.json +4 -4
  59. package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
  60. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +29 -29
  61. package/dist/_typedoc/Dropzone/Dropzone.types.json +41 -41
  62. package/dist/_typedoc/EmptyState/EmptyState.types.json +14 -14
  63. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  64. package/dist/_typedoc/FileSelect/FileSelect.types.json +26 -26
  65. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  66. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  67. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  68. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  69. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  70. package/dist/_typedoc/Form/Form.types.json +694 -694
  71. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  72. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
  73. package/dist/_typedoc/Input/Input.types.json +2 -2
  74. package/dist/_typedoc/Link/Link.types.json +4 -4
  75. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  76. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  77. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +71 -71
  78. package/dist/_typedoc/Modal/Modal.types.json +28 -28
  79. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
  80. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  81. package/dist/_typedoc/NumberInput/NumberInput.types.json +43 -43
  82. package/dist/_typedoc/PageLayout/PageLayout.types.json +22 -22
  83. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  84. package/dist/_typedoc/Panel/Panel.types.json +27 -27
  85. package/dist/_typedoc/Pill/Pill.types.json +1 -1
  86. package/dist/_typedoc/PillSelect/PillSelect.types.json +46 -46
  87. package/dist/_typedoc/Popover/Popover.types.json +10 -10
  88. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
  89. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  90. package/dist/_typedoc/Required/Required.types.json +5 -5
  91. package/dist/_typedoc/Search/Search.types.json +18 -18
  92. package/dist/_typedoc/Section/Section.types.json +14 -14
  93. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +20 -20
  94. package/dist/_typedoc/Select/Select.types.json +31 -31
  95. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  96. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  97. package/dist/_typedoc/Switch/Switch.types.json +3 -3
  98. package/dist/_typedoc/Table/Table.types.json +94 -94
  99. package/dist/_typedoc/Tabs/Tabs.types.json +17 -17
  100. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +10 -10
  101. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  102. package/dist/_typedoc/TextEditor/TextEditor.types.json +7 -7
  103. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +3 -3
  104. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
  105. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
  106. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
  107. package/dist/_typedoc/Tile/Tile.types.json +30 -30
  108. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  109. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +3 -3
  110. package/dist/_typedoc/Token/Token.types.json +4 -4
  111. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  112. package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
  113. package/dist/_typedoc/Tree/Tree.types.json +86 -86
  114. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  115. package/dist/_typedoc/Typography/Typography.types.json +9 -9
  116. package/dist/_typedoc/_utils/types.json +3 -3
  117. package/package.json +5 -3
  118. package/dist/SuperSelect/SuperSelectDraggableOptions.d.ts +0 -12
  119. package/dist/SuperSelect/SuperSelectDraggableOptions.js +0 -61
  120. package/dist/SuperSelect/SuperSelectDraggableOptions.js.map +0 -1
@@ -10,7 +10,7 @@
10
10
  "description": "",
11
11
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
12
12
  "sourceFile": "packages/core-react/src/Typeahead/Typeahead.types.ts",
13
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/Typeahead/Typeahead.types.ts#L15"
13
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/Typeahead/Typeahead.types.ts#L15"
14
14
  },
15
15
  {
16
16
  "name": "onChange",
@@ -20,7 +20,7 @@
20
20
  "description": "",
21
21
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
22
22
  "sourceFile": "packages/core-react/src/Typeahead/Typeahead.types.ts",
23
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/Typeahead/Typeahead.types.ts#L19"
23
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/Typeahead/Typeahead.types.ts#L19"
24
24
  }
25
25
  ],
26
26
  "description": ""
@@ -10,7 +10,7 @@
10
10
  "description": "<span>\n Change the HTML tag. This{' '}\n <Link href=\"https://styled-components.com/docs/api#as-polymorphic-prop\">\n prop is from styled-components\n </Link>\n .<em>WARNING</em>: If using TypeScript, it will not switch types and\n some props may error. You can add <Code>// @ts-expect-error</Code>.\n See{' '}\n <Link href=\"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30117\">\n styled-components issue\n </Link>\n .\n</span>",
11
11
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<span>\n Change the HTML tag. This{' '}\n <Link href=\"https://styled-components.com/docs/api#as-polymorphic-prop\">\n prop is from styled-components\n </Link>\n .<em>WARNING</em>: If using TypeScript, it will not switch types and\n some props may error. You can add <Code>// @ts-expect-error</Code>.\n See{' '}\n <Link href=\"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30117\">\n styled-components issue\n </Link>\n .\n</span></div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
12
12
  "sourceFile": "packages/core-react/src/Typography/Typography.types.ts",
13
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/Typography/Typography.types.ts#L35"
13
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/Typography/Typography.types.ts#L35"
14
14
  },
15
15
  {
16
16
  "name": "children",
@@ -20,7 +20,7 @@
20
20
  "description": "<span>\n When children are a string or multiple elements, they will be wrapped\n by a <Code>span</Code>. When it is a single element, classnames will\n be added to it instead\n</span>",
21
21
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<span>\n When children are a string or multiple elements, they will be wrapped\n by a <Code>span</Code>. When it is a single element, classnames will\n be added to it instead\n</span></div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
22
22
  "sourceFile": "packages/core-react/src/Typography/Typography.types.ts",
23
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/Typography/Typography.types.ts#L17"
23
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/Typography/Typography.types.ts#L17"
24
24
  },
25
25
  {
26
26
  "name": "className",
@@ -30,7 +30,7 @@
30
30
  "description": "Additional classNames",
31
31
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional classNames</p>\n</div></div>",
32
32
  "sourceFile": "packages/core-react/src/_utils/types.ts",
33
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/_utils/types.ts#L50"
33
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/_utils/types.ts#L50"
34
34
  },
35
35
  {
36
36
  "name": "color",
@@ -40,17 +40,17 @@
40
40
  "description": "<span>\n Changes font color, can be any of the{' '}\n <Link to=\"/web/style/colors/#hsl-palette\">HSL Palette</Link> css\n strings\n</span>",
41
41
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<span>\n Changes font color, can be any of the{' '}\n <Link to=\"/web/style/colors/#hsl-palette\">HSL Palette</Link> css\n strings\n</span></div><dl class=\"tsd-comment-tags\"><dt>default</dt><dd><p>&#39;gray15&#39;</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
42
42
  "sourceFile": "packages/core-react/src/Typography/Typography.types.ts",
43
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/Typography/Typography.types.ts#L46"
43
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/Typography/Typography.types.ts#L46"
44
44
  },
45
45
  {
46
46
  "name": "intent",
47
47
  "required": false,
48
48
  "type": "<a class=\"tsd-signature-type\" data-tsd-kind=\"Type alias\">Intent</a>",
49
- "typeDetail": "<span class=\"tsd-signature-type\">&quot;h1&quot;</span><span class=\"tsd-signature-symbol\"> | </span><span class=\"tsd-signature-type\">&quot;h2&quot;</span><span class=\"tsd-signature-symbol\"> | </span><span class=\"tsd-signature-type\">&quot;h3&quot;</span><span class=\"tsd-signature-symbol\"> | </span><span class=\"tsd-signature-type\">&quot;body&quot;</span><span class=\"tsd-signature-symbol\"> | </span><span class=\"tsd-signature-type\">&quot;small&quot;</span>",
49
+ "typeDetail": "<span class=\"tsd-signature-type\">&quot;h1&quot;</span><span class=\"tsd-signature-symbol\"> | </span><span class=\"tsd-signature-type\">&quot;h2&quot;</span><span class=\"tsd-signature-symbol\"> | </span><span class=\"tsd-signature-type\">&quot;h3&quot;</span><span class=\"tsd-signature-symbol\"> | </span><span class=\"tsd-signature-type\">&quot;body&quot;</span><span class=\"tsd-signature-symbol\"> | </span><span class=\"tsd-signature-type\">&quot;small&quot;</span><span class=\"tsd-signature-symbol\"> | </span><span class=\"tsd-signature-type\">&quot;label&quot;</span>",
50
50
  "description": "Changes the size of the font",
51
51
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Changes the size of the font</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
52
52
  "sourceFile": "packages/core-react/src/Typography/Typography.types.ts",
53
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/Typography/Typography.types.ts#L52"
53
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/Typography/Typography.types.ts#L52"
54
54
  },
55
55
  {
56
56
  "name": "italic",
@@ -60,7 +60,7 @@
60
60
  "description": "Applies `font-style: italic` if enabled",
61
61
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Applies <code>font-style: italic</code> if enabled</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
62
62
  "sourceFile": "packages/core-react/src/Typography/Typography.types.ts",
63
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/Typography/Typography.types.ts#L58"
63
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/Typography/Typography.types.ts#L58"
64
64
  },
65
65
  {
66
66
  "name": "style",
@@ -70,7 +70,7 @@
70
70
  "description": "Additional CSS styles",
71
71
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional CSS styles</p>\n</div></div>",
72
72
  "sourceFile": "packages/core-react/src/_utils/types.ts",
73
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/_utils/types.ts#L55"
73
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/_utils/types.ts#L55"
74
74
  },
75
75
  {
76
76
  "name": "weight",
@@ -80,7 +80,7 @@
80
80
  "description": "Changes font weight if it is supported in the design system",
81
81
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Changes font weight if it is supported in the design system</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
82
82
  "sourceFile": "packages/core-react/src/Typography/Typography.types.ts",
83
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/Typography/Typography.types.ts#L64"
83
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/Typography/Typography.types.ts#L64"
84
84
  }
85
85
  ],
86
86
  "description": ""
@@ -10,7 +10,7 @@
10
10
  "description": "Instead of using the default children, you can pass in your own.",
11
11
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Instead of using the default children, you can pass in your own.</p>\n</div></div>",
12
12
  "sourceFile": "packages/core-react/src/_utils/types.ts",
13
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/_utils/types.ts#L45"
13
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/_utils/types.ts#L45"
14
14
  },
15
15
  {
16
16
  "name": "className",
@@ -20,7 +20,7 @@
20
20
  "description": "Additional classNames",
21
21
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional classNames</p>\n</div></div>",
22
22
  "sourceFile": "packages/core-react/src/_utils/types.ts",
23
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/_utils/types.ts#L50"
23
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/_utils/types.ts#L50"
24
24
  },
25
25
  {
26
26
  "name": "style",
@@ -30,7 +30,7 @@
30
30
  "description": "Additional CSS styles",
31
31
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional CSS styles</p>\n</div></div>",
32
32
  "sourceFile": "packages/core-react/src/_utils/types.ts",
33
- "sourceUrl": "https://github.com/procore/core/blob/1c327990b/packages/core-react/src/_utils/types.ts#L55"
33
+ "sourceUrl": "https://github.com/procore/core/blob/49cbef2d2/packages/core-react/src/_utils/types.ts#L55"
34
34
  }
35
35
  ],
36
36
  "description": ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/core-react",
3
- "version": "11.8.0-rc.6",
3
+ "version": "11.8.0-rc.9",
4
4
  "description": "React library of Procore Design Guidelines",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "storybook:build": "yarn build:deps && yarn storybook:build:nodeps",
29
29
  "storybook:build:nodeps": "build-storybook -s .storybook/static --webpack-stats-json",
30
30
  "test": "yarn build:deps && yarn test:nodeps --runInBand",
31
- "test:nodeps": "TZ=America/Los_Angeles yarn jest --runInBand",
31
+ "test:nodeps": "TZ=America/Los_Angeles yarn jest --runInBand --silent --logHeapUsage",
32
32
  "test:watch": "yarn test --watch",
33
33
  "chromatic": "npx chromatic --storybook-build-dir ./storybook-static --only-changed --untraced=package.json"
34
34
  },
@@ -77,6 +77,7 @@
77
77
  "@types/jest": "27.5.0",
78
78
  "@types/lodash.debounce": "4.0.7",
79
79
  "@types/lodash.groupby": "4.6.7",
80
+ "@types/lodash.merge": "4.6.7",
80
81
  "@types/lodash.throttle": "4.1.7",
81
82
  "@types/lodash.times": "4.3.7",
82
83
  "@types/lodash.uniq": "4.5.7",
@@ -136,6 +137,7 @@
136
137
  "intersection-observer": "0.12.2",
137
138
  "lodash.debounce": "4.0.8",
138
139
  "lodash.groupby": "4.6.0",
140
+ "lodash.merge": "4.6.2",
139
141
  "lodash.throttle": "4.1.1",
140
142
  "lodash.times": "4.3.2",
141
143
  "lodash.uniq": "4.5.0",
@@ -155,5 +157,5 @@
155
157
  "react-dom": ">=16.8.0 < 19",
156
158
  "styled-components": ">= 5.1.1 < 6"
157
159
  },
158
- "gitHead": "1c327990bf33f43243a1e8135904d4dbd38ea733"
160
+ "gitHead": "49cbef2d2077f6f30731a7971489cf0eeabfd767"
159
161
  }
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { SuperSelectApi, SuperSelectComponents, SuperSelectMenuItemProps } from './SuperSelect.types';
3
- export declare const InternalDragDropContext: React.Context<{
4
- isDraggingOver: boolean;
5
- }>;
6
- export declare const SuperSelectDraggableOptions: ({ SuperSelectMenuItem, MenuItemLabelComponent, MenuGroupHeaderComponent, selectApi, onListHeightChange, }: {
7
- SuperSelectMenuItem: React.FC<SuperSelectMenuItemProps>;
8
- MenuItemLabelComponent: NonNullable<SuperSelectComponents['MenuItemLabel']>;
9
- MenuGroupHeaderComponent: NonNullable<SuperSelectComponents['MenuGroupHeader']>;
10
- selectApi: SuperSelectApi;
11
- onListHeightChange: (height: number) => void;
12
- }) => JSX.Element;
@@ -1,61 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { Grip } from '@procore/core-icons';
13
- import React from 'react';
14
- import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd';
15
- import { Virtuoso } from 'react-virtuoso';
16
- import { StyledGrip } from '../MenuImperative/MenuImperative.styles';
17
- import { colors } from '../_styles/colors';
18
- import { draggableOptionIdSymbol } from './SuperSelect.constants';
19
- import { StyledDraggableWrapper } from './SuperSelect.styles';
20
- export var InternalDragDropContext = React.createContext({
21
- isDraggingOver: false,
22
- });
23
- var InternalDragDropProvider = function (_a) {
24
- var isDraggingOver = _a.isDraggingOver, children = _a.children;
25
- var value = React.useMemo(function () {
26
- return {
27
- isDraggingOver: isDraggingOver,
28
- };
29
- }, [isDraggingOver]);
30
- return (React.createElement(InternalDragDropContext.Provider, { value: value }, children));
31
- };
32
- export var SuperSelectDraggableOptions = function (_a) {
33
- var SuperSelectMenuItem = _a.SuperSelectMenuItem, MenuItemLabelComponent = _a.MenuItemLabelComponent, MenuGroupHeaderComponent = _a.MenuGroupHeaderComponent, selectApi = _a.selectApi, onListHeightChange = _a.onListHeightChange;
34
- var getDraggableItemContent = function (index, option) {
35
- var disabled = selectApi.getOptionIsDisabled(option);
36
- var isOptgroup = selectApi.getOptionIsOptgroup(option);
37
- var optionId = isOptgroup ? option.id : option[draggableOptionIdSymbol];
38
- return (React.createElement(Draggable, { draggableId: optionId, index: index, key: optionId, isDragDisabled: isOptgroup || disabled || Boolean(selectApi.searchValue) }, function (provided) {
39
- return (React.createElement(StyledDraggableWrapper, __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps),
40
- !isOptgroup && (React.createElement(StyledGrip, null,
41
- React.createElement(Grip, { color: colors.gray45 }))),
42
- isOptgroup ? (React.createElement(MenuGroupHeaderComponent, { optgroup: option, selectApi: selectApi })) : (React.createElement(MenuItemLabelComponent, { option: option, selectApi: selectApi }))));
43
- }));
44
- };
45
- return (React.createElement(DragDropContext, { onDragEnd: selectApi.onDragEnd },
46
- React.createElement(Droppable, { droppableId: "droppable", mode: "virtual", renderClone: function (provided, snapshot, dragged) {
47
- var option = selectApi.options[dragged.source.index];
48
- return (React.createElement(SuperSelectMenuItem, __assign({ isDragging: true, "data-index": dragged.source.index }, provided.draggableProps),
49
- React.createElement(StyledGrip, null,
50
- React.createElement(Grip, { color: colors.gray45 })),
51
- React.createElement(MenuItemLabelComponent, { option: option, selectApi: selectApi })));
52
- } }, function (provided, snapshot) {
53
- return (React.createElement(InternalDragDropProvider, { isDraggingOver: snapshot.isDraggingOver },
54
- React.createElement(Virtuoso, { role: "listbox", id: selectApi.overlayId, ref: selectApi.virtuoso, data: selectApi.options, components: {
55
- Item: SuperSelectMenuItem,
56
- }, scrollerRef: function (el) {
57
- provided.innerRef(el);
58
- }, itemContent: getDraggableItemContent, initialTopMostItemIndex: selectApi.selectedIndex >= 0 ? selectApi.selectedIndex : 0, totalListHeightChanged: onListHeightChange, tabIndex: -1 })));
59
- })));
60
- };
61
- //# sourceMappingURL=SuperSelectDraggableOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SuperSelectDraggableOptions.js","sourceRoot":"","sources":["../../src/SuperSelect/SuperSelectDraggableOptions.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,M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