@plasmicpkgs/react-aria 0.0.2 → 0.0.4

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 (34) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/react-aria.esm.js +78 -10
  3. package/dist/react-aria.esm.js.map +1 -1
  4. package/dist/react-aria.js +77 -9
  5. package/dist/react-aria.js.map +1 -1
  6. package/package.json +2 -2
  7. package/skinny/registerButton.cjs.js +30 -2
  8. package/skinny/registerButton.cjs.js.map +1 -1
  9. package/skinny/registerButton.esm.js +30 -2
  10. package/skinny/registerButton.esm.js.map +1 -1
  11. package/skinny/registerInput.cjs.js +2 -2
  12. package/skinny/registerInput.cjs.js.map +1 -1
  13. package/skinny/registerInput.esm.js +2 -2
  14. package/skinny/registerInput.esm.js.map +1 -1
  15. package/skinny/registerLabel.cjs.js +4 -2
  16. package/skinny/registerLabel.cjs.js.map +1 -1
  17. package/skinny/registerLabel.esm.js +4 -2
  18. package/skinny/registerLabel.esm.js.map +1 -1
  19. package/skinny/registerListBox.cjs.js +15 -1
  20. package/skinny/registerListBox.cjs.js.map +1 -1
  21. package/skinny/registerListBox.esm.js +16 -2
  22. package/skinny/registerListBox.esm.js.map +1 -1
  23. package/skinny/registerListBoxItem.cjs.js +1 -1
  24. package/skinny/registerListBoxItem.cjs.js.map +1 -1
  25. package/skinny/registerListBoxItem.esm.js +1 -1
  26. package/skinny/registerListBoxItem.esm.js.map +1 -1
  27. package/skinny/registerPopover.cjs.js +14 -0
  28. package/skinny/registerPopover.cjs.js.map +1 -1
  29. package/skinny/registerPopover.esm.js +14 -0
  30. package/skinny/registerPopover.esm.js.map +1 -1
  31. package/skinny/registerSelect.cjs.js +11 -1
  32. package/skinny/registerSelect.cjs.js.map +1 -1
  33. package/skinny/registerSelect.esm.js +11 -1
  34. package/skinny/registerSelect.esm.js.map +1 -1
