@plasmicpkgs/react-aria 0.0.2

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 (86) hide show
  1. package/LICENSE.md +21 -0
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/contexts.d.ts +14 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/option-utils.d.ts +51 -0
  6. package/dist/react-aria.esm.js +1191 -0
  7. package/dist/react-aria.esm.js.map +1 -0
  8. package/dist/react-aria.js +1198 -0
  9. package/dist/react-aria.js.map +1 -0
  10. package/dist/registerButton.d.ts +4 -0
  11. package/dist/registerComboBox.d.ts +21 -0
  12. package/dist/registerHeader.d.ts +5 -0
  13. package/dist/registerInput.d.ts +5 -0
  14. package/dist/registerLabel.d.ts +5 -0
  15. package/dist/registerListBox.d.ts +14 -0
  16. package/dist/registerListBoxItem.d.ts +7 -0
  17. package/dist/registerPopover.d.ts +7 -0
  18. package/dist/registerSection.d.ts +14 -0
  19. package/dist/registerSelect.d.ts +23 -0
  20. package/dist/utils.d.ts +18 -0
  21. package/package.json +74 -0
  22. package/skinny/contexts-c0294d96.cjs.js +24 -0
  23. package/skinny/contexts-c0294d96.cjs.js.map +1 -0
  24. package/skinny/contexts-fd3e1077.esm.js +12 -0
  25. package/skinny/contexts-fd3e1077.esm.js.map +1 -0
  26. package/skinny/contexts.d.ts +14 -0
  27. package/skinny/option-utils-0db61f6d.cjs.js +162 -0
  28. package/skinny/option-utils-0db61f6d.cjs.js.map +1 -0
  29. package/skinny/option-utils-765a1782.esm.js +153 -0
  30. package/skinny/option-utils-765a1782.esm.js.map +1 -0
  31. package/skinny/option-utils.d.ts +51 -0
  32. package/skinny/registerButton.cjs.js +31 -0
  33. package/skinny/registerButton.cjs.js.map +1 -0
  34. package/skinny/registerButton.d.ts +4 -0
  35. package/skinny/registerButton.esm.js +26 -0
  36. package/skinny/registerButton.esm.js.map +1 -0
  37. package/skinny/registerComboBox.cjs.js +291 -0
  38. package/skinny/registerComboBox.cjs.js.map +1 -0
  39. package/skinny/registerComboBox.d.ts +21 -0
  40. package/skinny/registerComboBox.esm.js +284 -0
  41. package/skinny/registerComboBox.esm.js.map +1 -0
  42. package/skinny/registerHeader.cjs.js +51 -0
  43. package/skinny/registerHeader.cjs.js.map +1 -0
  44. package/skinny/registerHeader.d.ts +5 -0
  45. package/skinny/registerHeader.esm.js +44 -0
  46. package/skinny/registerHeader.esm.js.map +1 -0
  47. package/skinny/registerInput.cjs.js +78 -0
  48. package/skinny/registerInput.cjs.js.map +1 -0
  49. package/skinny/registerInput.d.ts +5 -0
  50. package/skinny/registerInput.esm.js +71 -0
  51. package/skinny/registerInput.esm.js.map +1 -0
  52. package/skinny/registerLabel.cjs.js +59 -0
  53. package/skinny/registerLabel.cjs.js.map +1 -0
  54. package/skinny/registerLabel.d.ts +5 -0
  55. package/skinny/registerLabel.esm.js +52 -0
  56. package/skinny/registerLabel.esm.js.map +1 -0
  57. package/skinny/registerListBox.cjs.js +145 -0
  58. package/skinny/registerListBox.cjs.js.map +1 -0
  59. package/skinny/registerListBox.d.ts +14 -0
  60. package/skinny/registerListBox.esm.js +138 -0
  61. package/skinny/registerListBox.esm.js.map +1 -0
  62. package/skinny/registerListBoxItem.cjs.js +72 -0
  63. package/skinny/registerListBoxItem.cjs.js.map +1 -0
  64. package/skinny/registerListBoxItem.d.ts +7 -0
  65. package/skinny/registerListBoxItem.esm.js +65 -0
  66. package/skinny/registerListBoxItem.esm.js.map +1 -0
  67. package/skinny/registerPopover.cjs.js +111 -0
  68. package/skinny/registerPopover.cjs.js.map +1 -0
  69. package/skinny/registerPopover.d.ts +7 -0
  70. package/skinny/registerPopover.esm.js +104 -0
  71. package/skinny/registerPopover.esm.js.map +1 -0
  72. package/skinny/registerSection.cjs.js +82 -0
  73. package/skinny/registerSection.cjs.js.map +1 -0
  74. package/skinny/registerSection.d.ts +14 -0
  75. package/skinny/registerSection.esm.js +75 -0
  76. package/skinny/registerSection.esm.js.map +1 -0
  77. package/skinny/registerSelect.cjs.js +199 -0
  78. package/skinny/registerSelect.cjs.js.map +1 -0
  79. package/skinny/registerSelect.d.ts +23 -0
  80. package/skinny/registerSelect.esm.js +189 -0
  81. package/skinny/registerSelect.esm.js.map +1 -0
  82. package/skinny/utils-044c7f37.cjs.js +74 -0
  83. package/skinny/utils-044c7f37.cjs.js.map +1 -0
  84. package/skinny/utils-d92b3b76.esm.js +64 -0
  85. package/skinny/utils-d92b3b76.esm.js.map +1 -0
  86. package/skinny/utils.d.ts +18 -0
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ var utils = require('@react-aria/utils');
4
+ var React = require('react');
5
+ var reactAriaComponents = require('react-aria-components');
6
+ var contexts = require('./contexts-c0294d96.cjs.js');
7
+ var utils$1 = require('./utils-044c7f37.cjs.js');
8
+ require('@plasmicapp/host/registerComponent');
9
+
10
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ var React__default = /*#__PURE__*/_interopDefault(React);
13
+
14
+ var __defProp = Object.defineProperty;
15
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
16
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
17
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
18
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19
+ var __spreadValues = (a, b) => {
20
+ for (var prop in b || (b = {}))
21
+ if (__hasOwnProp.call(b, prop))
22
+ __defNormalProp(a, prop, b[prop]);
23
+ if (__getOwnPropSymbols)
24
+ for (var prop of __getOwnPropSymbols(b)) {
25
+ if (__propIsEnum.call(b, prop))
26
+ __defNormalProp(a, prop, b[prop]);
27
+ }
28
+ return a;
29
+ };
30
+ function BaseLabel(props) {
31
+ const contextProps = React__default.default.useContext(contexts.PlasmicLabelContext);
32
+ return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Label, __spreadValues({}, utils.mergeProps(contextProps, props)));
33
+ }
34
+ function registerLabel(loader, overrides) {
35
+ utils$1.registerComponentHelper(
36
+ loader,
37
+ BaseLabel,
38
+ {
39
+ name: "plasmic-react-aria-label",
40
+ displayName: "BaseLabel",
41
+ importPath: "@plasmicpkgs/react-aria/registerLabel",
42
+ importName: "BaseLabel",
43
+ props: {
44
+ children: {
45
+ type: "slot",
46
+ defaultValue: {
47
+ type: "text",
48
+ value: "Label"
49
+ }
50
+ }
51
+ }
52
+ },
53
+ overrides
54
+ );
55
+ }
56
+
57
+ exports.BaseLabel = BaseLabel;
58
+ exports.registerLabel = registerLabel;
59
+ //# sourceMappingURL=registerLabel.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerLabel.cjs.js","sources":["../src/registerLabel.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Label } from \"react-aria-components\";\nimport { PlasmicLabelContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseLabel(props: React.ComponentProps<typeof Label>) {\n const contextProps = React.useContext(PlasmicLabelContext);\n return <Label {...mergeProps(contextProps, props)} />;\n}\nexport function registerLabel(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseLabel>\n) {\n registerComponentHelper(\n loader,\n BaseLabel,\n {\n name: \"plasmic-react-aria-label\",\n displayName: \"BaseLabel\",\n importPath: \"@plasmicpkgs/react-aria/registerLabel\",\n importName: \"BaseLabel\",\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"text\",\n value: \"Label\",\n },\n },\n },\n },\n overrides\n );\n}\n"],"names":["React","PlasmicLabelContext","Label","mergeProps","registerComponentHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,SAAS,UAAU,KAA2C,EAAA;AACnE,EAAM,MAAA,YAAA,GAAeA,sBAAM,CAAA,UAAA,CAAWC,4BAAmB,CAAA,CAAA;AACzD,EAAA,uBAAQD,sBAAA,CAAA,aAAA,CAAAE,yBAAA,EAAA,cAAA,CAAA,EAAA,EAAUC,gBAAW,CAAA,YAAA,EAAc,KAAK,CAAG,CAAA,CAAA,CAAA;AACrD,CAAA;AACgB,SAAA,aAAA,CACd,QACA,SACA,EAAA;AACA,EAAAC,+BAAA;AAAA,IACE,MAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,IAAM,EAAA,0BAAA;AAAA,MACN,WAAa,EAAA,WAAA;AAAA,MACb,UAAY,EAAA,uCAAA;AAAA,MACZ,UAAY,EAAA,WAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,UACN,YAAc,EAAA;AAAA,YACZ,IAAM,EAAA,MAAA;AAAA,YACN,KAAO,EAAA,OAAA;AAAA,WACT;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { Label } from "react-aria-components";
3
+ import { CodeComponentMetaOverrides, Registerable } from "./utils";
4
+ export declare function BaseLabel(props: React.ComponentProps<typeof Label>): React.JSX.Element;
5
+ export declare function registerLabel(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseLabel>): void;
@@ -0,0 +1,52 @@
1
+ import { mergeProps } from '@react-aria/utils';
2
+ import React from 'react';
3
+ import { Label } from 'react-aria-components';
4
+ import { b as PlasmicLabelContext } from './contexts-fd3e1077.esm.js';
5
+ import { r as registerComponentHelper } from './utils-d92b3b76.esm.js';
6
+ import '@plasmicapp/host/registerComponent';
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ function BaseLabel(props) {
25
+ const contextProps = React.useContext(PlasmicLabelContext);
26
+ return /* @__PURE__ */ React.createElement(Label, __spreadValues({}, mergeProps(contextProps, props)));
27
+ }
28
+ function registerLabel(loader, overrides) {
29
+ registerComponentHelper(
30
+ loader,
31
+ BaseLabel,
32
+ {
33
+ name: "plasmic-react-aria-label",
34
+ displayName: "BaseLabel",
35
+ importPath: "@plasmicpkgs/react-aria/registerLabel",
36
+ importName: "BaseLabel",
37
+ props: {
38
+ children: {
39
+ type: "slot",
40
+ defaultValue: {
41
+ type: "text",
42
+ value: "Label"
43
+ }
44
+ }
45
+ }
46
+ },
47
+ overrides
48
+ );
49
+ }
50
+
51
+ export { BaseLabel, registerLabel };
52
+ //# sourceMappingURL=registerLabel.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerLabel.esm.js","sources":["../src/registerLabel.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Label } from \"react-aria-components\";\nimport { PlasmicLabelContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseLabel(props: React.ComponentProps<typeof Label>) {\n const contextProps = React.useContext(PlasmicLabelContext);\n return <Label {...mergeProps(contextProps, props)} />;\n}\nexport function registerLabel(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseLabel>\n) {\n registerComponentHelper(\n loader,\n BaseLabel,\n {\n name: \"plasmic-react-aria-label\",\n displayName: \"BaseLabel\",\n importPath: \"@plasmicpkgs/react-aria/registerLabel\",\n importName: \"BaseLabel\",\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"text\",\n value: \"Label\",\n },\n },\n },\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAUO,SAAS,UAAU,KAA2C,EAAA;AACnE,EAAM,MAAA,YAAA,GAAe,KAAM,CAAA,UAAA,CAAW,mBAAmB,CAAA,CAAA;AACzD,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,cAAA,CAAA,EAAA,EAAU,UAAW,CAAA,YAAA,EAAc,KAAK,CAAG,CAAA,CAAA,CAAA;AACrD,CAAA;AACgB,SAAA,aAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,IAAM,EAAA,0BAAA;AAAA,MACN,WAAa,EAAA,WAAA;AAAA,MACb,UAAY,EAAA,uCAAA;AAAA,MACZ,UAAY,EAAA,WAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,UACN,YAAc,EAAA;AAAA,YACZ,IAAM,EAAA,MAAA;AAAA,YACN,KAAO,EAAA,OAAA;AAAA,WACT;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,145 @@
1
+ 'use strict';
2
+
3
+ var utils = require('@react-aria/utils');
4
+ var React = require('react');
5
+ var reactAriaComponents = require('react-aria-components');
6
+ var contexts = require('./contexts-c0294d96.cjs.js');
7
+ var registerListBoxItem = require('./registerListBoxItem.cjs.js');
8
+ var utils$1 = require('./utils-044c7f37.cjs.js');
9
+ require('@plasmicapp/host/registerComponent');
10
+
11
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefault(React);
14
+
15
+ var __defProp = Object.defineProperty;
16
+ var __defProps = Object.defineProperties;
17
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
18
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
19
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
20
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
21
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
22
+ var __spreadValues = (a, b) => {
23
+ for (var prop in b || (b = {}))
24
+ if (__hasOwnProp.call(b, prop))
25
+ __defNormalProp(a, prop, b[prop]);
26
+ if (__getOwnPropSymbols)
27
+ for (var prop of __getOwnPropSymbols(b)) {
28
+ if (__propIsEnum.call(b, prop))
29
+ __defNormalProp(a, prop, b[prop]);
30
+ }
31
+ return a;
32
+ };
33
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
34
+ var __objRest = (source, exclude) => {
35
+ var target = {};
36
+ for (var prop in source)
37
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
38
+ target[prop] = source[prop];
39
+ if (source != null && __getOwnPropSymbols)
40
+ for (var prop of __getOwnPropSymbols(source)) {
41
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
42
+ target[prop] = source[prop];
43
+ }
44
+ return target;
45
+ };
46
+ const STANDALONE_PROPS = {
47
+ getItemType: (item) => item.type,
48
+ items: [
49
+ { type: "item", value: "op1", label: "Option 1" },
50
+ { type: "item", value: "op2", label: "Option 2" },
51
+ { type: "item", value: "op3", label: "Option 3" },
52
+ {
53
+ type: "section",
54
+ label: "Section 1",
55
+ items: [
56
+ { type: "item", value: "s1op1", label: "Section 1 Option 1" },
57
+ { type: "item", value: "s1op2", label: "Section 1 Option 2" },
58
+ { type: "item", value: "s1op3", label: "Section 1 Option 3" }
59
+ ]
60
+ },
61
+ {
62
+ type: "section",
63
+ label: "Section 2",
64
+ items: [
65
+ { type: "item", value: "s2op1", label: "Section 2 Option 1" },
66
+ { type: "item", value: "s2op2", label: "Section 2 Option 2" },
67
+ { type: "item", value: "s2op3", label: "Section 2 Option 3" }
68
+ ]
69
+ }
70
+ ],
71
+ makeItemProps: (item) => ({
72
+ key: item.value,
73
+ textValue: item.label,
74
+ children: item.label
75
+ }),
76
+ makeSectionProps: (section) => ({
77
+ section,
78
+ key: section.label
79
+ })
80
+ };
81
+ function BaseListBox(props) {
82
+ const contextProps = React__default.default.useContext(contexts.PlasmicListBoxContext);
83
+ const isStandalone = !React__default.default.useContext(reactAriaComponents.ListBoxContext);
84
+ const _a = utils.mergeProps(contextProps, props, isStandalone ? STANDALONE_PROPS : {}), {
85
+ makeItemProps,
86
+ makeSectionProps,
87
+ renderItem,
88
+ renderSection,
89
+ getItemType
90
+ } = _a, rest = __objRest(_a, [
91
+ "makeItemProps",
92
+ "makeSectionProps",
93
+ "renderItem",
94
+ "renderSection",
95
+ "getItemType"
96
+ ]);
97
+ return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBox, __spreadValues({}, utils.mergeProps(contextProps, rest)), (item) => {
98
+ if ((getItemType == null ? void 0 : getItemType(item)) === "section") {
99
+ const sectionProps = makeSectionProps == null ? void 0 : makeSectionProps(item);
100
+ return /* @__PURE__ */ React__default.default.createElement(
101
+ contexts.PlasmicSectionContext.Provider,
102
+ {
103
+ key: sectionProps == null ? void 0 : sectionProps.key,
104
+ value: __spreadProps(__spreadValues({}, sectionProps), { makeItemProps, renderItem })
105
+ },
106
+ renderSection == null ? void 0 : renderSection(item)
107
+ );
108
+ } else {
109
+ const itemProps = makeItemProps == null ? void 0 : makeItemProps(item);
110
+ return /* @__PURE__ */ React__default.default.createElement(contexts.PlasmicItemContext.Provider, { key: itemProps == null ? void 0 : itemProps.key, value: itemProps }, renderItem == null ? void 0 : renderItem(item));
111
+ }
112
+ });
113
+ }
114
+ function registerListBox(loader, overrides) {
115
+ utils$1.registerComponentHelper(
116
+ loader,
117
+ BaseListBox,
118
+ {
119
+ name: utils$1.makeComponentName("listbox"),
120
+ displayName: "BaseListBox",
121
+ importPath: "@plasmicpkgs/react-aria/registerListBox",
122
+ importName: "BaseListBox",
123
+ props: {
124
+ renderItem: {
125
+ type: "slot",
126
+ displayName: "Render Item",
127
+ renderPropParams: ["item"]
128
+ },
129
+ renderSection: {
130
+ type: "slot",
131
+ displayName: "Render Section",
132
+ renderPropParams: ["section"]
133
+ }
134
+ }
135
+ },
136
+ overrides
137
+ );
138
+ registerListBoxItem.registerListBoxItem(loader, {
139
+ parentComponentName: utils$1.makeComponentName("listbox")
140
+ });
141
+ }
142
+
143
+ exports.BaseListBox = BaseListBox;
144
+ exports.registerListBox = registerListBox;
145
+ //# sourceMappingURL=registerListBox.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerListBox.cjs.js","sources":["../src/registerListBox.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBox, ListBoxContext } from \"react-aria-components\";\nimport {\n PlasmicItemContext,\n PlasmicListBoxContext,\n PlasmicSectionContext,\n} from \"./contexts\";\nimport {\n registerListBoxItem,\n type BaseListBoxItem,\n} from \"./registerListBoxItem\";\nimport type { BaseSection } from \"./registerSection\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BaseListBoxProps extends React.ComponentProps<typeof ListBox> {\n makeItemProps?: (\n item: any\n ) => Partial<React.ComponentProps<typeof BaseListBoxItem>>;\n makeSectionProps?: (\n section: any\n ) => Partial<React.ComponentProps<typeof BaseSection>>;\n renderItem?: (item: any) => React.ReactNode;\n renderSection?: (section: any) => React.ReactNode;\n getItemType?: (thing: any) => \"item\" | \"section\";\n}\n\nconst STANDALONE_PROPS: Partial<BaseListBoxProps> = {\n getItemType: (item: any) => item.type,\n items: [\n { type: \"item\", value: \"op1\", label: \"Option 1\" },\n { type: \"item\", value: \"op2\", label: \"Option 2\" },\n { type: \"item\", value: \"op3\", label: \"Option 3\" },\n {\n type: \"section\",\n label: \"Section 1\",\n items: [\n { type: \"item\", value: \"s1op1\", label: \"Section 1 Option 1\" },\n { type: \"item\", value: \"s1op2\", label: \"Section 1 Option 2\" },\n { type: \"item\", value: \"s1op3\", label: \"Section 1 Option 3\" },\n ],\n },\n {\n type: \"section\",\n label: \"Section 2\",\n items: [\n { type: \"item\", value: \"s2op1\", label: \"Section 2 Option 1\" },\n { type: \"item\", value: \"s2op2\", label: \"Section 2 Option 2\" },\n { type: \"item\", value: \"s2op3\", label: \"Section 2 Option 3\" },\n ],\n },\n ],\n makeItemProps: (item: any) => ({\n key: item.value,\n textValue: item.label,\n children: item.label,\n }),\n makeSectionProps: (section: any) => ({\n section: section,\n key: section.label,\n }),\n};\n\nexport function BaseListBox(props: BaseListBoxProps) {\n const contextProps = React.useContext(PlasmicListBoxContext);\n const isStandalone: boolean = !React.useContext(ListBoxContext);\n const {\n makeItemProps,\n makeSectionProps,\n renderItem,\n renderSection,\n getItemType,\n ...rest\n } = mergeProps(contextProps, props, isStandalone ? STANDALONE_PROPS : {});\n return (\n <ListBox {...mergeProps(contextProps, rest)}>\n {(item) => {\n if (getItemType?.(item) === \"section\") {\n const sectionProps = makeSectionProps?.(item);\n return (\n <PlasmicSectionContext.Provider\n key={sectionProps?.key}\n value={{ ...sectionProps, makeItemProps, renderItem }}\n >\n {renderSection?.(item)}\n </PlasmicSectionContext.Provider>\n );\n } else {\n const itemProps = makeItemProps?.(item);\n return (\n <PlasmicItemContext.Provider key={itemProps?.key} value={itemProps}>\n {renderItem?.(item)}\n </PlasmicItemContext.Provider>\n );\n }\n }}\n </ListBox>\n );\n}\n\nexport function registerListBox(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBox>\n) {\n registerComponentHelper(\n loader,\n BaseListBox,\n {\n name: makeComponentName(\"listbox\"),\n displayName: \"BaseListBox\",\n importPath: \"@plasmicpkgs/react-aria/registerListBox\",\n importName: \"BaseListBox\",\n props: {\n renderItem: {\n type: \"slot\",\n displayName: \"Render Item\",\n renderPropParams: [\"item\"],\n },\n renderSection: {\n type: \"slot\",\n displayName: \"Render Section\",\n renderPropParams: [\"section\"],\n },\n },\n },\n overrides\n );\n\n registerListBoxItem(loader, {\n parentComponentName: makeComponentName(\"listbox\"),\n });\n}\n"],"names":["React","PlasmicListBoxContext","ListBoxContext","ListBox","mergeProps","PlasmicSectionContext","PlasmicItemContext","registerComponentHelper","makeComponentName","registerListBoxItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,gBAA8C,GAAA;AAAA,EAClD,WAAA,EAAa,CAAC,IAAA,KAAc,IAAK,CAAA,IAAA;AAAA,EACjC,KAAO,EAAA;AAAA,IACL,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,KAAA,EAAO,OAAO,UAAW,EAAA;AAAA,IAChD,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,KAAA,EAAO,OAAO,UAAW,EAAA;AAAA,IAChD,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,KAAA,EAAO,OAAO,UAAW,EAAA;AAAA,IAChD;AAAA,MACE,IAAM,EAAA,SAAA;AAAA,MACN,KAAO,EAAA,WAAA;AAAA,MACP,KAAO,EAAA;AAAA,QACL,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,OAAA,EAAS,OAAO,oBAAqB,EAAA;AAAA,QAC5D,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,OAAA,EAAS,OAAO,oBAAqB,EAAA;AAAA,QAC5D,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,OAAA,EAAS,OAAO,oBAAqB,EAAA;AAAA,OAC9D;AAAA,KACF;AAAA,IACA;AAAA,MACE,IAAM,EAAA,SAAA;AAAA,MACN,KAAO,EAAA,WAAA;AAAA,MACP,KAAO,EAAA;AAAA,QACL,EAAE,IAA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AA;AAAA,QACL,UAAY,EAAA;AAAA,UACV,IAAM,EAAA,MAAA;AAAA,UACN,WAAa,EAAA,aAAA;AAAA,UACb,gBAAA,EAAkB,CAAC,MAAM,CAAA;AAAA,SAC3B;AAAA,QACA,aAAe,EAAA;AAAA,UACb,IAAM,EAAA,MAAA;AAAA,UACN,WAAa,EAAA,gBAAA;AAAA,UACb,gBAAA,EAAkB,CAAC,SAAS,CAAA;AAAA,SAC9B;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AAEA,EAAAC,uCAAA,CAAoB,MAAQ,EAAA;AAAA,IAC1B,mBAAA,EAAqBD,0BAAkB,SAAS,CAAA;AAAA,GACjD,CAAA,CAAA;AACH;;;;;"}
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { ListBox } from "react-aria-components";
3
+ import { type BaseListBoxItem } from "./registerListBoxItem";
4
+ import type { BaseSection } from "./registerSection";
5
+ import { CodeComponentMetaOverrides, Registerable } from "./utils";
6
+ export interface BaseListBoxProps extends React.ComponentProps<typeof ListBox> {
7
+ makeItemProps?: (item: any) => Partial<React.ComponentProps<typeof BaseListBoxItem>>;
8
+ makeSectionProps?: (section: any) => Partial<React.ComponentProps<typeof BaseSection>>;
9
+ renderItem?: (item: any) => React.ReactNode;
10
+ renderSection?: (section: any) => React.ReactNode;
11
+ getItemType?: (thing: any) => "item" | "section";
12
+ }
13
+ export declare function BaseListBox(props: BaseListBoxProps): React.JSX.Element;
14
+ export declare function registerListBox(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseListBox>): void;
@@ -0,0 +1,138 @@
1
+ import { mergeProps } from '@react-aria/utils';
2
+ import React from 'react';
3
+ import { ListBoxContext, ListBox } from 'react-aria-components';
4
+ import { P as PlasmicListBoxContext, c as PlasmicSectionContext, d as PlasmicItemContext } from './contexts-fd3e1077.esm.js';
5
+ import { registerListBoxItem } from './registerListBoxItem.esm.js';
6
+ import { r as registerComponentHelper, m as makeComponentName } from './utils-d92b3b76.esm.js';
7
+ import '@plasmicapp/host/registerComponent';
8
+
9
+ var __defProp = Object.defineProperty;
10
+ var __defProps = Object.defineProperties;
11
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
12
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
15
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16
+ var __spreadValues = (a, b) => {
17
+ for (var prop in b || (b = {}))
18
+ if (__hasOwnProp.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ if (__getOwnPropSymbols)
21
+ for (var prop of __getOwnPropSymbols(b)) {
22
+ if (__propIsEnum.call(b, prop))
23
+ __defNormalProp(a, prop, b[prop]);
24
+ }
25
+ return a;
26
+ };
27
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
+ var __objRest = (source, exclude) => {
29
+ var target = {};
30
+ for (var prop in source)
31
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
32
+ target[prop] = source[prop];
33
+ if (source != null && __getOwnPropSymbols)
34
+ for (var prop of __getOwnPropSymbols(source)) {
35
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
36
+ target[prop] = source[prop];
37
+ }
38
+ return target;
39
+ };
40
+ const STANDALONE_PROPS = {
41
+ getItemType: (item) => item.type,
42
+ items: [
43
+ { type: "item", value: "op1", label: "Option 1" },
44
+ { type: "item", value: "op2", label: "Option 2" },
45
+ { type: "item", value: "op3", label: "Option 3" },
46
+ {
47
+ type: "section",
48
+ label: "Section 1",
49
+ items: [
50
+ { type: "item", value: "s1op1", label: "Section 1 Option 1" },
51
+ { type: "item", value: "s1op2", label: "Section 1 Option 2" },
52
+ { type: "item", value: "s1op3", label: "Section 1 Option 3" }
53
+ ]
54
+ },
55
+ {
56
+ type: "section",
57
+ label: "Section 2",
58
+ items: [
59
+ { type: "item", value: "s2op1", label: "Section 2 Option 1" },
60
+ { type: "item", value: "s2op2", label: "Section 2 Option 2" },
61
+ { type: "item", value: "s2op3", label: "Section 2 Option 3" }
62
+ ]
63
+ }
64
+ ],
65
+ makeItemProps: (item) => ({
66
+ key: item.value,
67
+ textValue: item.label,
68
+ children: item.label
69
+ }),
70
+ makeSectionProps: (section) => ({
71
+ section,
72
+ key: section.label
73
+ })
74
+ };
75
+ function BaseListBox(props) {
76
+ const contextProps = React.useContext(PlasmicListBoxContext);
77
+ const isStandalone = !React.useContext(ListBoxContext);
78
+ const _a = mergeProps(contextProps, props, isStandalone ? STANDALONE_PROPS : {}), {
79
+ makeItemProps,
80
+ makeSectionProps,
81
+ renderItem,
82
+ renderSection,
83
+ getItemType
84
+ } = _a, rest = __objRest(_a, [
85
+ "makeItemProps",
86
+ "makeSectionProps",
87
+ "renderItem",
88
+ "renderSection",
89
+ "getItemType"
90
+ ]);
91
+ return /* @__PURE__ */ React.createElement(ListBox, __spreadValues({}, mergeProps(contextProps, rest)), (item) => {
92
+ if ((getItemType == null ? void 0 : getItemType(item)) === "section") {
93
+ const sectionProps = makeSectionProps == null ? void 0 : makeSectionProps(item);
94
+ return /* @__PURE__ */ React.createElement(
95
+ PlasmicSectionContext.Provider,
96
+ {
97
+ key: sectionProps == null ? void 0 : sectionProps.key,
98
+ value: __spreadProps(__spreadValues({}, sectionProps), { makeItemProps, renderItem })
99
+ },
100
+ renderSection == null ? void 0 : renderSection(item)
101
+ );
102
+ } else {
103
+ const itemProps = makeItemProps == null ? void 0 : makeItemProps(item);
104
+ return /* @__PURE__ */ React.createElement(PlasmicItemContext.Provider, { key: itemProps == null ? void 0 : itemProps.key, value: itemProps }, renderItem == null ? void 0 : renderItem(item));
105
+ }
106
+ });
107
+ }
108
+ function registerListBox(loader, overrides) {
109
+ registerComponentHelper(
110
+ loader,
111
+ BaseListBox,
112
+ {
113
+ name: makeComponentName("listbox"),
114
+ displayName: "BaseListBox",
115
+ importPath: "@plasmicpkgs/react-aria/registerListBox",
116
+ importName: "BaseListBox",
117
+ props: {
118
+ renderItem: {
119
+ type: "slot",
120
+ displayName: "Render Item",
121
+ renderPropParams: ["item"]
122
+ },
123
+ renderSection: {
124
+ type: "slot",
125
+ displayName: "Render Section",
126
+ renderPropParams: ["section"]
127
+ }
128
+ }
129
+ },
130
+ overrides
131
+ );
132
+ registerListBoxItem(loader, {
133
+ parentComponentName: makeComponentName("listbox")
134
+ });
135
+ }
136
+
137
+ export { BaseListBox, registerListBox };
138
+ //# sourceMappingURL=registerListBox.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerListBox.esm.js","sources":["../src/registerListBox.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBox, ListBoxContext } from \"react-aria-components\";\nimport {\n PlasmicItemContext,\n PlasmicListBoxContext,\n PlasmicSectionContext,\n} from \"./contexts\";\nimport {\n registerListBoxItem,\n type BaseListBoxItem,\n} from \"./registerListBoxItem\";\nimport type { BaseSection } from \"./registerSection\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BaseListBoxProps extends React.ComponentProps<typeof ListBox> {\n makeItemProps?: (\n item: any\n ) => Partial<React.ComponentProps<typeof BaseListBoxItem>>;\n makeSectionProps?: (\n section: any\n ) => Partial<React.ComponentProps<typeof BaseSection>>;\n renderItem?: (item: any) => React.ReactNode;\n renderSection?: (section: any) => React.ReactNode;\n getItemType?: (thing: any) => \"item\" | \"section\";\n}\n\nconst STANDALONE_PROPS: Partial<BaseListBoxProps> = {\n getItemType: (item: any) => item.type,\n items: [\n { type: \"item\", value: \"op1\", label: \"Option 1\" },\n { type: \"item\", value: \"op2\", label: \"Option 2\" },\n { type: \"item\", value: \"op3\", label: \"Option 3\" },\n {\n type: \"section\",\n label: \"Section 1\",\n items: [\n { type: \"item\", value: \"s1op1\", label: \"Section 1 Option 1\" },\n { type: \"item\", value: \"s1op2\", label: \"Section 1 Option 2\" },\n { type: \"item\", value: \"s1op3\", label: \"Section 1 Option 3\" },\n ],\n },\n {\n type: \"section\",\n label: \"Section 2\",\n items: [\n { type: \"item\", value: \"s2op1\", label: \"Section 2 Option 1\" },\n { type: \"item\", value: \"s2op2\", label: \"Section 2 Option 2\" },\n { type: \"item\", value: \"s2op3\", label: \"Section 2 Option 3\" },\n ],\n },\n ],\n makeItemProps: (item: any) => ({\n key: item.value,\n textValue: item.label,\n children: item.label,\n }),\n makeSectionProps: (section: any) => ({\n section: section,\n key: section.label,\n }),\n};\n\nexport function BaseListBox(props: BaseListBoxProps) {\n const contextProps = React.useContext(PlasmicListBoxContext);\n const isStandalone: boolean = !React.useContext(ListBoxContext);\n const {\n makeItemProps,\n makeSectionProps,\n renderItem,\n renderSection,\n getItemType,\n ...rest\n } = mergeProps(contextProps, props, isStandalone ? STANDALONE_PROPS : {});\n return (\n <ListBox {...mergeProps(contextProps, rest)}>\n {(item) => {\n if (getItemType?.(item) === \"section\") {\n const sectionProps = makeSectionProps?.(item);\n return (\n <PlasmicSectionContext.Provider\n key={sectionProps?.key}\n value={{ ...sectionProps, makeItemProps, renderItem }}\n >\n {renderSection?.(item)}\n </PlasmicSectionContext.Provider>\n );\n } else {\n const itemProps = makeItemProps?.(item);\n return (\n <PlasmicItemContext.Provider key={itemProps?.key} value={itemProps}>\n {renderItem?.(item)}\n </PlasmicItemContext.Provider>\n );\n }\n }}\n </ListBox>\n );\n}\n\nexport function registerListBox(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBox>\n) {\n registerComponentHelper(\n loader,\n BaseListBox,\n {\n name: makeComponentName(\"listbox\"),\n displayName: \"BaseListBox\",\n importPath: \"@plasmicpkgs/react-aria/registerListBox\",\n importName: \"BaseListBox\",\n props: {\n renderItem: {\n type: \"slot\",\n displayName: \"Render Item\",\n renderPropParams: [\"item\"],\n },\n renderSection: {\n type: \"slot\",\n displayName: \"Render Section\",\n renderPropParams: [\"section\"],\n },\n },\n },\n overrides\n );\n\n registerListBoxItem(loader, {\n parentComponentName: makeComponentName(\"listbox\"),\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,gBAA8C,GAAA;AAAA,EAClD,WAAA,EAAa,CAAC,IAAA,KAAc,IAAK,CAAA,IAAA;AAAA,EACjC,KAAO,EAAA;AAAA,IACL,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,KAAA,EAAO,OAAO,UAAW,EAAA;AAAA,IAChD,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,KAAA,EAAO,OAAO,UAAW,EAAA;AAAA,IAChD,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,KAAA,EAAO,OAAO,UAAW,EAAA;AAAA,IAChD;AAAA,MACE,IAAM,EAAA,SAAA;AAAA,MACN,KAAO,EAAA,WAAA;AAAA,MACP,KAAO,EAAA;AAAA,QACL,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,OAAA,EAAS,OAAO,oBAAqB,EAAA;AAAA,QAC5D,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,OAAA,EAAS,OAAO,oBAAqB,EAAA;AAAA,QAC5D,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,OAAA,EAAS,OAAO,oBAAqB,EAAA;AAAA,OAC9D;AAAA,KACF;AAAA,IACA;AAAA,MACE,IAAM,EAAA,SAAA;AAAA,MACN,KAAO,EAAA,WAAA;AAAA,MACP,KAAO,EAAA;AAAA,QACL,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,OAAA,EAAS,OAAO,oBAAqB,EAAA;AAAA,QAC5D,EAAE,IAAM,EAAA,MAAA,EAAQ,KAAO,EAAA,OAAA,EAAS,OAAO,oBAAqB,EAAA;AAAA,QAC5D,EAA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AAAA,UACN,WAAa,EAAA,gBAAA;AAAA,UACb,gBAAA,EAAkB,CAAC,SAAS,CAAA;AAAA,SAC9B;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AAEA,EAAA,mBAAA,CAAoB,MAAQ,EAAA;AAAA,IAC1B,mBAAA,EAAqB,kBAAkB,SAAS,CAAA;AAAA,GACjD,CAAA,CAAA;AACH;;;;"}
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ var utils = require('@react-aria/utils');
4
+ var React = require('react');
5
+ var reactAriaComponents = require('react-aria-components');
6
+ var contexts = require('./contexts-c0294d96.cjs.js');
7
+ var utils$1 = require('./utils-044c7f37.cjs.js');
8
+ require('@plasmicapp/host/registerComponent');
9
+
10
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ var React__default = /*#__PURE__*/_interopDefault(React);
13
+
14
+ var __defProp = Object.defineProperty;
15
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
16
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
17
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
18
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19
+ var __spreadValues = (a, b) => {
20
+ for (var prop in b || (b = {}))
21
+ if (__hasOwnProp.call(b, prop))
22
+ __defNormalProp(a, prop, b[prop]);
23
+ if (__getOwnPropSymbols)
24
+ for (var prop of __getOwnPropSymbols(b)) {
25
+ if (__propIsEnum.call(b, prop))
26
+ __defNormalProp(a, prop, b[prop]);
27
+ }
28
+ return a;
29
+ };
30
+ function BaseListBoxItem(props) {
31
+ var _a;
32
+ const contextProps = React__default.default.useContext(contexts.PlasmicItemContext);
33
+ const mergedProps = utils.mergeProps(contextProps, props);
34
+ return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadValues({ id: (_a = mergedProps.key) != null ? _a : void 0 }, mergedProps));
35
+ }
36
+ function registerListBoxItem(loader, overrides) {
37
+ utils$1.registerComponentHelper(
38
+ loader,
39
+ BaseListBoxItem,
40
+ {
41
+ name: utils$1.makeComponentName("item"),
42
+ displayName: "BaseListBoxItem",
43
+ importPath: "@plasmicpkgs/react-aria/registerListBoxItem",
44
+ importName: "BaseListBoxItem",
45
+ props: {
46
+ className: {
47
+ type: "class",
48
+ displayName: "Styles in different states",
49
+ selectors: [
50
+ {
51
+ selector: ":self[data-selected]",
52
+ label: "Selected"
53
+ },
54
+ {
55
+ selector: ":self[data-focused], :self[data-hovered]",
56
+ label: "Focused"
57
+ },
58
+ {
59
+ selector: ":self[data-disabled]",
60
+ label: "Disabled"
61
+ }
62
+ ]
63
+ }
64
+ }
65
+ },
66
+ overrides
67
+ );
68
+ }
69
+
70
+ exports.BaseListBoxItem = BaseListBoxItem;
71
+ exports.registerListBoxItem = registerListBoxItem;
72
+ //# sourceMappingURL=registerListBoxItem.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerListBoxItem.cjs.js","sources":["../src/registerListBoxItem.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Key, ListBoxItem } from \"react-aria-components\";\nimport { PlasmicItemContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseListBoxItem(\n props: React.ComponentProps<typeof ListBoxItem> & {\n key?: Key;\n }\n) {\n const contextProps = React.useContext(PlasmicItemContext);\n const mergedProps = mergeProps(contextProps, props);\n return <ListBoxItem id={mergedProps.key ?? undefined} {...mergedProps} />;\n}\n\nexport function registerListBoxItem(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>\n) {\n registerComponentHelper(\n loader,\n BaseListBoxItem,\n {\n name: makeComponentName(\"item\"),\n displayName: \"BaseListBoxItem\",\n importPath: \"@plasmicpkgs/react-aria/registerListBoxItem\",\n importName: \"BaseListBoxItem\",\n props: {\n className: {\n type: \"class\",\n displayName: \"Styles in different states\",\n selectors: [\n {\n selector: \":self[data-selected]\",\n label: \"Selected\",\n },\n {\n selector: \":self[data-focused], :self[data-hovered]\",\n label: \"Focused\",\n },\n {\n selector: \":self[data-disabled]\",\n label: \"Disabled\",\n },\n ],\n },\n },\n },\n overrides\n );\n}\n"],"names":["React","PlasmicItemContext","mergeProps","ListBoxItem","registerComponentHelper","makeComponentName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,gBACd,KAGA,EAAA;AAfF,EAAA,IAAA,EAAA,CAAA;AAgBE,EAAM,MAAA,YAAA,GAAeA,sBAAM,CAAA,UAAA,CAAWC,2BAAkB,CAAA,CAAA;AACxD,EAAM,MAAA,WAAA,GAAcC,gBAAW,CAAA,YAAA,EAAc,KAAK,CAAA,CAAA;AAClD,EAAA,4DAAQC,+BAAY,EAAA,cAAA,CAAA,EAAA,EAAA,EAAA,CAAI,iBAAY,GAAZ,KAAA,IAAA,GAAA,EAAA,GAAmB,UAAe,WAAa,CAAA,CAAA,CAAA;AACzE,CAAA;AAEgB,SAAA,mBAAA,CACd,QACA,SACA,EAAA;AACA,EAAAC,+BAAA;AAAA,IACE,MAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAMC,0BAAkB,MAAM,CAAA;AAAA,MAC9B,WAAa,EAAA,iBAAA;AAAA,MACb,UAAY,EAAA,6CAAA;AAAA,MACZ,UAAY,EAAA,iBAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,OAAA;AAAA,UACN,WAAa,EAAA,4BAAA;AAAA,UACb,SAAW,EAAA;AAAA,YACT;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,0CAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { Key, ListBoxItem } from "react-aria-components";
3
+ import { CodeComponentMetaOverrides, Registerable } from "./utils";
4
+ export declare function BaseListBoxItem(props: React.ComponentProps<typeof ListBoxItem> & {
5
+ key?: Key;
6
+ }): React.JSX.Element;
7
+ export declare function registerListBoxItem(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>): void;
@@ -0,0 +1,65 @@
1
+ import { mergeProps } from '@react-aria/utils';
2
+ import React from 'react';
3
+ import { ListBoxItem } from 'react-aria-components';
4
+ import { d as PlasmicItemContext } from './contexts-fd3e1077.esm.js';
5
+ import { r as registerComponentHelper, m as makeComponentName } from './utils-d92b3b76.esm.js';
6
+ import '@plasmicapp/host/registerComponent';
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ function BaseListBoxItem(props) {
25
+ var _a;
26
+ const contextProps = React.useContext(PlasmicItemContext);
27
+ const mergedProps = mergeProps(contextProps, props);
28
+ return /* @__PURE__ */ React.createElement(ListBoxItem, __spreadValues({ id: (_a = mergedProps.key) != null ? _a : void 0 }, mergedProps));
29
+ }
30
+ function registerListBoxItem(loader, overrides) {
31
+ registerComponentHelper(
32
+ loader,
33
+ BaseListBoxItem,
34
+ {
35
+ name: makeComponentName("item"),
36
+ displayName: "BaseListBoxItem",
37
+ importPath: "@plasmicpkgs/react-aria/registerListBoxItem",
38
+ importName: "BaseListBoxItem",
39
+ props: {
40
+ className: {
41
+ type: "class",
42
+ displayName: "Styles in different states",
43
+ selectors: [
44
+ {
45
+ selector: ":self[data-selected]",
46
+ label: "Selected"
47
+ },
48
+ {
49
+ selector: ":self[data-focused], :self[data-hovered]",
50
+ label: "Focused"
51
+ },
52
+ {
53
+ selector: ":self[data-disabled]",
54
+ label: "Disabled"
55
+ }
56
+ ]
57
+ }
58
+ }
59
+ },
60
+ overrides
61
+ );
62
+ }
63
+
64
+ export { BaseListBoxItem, registerListBoxItem };
65
+ //# sourceMappingURL=registerListBoxItem.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerListBoxItem.esm.js","sources":["../src/registerListBoxItem.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Key, ListBoxItem } from \"react-aria-components\";\nimport { PlasmicItemContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseListBoxItem(\n props: React.ComponentProps<typeof ListBoxItem> & {\n key?: Key;\n }\n) {\n const contextProps = React.useContext(PlasmicItemContext);\n const mergedProps = mergeProps(contextProps, props);\n return <ListBoxItem id={mergedProps.key ?? undefined} {...mergedProps} />;\n}\n\nexport function registerListBoxItem(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>\n) {\n registerComponentHelper(\n loader,\n BaseListBoxItem,\n {\n name: makeComponentName(\"item\"),\n displayName: \"BaseListBoxItem\",\n importPath: \"@plasmicpkgs/react-aria/registerListBoxItem\",\n importName: \"BaseListBoxItem\",\n props: {\n className: {\n type: \"class\",\n displayName: \"Styles in different states\",\n selectors: [\n {\n selector: \":self[data-selected]\",\n label: \"Selected\",\n },\n {\n selector: \":self[data-focused], :self[data-hovered]\",\n label: \"Focused\",\n },\n {\n selector: \":self[data-disabled]\",\n label: \"Disabled\",\n },\n ],\n },\n },\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,gBACd,KAGA,EAAA;AAfF,EAAA,IAAA,EAAA,CAAA;AAgBE,EAAM,MAAA,YAAA,GAAe,KAAM,CAAA,UAAA,CAAW,kBAAkB,CAAA,CAAA;AACxD,EAAM,MAAA,WAAA,GAAc,UAAW,CAAA,YAAA,EAAc,KAAK,CAAA,CAAA;AAClD,EAAA,2CAAQ,WAAY,EAAA,cAAA,CAAA,EAAA,EAAA,EAAA,CAAI,iBAAY,GAAZ,KAAA,IAAA,GAAA,EAAA,GAAmB,UAAe,WAAa,CAAA,CAAA,CAAA;AACzE,CAAA;AAEgB,SAAA,mBAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,kBAAkB,MAAM,CAAA;AAAA,MAC9B,WAAa,EAAA,iBAAA;AAAA,MACb,UAAY,EAAA,6CAAA;AAAA,MACZ,UAAY,EAAA,iBAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,OAAA;AAAA,UACN,WAAa,EAAA,4BAAA;AAAA,UACb,SAAW,EAAA;AAAA,YACT;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,0CAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}