@@ -43,7 +43,7 @@ function registerInput(loader, overrides) {
43
43
  props: {
44
44
  className: {
45
45
  type: "class",
46
- displayName: "Styles in different states",
46
+ displayName: "Additional states",
47
47
  selectors: [
48
48
  {
49
49
  selector: ":self[data-hovered]",
@@ -55,7 +55,7 @@ function registerInput(loader, overrides) {
55
55
  },
56
56
  {
57
57
  selector: ":self[data-focus-visible]",
58
- label: "Focus visible"
58
+ label: "Focused by keyboard"
59
59
  },
60
60
  {
61
61
  selector: ":self[data-disabled]",
@@ -1 +1 @@
1
- {"version":3,"file":"registerInput.cjs.js","sources":["../src/registerInput.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Input } from \"react-aria-components\";\nimport { PlasmicInputContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseInput(props: React.ComponentProps<typeof Input>) {\n const contextProps = React.useContext(PlasmicInputContext);\n return <Input {...mergeProps(contextProps, props)} />;\n}\n\nexport function registerInput(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseInput>\n) {\n registerComponentHelper(\n loader,\n BaseInput,\n {\n name: makeComponentName(\"input\"),\n displayName: \"BaseInput\",\n importPath: \"@plasmicpkgs/react-aria/registerInput\",\n importName: \"BaseInput\",\n props: {\n className: {\n type: \"class\",\n displayName: \"Styles in different states\",\n selectors: [\n {\n selector: \":self[data-hovered]\",\n label: \"Hovered\",\n },\n {\n selector: \":self[data-focused]\",\n label: \"Focused\",\n },\n {\n selector: \":self[data-focus-visible]\",\n label: \"Focus visible\",\n },\n {\n selector: \":self[data-disabled]\",\n label: \"Disabled\",\n },\n {\n selector: \":self::placeholder\",\n label: \"Placeholder\",\n },\n ],\n },\n },\n },\n overrides\n );\n}\n"],"names":["React","PlasmicInputContext","Input","mergeProps","registerComponentHelper","makeComponentName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,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;AAEgB,SAAA,aAAA,CACd,QACA,SACA,EAAA;AACA,EAAAC,+BAAA;AAAA,IACE,MAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAMC,0BAAkB,OAAO,CAAA;AAAA,MAC/B,WAAa,EAAA,WAAA;AAAA,MACb,UAAY,EAAA,uCAAA;AAAA,MACZ,UAAY,EAAA,WAAA;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,qBAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,qBAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,2BAAA;AAAA,cACV,KAAO,EAAA,eAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,oBAAA;AAAA,cACV,KAAO,EAAA,aAAA;AAAA,aACT;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
1
+ {"version":3,"file":"registerInput.cjs.js","sources":["../src/registerInput.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Input } from \"react-aria-components\";\nimport { PlasmicInputContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseInput(props: React.ComponentProps<typeof Input>) {\n const contextProps = React.useContext(PlasmicInputContext);\n return <Input {...mergeProps(contextProps, props)} />;\n}\n\nexport function registerInput(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseInput>\n) {\n registerComponentHelper(\n loader,\n BaseInput,\n {\n name: makeComponentName(\"input\"),\n displayName: \"BaseInput\",\n importPath: \"@plasmicpkgs/react-aria/registerInput\",\n importName: \"BaseInput\",\n props: {\n className: {\n type: \"class\",\n displayName: \"Additional states\",\n selectors: [\n {\n selector: \":self[data-hovered]\",\n label: \"Hovered\",\n },\n {\n selector: \":self[data-focused]\",\n label: \"Focused\",\n },\n {\n selector: \":self[data-focus-visible]\",\n label: \"Focused by keyboard\",\n },\n {\n selector: \":self[data-disabled]\",\n label: \"Disabled\",\n },\n {\n selector: \":self::placeholder\",\n label: \"Placeholder\",\n },\n ],\n },\n },\n },\n overrides\n );\n}\n"],"names":["React","PlasmicInputContext","Input","mergeProps","registerComponentHelper","makeComponentName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,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;AAEgB,SAAA,aAAA,CACd,QACA,SACA,EAAA;AACA,EAAAC,+BAAA;AAAA,IACE,MAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAMC,0BAAkB,OAAO,CAAA;AAAA,MAC/B,WAAa,EAAA,WAAA;AAAA,MACb,UAAY,EAAA,uCAAA;AAAA,MACZ,UAAY,EAAA,WAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,OAAA;AAAA,UACN,WAAa,EAAA,mBAAA;AAAA,UACb,SAAW,EAAA;AAAA,YACT;AAAA,cACE,QAAU,EAAA,qBAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,qBAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,2BAAA;AAAA,cACV,KAAO,EAAA,qBAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,oBAAA;AAAA,cACV,KAAO,EAAA,aAAA;AAAA,aACT;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
@@ -37,7 +37,7 @@ function registerInput(loader, overrides) {
37
37
  props: {
38
38
  className: {
39
39
  type: "class",
40
- displayName: "Styles in different states",
40
+ displayName: "Additional states",
41
41
  selectors: [
42
42
  {
43
43
  selector: ":self[data-hovered]",
@@ -49,7 +49,7 @@ function registerInput(loader, overrides) {
49
49
  },
50
50
  {
51
51
  selector: ":self[data-focus-visible]",
52
- label: "Focus visible"
52
+ label: "Focused by keyboard"
53
53
  },
54
54
  {
55
55
  selector: ":self[data-disabled]",
@@ -1 +1 @@
1
- {"version":3,"file":"registerInput.esm.js","sources":["../src/registerInput.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Input } from \"react-aria-components\";\nimport { PlasmicInputContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseInput(props: React.ComponentProps<typeof Input>) {\n const contextProps = React.useContext(PlasmicInputContext);\n return <Input {...mergeProps(contextProps, props)} />;\n}\n\nexport function registerInput(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseInput>\n) {\n registerComponentHelper(\n loader,\n BaseInput,\n {\n name: makeComponentName(\"input\"),\n displayName: \"BaseInput\",\n importPath: \"@plasmicpkgs/react-aria/registerInput\",\n importName: \"BaseInput\",\n props: {\n className: {\n type: \"class\",\n displayName: \"Styles in different states\",\n selectors: [\n {\n selector: \":self[data-hovered]\",\n label: \"Hovered\",\n },\n {\n selector: \":self[data-focused]\",\n label: \"Focused\",\n },\n {\n selector: \":self[data-focus-visible]\",\n label: \"Focus visible\",\n },\n {\n selector: \":self[data-disabled]\",\n label: \"Disabled\",\n },\n {\n selector: \":self::placeholder\",\n label: \"Placeholder\",\n },\n ],\n },\n },\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWO,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;AAEgB,SAAA,aAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,kBAAkB,OAAO,CAAA;AAAA,MAC/B,WAAa,EAAA,WAAA;AAAA,MACb,UAAY,EAAA,uCAAA;AAAA,MACZ,UAAY,EAAA,WAAA;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,qBAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,qBAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,2BAAA;AAAA,cACV,KAAO,EAAA,eAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,oBAAA;AAAA,cACV,KAAO,EAAA,aAAA;AAAA,aACT;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"registerInput.esm.js","sources":["../src/registerInput.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Input } from \"react-aria-components\";\nimport { PlasmicInputContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseInput(props: React.ComponentProps<typeof Input>) {\n const contextProps = React.useContext(PlasmicInputContext);\n return <Input {...mergeProps(contextProps, props)} />;\n}\n\nexport function registerInput(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseInput>\n) {\n registerComponentHelper(\n loader,\n BaseInput,\n {\n name: makeComponentName(\"input\"),\n displayName: \"BaseInput\",\n importPath: \"@plasmicpkgs/react-aria/registerInput\",\n importName: \"BaseInput\",\n props: {\n className: {\n type: \"class\",\n displayName: \"Additional states\",\n selectors: [\n {\n selector: \":self[data-hovered]\",\n label: \"Hovered\",\n },\n {\n selector: \":self[data-focused]\",\n label: \"Focused\",\n },\n {\n selector: \":self[data-focus-visible]\",\n label: \"Focused by keyboard\",\n },\n {\n selector: \":self[data-disabled]\",\n label: \"Disabled\",\n },\n {\n selector: \":self::placeholder\",\n label: \"Placeholder\",\n },\n ],\n },\n },\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWO,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;AAEgB,SAAA,aAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,kBAAkB,OAAO,CAAA;AAAA,MAC/B,WAAa,EAAA,WAAA;AAAA,MACb,UAAY,EAAA,uCAAA;AAAA,MACZ,UAAY,EAAA,WAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,OAAA;AAAA,UACN,WAAa,EAAA,mBAAA;AAAA,UACb,SAAW,EAAA;AAAA,YACT;AAAA,cACE,QAAU,EAAA,qBAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,qBAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,2BAAA;AAAA,cACV,KAAO,EAAA,qBAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,sBAAA;AAAA,cACV,KAAO,EAAA,UAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,oBAAA;AAAA,cACV,KAAO,EAAA,aAAA;AAAA,aACT;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -46,9 +46,11 @@ function registerLabel(loader, overrides) {
46
46
  defaultValue: {
47
47
  type: "text",
48
48
  value: "Label"
49
- }
49
+ },
50
+ mergeWithParent: true
50
51
  }
51
- }
52
+ },
53
+ trapsFocus: true
52
54
  },
53
55
  overrides
54
56
  );
@@ -1 +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;;;;;"}
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 mergeWithParent: true as any,\n },\n },\n trapsFocus: true,\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,UACA,eAAiB,EAAA,IAAA;AAAA,SACnB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
@@ -40,9 +40,11 @@ function registerLabel(loader, overrides) {
40
40
  defaultValue: {
41
41
  type: "text",
42
42
  value: "Label"
43
- }
43
+ },
44
+ mergeWithParent: true
44
45
  }
45
- }
46
+ },
47
+ trapsFocus: true
46
48
  },
47
49
  overrides
48
50
  );
@@ -1 +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;;;;"}
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 mergeWithParent: true as any,\n },\n },\n trapsFocus: true,\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,UACA,eAAiB,EAAA,IAAA;AAAA,SACnB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -80,7 +80,7 @@ const STANDALONE_PROPS = {
80
80
  };
81
81
  function BaseListBox(props) {
82
82
  const contextProps = React__default.default.useContext(contexts.PlasmicListBoxContext);
83
- const isStandalone = !React__default.default.useContext(reactAriaComponents.ListBoxContext);
83
+ const isStandalone = !contextProps;
84
84
  const _a = utils.mergeProps(contextProps, props, isStandalone ? STANDALONE_PROPS : {}), {
85
85
  makeItemProps,
86
86
  makeSectionProps,
@@ -130,6 +130,20 @@ function registerListBox(loader, overrides) {
130
130
  type: "slot",
131
131
  displayName: "Render Section",
132
132
  renderPropParams: ["section"]
133
+ },
134
+ class: {
135
+ type: "class",
136
+ displayName: "Additional states",
137
+ selectors: [
138
+ {
139
+ selector: ":self[data-focused]",
140
+ label: "Focused"
141
+ },
142
+ {
143
+ selector: ":self[data-focus-visible]",
144
+ label: "Focused by keyboard"
145
+ }
146
+ ]
133
147
  }
134
148
  }
135
149
  },
@@ -1 +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;A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AAA,MACZ,KAAO,EAAA;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;;;;;"}
1
+ {"version":3,"file":"registerListBox.cjs.js","sources":["../src/registerListBox.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBox } 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 = !contextProps;\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 class: {\n type: \"class\",\n displayName: \"Additional states\",\n selectors: [\n {\n selector: \":self[data-focused]\",\n label: \"Focused\",\n },\n {\n selector: \":self[data-focus-visible]\",\n label: \"Focused by keyboard\",\n },\n ],\n },\n },\n },\n overrides\n );\n\n registerListBoxItem(loader, {\n parentComponentName: makeComponentName(\"listbox\"),\n });\n}\n"],"names":["React","PlasmicListBoxContext","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;AA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UAAY,EAAA,yCAAA;AAAA,MACZ,UAAY,EAAA,aAAA;AAAA,MACZ,KAAO,EAAA;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,QACA,KAAO,EAAA;AAAA,UACL,IAAM,EAAA,OAAA;AAAA,UACN,WAAa,EAAA,mBAAA;AAAA,UACb,SAAW,EAAA;AAAA,YACT;AAAA,cACE,QAAU,EAAA,qBAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,2BAAA;AAAA,cACV,KAAO,EAAA,qBAAA;AAAA,aACT;AAAA,WACF;AAAA,SACF;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;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { mergeProps } from '@react-aria/utils';
2
2
  import React from 'react';
3
- import { ListBoxContext, ListBox } from 'react-aria-components';
3
+ import { ListBox } from 'react-aria-components';
4
4
  import { P as PlasmicListBoxContext, c as PlasmicSectionContext, d as PlasmicItemContext } from './contexts-fd3e1077.esm.js';
5
5
  import { registerListBoxItem } from './registerListBoxItem.esm.js';
6
6
  import { r as registerComponentHelper, m as makeComponentName } from './utils-d92b3b76.esm.js';
@@ -74,7 +74,7 @@ const STANDALONE_PROPS = {
74
74
  };
75
75
  function BaseListBox(props) {
76
76
  const contextProps = React.useContext(PlasmicListBoxContext);
77
- const isStandalone = !React.useContext(ListBoxContext);
77
+ const isStandalone = !contextProps;
78
78
  const _a = mergeProps(contextProps, props, isStandalone ? STANDALONE_PROPS : {}), {
79
79
  makeItemProps,
80
80
  makeSectionProps,
@@ -124,6 +124,20 @@ function registerListBox(loader, overrides) {
124
124
  type: "slot",
125
125
  displayName: "Render Section",
126
126
  renderPropParams: ["section"]
127
+ },
128
+ class: {
129
+ type: "class",
130
+ displayName: "Additional states",
131
+ selectors: [
132
+ {
133
+ selector: ":self[data-focused]",
134
+ label: "Focused"
135
+ },
136
+ {
137
+ selector: ":self[data-focus-visible]",
138
+ label: "Focused by keyboard"
139
+ }
140
+ ]
127
141
  }
128
142
  }
129
143
  },
@@ -1 +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,oBA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AAA,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,EAAA,mBAAA,CAAoB,MAAQ,EAAA;AAAA,IAC1B,mBAAA,EAAqB,kBAAkB,SAAS,CAAA;AAAA,GACjD,CAAA,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"registerListBox.esm.js","sources":["../src/registerListBox.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBox } 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 = !contextProps;\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 class: {\n type: \"class\",\n displayName: \"Additional states\",\n selectors: [\n {\n selector: \":self[data-focused]\",\n label: \"Focused\",\n },\n {\n selector: \":self[data-focus-visible]\",\n label: \"Focused by keyboard\",\n },\n ],\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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UACb,gBAAA,EAAkB,CAAC,SAAS,CAAA;AAAA,SAC9B;AAAA,QACA,KAAO,EAAA;AAAA,UACL,IAAM,EAAA,OAAA;AAAA,UACN,WAAa,EAAA,mBAAA;AAAA,UACb,SAAW,EAAA;AAAA,YACT;AAAA,cACE,QAAU,EAAA,qBAAA;AAAA,cACV,KAAO,EAAA,SAAA;AAAA,aACT;AAAA,YACA;AAAA,cACE,QAAU,EAAA,2BAAA;AAAA,cACV,KAAO,EAAA,qBAAA;AAAA,aACT;AAAA,WACF;AAAA,SACF;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;;;;"}
@@ -45,7 +45,7 @@ function registerListBoxItem(loader, overrides) {
45
45
  props: {
46
46
  className: {
47
47
  type: "class",
48
- displayName: "Styles in different states",
48
+ displayName: "Additional states",
49
49
  selectors: [
50
50
  {
51
51
  selector: ":self[data-selected]",
@@ -1 +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;;;;;"}
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: \"Additional 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,mBAAA;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;;;;;"}
@@ -39,7 +39,7 @@ function registerListBoxItem(loader, overrides) {
39
39
  props: {
40
40
  className: {
41
41
  type: "class",
42
- displayName: "Styles in different states",
42
+ displayName: "Additional states",
43
43
  selectors: [
44
44
  {
45
45
  selector: ":self[data-selected]",
@@ -1 +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;;;;"}
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: \"Additional 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,mBAAA;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;;;;"}
@@ -99,6 +99,20 @@ function registerPopover(loader, overrides) {
99
99
  resetClassName: {
100
100
  type: "themeResetClass"
101
101
  }
102
+ // className: {
103
+ // type: "class",
104
+ // displayName: "Additional states",
105
+ // selectors: [
106
+ // {
107
+ // selector: ":self[data-entering]",
108
+ // label: "Entering",
109
+ // },
110
+ // {
111
+ // selector: ":self[data-exiting]",
112
+ // label: "Exiting",
113
+ // },
114
+ // ],
115
+ // },
102
116
  },
103
117
  styleSections: true
104
118
  },
@@ -1 +1 @@
1
- {"version":3,"file":"registerPopover.cjs.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BasePopover(props: {\n className?: string;\n resetClassName?: string;\n}) {\n const { resetClassName, ...restProps } = props;\n const isStandalone = !React.useContext(PopoverContext);\n const contextProps = React.useContext(PlasmicPopoverContext);\n const canvas = usePlasmicCanvasContext();\n const mergedProps = mergeProps(contextProps, restProps, {\n className: `${props.resetClassName}`,\n });\n\n if (isStandalone) {\n const triggerRef = React.useRef<any>(null);\n return (\n <>\n <div ref={triggerRef} />\n <Popover\n {...mergedProps}\n triggerRef={triggerRef}\n isNonModal={true}\n isOpen={true}\n />\n </>\n );\n } else {\n return <Popover {...mergedProps} isNonModal={!!canvas} />;\n }\n}\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: \"plasmic-react-aria-popover\",\n displayName: \"BasePopover\",\n importPath: \"@plasmicpkgs/react-aria/registerPopover\",\n importName: \"BasePopover\",\n props: {\n children: {\n type: \"slot\",\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 0,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"top\",\n \"top left\",\n \"top right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n styleSections: true,\n },\n overrides\n );\n}\n"],"names":["React","PopoverContext","PlasmicPopoverContext","usePlasmicCanvasContext","mergeProps","Popover","registerComponentHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,YAAY,KAGzB,EAAA;AACD,EAAA,MAAyC,YAAd,SAAA,GAAA,SAAA,CAAc,IAAd,CAAnB,gBAAA,CAAA,EAAA;AACR,EAAA,MAAM,YAAe,GAAA,CAACA,sBAAM,CAAA,UAAA,CAAWC,kCAAc,CAAA,CAAA;AACrD,EAAM,MAAA,YAAA,GAAeD,sBAAM,CAAA,UAAA,CAAWE,8BAAqB,CAAA,CAAA;AAC3D,EAAA,MAAM,SAASC,4BAAwB,EAAA,CAAA;AACvC,EAAM,MAAA,WAAA,GAAcC,gBAAW,CAAA,YAAA,EAAc,SAAW,EAAA;AAAA,IACtD,SAAA,EAAW,GAAG,KAAM,CAAA,cAAA,CAAA,CAAA;AAAA,GACrB,CAAA,CAAA;AAED,EAAA,IAAI,YAAc,EAAA;AAChB,IAAM,MAAA,UAAA,GAAaJ,sBAAM,CAAA,MAAA,CAAY,IAAI,CAAA,CAAA;AACzC,IAAA,uBAEIA,sBAAA,CAAA,aAAA,CAAAA,sBAAA,CAAA,QAAA,EAAA,IAAA,kBA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iBAAA;AAAA,SACR;AAAA,OACF;AAAA,MACA,aAAe,EAAA,IAAA;AAAA,KACjB;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
1
+ {"version":3,"file":"registerPopover.cjs.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BasePopover(props: {\n className?: string;\n resetClassName?: string;\n}) {\n const { resetClassName, ...restProps } = props;\n const isStandalone = !React.useContext(PopoverContext);\n const contextProps = React.useContext(PlasmicPopoverContext);\n const canvas = usePlasmicCanvasContext();\n const mergedProps = mergeProps(contextProps, restProps, {\n className: `${props.resetClassName}`,\n });\n\n if (isStandalone) {\n const triggerRef = React.useRef<any>(null);\n return (\n <>\n <div ref={triggerRef} />\n <Popover\n {...mergedProps}\n triggerRef={triggerRef}\n isNonModal={true}\n isOpen={true}\n />\n </>\n );\n } else {\n return <Popover {...mergedProps} isNonModal={!!canvas} />;\n }\n}\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: \"plasmic-react-aria-popover\",\n displayName: \"BasePopover\",\n importPath: \"@plasmicpkgs/react-aria/registerPopover\",\n importName: \"BasePopover\",\n props: {\n children: {\n type: \"slot\",\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 0,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"top\",\n \"top left\",\n \"top right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n // className: {\n // type: \"class\",\n // displayName: \"Additional states\",\n // selectors: [\n // {\n // selector: \":self[data-entering]\",\n // label: \"Entering\",\n // },\n // {\n // selector: \":self[data-exiting]\",\n // label: \"Exiting\",\n // },\n // ],\n // },\n },\n styleSections: true,\n },\n overrides\n );\n}\n"],"names":["React","PopoverContext","PlasmicPopoverContext","usePlasmicCanvasContext","mergeProps","Popover","registerComponentHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,YAAY,KAGzB,EAAA;AACD,EAAA,MAAyC,YAAd,SAAA,GAAA,SAAA,CAAc,IAAd,CAAnB,gBAAA,CAAA,EAAA;AACR,EAAA,MAAM,YAAe,GAAA,CAACA,sBAAM,CAAA,UAAA,CAAWC,kCAAc,CAAA,CAAA;AACrD,EAAM,MAAA,YAAA,GAAeD,sBAAM,CAAA,UAAA,CAAWE,8BAAqB,CAAA,CAAA;AAC3D,EAAA,MAAM,SAASC,4BAAwB,EAAA,CAAA;AACvC,EAAM,MAAA,WAAA,GAAcC,gBAAW,CAAA,YAAA,EAAc,SAAW,EAAA;AAAA,IACtD,SAAA,EAAW,GAAG,KAAM,CAAA,cAAA,CAAA,CAAA;AAAA,GACrB,CAAA,CAAA;AAED,EAAA,IAAI,YAAc,EAAA;AAChB,IAAM,MAAA,UAAA,GAAaJ,sBAAM,CAAA,MAAA,CAAY,IAAI,CAAA,CAAA;AACzC,IAAA,uBAEIA,sBAAA,CAAA,aAAA,CAAAA,sBAAA,CAAA,QAAA,EAAA,IAAA,kBAAAA,sBAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,GAAA,EAAK,YAAY,CACtB,kBAAAA,sBAAA,CAAA,aAAA;AAAA,MAACK,2BAAA;AAAA,MAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EACK,WADL,CAAA,EAAA;AAAA,QAEC,UAAA;AAAA,QACA,UAAY,EAAA,IAAA;AAAA,QACZ,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
93
  resetClassName: {
94
94
  type: "themeResetClass"
95
95
  }
96
+ // className: {
97
+ // type: "class",
98
+ // displayName: "Additional states",
99
+ // selectors: [
100
+ // {
101
+ // selector: ":self[data-entering]",
102
+ // label: "Entering",
103
+ // },
104
+ // {
105
+ // selector: ":self[data-exiting]",
106
+ // label: "Exiting",
107
+ // },
108
+ // ],
109
+ // },
96
110
  },
97
111
  styleSections: true
98
112
  },
@@ -1 +1 @@
1
- {"version":3,"file":"registerPopover.esm.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BasePopover(props: {\n className?: string;\n resetClassName?: string;\n}) {\n const { resetClassName, ...restProps } = props;\n const isStandalone = !React.useContext(PopoverContext);\n const contextProps = React.useContext(PlasmicPopoverContext);\n const canvas = usePlasmicCanvasContext();\n const mergedProps = mergeProps(contextProps, restProps, {\n className: `${props.resetClassName}`,\n });\n\n if (isStandalone) {\n const triggerRef = React.useRef<any>(null);\n return (\n <>\n <div ref={triggerRef} />\n <Popover\n {...mergedProps}\n triggerRef={triggerRef}\n isNonModal={true}\n isOpen={true}\n />\n </>\n );\n } else {\n return <Popover {...mergedProps} isNonModal={!!canvas} />;\n }\n}\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: \"plasmic-react-aria-popover\",\n displayName: \"BasePopover\",\n importPath: \"@plasmicpkgs/react-aria/registerPopover\",\n importName: \"BasePopover\",\n props: {\n children: {\n type: \"slot\",\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 0,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"top\",\n \"top left\",\n \"top right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n styleSections: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,YAAY,KAGzB,EAAA;AACD,EAAA,MAAyC,YAAd,SAAA,GAAA,SAAA,CAAc,IAAd,CAAnB,gBAAA,CAAA,EAAA;AACR,EAAA,MAAM,YAAe,GAAA,CAAC,KAAM,CAAA,UAAA,CAAW,cAAc,CAAA,CAAA;AACrD,EAAM,MAAA,YAAA,GAAe,KAAM,CAAA,UAAA,CAAW,qBAAqB,CAAA,CAAA;AAC3D,EAAA,MAAM,SAAS,uBAAwB,EAAA,CAAA;AACvC,EAAM,MAAA,WAAA,GAAc,UAAW,CAAA,YAAA,EAAc,SAAW,EAAA;AAAA,IACtD,SAAA,EAAW,GAAG,KAAM,CAAA,cAAA,CAAA,CAAA;AAAA,GACrB,CAAA,CAAA;AAED,EAAA,IAAI,YAAc,EAAA;AAChB,IAAM,MAAA,UAAA,GAAa,KAAM,CAAA,MAAA,CAAY,IAAI,CAAA,CAAA;AACzC,IAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,GAAA,EAAK,YAAY,CACtB,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,OAAA;AAAA,MAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EACK,WADL,CAAA,EAAA;AAAA,QAEC,UAAA;AAAA,QACA,UAAY,EAAA,IAAA;AAAA,QACZ,MAAQ,EAAA,IAAA;AAAA,OAAA,CAAA;AAAA,KAEZ,CAAA,CAAA;AAAA,GAEG,MAAA;AACL,IAAA,2CAAQ,OAAY,EAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EAAA,WAAA,CAAA,EAAZ,EAAyB,UAAY,EAAA,CAAC,CAAC,MAAQ,EAAA,CAAA,CAAA,CAAA;AAAA,GACzD;AACF,CAAA;AAEgB,SAAA,eAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,MACE,IAAM,EAAA,4BAAA;AAAA,MACN,WAAa,EAAA,aAAA;AAAA,MACb,UAAY,EAAA,yCAAA;AAAA,MACZ,UAAY,EAAA,aAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,SACR;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,IAAM,EAAA,QAAA;AAAA,UACN,WAAa,EAAA,QAAA;AAAA,UACb,WACE,EAAA,0EAAA;AAAA,UACF,gBAAkB,EAAA,CAAA;AAAA,SACpB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oFAAA;AAAA,UACF,OAAS,EAAA;AAAA,YACP,QAAA;AAAA,YACA,aAAA;AAAA,YACA,cAAA;AAAA,YACA,KAAA;AAAA,YACA,UAAA;AAAA,YACA,WAAA;AAAA,WACF;AAAA,SACF;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA,OACF;AAAA,MACA,aAAe,EAAA,IAAA;AAAA,KACjB;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"registerPopover.esm.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BasePopover(props: {\n className?: string;\n resetClassName?: string;\n}) {\n const { resetClassName, ...restProps } = props;\n const isStandalone = !React.useContext(PopoverContext);\n const contextProps = React.useContext(PlasmicPopoverContext);\n const canvas = usePlasmicCanvasContext();\n const mergedProps = mergeProps(contextProps, restProps, {\n className: `${props.resetClassName}`,\n });\n\n if (isStandalone) {\n const triggerRef = React.useRef<any>(null);\n return (\n <>\n <div ref={triggerRef} />\n <Popover\n {...mergedProps}\n triggerRef={triggerRef}\n isNonModal={true}\n isOpen={true}\n />\n </>\n );\n } else {\n return <Popover {...mergedProps} isNonModal={!!canvas} />;\n }\n}\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: \"plasmic-react-aria-popover\",\n displayName: \"BasePopover\",\n importPath: \"@plasmicpkgs/react-aria/registerPopover\",\n importName: \"BasePopover\",\n props: {\n children: {\n type: \"slot\",\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 0,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"top\",\n \"top left\",\n \"top right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n // className: {\n // type: \"class\",\n // displayName: \"Additional states\",\n // selectors: [\n // {\n // selector: \":self[data-entering]\",\n // label: \"Entering\",\n // },\n // {\n // selector: \":self[data-exiting]\",\n // label: \"Exiting\",\n // },\n // ],\n // },\n },\n styleSections: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,YAAY,KAGzB,EAAA;AACD,EAAA,MAAyC,YAAd,SAAA,GAAA,SAA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,EAAA,yCAAA;AAAA,MACZ,UAAY,EAAA,aAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,SACR;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,IAAM,EAAA,QAAA;AAAA,UACN,WAAa,EAAA,QAAA;AAAA,UACb,WACE,EAAA,0EAAA;AAAA,UACF,gBAAkB,EAAA,CAAA;AAAA,SACpB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oFAAA;AAAA,UACF,OAAS,EAAA;AAAA,YACP,QAAA;AAAA,YACA,aAAA;AAAA,YACA,cAAA;AAAA,YACA,KAAA;AAAA,YACA,UAAA;AAAA,YACA,WAAA;AAAA,WACF;AAAA,SACF;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAeF;AAAA,MACA,aAAe,EAAA,IAAA;AAAA,KACjB;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -186,7 +186,17 @@ function registerSelect(loader) {
186
186
  importPath: "@plasmicpkgs/react-aria/registerSelect",
187
187
  importName: "SelectValue",
188
188
  parentComponentName: SELECT_NAME,
189
- props: {}
189
+ props: {
190
+ className: {
191
+ type: "class",
192
+ selectors: [
193
+ {
194
+ selector: ":self[data-placeholder]",
195
+ label: "Placeholder"
196
+ }
197
+ ]
198
+ }
199
+ }
190
200
  });
191
201
  }
192
202
 
@@ -1 +1 @@
1
- {"version":3,"file":"registerSelect.cjs.js","sources":["../src/registerSelect.tsx"],"sourcesContent":["import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport React from \"react\";\nimport {\n Key,\n Select,\n SelectValue as BaseSelectValue,\n} from \"react-aria-components\";\nimport { PlasmicListBoxContext } from \"./contexts\";\nimport {\n flattenOptions,\n HasOptions,\n makeOptionsPropType,\n makeValuePropType,\n useStrictOptions,\n} from \"./option-utils\";\nimport {\n extractPlasmicDataProps,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n Styleable,\n} from \"./utils\";\n\nexport { BaseSelectValue };\n\nconst SELECT_NAME = makeComponentName(\"select\");\n\nexport interface BaseSelectProps<T extends object>\n extends HasOptions<T>,\n Styleable {\n placeholder?: string;\n isDisabled?: boolean;\n\n value?: Key;\n onChange?: (value: Key) => void;\n\n previewOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n\n structure?: React.ReactNode;\n\n name?: string;\n \"aria-label\"?: string;\n\n renderOption?: (item: {\n value: string;\n label?: string;\n isDisabled?: boolean;\n }) => React.ReactNode;\n}\n\nexport function BaseSelect<T extends object>(props: BaseSelectProps<T>) {\n const {\n value,\n onChange,\n placeholder,\n previewOpen,\n onOpenChange,\n isDisabled,\n className,\n style,\n structure,\n renderOption,\n name,\n \"aria-label\": ariaLabel,\n } = props;\n\n const { options, optionText } = useStrictOptions(props);\n\n const canvas = usePlasmicCanvasContext();\n\n const disabledKeys = flattenOptions(options)\n .filter((op) => op.isDisabled)\n .map((op) => op.value);\n\n return (\n <Select\n placeholder={placeholder}\n selectedKey={value}\n onSelectionChange={onChange}\n onOpenChange={onOpenChange}\n isDisabled={isDisabled}\n className={className}\n style={style}\n name={name}\n aria-label={ariaLabel}\n {...(previewOpen && canvas ? { isOpen: previewOpen } : undefined)}\n {...extractPlasmicDataProps(props)}\n >\n <PlasmicListBoxContext.Provider\n value={{\n items: options,\n disabledKeys: disabledKeys,\n makeItemProps: (item) => ({\n key: item.value,\n textValue: optionText(item),\n children: renderOption ? renderOption(item) : optionText(item),\n }),\n makeSectionProps: (section) => ({\n section,\n key: section.key,\n }),\n getItemType: (option) =>\n option.type === \"section\" ? \"section\" : \"item\",\n }}\n >\n {structure}\n </PlasmicListBoxContext.Provider>\n </Select>\n );\n}\n\nexport function registerSelect(loader?: Registerable) {\n registerComponentHelper(loader, BaseSelect, {\n name: SELECT_NAME,\n displayName: \"BaseSelect\",\n importPath: \"@plasmicpkgs/react-aria/registerSelect\",\n importName: \"BaseSelect\",\n props: {\n options: makeOptionsPropType(),\n placeholder: {\n type: \"string\",\n },\n isDisabled: {\n type: \"boolean\",\n },\n value: makeValuePropType(),\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n },\n previewOpen: {\n type: \"boolean\",\n displayName: \"Preview opened?\",\n description: \"Preview opened state while designing in Plasmic editor\",\n editOnly: true,\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n // optionValue: {\n // type: \"string\",\n // displayName: \"Field key for an option's value\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns the key to use\",\n // },\n // optionText: {\n // type: \"string\",\n // displayName: \"Field key for an option's text value\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns the text value to use\",\n // },\n // optionDisabled: {\n // type: \"string\",\n // displayName: \"Field key for whether an option is disabled\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns true if option should be disabled\",\n // },\n\n structure: {\n type: \"slot\",\n },\n\n // renderOption: {\n // type: \"slot\",\n // displayName: \"Custom render option\",\n // renderPropParams: [\"item\"],\n // hidePlaceholder: true\n // },\n\n name: {\n type: \"string\",\n displayName: \"Form field key\",\n description: \"Name of the input, when submitting in an HTML form\",\n advanced: true,\n },\n\n \"aria-label\": {\n type: \"string\",\n displayName: \"Aria Label\",\n description: \"Label for this input, if no visible label is used\",\n advanced: true,\n },\n },\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"text\",\n },\n isOpen: {\n type: \"readonly\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n },\n },\n });\n\n registerComponentHelper(loader, BaseSelectValue, {\n name: makeComponentName(\"select-value\"),\n displayName: \"Base Selected Value\",\n importPath: \"@plasmicpkgs/react-aria/registerSelect\",\n importName: \"SelectValue\",\n parentComponentName: SELECT_NAME,\n props: {},\n });\n}\n"],"names":["makeComponentName","useStrictOptions","usePlasmicCanvasContext","flattenOptions","React","Select","extractPlasmicDataProps","PlasmicListBoxContext","registerComponentHelper","makeOptionsPropType","makeValuePropType","BaseSelectValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,WAAA,GAAcA,wBAAkB,QAAQ,CAAA,CAAA;AA0BvC,SAAS,WAA6B,KAA2B,EAAA;AACtE,EAAM,MAAA;AAAA,IACJ,KAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,IAAA;AAAA,IACA,YAAc,EAAA,SAAA;AAAA,GACZ,GAAA,KAAA,CAAA;AAEJ,EAAA,MAAM,EAAE,OAAA,EAAS,UAAW,EAAA,GAAIC,6BAAiB,KAAK,CAAA,CAAA;AAEtD,EAAA,MAAM,SAASC,4BAAwB,EAAA,CAAA;AAEvC,EAAA,MAAM,YAAe,GAAAC,0BAAA,CAAe,OAAO,CAAA,CACxC,OAAO,CAAC,EAAA,KAAO,EAAG,CAAA,UAAU,CAC5B,CAAA,GAAA,CAAI,CAAC,EAAA,KAAO,GAAG,KAAK,CAAA,CAAA;AAEvB,EACE,uBAAAC,sBAAA,CAAA,aAAA;AAAA,IAACC,0BAAA;AA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AQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,IAAM,EAAA,UAAA;AAAA,QACN,SAAW,EAAA,OAAA;AAAA,QACX,YAAc,EAAA,UAAA;AAAA,QACd,YAAc,EAAA,MAAA;AAAA,OAChB;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,IAAM,EAAA,UAAA;AAAA,QACN,YAAc,EAAA,cAAA;AAAA,QACd,YAAc,EAAA,SAAA;AAAA,OAChB;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AAED,EAAAF,6BAAA,CAAwB,QAAQG,+BAAiB,EAAA;AAAA,IAC/C,IAAA,EAAMX,wBAAkB,cAAc,CAAA;AAAA,IACtC,WAAa,EAAA,qBAAA;AAAA,IACb,UAAY,EAAA,wCAAA;AAAA,IACZ,UAAY,EAAA,aAAA;AAAA,IACZ,mBAAqB,EAAA,WAAA;AAAA,IACrB,OAAO,EAAC;AAAA,GACT,CAAA,CAAA;AACH;;;;;;;;;"}
1
+ {"version":3,"file":"registerSelect.cjs.js","sources":["../src/registerSelect.tsx"],"sourcesContent":["import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport React from \"react\";\nimport {\n Key,\n Select,\n SelectValue as BaseSelectValue,\n} from \"react-aria-components\";\nimport { PlasmicListBoxContext } from \"./contexts\";\nimport {\n flattenOptions,\n HasOptions,\n makeOptionsPropType,\n makeValuePropType,\n useStrictOptions,\n} from \"./option-utils\";\nimport {\n extractPlasmicDataProps,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n Styleable,\n} from \"./utils\";\n\nexport { BaseSelectValue };\n\nconst SELECT_NAME = makeComponentName(\"select\");\n\nexport interface BaseSelectProps<T extends object>\n extends HasOptions<T>,\n Styleable {\n placeholder?: string;\n isDisabled?: boolean;\n\n value?: Key;\n onChange?: (value: Key) => void;\n\n previewOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n\n structure?: React.ReactNode;\n\n name?: string;\n \"aria-label\"?: string;\n\n renderOption?: (item: {\n value: string;\n label?: string;\n isDisabled?: boolean;\n }) => React.ReactNode;\n}\n\nexport function BaseSelect<T extends object>(props: BaseSelectProps<T>) {\n const {\n value,\n onChange,\n placeholder,\n previewOpen,\n onOpenChange,\n isDisabled,\n className,\n style,\n structure,\n renderOption,\n name,\n \"aria-label\": ariaLabel,\n } = props;\n\n const { options, optionText } = useStrictOptions(props);\n\n const canvas = usePlasmicCanvasContext();\n\n const disabledKeys = flattenOptions(options)\n .filter((op) => op.isDisabled)\n .map((op) => op.value);\n\n return (\n <Select\n placeholder={placeholder}\n selectedKey={value}\n onSelectionChange={onChange}\n onOpenChange={onOpenChange}\n isDisabled={isDisabled}\n className={className}\n style={style}\n name={name}\n aria-label={ariaLabel}\n {...(previewOpen && canvas ? { isOpen: previewOpen } : undefined)}\n {...extractPlasmicDataProps(props)}\n >\n <PlasmicListBoxContext.Provider\n value={{\n items: options,\n disabledKeys: disabledKeys,\n makeItemProps: (item) => ({\n key: item.value,\n textValue: optionText(item),\n children: renderOption ? renderOption(item) : optionText(item),\n }),\n makeSectionProps: (section) => ({\n section,\n key: section.key,\n }),\n getItemType: (option) =>\n option.type === \"section\" ? \"section\" : \"item\",\n }}\n >\n {structure}\n </PlasmicListBoxContext.Provider>\n </Select>\n );\n}\n\nexport function registerSelect(loader?: Registerable) {\n registerComponentHelper(loader, BaseSelect, {\n name: SELECT_NAME,\n displayName: \"BaseSelect\",\n importPath: \"@plasmicpkgs/react-aria/registerSelect\",\n importName: \"BaseSelect\",\n props: {\n options: makeOptionsPropType(),\n placeholder: {\n type: \"string\",\n },\n isDisabled: {\n type: \"boolean\",\n },\n value: makeValuePropType(),\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n },\n previewOpen: {\n type: \"boolean\",\n displayName: \"Preview opened?\",\n description: \"Preview opened state while designing in Plasmic editor\",\n editOnly: true,\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n // optionValue: {\n // type: \"string\",\n // displayName: \"Field key for an option's value\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns the key to use\",\n // },\n // optionText: {\n // type: \"string\",\n // displayName: \"Field key for an option's text value\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns the text value to use\",\n // },\n // optionDisabled: {\n // type: \"string\",\n // displayName: \"Field key for whether an option is disabled\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns true if option should be disabled\",\n // },\n\n structure: {\n type: \"slot\",\n },\n\n // renderOption: {\n // type: \"slot\",\n // displayName: \"Custom render option\",\n // renderPropParams: [\"item\"],\n // hidePlaceholder: true\n // },\n\n name: {\n type: \"string\",\n displayName: \"Form field key\",\n description: \"Name of the input, when submitting in an HTML form\",\n advanced: true,\n },\n\n \"aria-label\": {\n type: \"string\",\n displayName: \"Aria Label\",\n description: \"Label for this input, if no visible label is used\",\n advanced: true,\n },\n },\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"text\",\n },\n isOpen: {\n type: \"readonly\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n },\n },\n });\n\n registerComponentHelper(loader, BaseSelectValue, {\n name: makeComponentName(\"select-value\"),\n displayName: \"Base Selected Value\",\n importPath: \"@plasmicpkgs/react-aria/registerSelect\",\n importName: \"SelectValue\",\n parentComponentName: SELECT_NAME,\n props: {\n className: {\n type: \"class\",\n selectors: [\n {\n selector: \":self[data-placeholder]\",\n label: \"Placeholder\",\n },\n ],\n },\n },\n });\n}\n"],"names":["makeComponentName","useStrictOptions","usePlasmicCanvasContext","flattenOptions","React","Select","extractPlasmicDataProps","PlasmicListBoxContext","registerComponentHelper","makeOptionsPropType","makeValuePropType","BaseSelectValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,WAAA,GAAcA,wBAAkB,QAAQ,CAAA,CAAA;AA0BvC,SAAS,WAA6B,KAA2B,EAAA;AACtE,EAAM,MAAA;AAAA,IACJ,KAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,IAAA;AAAA,IACA,YAAc,EAAA,SAAA;AAAA,GACZ,GAAA,KAAA,CAAA;AAEJ,EAAA,MAAM,EAAE,OAAA,EAAS,UAAW,EAAA,GAAIC,6BAAiB,KAAK,CAAA,CAAA;AAEtD,EAAA,MAAM,SAASC,4BAAwB,EAAA,CAAA;AAEvC,EAAA,MAAM,YAAe,GAAAC,0BAAA,CAAe,OAAO,CAAA,CACxC,OAAO,CAAC,EAAA,KAAO,EAAG,CAAA,UAAU,CAC5B,CAAA,GAAA,CAAI,CAAC,EAAA,KAAO,GAAG,KAAK,CAAA,CAAA;AAEvB,EACE,uBAAAC,sBAAA,CAAA,aAAA;AAAA,IAACC,0BAAA;AAAA,IAAA,cAAA,CAAA,cAAA,CAAA;AAAA,MACC,WAAA;AAAA,MACA,WAAa,EAAA,KAAA;AAAA,MACb,iBAAmB,EAAA,QAAA;AAAA,MACnB,YAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,YAAY,EAAA,SAAA;AAAA,KACP,EAAA,WAAA,IAAe,SAAS,EAAE,MAAA,EAAQ,aAAgB,GAAA,KAAA,CAAA,CAAA,EACnDC,8BAAwB,KAAK,CAAA,CAAA;AAAA,oBAEjCF,sBA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A;AAAA,IAC/C,IAAA,EAAMX,wBAAkB,cAAc,CAAA;AAAA,IACtC,WAAa,EAAA,qBAAA;AAAA,IACb,UAAY,EAAA,wCAAA;AAAA,IACZ,UAAY,EAAA,aAAA;AAAA,IACZ,mBAAqB,EAAA,WAAA;AAAA,IACrB,KAAO,EAAA;AAAA,MACL,SAAW,EAAA;AAAA,QACT,IAAM,EAAA,OAAA;AAAA,QACN,SAAW,EAAA;AAAA,UACT;AAAA,YACE,QAAU,EAAA,yBAAA;AAAA,YACV,KAAO,EAAA,aAAA;AAAA,WACT;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH;;;;;;;;;"}
@@ -181,7 +181,17 @@ function registerSelect(loader) {
181
181
  importPath: "@plasmicpkgs/react-aria/registerSelect",
182
182
  importName: "SelectValue",
183
183
  parentComponentName: SELECT_NAME,
184
- props: {}
184
+ props: {
185
+ className: {
186
+ type: "class",
187
+ selectors: [
188
+ {
189
+ selector: ":self[data-placeholder]",
190
+ label: "Placeholder"
191
+ }
192
+ ]
193
+ }
194
+ }
185
195
  });
186
196
  }
187
197
 
@@ -1 +1 @@
1
- {"version":3,"file":"registerSelect.esm.js","sources":["../src/registerSelect.tsx"],"sourcesContent":["import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport React from \"react\";\nimport {\n Key,\n Select,\n SelectValue as BaseSelectValue,\n} from \"react-aria-components\";\nimport { PlasmicListBoxContext } from \"./contexts\";\nimport {\n flattenOptions,\n HasOptions,\n makeOptionsPropType,\n makeValuePropType,\n useStrictOptions,\n} from \"./option-utils\";\nimport {\n extractPlasmicDataProps,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n Styleable,\n} from \"./utils\";\n\nexport { BaseSelectValue };\n\nconst SELECT_NAME = makeComponentName(\"select\");\n\nexport interface BaseSelectProps<T extends object>\n extends HasOptions<T>,\n Styleable {\n placeholder?: string;\n isDisabled?: boolean;\n\n value?: Key;\n onChange?: (value: Key) => void;\n\n previewOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n\n structure?: React.ReactNode;\n\n name?: string;\n \"aria-label\"?: string;\n\n renderOption?: (item: {\n value: string;\n label?: string;\n isDisabled?: boolean;\n }) => React.ReactNode;\n}\n\nexport function BaseSelect<T extends object>(props: BaseSelectProps<T>) {\n const {\n value,\n onChange,\n placeholder,\n previewOpen,\n onOpenChange,\n isDisabled,\n className,\n style,\n structure,\n renderOption,\n name,\n \"aria-label\": ariaLabel,\n } = props;\n\n const { options, optionText } = useStrictOptions(props);\n\n const canvas = usePlasmicCanvasContext();\n\n const disabledKeys = flattenOptions(options)\n .filter((op) => op.isDisabled)\n .map((op) => op.value);\n\n return (\n <Select\n placeholder={placeholder}\n selectedKey={value}\n onSelectionChange={onChange}\n onOpenChange={onOpenChange}\n isDisabled={isDisabled}\n className={className}\n style={style}\n name={name}\n aria-label={ariaLabel}\n {...(previewOpen && canvas ? { isOpen: previewOpen } : undefined)}\n {...extractPlasmicDataProps(props)}\n >\n <PlasmicListBoxContext.Provider\n value={{\n items: options,\n disabledKeys: disabledKeys,\n makeItemProps: (item) => ({\n key: item.value,\n textValue: optionText(item),\n children: renderOption ? renderOption(item) : optionText(item),\n }),\n makeSectionProps: (section) => ({\n section,\n key: section.key,\n }),\n getItemType: (option) =>\n option.type === \"section\" ? \"section\" : \"item\",\n }}\n >\n {structure}\n </PlasmicListBoxContext.Provider>\n </Select>\n );\n}\n\nexport function registerSelect(loader?: Registerable) {\n registerComponentHelper(loader, BaseSelect, {\n name: SELECT_NAME,\n displayName: \"BaseSelect\",\n importPath: \"@plasmicpkgs/react-aria/registerSelect\",\n importName: \"BaseSelect\",\n props: {\n options: makeOptionsPropType(),\n placeholder: {\n type: \"string\",\n },\n isDisabled: {\n type: \"boolean\",\n },\n value: makeValuePropType(),\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n },\n previewOpen: {\n type: \"boolean\",\n displayName: \"Preview opened?\",\n description: \"Preview opened state while designing in Plasmic editor\",\n editOnly: true,\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n // optionValue: {\n // type: \"string\",\n // displayName: \"Field key for an option's value\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns the key to use\",\n // },\n // optionText: {\n // type: \"string\",\n // displayName: \"Field key for an option's text value\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns the text value to use\",\n // },\n // optionDisabled: {\n // type: \"string\",\n // displayName: \"Field key for whether an option is disabled\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns true if option should be disabled\",\n // },\n\n structure: {\n type: \"slot\",\n },\n\n // renderOption: {\n // type: \"slot\",\n // displayName: \"Custom render option\",\n // renderPropParams: [\"item\"],\n // hidePlaceholder: true\n // },\n\n name: {\n type: \"string\",\n displayName: \"Form field key\",\n description: \"Name of the input, when submitting in an HTML form\",\n advanced: true,\n },\n\n \"aria-label\": {\n type: \"string\",\n displayName: \"Aria Label\",\n description: \"Label for this input, if no visible label is used\",\n advanced: true,\n },\n },\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"text\",\n },\n isOpen: {\n type: \"readonly\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n },\n },\n });\n\n registerComponentHelper(loader, BaseSelectValue, {\n name: makeComponentName(\"select-value\"),\n displayName: \"Base Selected Value\",\n importPath: \"@plasmicpkgs/react-aria/registerSelect\",\n importName: \"SelectValue\",\n parentComponentName: SELECT_NAME,\n props: {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CAAA;AAAA,IACZ,UAAY,EAAA,aAAA;AAAA,IACZ,mBAAqB,EAAA,WAAA;AAAA,IACrB,OAAO,EAAC;AAAA,GACT,CAAA,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"registerSelect.esm.js","sources":["../src/registerSelect.tsx"],"sourcesContent":["import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport React from \"react\";\nimport {\n Key,\n Select,\n SelectValue as BaseSelectValue,\n} from \"react-aria-components\";\nimport { PlasmicListBoxContext } from \"./contexts\";\nimport {\n flattenOptions,\n HasOptions,\n makeOptionsPropType,\n makeValuePropType,\n useStrictOptions,\n} from \"./option-utils\";\nimport {\n extractPlasmicDataProps,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n Styleable,\n} from \"./utils\";\n\nexport { BaseSelectValue };\n\nconst SELECT_NAME = makeComponentName(\"select\");\n\nexport interface BaseSelectProps<T extends object>\n extends HasOptions<T>,\n Styleable {\n placeholder?: string;\n isDisabled?: boolean;\n\n value?: Key;\n onChange?: (value: Key) => void;\n\n previewOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n\n structure?: React.ReactNode;\n\n name?: string;\n \"aria-label\"?: string;\n\n renderOption?: (item: {\n value: string;\n label?: string;\n isDisabled?: boolean;\n }) => React.ReactNode;\n}\n\nexport function BaseSelect<T extends object>(props: BaseSelectProps<T>) {\n const {\n value,\n onChange,\n placeholder,\n previewOpen,\n onOpenChange,\n isDisabled,\n className,\n style,\n structure,\n renderOption,\n name,\n \"aria-label\": ariaLabel,\n } = props;\n\n const { options, optionText } = useStrictOptions(props);\n\n const canvas = usePlasmicCanvasContext();\n\n const disabledKeys = flattenOptions(options)\n .filter((op) => op.isDisabled)\n .map((op) => op.value);\n\n return (\n <Select\n placeholder={placeholder}\n selectedKey={value}\n onSelectionChange={onChange}\n onOpenChange={onOpenChange}\n isDisabled={isDisabled}\n className={className}\n style={style}\n name={name}\n aria-label={ariaLabel}\n {...(previewOpen && canvas ? { isOpen: previewOpen } : undefined)}\n {...extractPlasmicDataProps(props)}\n >\n <PlasmicListBoxContext.Provider\n value={{\n items: options,\n disabledKeys: disabledKeys,\n makeItemProps: (item) => ({\n key: item.value,\n textValue: optionText(item),\n children: renderOption ? renderOption(item) : optionText(item),\n }),\n makeSectionProps: (section) => ({\n section,\n key: section.key,\n }),\n getItemType: (option) =>\n option.type === \"section\" ? \"section\" : \"item\",\n }}\n >\n {structure}\n </PlasmicListBoxContext.Provider>\n </Select>\n );\n}\n\nexport function registerSelect(loader?: Registerable) {\n registerComponentHelper(loader, BaseSelect, {\n name: SELECT_NAME,\n displayName: \"BaseSelect\",\n importPath: \"@plasmicpkgs/react-aria/registerSelect\",\n importName: \"BaseSelect\",\n props: {\n options: makeOptionsPropType(),\n placeholder: {\n type: \"string\",\n },\n isDisabled: {\n type: \"boolean\",\n },\n value: makeValuePropType(),\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n },\n previewOpen: {\n type: \"boolean\",\n displayName: \"Preview opened?\",\n description: \"Preview opened state while designing in Plasmic editor\",\n editOnly: true,\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n // optionValue: {\n // type: \"string\",\n // displayName: \"Field key for an option's value\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns the key to use\",\n // },\n // optionText: {\n // type: \"string\",\n // displayName: \"Field key for an option's text value\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns the text value to use\",\n // },\n // optionDisabled: {\n // type: \"string\",\n // displayName: \"Field key for whether an option is disabled\",\n // hidden: (ps) =>\n // !ps.options ||\n // !ps.options[0] ||\n // typeof ps.options[0] === \"string\" ||\n // \"value\" in ps.options[0],\n // exprHint:\n // \"Return a function that takes in an option object, and returns true if option should be disabled\",\n // },\n\n structure: {\n type: \"slot\",\n },\n\n // renderOption: {\n // type: \"slot\",\n // displayName: \"Custom render option\",\n // renderPropParams: [\"item\"],\n // hidePlaceholder: true\n // },\n\n name: {\n type: \"string\",\n displayName: \"Form field key\",\n description: \"Name of the input, when submitting in an HTML form\",\n advanced: true,\n },\n\n \"aria-label\": {\n type: \"string\",\n displayName: \"Aria Label\",\n description: \"Label for this input, if no visible label is used\",\n advanced: true,\n },\n },\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"text\",\n },\n isOpen: {\n type: \"readonly\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n },\n },\n });\n\n registerComponentHelper(loader, BaseSelectValue, {\n name: makeComponentName(\"select-value\"),\n displayName: \"Base Selected Value\",\n importPath: \"@plasmicpkgs/react-aria/registerSelect\",\n importName: \"SelectValue\",\n parentComponentName: SELECT_NAME,\n props: {\n className: {\n type: \"class\",\n selectors: [\n {\n selector: \":self[data-placeholder]\",\n label: \"Placeholder\",\n },\n ],\n },\n },\n });\n}\n"],"names":["BaseSelectValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,WAAA,GAAc,kBAAkB,QAAQ,CAAA,CAAA;AA0BvC,SAAS,WAA6B,KAA2B,EAAA;AACtE,EAAM,MAAA;AAAA,IACJ,KAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,IAAA;AAAA,IACA,YAAc,EAAA,SAAA;AAAA,GACZ,GAAA,KAAA,CAAA;AAEJ,EAAA,MAAM,EAAE,OAAA,EAAS,UAAW,EAAA,GAAI,iBAAiB,KAAK,CAAA,CAAA;AAEt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