@plasmicpkgs/react-aria 0.0.27 → 0.0.29

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 (138) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/contexts.d.ts +3 -7
  3. package/dist/interaction-variant-utils.d.ts +4 -0
  4. package/dist/option-utils.d.ts +4 -13
  5. package/dist/react-aria.esm.js +1193 -686
  6. package/dist/react-aria.esm.js.map +1 -1
  7. package/dist/react-aria.js +1190 -683
  8. package/dist/react-aria.js.map +1 -1
  9. package/dist/registerDialogTrigger.d.ts +10 -0
  10. package/dist/registerLabel.d.ts +1 -0
  11. package/dist/registerListBox.d.ts +7 -5
  12. package/dist/registerListBoxItem.d.ts +2 -4
  13. package/dist/registerPopover.d.ts +4 -2
  14. package/dist/registerSection.d.ts +1 -3
  15. package/dist/registerSelect.d.ts +1 -1
  16. package/dist/registerSlider.d.ts +14 -0
  17. package/dist/registerSliderOutput.d.ts +5 -0
  18. package/dist/registerSliderThumb.d.ts +13 -0
  19. package/dist/registerSliderTrack.d.ts +14 -0
  20. package/package.json +3 -3
  21. package/skinny/ErrorBoundary-c6b111d3.esm.js +20 -0
  22. package/skinny/ErrorBoundary-c6b111d3.esm.js.map +1 -0
  23. package/skinny/ErrorBoundary-e9b86248.cjs.js +22 -0
  24. package/skinny/ErrorBoundary-e9b86248.cjs.js.map +1 -0
  25. package/skinny/{contexts-49f6c298.esm.js → contexts-8a2a183b.esm.js} +3 -2
  26. package/skinny/contexts-8a2a183b.esm.js.map +1 -0
  27. package/skinny/{contexts-3e42cdf9.cjs.js → contexts-dd0ce341.cjs.js} +3 -1
  28. package/skinny/contexts-dd0ce341.cjs.js.map +1 -0
  29. package/skinny/contexts.d.ts +3 -7
  30. package/skinny/{interaction-variant-utils-80bf1cfd.cjs.js → interaction-variant-utils-244b74fb.cjs.js} +20 -2
  31. package/skinny/interaction-variant-utils-244b74fb.cjs.js.map +1 -0
  32. package/skinny/{interaction-variant-utils-608d984b.esm.js → interaction-variant-utils-c44a9d56.esm.js} +20 -2
  33. package/skinny/interaction-variant-utils-c44a9d56.esm.js.map +1 -0
  34. package/skinny/interaction-variant-utils.d.ts +4 -0
  35. package/skinny/{option-utils-765a1782.esm.js → option-utils-4f037568.esm.js} +22 -22
  36. package/skinny/option-utils-4f037568.esm.js.map +1 -0
  37. package/skinny/{option-utils-0db61f6d.cjs.js → option-utils-5e4e85bd.cjs.js} +22 -22
  38. package/skinny/option-utils-5e4e85bd.cjs.js.map +1 -0
  39. package/skinny/option-utils.d.ts +4 -13
  40. package/skinny/registerButton.cjs.js +5 -1
  41. package/skinny/registerButton.cjs.js.map +1 -1
  42. package/skinny/registerButton.esm.js +5 -1
  43. package/skinny/registerButton.esm.js.map +1 -1
  44. package/skinny/registerCheckbox.cjs.js +1 -1
  45. package/skinny/registerCheckbox.esm.js +1 -1
  46. package/skinny/registerCheckboxGroup.cjs.js +1 -1
  47. package/skinny/registerCheckboxGroup.esm.js +1 -1
  48. package/skinny/registerComboBox.cjs.js +11 -19
  49. package/skinny/registerComboBox.cjs.js.map +1 -1
  50. package/skinny/registerComboBox.esm.js +11 -19
  51. package/skinny/registerComboBox.esm.js.map +1 -1
  52. package/skinny/registerDialogTrigger.cjs.js +88 -0
  53. package/skinny/registerDialogTrigger.cjs.js.map +1 -0
  54. package/skinny/registerDialogTrigger.d.ts +10 -0
  55. package/skinny/registerDialogTrigger.esm.js +81 -0
  56. package/skinny/registerDialogTrigger.esm.js.map +1 -0
  57. package/skinny/registerHeader.cjs.js +1 -1
  58. package/skinny/registerHeader.esm.js +1 -1
  59. package/skinny/registerInput.cjs.js +1 -1
  60. package/skinny/registerInput.esm.js +1 -1
  61. package/skinny/registerLabel.cjs.js +6 -1
  62. package/skinny/registerLabel.cjs.js.map +1 -1
  63. package/skinny/registerLabel.d.ts +1 -0
  64. package/skinny/registerLabel.esm.js +7 -3
  65. package/skinny/registerLabel.esm.js.map +1 -1
  66. package/skinny/registerListBox.cjs.js +30 -74
  67. package/skinny/registerListBox.cjs.js.map +1 -1
  68. package/skinny/registerListBox.d.ts +7 -5
  69. package/skinny/registerListBox.esm.js +30 -74
  70. package/skinny/registerListBox.esm.js.map +1 -1
  71. package/skinny/registerListBoxItem.cjs.js +4 -20
  72. package/skinny/registerListBoxItem.cjs.js.map +1 -1
  73. package/skinny/registerListBoxItem.d.ts +2 -4
  74. package/skinny/registerListBoxItem.esm.js +4 -20
  75. package/skinny/registerListBoxItem.esm.js.map +1 -1
  76. package/skinny/registerPopover.cjs.js +8 -33
  77. package/skinny/registerPopover.cjs.js.map +1 -1
  78. package/skinny/registerPopover.d.ts +4 -2
  79. package/skinny/registerPopover.esm.js +8 -33
  80. package/skinny/registerPopover.esm.js.map +1 -1
  81. package/skinny/registerRadio.cjs.js +3 -18
  82. package/skinny/registerRadio.cjs.js.map +1 -1
  83. package/skinny/registerRadio.esm.js +3 -18
  84. package/skinny/registerRadio.esm.js.map +1 -1
  85. package/skinny/registerRadioGroup.cjs.js +2 -1
  86. package/skinny/registerRadioGroup.cjs.js.map +1 -1
  87. package/skinny/registerRadioGroup.esm.js +2 -1
  88. package/skinny/registerRadioGroup.esm.js.map +1 -1
  89. package/skinny/registerSection.cjs.js +5 -34
  90. package/skinny/registerSection.cjs.js.map +1 -1
  91. package/skinny/registerSection.d.ts +1 -3
  92. package/skinny/registerSection.esm.js +5 -34
  93. package/skinny/registerSection.esm.js.map +1 -1
  94. package/skinny/registerSelect.cjs.js +5 -16
  95. package/skinny/registerSelect.cjs.js.map +1 -1
  96. package/skinny/registerSelect.d.ts +1 -1
  97. package/skinny/registerSelect.esm.js +5 -16
  98. package/skinny/registerSelect.esm.js.map +1 -1
  99. package/skinny/registerSlider-73e80194.cjs.js +437 -0
  100. package/skinny/registerSlider-73e80194.cjs.js.map +1 -0
  101. package/skinny/registerSlider-efdba013.esm.js +425 -0
  102. package/skinny/registerSlider-efdba013.esm.js.map +1 -0
  103. package/skinny/registerSlider.cjs.js +23 -0
  104. package/skinny/registerSlider.cjs.js.map +1 -0
  105. package/skinny/registerSlider.d.ts +14 -0
  106. package/skinny/registerSlider.esm.js +15 -0
  107. package/skinny/registerSlider.esm.js.map +1 -0
  108. package/skinny/registerSliderOutput.cjs.js +30 -0
  109. package/skinny/registerSliderOutput.cjs.js.map +1 -0
  110. package/skinny/registerSliderOutput.d.ts +5 -0
  111. package/skinny/registerSliderOutput.esm.js +26 -0
  112. package/skinny/registerSliderOutput.esm.js.map +1 -0
  113. package/skinny/registerSliderThumb.cjs.js +119 -0
  114. package/skinny/registerSliderThumb.cjs.js.map +1 -0
  115. package/skinny/registerSliderThumb.d.ts +13 -0
  116. package/skinny/registerSliderThumb.esm.js +111 -0
  117. package/skinny/registerSliderThumb.esm.js.map +1 -0
  118. package/skinny/registerSliderTrack.cjs.js +23 -0
  119. package/skinny/registerSliderTrack.cjs.js.map +1 -0
  120. package/skinny/registerSliderTrack.d.ts +14 -0
  121. package/skinny/registerSliderTrack.esm.js +15 -0
  122. package/skinny/registerSliderTrack.esm.js.map +1 -0
  123. package/skinny/registerSwitch.cjs.js +1 -1
  124. package/skinny/registerSwitch.esm.js +1 -1
  125. package/skinny/registerTextArea.cjs.js +1 -1
  126. package/skinny/registerTextArea.esm.js +1 -1
  127. package/skinny/registerTextField.cjs.js +1 -1
  128. package/skinny/registerTextField.esm.js +1 -1
  129. package/skinny/registerTooltip.cjs.js +13 -6
  130. package/skinny/registerTooltip.cjs.js.map +1 -1
  131. package/skinny/registerTooltip.esm.js +13 -6
  132. package/skinny/registerTooltip.esm.js.map +1 -1
  133. package/skinny/contexts-3e42cdf9.cjs.js.map +0 -1
  134. package/skinny/contexts-49f6c298.esm.js.map +0 -1
  135. package/skinny/interaction-variant-utils-608d984b.esm.js.map +0 -1
  136. package/skinny/interaction-variant-utils-80bf1cfd.cjs.js.map +0 -1
  137. package/skinny/option-utils-0db61f6d.cjs.js.map +0 -1
  138. package/skinny/option-utils-765a1782.esm.js.map +0 -1
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { DialogTrigger } from "react-aria-components";
3
+ import { CodeComponentMetaOverrides, Registerable } from "./utils";
4
+ interface BaseDialogTriggerProps extends React.ComponentProps<typeof DialogTrigger> {
5
+ trigger: React.ReactNode;
6
+ dialog: React.ReactNode;
7
+ }
8
+ export declare function BaseDialogTrigger(props: BaseDialogTriggerProps): React.JSX.Element;
9
+ export declare function registerDialogTrigger(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseDialogTrigger>): void;
10
+ export {};
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { CodeComponentMetaOverrides, Registerable } from "./utils";
3
3
  export declare const BaseLabel: (props: import("react-aria-components").LabelProps & import("react").RefAttributes<HTMLLabelElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
4
+ export declare const LABEL_COMPONENT_NAME: string;
4
5
  export declare function registerLabel(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseLabel>): void;
@@ -1,14 +1,16 @@
1
1
  import React from "react";
2
2
  import { ListBox } from "react-aria-components";
3
- import { type BaseListBoxItem } from "./registerListBoxItem";
4
- import type { BaseSection } from "./registerSection";
3
+ import { HasOptions } from "./option-utils";
5
4
  import { CodeComponentMetaOverrides, Registerable } from "./utils";
6
- export interface BaseListBoxProps extends React.ComponentProps<typeof ListBox> {
7
- makeItemProps?: (item: any) => Partial<React.ComponentProps<typeof BaseListBoxItem>>;
8
- makeSectionProps?: (section: any) => Partial<React.ComponentProps<typeof BaseSection>>;
5
+ interface BaseListBoxControlContextData {
6
+ isStandalone: boolean;
7
+ }
8
+ export interface BaseListBoxProps extends React.ComponentProps<typeof ListBox>, HasOptions<any> {
9
9
  renderItem?: (item: any) => React.ReactNode;
10
10
  renderSection?: (section: any) => React.ReactNode;
11
11
  getItemType?: (thing: any) => "item" | "section";
12
+ setControlContextData?: (ctxData: BaseListBoxControlContextData) => void;
12
13
  }
13
14
  export declare function BaseListBox(props: BaseListBoxProps): React.JSX.Element;
14
15
  export declare function registerListBox(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseListBox>): void;
16
+ export {};
@@ -1,7 +1,5 @@
1
1
  import React from "react";
2
- import { Key, ListBoxItem } from "react-aria-components";
2
+ import { ListBoxItem } from "react-aria-components";
3
3
  import { CodeComponentMetaOverrides, Registerable } from "./utils";
4
- export declare function BaseListBoxItem(props: React.ComponentProps<typeof ListBoxItem> & {
5
- key?: Key;
6
- }): React.JSX.Element;
4
+ export declare function BaseListBoxItem(props: React.ComponentProps<typeof ListBoxItem>): React.JSX.Element;
7
5
  export declare function registerListBoxItem(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>): void;
@@ -1,7 +1,9 @@
1
1
  import React from "react";
2
+ import { Popover } from "react-aria-components";
2
3
  import { CodeComponentMetaOverrides, Registerable } from "./utils";
3
- export declare function BasePopover(props: {
4
+ export interface BasePopoverProps extends React.ComponentProps<typeof Popover> {
4
5
  className?: string;
5
6
  resetClassName?: string;
6
- }): React.JSX.Element;
7
+ }
8
+ export declare function BasePopover(props: BasePopoverProps): React.JSX.Element;
7
9
  export declare function registerPopover(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BasePopover>): void;
@@ -1,14 +1,12 @@
1
1
  import React from "react";
2
2
  import { Key } from "react-aria-components";
3
3
  import type { StrictSectionType } from "./option-utils";
4
- import { BaseListBoxItem } from "./registerListBoxItem";
5
4
  import { CodeComponentMetaOverrides, Registerable, Styleable } from "./utils";
6
5
  export interface BaseSectionProps extends Styleable {
7
6
  renderHeader?: (section: any) => React.ReactNode;
7
+ renderItem?: (item?: any) => React.ReactNode;
8
8
  key?: Key;
9
9
  section?: StrictSectionType;
10
- makeItemProps?: (item: any) => Partial<React.ComponentProps<typeof BaseListBoxItem>>;
11
- renderItem?: (item?: any) => React.ReactNode;
12
10
  }
13
11
  export declare function BaseSection(props: BaseSectionProps): React.JSX.Element;
14
12
  export declare function registerSection(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseSection>): void;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Key, SelectValue as BaseSelectValue } from "react-aria-components";
2
+ import { SelectValue as BaseSelectValue, Key } from "react-aria-components";
3
3
  import { HasOptions } from "./option-utils";
4
4
  import { Registerable, Styleable } from "./utils";
5
5
  export { BaseSelectValue };
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { type SliderProps } from "react-aria-components";
3
+ import { CodeComponentMetaOverrides, Registerable } from "./utils";
4
+ export declare const SLIDER_COMPONENT_NAME: string;
5
+ export interface BaseSliderProps extends Omit<SliderProps<number | number[]>, "onChange"> {
6
+ name?: string;
7
+ autoFocus?: boolean;
8
+ isMultiValue?: boolean;
9
+ range?: number[];
10
+ defaultRange?: number[];
11
+ onChange?: (value: number | number[], isMultiValue?: boolean) => void;
12
+ }
13
+ export declare function BaseSlider(props: BaseSliderProps): React.JSX.Element;
14
+ export declare function registerSlider(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseSlider>): void;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { CodeComponentMetaOverrides, Registerable } from "./utils";
3
+ export declare const BaseSliderOutput: (props: import("react-aria-components").SliderOutputProps & import("react").RefAttributes<HTMLOutputElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
4
+ export declare const SLIDER_OUTPUT_COMPONENT_NAME: string;
5
+ export declare function registerSliderOutput(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseSliderOutput>): void;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { SliderThumb } from "react-aria-components";
3
+ import { UpdateInteractionVariant } from "./interaction-variant-utils";
4
+ import { CodeComponentMetaOverrides, Registerable } from "./utils";
5
+ declare const SLIDER_THUMB_INTERACTION_VARIANTS: ("hovered" | "focused" | "focusVisible" | "dragging")[];
6
+ interface BaseSliderThumbProps extends React.ComponentProps<typeof SliderThumb> {
7
+ advanced?: boolean;
8
+ updateInteractionVariant?: UpdateInteractionVariant<typeof SLIDER_THUMB_INTERACTION_VARIANTS>;
9
+ }
10
+ export declare function BaseSliderThumb({ children, advanced, updateInteractionVariant, ...rest }: BaseSliderThumbProps): React.JSX.Element;
11
+ export declare const SLIDER_THUMB_COMPONENT_NAME: string;
12
+ export declare function registerSliderThumb(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseSliderThumb>): void;
13
+ export {};
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { SliderTrack } from "react-aria-components";
3
+ import { UpdateInteractionVariant } from "./interaction-variant-utils";
4
+ import { CodeComponentMetaOverrides, Registerable } from "./utils";
5
+ declare const SLIDER_TRACK_INTERACTION_VARIANTS: "hovered"[];
6
+ export interface BaseSliderTrackProps extends React.ComponentProps<typeof SliderTrack> {
7
+ progressBar?: React.ReactNode;
8
+ updateInteractionVariant?: UpdateInteractionVariant<typeof SLIDER_TRACK_INTERACTION_VARIANTS>;
9
+ children?: React.ReactElement<HTMLElement>;
10
+ }
11
+ export declare function BaseSliderTrack(props: BaseSliderTrackProps): React.JSX.Element;
12
+ export declare const SLIDER_TRACK_COMPONENT_NAME: string;
13
+ export declare function registerSliderTrack(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseSliderTrack>): void;
14
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicpkgs/react-aria",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "description": "Plasmic registration calls for react-aria based components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -54,7 +54,7 @@
54
54
  "react-stately": "^3.31.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@plasmicapp/host": "1.0.199",
57
+ "@plasmicapp/host": "1.0.200",
58
58
  "@rollup/plugin-commonjs": "^11.0.0",
59
59
  "@rollup/plugin-json": "^4.0.0",
60
60
  "@rollup/plugin-node-resolve": "^9.0.0",
@@ -74,5 +74,5 @@
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  },
77
- "gitHead": "7fdda11c2d8a17f38f4af56153ff6fbaf09d4b07"
77
+ "gitHead": "09dcebae0f1dfa4dbf47e493e17b217012759c48"
78
78
  }
@@ -0,0 +1,20 @@
1
+ import { Component } from 'react';
2
+
3
+ class ErrorBoundary extends Component {
4
+ constructor(props) {
5
+ super(props);
6
+ this.state = { hasError: false };
7
+ }
8
+ static getDerivedStateFromError(_) {
9
+ return { hasError: true };
10
+ }
11
+ render() {
12
+ if (this.state.hasError) {
13
+ return this.props.fallback;
14
+ }
15
+ return this.props.children;
16
+ }
17
+ }
18
+
19
+ export { ErrorBoundary as E };
20
+ //# sourceMappingURL=ErrorBoundary-c6b111d3.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorBoundary-c6b111d3.esm.js","sources":["../src/ErrorBoundary.tsx"],"sourcesContent":["import { Component, ReactNode } from \"react\";\n\ninterface ErrorBoundaryProps {\n children: ReactNode;\n fallback: ReactNode;\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n}\n\nclass ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(_: Error): ErrorBoundaryState {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n render() {\n if (this.state.hasError) {\n return this.props.fallback;\n }\n\n return this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n"],"names":[],"mappings":";;AAWA,MAAM,sBAAsB,SAAkD,CAAA;AAAA,EAC5E,YAAY,KAA2B,EAAA;AACrC,IAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AACX,IAAK,IAAA,CAAA,KAAA,GAAQ,EAAE,QAAA,EAAU,KAAM,EAAA,CAAA;AAAA,GACjC;AAAA,EAEA,OAAO,yBAAyB,CAA8B,EAAA;AAE5D,IAAO,OAAA,EAAE,UAAU,IAAK,EAAA,CAAA;AAAA,GAC1B;AAAA,EAEA,MAAS,GAAA;AACP,IAAI,IAAA,IAAA,CAAK,MAAM,QAAU,EAAA;AACvB,MAAA,OAAO,KAAK,KAAM,CAAA,QAAA,CAAA;AAAA,KACpB;AAEA,IAAA,OAAO,KAAK,KAAM,CAAA,QAAA,CAAA;AAAA,GACpB;AACF;;;;"}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+
5
+ class ErrorBoundary extends React.Component {
6
+ constructor(props) {
7
+ super(props);
8
+ this.state = { hasError: false };
9
+ }
10
+ static getDerivedStateFromError(_) {
11
+ return { hasError: true };
12
+ }
13
+ render() {
14
+ if (this.state.hasError) {
15
+ return this.props.fallback;
16
+ }
17
+ return this.props.children;
18
+ }
19
+ }
20
+
21
+ exports.ErrorBoundary = ErrorBoundary;
22
+ //# sourceMappingURL=ErrorBoundary-e9b86248.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorBoundary-e9b86248.cjs.js","sources":["../src/ErrorBoundary.tsx"],"sourcesContent":["import { Component, ReactNode } from \"react\";\n\ninterface ErrorBoundaryProps {\n children: ReactNode;\n fallback: ReactNode;\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n}\n\nclass ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(_: Error): ErrorBoundaryState {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n render() {\n if (this.state.hasError) {\n return this.props.fallback;\n }\n\n return this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n"],"names":["Component"],"mappings":";;;;AAWA,MAAM,sBAAsBA,eAAkD,CAAA;AAAA,EAC5E,YAAY,KAA2B,EAAA;AACrC,IAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AACX,IAAK,IAAA,CAAA,KAAA,GAAQ,EAAE,QAAA,EAAU,KAAM,EAAA,CAAA;AAAA,GACjC;AAAA,EAEA,OAAO,yBAAyB,CAA8B,EAAA;AAE5D,IAAO,OAAA,EAAE,UAAU,IAAK,EAAA,CAAA;AAAA,GAC1B;AAAA,EAEA,MAAS,GAAA;AACP,IAAI,IAAA,IAAA,CAAK,MAAM,QAAU,EAAA;AACvB,MAAA,OAAO,KAAK,KAAM,CAAA,QAAA,CAAA;AAAA,KACpB;AAEA,IAAA,OAAO,KAAK,KAAM,CAAA,QAAA,CAAA;AAAA,GACpB;AACF;;;;"}
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
+ const PlasmicSliderContext = React.createContext(void 0);
3
4
  React.createContext(void 0);
4
5
  const PlasmicListBoxContext = React.createContext(void 0);
5
6
  const PlasmicPopoverContext = React.createContext(void 0);
@@ -8,5 +9,5 @@ const PlasmicSectionContext = React.createContext(void 0);
8
9
  const PlasmicHeaderContext = React.createContext(void 0);
9
10
  const PlasmicInputContext = React.createContext(void 0);
10
11
 
11
- export { PlasmicListBoxContext as P, PlasmicInputContext as a, PlasmicSectionContext as b, PlasmicItemContext as c, PlasmicPopoverContext as d, PlasmicHeaderContext as e };
12
- //# sourceMappingURL=contexts-49f6c298.esm.js.map
12
+ export { PlasmicListBoxContext as P, PlasmicInputContext as a, PlasmicSectionContext as b, PlasmicItemContext as c, PlasmicPopoverContext as d, PlasmicHeaderContext as e, PlasmicSliderContext as f };
13
+ //# sourceMappingURL=contexts-8a2a183b.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts-8a2a183b.esm.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport type { BaseHeader } from \"./registerHeader\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport type { BaseListBoxProps } from \"./registerListBox\";\nimport type { BaseListBoxItem } from \"./registerListBoxItem\";\nimport type { BasePopover } from \"./registerPopover\";\nimport type { BaseSection } from \"./registerSection\";\nimport { BaseSlider } from \"./registerSlider\";\n\n// We pass down context props via our own Plasmic*Context instead of directly\n// using react-aria-component's *Context, because react-aria-component's\n// contexts don't \"merge\" with contexts further up the tree, so if we render\n// a context provider, it will just be overwritten by react-aria-component's\n// context provider. So we do the merging within our own Base* components\n// instead.\n\nexport const PlasmicSliderContext = React.createContext<\n React.ComponentProps<typeof BaseSlider> | undefined\n>(undefined);\n\nexport const PlasmicLabelContext = React.createContext<\n React.ComponentProps<typeof BaseLabel> | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n BaseListBoxProps | undefined\n>(undefined);\n\nexport const PlasmicPopoverContext = React.createContext<\n React.ComponentProps<typeof BasePopover> | undefined\n>(undefined);\n\nexport const PlasmicItemContext = React.createContext<\n React.ComponentProps<typeof BaseListBoxItem> | undefined\n>(undefined);\n\nexport const PlasmicSectionContext = React.createContext<\n React.ComponentProps<typeof BaseSection> | undefined\n>(undefined);\n\nexport const PlasmicHeaderContext = React.createContext<\n React.ComponentProps<typeof BaseHeader> | undefined\n>(undefined);\n\nexport const PlasmicInputContext = React.createContext<\n React.ComponentProps<typeof BaseInput> | undefined\n>(undefined);\n"],"names":[],"mappings":";;AAiBa,MAAA,oBAAA,GAAuB,KAAM,CAAA,aAAA,CAExC,KAAS,CAAA,EAAA;AAEwB,KAAM,CAAA,aAAA,CAEvC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwB,KAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwB,KAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,kBAAA,GAAqB,KAAM,CAAA,aAAA,CAEtC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwB,KAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,oBAAA,GAAuB,KAAM,CAAA,aAAA,CAExC,KAAS,CAAA,EAAA;AAEE,MAAA,mBAAA,GAAsB,KAAM,CAAA,aAAA,CAEvC,KAAS,CAAA;;;;"}
@@ -6,6 +6,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
6
 
7
7
  var React__default = /*#__PURE__*/_interopDefault(React);
8
8
 
9
+ const PlasmicSliderContext = React__default.default.createContext(void 0);
9
10
  React__default.default.createContext(void 0);
10
11
  const PlasmicListBoxContext = React__default.default.createContext(void 0);
11
12
  const PlasmicPopoverContext = React__default.default.createContext(void 0);
@@ -20,4 +21,5 @@ exports.PlasmicItemContext = PlasmicItemContext;
20
21
  exports.PlasmicListBoxContext = PlasmicListBoxContext;
21
22
  exports.PlasmicPopoverContext = PlasmicPopoverContext;
22
23
  exports.PlasmicSectionContext = PlasmicSectionContext;
23
- //# sourceMappingURL=contexts-3e42cdf9.cjs.js.map
24
+ exports.PlasmicSliderContext = PlasmicSliderContext;
25
+ //# sourceMappingURL=contexts-dd0ce341.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts-dd0ce341.cjs.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport type { BaseHeader } from \"./registerHeader\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport type { BaseListBoxProps } from \"./registerListBox\";\nimport type { BaseListBoxItem } from \"./registerListBoxItem\";\nimport type { BasePopover } from \"./registerPopover\";\nimport type { BaseSection } from \"./registerSection\";\nimport { BaseSlider } from \"./registerSlider\";\n\n// We pass down context props via our own Plasmic*Context instead of directly\n// using react-aria-component's *Context, because react-aria-component's\n// contexts don't \"merge\" with contexts further up the tree, so if we render\n// a context provider, it will just be overwritten by react-aria-component's\n// context provider. So we do the merging within our own Base* components\n// instead.\n\nexport const PlasmicSliderContext = React.createContext<\n React.ComponentProps<typeof BaseSlider> | undefined\n>(undefined);\n\nexport const PlasmicLabelContext = React.createContext<\n React.ComponentProps<typeof BaseLabel> | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n BaseListBoxProps | undefined\n>(undefined);\n\nexport const PlasmicPopoverContext = React.createContext<\n React.ComponentProps<typeof BasePopover> | undefined\n>(undefined);\n\nexport const PlasmicItemContext = React.createContext<\n React.ComponentProps<typeof BaseListBoxItem> | undefined\n>(undefined);\n\nexport const PlasmicSectionContext = React.createContext<\n React.ComponentProps<typeof BaseSection> | undefined\n>(undefined);\n\nexport const PlasmicHeaderContext = React.createContext<\n React.ComponentProps<typeof BaseHeader> | undefined\n>(undefined);\n\nexport const PlasmicInputContext = React.createContext<\n React.ComponentProps<typeof BaseInput> | undefined\n>(undefined);\n"],"names":["React"],"mappings":";;;;;;;;AAiBa,MAAA,oBAAA,GAAuBA,sBAAM,CAAA,aAAA,CAExC,KAAS,CAAA,EAAA;AAEwBA,sBAAM,CAAA,aAAA,CAEvC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwBA,sBAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwBA,sBAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,kBAAA,GAAqBA,sBAAM,CAAA,aAAA,CAEtC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwBA,sBAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,oBAAA,GAAuBA,sBAAM,CAAA,aAAA,CAExC,KAAS,CAAA,EAAA;AAEE,MAAA,mBAAA,GAAsBA,sBAAM,CAAA,aAAA,CAEvC,KAAS,CAAA;;;;;;;;;;"}
@@ -1,14 +1,10 @@
1
1
  import React from "react";
2
2
  import type { BaseListBoxProps } from "./registerListBox";
3
+ export declare const PlasmicSliderContext: React.Context<import("./registerSlider").BaseSliderProps | undefined>;
3
4
  export declare const PlasmicLabelContext: React.Context<(import("react-aria-components").LabelProps & React.RefAttributes<HTMLLabelElement>) | undefined>;
4
5
  export declare const PlasmicListBoxContext: React.Context<BaseListBoxProps | undefined>;
5
- export declare const PlasmicPopoverContext: React.Context<{
6
- className?: string | undefined;
7
- resetClassName?: string | undefined;
8
- } | undefined>;
9
- export declare const PlasmicItemContext: React.Context<(import("react-aria-components").ListBoxItemProps<object> & React.RefAttributes<HTMLDivElement> & {
10
- key?: import("react-aria").Key | undefined;
11
- }) | undefined>;
6
+ export declare const PlasmicPopoverContext: React.Context<import("./registerPopover").BasePopoverProps | undefined>;
7
+ export declare const PlasmicItemContext: React.Context<(import("react-aria-components").ListBoxItemProps<object> & React.RefAttributes<HTMLDivElement>) | undefined>;
12
8
  export declare const PlasmicSectionContext: React.Context<import("./registerSection").BaseSectionProps | undefined>;
13
9
  export declare const PlasmicHeaderContext: React.Context<(React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>) | undefined>;
14
10
  export declare const PlasmicInputContext: React.Context<import("./registerInput").BaseInputProps | undefined>;
@@ -22,9 +22,17 @@ const ARIA_COMPONENTS_INTERACTION_VARIANTS = {
22
22
  focusVisible: {
23
23
  cssSelector: "[data-focus-visible]",
24
24
  displayName: "Focus Visible"
25
+ },
26
+ dragging: {
27
+ cssSelector: "[data-dragging]",
28
+ displayName: "Dragging"
25
29
  }
26
30
  };
27
- function realWithObservedValues(children, changes, updateInteractionVariant) {
31
+ function ChangesObserver({
32
+ children,
33
+ changes,
34
+ updateInteractionVariant
35
+ }) {
28
36
  React__default.default.useEffect(() => {
29
37
  if (updateInteractionVariant) {
30
38
  updateInteractionVariant(changes);
@@ -32,6 +40,16 @@ function realWithObservedValues(children, changes, updateInteractionVariant) {
32
40
  }, [changes, updateInteractionVariant]);
33
41
  return children;
34
42
  }
43
+ function realWithObservedValues(children, changes, updateInteractionVariant) {
44
+ return /* @__PURE__ */ React__default.default.createElement(
45
+ ChangesObserver,
46
+ {
47
+ changes,
48
+ updateInteractionVariant
49
+ },
50
+ children
51
+ );
52
+ }
35
53
  function pickAriaComponentVariants(keys) {
36
54
  return {
37
55
  interactionVariants: Object.fromEntries(
@@ -42,4 +60,4 @@ function pickAriaComponentVariants(keys) {
42
60
  }
43
61
 
44
62
  exports.pickAriaComponentVariants = pickAriaComponentVariants;
45
- //# sourceMappingURL=interaction-variant-utils-80bf1cfd.cjs.js.map
63
+ //# sourceMappingURL=interaction-variant-utils-244b74fb.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interaction-variant-utils-244b74fb.cjs.js","sources":["../src/interaction-variant-utils.tsx"],"sourcesContent":["import { CodeComponentMeta } from \"@plasmicapp/host\";\nimport React from \"react\";\n\nconst ARIA_COMPONENTS_INTERACTION_VARIANTS = {\n hovered: {\n cssSelector: \"[data-hovered]\",\n displayName: \"Hovered\",\n },\n pressed: {\n cssSelector: \"[data-pressed]\",\n displayName: \"Pressed\",\n },\n focused: {\n cssSelector: \"[data-focused]\",\n displayName: \"Focused\",\n },\n focusVisible: {\n cssSelector: \"[data-focus-visible]\",\n displayName: \"Focus Visible\",\n },\n dragging: {\n cssSelector: \"[data-dragging]\",\n displayName: \"Dragging\",\n },\n};\n\ntype AriaInteractionVariant = keyof typeof ARIA_COMPONENTS_INTERACTION_VARIANTS;\n\ntype CodeComponentInteractionVariantsMeta = NonNullable<\n CodeComponentMeta<unknown>[\"interactionVariants\"]\n>;\n\ntype InteractionVariantMeta = CodeComponentInteractionVariantsMeta[string];\n\ntype ArrayElement<T> = T extends (infer U)[] ? U : never;\n\nexport type UpdateInteractionVariant<T extends AriaInteractionVariant[]> =\n | ((changes: Partial<Record<ArrayElement<T>, boolean>>) => void)\n | undefined;\n\ntype WithObservedValues<T extends AriaInteractionVariant[]> = (\n children: React.ReactNode,\n state: Record<ArrayElement<T>, boolean>,\n updateInteractionVariant: UpdateInteractionVariant<T>\n) => React.ReactNode;\n\nfunction ChangesObserver<T extends AriaInteractionVariant[]>({\n children,\n changes,\n updateInteractionVariant,\n}: {\n children: React.ReactNode;\n changes: Partial<Record<ArrayElement<T>, boolean>>;\n updateInteractionVariant?: UpdateInteractionVariant<T>;\n}) {\n React.useEffect(() => {\n if (updateInteractionVariant) {\n updateInteractionVariant(changes);\n }\n }, [changes, updateInteractionVariant]);\n return children;\n}\n\nfunction realWithObservedValues<T extends AriaInteractionVariant[]>(\n children: React.ReactNode,\n changes: Partial<Record<ArrayElement<T>, boolean>>,\n updateInteractionVariant?: UpdateInteractionVariant<T>\n) {\n return (\n <ChangesObserver\n changes={changes}\n updateInteractionVariant={updateInteractionVariant}\n >\n {children}\n </ChangesObserver>\n );\n}\n\nexport function pickAriaComponentVariants<T extends AriaInteractionVariant[]>(\n keys: T\n): {\n interactionVariants: Record<ArrayElement<T>, InteractionVariantMeta>;\n withObservedValues: WithObservedValues<T>;\n} {\n return {\n interactionVariants: Object.fromEntries(\n keys.map((key) => [key, ARIA_COMPONENTS_INTERACTION_VARIANTS[key]])\n ) as Record<ArrayElement<T>, InteractionVariantMeta>,\n withObservedValues: realWithObservedValues<T>,\n };\n}\n"],"names":["React"],"mappings":";;;;;;;;AAGA,MAAM,oCAAuC,GAAA;AAAA,EAC3C,OAAS,EAAA;AAAA,IACP,WAAa,EAAA,gBAAA;AAAA,IACb,WAAa,EAAA,SAAA;AAAA,GACf;AAAA,EACA,OAAS,EAAA;AAAA,IACP,WAAa,EAAA,gBAAA;AAAA,IACb,WAAa,EAAA,SAAA;AAAA,GACf;AAAA,EACA,OAAS,EAAA;AAAA,IACP,WAAa,EAAA,gBAAA;AAAA,IACb,WAAa,EAAA,SAAA;AAAA,GACf;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,WAAa,EAAA,sBAAA;AAAA,IACb,WAAa,EAAA,eAAA;AAAA,GACf;AAAA,EACA,QAAU,EAAA;AAAA,IACR,WAAa,EAAA,iBAAA;AAAA,IACb,WAAa,EAAA,UAAA;AAAA,GACf;AACF,CAAA,CAAA;AAsBA,SAAS,eAAoD,CAAA;AAAA,EAC3D,QAAA;AAAA,EACA,OAAA;AAAA,EACA,wBAAA;AACF,CAIG,EAAA;AACD,EAAAA,sBAAA,CAAM,UAAU,MAAM;AACpB,IAAA,IAAI,wBAA0B,EAAA;AAC5B,MAAA,wBAAA,CAAyB,OAAO,CAAA,CAAA;AAAA,KAClC;AAAA,GACC,EAAA,CAAC,OAAS,EAAA,wBAAwB,CAAC,CAAA,CAAA;AACtC,EAAO,OAAA,QAAA,CAAA;AACT,CAAA;AAEA,SAAS,sBAAA,CACP,QACA,EAAA,OAAA,EACA,wBACA,EAAA;AACA,EACE,uBAAAA,sBAAA,CAAA,aAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,wBAAA;AAAA,KAAA;AAAA,IAEC,QAAA;AAAA,GACH,CAAA;AAEJ,CAAA;AAEO,SAAS,0BACd,IAIA,EAAA;AACA,EAAO,OAAA;AAAA,IACL,qBAAqB,MAAO,CAAA,WAAA;AAAA,MAC1B,IAAA,CAAK,IAAI,CAAC,GAAA,KAAQ,CAAC,GAAK,EAAA,oCAAA,CAAqC,GAAG,CAAC,CAAC,CAAA;AAAA,KACpE;AAAA,IACA,kBAAoB,EAAA,sBAAA;AAAA,GACtB,CAAA;AACF;;;;"}
@@ -16,9 +16,17 @@ const ARIA_COMPONENTS_INTERACTION_VARIANTS = {
16
16
  focusVisible: {
17
17
  cssSelector: "[data-focus-visible]",
18
18
  displayName: "Focus Visible"
19
+ },
20
+ dragging: {
21
+ cssSelector: "[data-dragging]",
22
+ displayName: "Dragging"
19
23
  }
20
24
  };
21
- function realWithObservedValues(children, changes, updateInteractionVariant) {
25
+ function ChangesObserver({
26
+ children,
27
+ changes,
28
+ updateInteractionVariant
29
+ }) {
22
30
  React.useEffect(() => {
23
31
  if (updateInteractionVariant) {
24
32
  updateInteractionVariant(changes);
@@ -26,6 +34,16 @@ function realWithObservedValues(children, changes, updateInteractionVariant) {
26
34
  }, [changes, updateInteractionVariant]);
27
35
  return children;
28
36
  }
37
+ function realWithObservedValues(children, changes, updateInteractionVariant) {
38
+ return /* @__PURE__ */ React.createElement(
39
+ ChangesObserver,
40
+ {
41
+ changes,
42
+ updateInteractionVariant
43
+ },
44
+ children
45
+ );
46
+ }
29
47
  function pickAriaComponentVariants(keys) {
30
48
  return {
31
49
  interactionVariants: Object.fromEntries(
@@ -36,4 +54,4 @@ function pickAriaComponentVariants(keys) {
36
54
  }
37
55
 
38
56
  export { pickAriaComponentVariants as p };
39
- //# sourceMappingURL=interaction-variant-utils-608d984b.esm.js.map
57
+ //# sourceMappingURL=interaction-variant-utils-c44a9d56.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interaction-variant-utils-c44a9d56.esm.js","sources":["../src/interaction-variant-utils.tsx"],"sourcesContent":["import { CodeComponentMeta } from \"@plasmicapp/host\";\nimport React from \"react\";\n\nconst ARIA_COMPONENTS_INTERACTION_VARIANTS = {\n hovered: {\n cssSelector: \"[data-hovered]\",\n displayName: \"Hovered\",\n },\n pressed: {\n cssSelector: \"[data-pressed]\",\n displayName: \"Pressed\",\n },\n focused: {\n cssSelector: \"[data-focused]\",\n displayName: \"Focused\",\n },\n focusVisible: {\n cssSelector: \"[data-focus-visible]\",\n displayName: \"Focus Visible\",\n },\n dragging: {\n cssSelector: \"[data-dragging]\",\n displayName: \"Dragging\",\n },\n};\n\ntype AriaInteractionVariant = keyof typeof ARIA_COMPONENTS_INTERACTION_VARIANTS;\n\ntype CodeComponentInteractionVariantsMeta = NonNullable<\n CodeComponentMeta<unknown>[\"interactionVariants\"]\n>;\n\ntype InteractionVariantMeta = CodeComponentInteractionVariantsMeta[string];\n\ntype ArrayElement<T> = T extends (infer U)[] ? U : never;\n\nexport type UpdateInteractionVariant<T extends AriaInteractionVariant[]> =\n | ((changes: Partial<Record<ArrayElement<T>, boolean>>) => void)\n | undefined;\n\ntype WithObservedValues<T extends AriaInteractionVariant[]> = (\n children: React.ReactNode,\n state: Record<ArrayElement<T>, boolean>,\n updateInteractionVariant: UpdateInteractionVariant<T>\n) => React.ReactNode;\n\nfunction ChangesObserver<T extends AriaInteractionVariant[]>({\n children,\n changes,\n updateInteractionVariant,\n}: {\n children: React.ReactNode;\n changes: Partial<Record<ArrayElement<T>, boolean>>;\n updateInteractionVariant?: UpdateInteractionVariant<T>;\n}) {\n React.useEffect(() => {\n if (updateInteractionVariant) {\n updateInteractionVariant(changes);\n }\n }, [changes, updateInteractionVariant]);\n return children;\n}\n\nfunction realWithObservedValues<T extends AriaInteractionVariant[]>(\n children: React.ReactNode,\n changes: Partial<Record<ArrayElement<T>, boolean>>,\n updateInteractionVariant?: UpdateInteractionVariant<T>\n) {\n return (\n <ChangesObserver\n changes={changes}\n updateInteractionVariant={updateInteractionVariant}\n >\n {children}\n </ChangesObserver>\n );\n}\n\nexport function pickAriaComponentVariants<T extends AriaInteractionVariant[]>(\n keys: T\n): {\n interactionVariants: Record<ArrayElement<T>, InteractionVariantMeta>;\n withObservedValues: WithObservedValues<T>;\n} {\n return {\n interactionVariants: Object.fromEntries(\n keys.map((key) => [key, ARIA_COMPONENTS_INTERACTION_VARIANTS[key]])\n ) as Record<ArrayElement<T>, InteractionVariantMeta>,\n withObservedValues: realWithObservedValues<T>,\n };\n}\n"],"names":[],"mappings":";;AAGA,MAAM,oCAAuC,GAAA;AAAA,EAC3C,OAAS,EAAA;AAAA,IACP,WAAa,EAAA,gBAAA;AAAA,IACb,WAAa,EAAA,SAAA;AAAA,GACf;AAAA,EACA,OAAS,EAAA;AAAA,IACP,WAAa,EAAA,gBAAA;AAAA,IACb,WAAa,EAAA,SAAA;AAAA,GACf;AAAA,EACA,OAAS,EAAA;AAAA,IACP,WAAa,EAAA,gBAAA;AAAA,IACb,WAAa,EAAA,SAAA;AAAA,GACf;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,WAAa,EAAA,sBAAA;AAAA,IACb,WAAa,EAAA,eAAA;AAAA,GACf;AAAA,EACA,QAAU,EAAA;AAAA,IACR,WAAa,EAAA,iBAAA;AAAA,IACb,WAAa,EAAA,UAAA;AAAA,GACf;AACF,CAAA,CAAA;AAsBA,SAAS,eAAoD,CAAA;AAAA,EAC3D,QAAA;AAAA,EACA,OAAA;AAAA,EACA,wBAAA;AACF,CAIG,EAAA;AACD,EAAA,KAAA,CAAM,UAAU,MAAM;AACpB,IAAA,IAAI,wBAA0B,EAAA;AAC5B,MAAA,wBAAA,CAAyB,OAAO,CAAA,CAAA;AAAA,KAClC;AAAA,GACC,EAAA,CAAC,OAAS,EAAA,wBAAwB,CAAC,CAAA,CAAA;AACtC,EAAO,OAAA,QAAA,CAAA;AACT,CAAA;AAEA,SAAS,sBAAA,CACP,QACA,EAAA,OAAA,EACA,wBACA,EAAA;AACA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,wBAAA;AAAA,KAAA;AAAA,IAEC,QAAA;AAAA,GACH,CAAA;AAEJ,CAAA;AAEO,SAAS,0BACd,IAIA,EAAA;AACA,EAAO,OAAA;AAAA,IACL,qBAAqB,MAAO,CAAA,WAAA;AAAA,MAC1B,IAAA,CAAK,IAAI,CAAC,GAAA,KAAQ,CAAC,GAAK,EAAA,oCAAA,CAAqC,GAAG,CAAC,CAAC,CAAA;AAAA,KACpE;AAAA,IACA,kBAAoB,EAAA,sBAAA;AAAA,GACtB,CAAA;AACF;;;;"}
@@ -17,6 +17,10 @@ declare const ARIA_COMPONENTS_INTERACTION_VARIANTS: {
17
17
  cssSelector: string;
18
18
  displayName: string;
19
19
  };
20
+ dragging: {
21
+ cssSelector: string;
22
+ displayName: string;
23
+ };
20
24
  };
21
25
  type AriaInteractionVariant = keyof typeof ARIA_COMPONENTS_INTERACTION_VARIANTS;
22
26
  type CodeComponentInteractionVariantsMeta = NonNullable<CodeComponentMeta<unknown>["interactionVariants"]>;
@@ -16,26 +16,26 @@ function deriveStrictOptions(props) {
16
16
  return void 0;
17
17
  } else if (typeof op === "string" || typeof op === "number") {
18
18
  const item = {
19
- value: op
19
+ id: op
20
20
  };
21
21
  return item;
22
22
  } else if (optionInfo) {
23
23
  const info = optionInfo(op);
24
- if (info.type === "section") {
24
+ if (info.type === "option-group") {
25
25
  const section = {
26
- type: "section",
26
+ type: "option-group",
27
27
  items: (_c = (_b = (_a2 = info.items) == null ? void 0 : _a2.map) == null ? void 0 : _b.call(_a2, (item) => makeStrict(item))) == null ? void 0 : _c.filter((x) => !!x),
28
28
  label: info.label,
29
- key: `section-${sectionCount}`
29
+ key: `option-group-${sectionCount}`
30
30
  };
31
31
  sectionCount += 1;
32
32
  return section;
33
33
  } else {
34
34
  let item = info;
35
- if (!("value" in item)) {
35
+ if (!("id" in item)) {
36
36
  item = {
37
- type: "item",
38
- value: JSON.stringify(item)
37
+ type: "option",
38
+ id: JSON.stringify(item)
39
39
  };
40
40
  }
41
41
  return item;
@@ -43,19 +43,19 @@ function deriveStrictOptions(props) {
43
43
  } else if (typeof op === "object") {
44
44
  if ("items" in op) {
45
45
  const section = {
46
- type: "section",
46
+ type: "option-group",
47
47
  items: (_f = (_e = (_d = op.items) == null ? void 0 : _d.map) == null ? void 0 : _e.call(_d, (item) => makeStrict(item))) == null ? void 0 : _f.filter((x) => !!x),
48
48
  label: op.label,
49
- key: `section-${sectionCount}`
49
+ key: `option-group-${sectionCount}`
50
50
  };
51
51
  sectionCount += 1;
52
52
  return section;
53
53
  } else {
54
54
  let item = op;
55
- if (!("value" in item)) {
55
+ if (!("id" in item)) {
56
56
  item = {
57
- type: "item",
58
- value: JSON.stringify(item)
57
+ type: "option",
58
+ id: JSON.stringify(item)
59
59
  };
60
60
  }
61
61
  return item;
@@ -67,7 +67,7 @@ function deriveStrictOptions(props) {
67
67
  const strictOptions = (_a = options == null ? void 0 : options.map(makeStrict)) == null ? void 0 : _a.filter((x) => !!x);
68
68
  const optionText = (op) => {
69
69
  var _a2;
70
- return (_a2 = op.label) != null ? _a2 : op.value;
70
+ return (_a2 = op.label) != null ? _a2 : op.id;
71
71
  };
72
72
  return { options: strictOptions, optionText };
73
73
  }
@@ -78,7 +78,7 @@ function flattenOptions(options) {
78
78
  return options.flatMap(
79
79
  (op) => {
80
80
  var _a;
81
- return op.type === "section" ? (_a = op.items) != null ? _a : [] : op;
81
+ return op.type === "option-group" ? (_a = op.items) != null ? _a : [] : op;
82
82
  }
83
83
  );
84
84
  }
@@ -88,7 +88,7 @@ function makeOptionsPropType() {
88
88
  type: "array",
89
89
  itemType: {
90
90
  type: "object",
91
- nameFunc: (item) => item.label || item.value,
91
+ nameFunc: (item) => item.label || item.id,
92
92
  fields: {
93
93
  type: {
94
94
  type: "choice",
@@ -98,7 +98,7 @@ function makeOptionsPropType() {
98
98
  ],
99
99
  defaultValue: "option"
100
100
  },
101
- value: {
101
+ id: {
102
102
  type: "string",
103
103
  hidden: (_ps, _ctx, { item }) => item.type !== "option"
104
104
  },
@@ -111,9 +111,9 @@ function makeOptionsPropType() {
111
111
  },
112
112
  itemType: {
113
113
  type: "object",
114
- nameFunc: (item) => item.label || item.value,
114
+ nameFunc: (item) => item.label || item.id,
115
115
  fields: {
116
- value: "string",
116
+ id: "string",
117
117
  label: "string"
118
118
  }
119
119
  }
@@ -122,12 +122,12 @@ function makeOptionsPropType() {
122
122
  },
123
123
  defaultValue: [
124
124
  {
125
- value: "option1",
125
+ id: "option1",
126
126
  label: "Option 1",
127
127
  type: "option"
128
128
  },
129
129
  {
130
- value: "option2",
130
+ id: "option2",
131
131
  label: "Option 2",
132
132
  type: "option"
133
133
  }
@@ -141,7 +141,7 @@ function makeValuePropType() {
141
141
  options: (ps) => {
142
142
  const { options, optionText } = deriveStrictOptions(ps);
143
143
  return flattenOptions(options).map((op) => ({
144
- value: op.value,
144
+ value: op.id,
145
145
  label: optionText(op)
146
146
  }));
147
147
  }
@@ -150,4 +150,4 @@ function makeValuePropType() {
150
150
  }
151
151
 
152
152
  export { makeValuePropType as a, flattenOptions as f, makeOptionsPropType as m, useStrictOptions as u };
153
- //# sourceMappingURL=option-utils-765a1782.esm.js.map
153
+ //# sourceMappingURL=option-utils-4f037568.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"option-utils-4f037568.esm.js","sources":["../src/option-utils.ts"],"sourcesContent":["import type { ArrayType, ChoiceType } from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport interface ObjectSectionType<T extends object> {\n label?: string;\n items?: ObjectItemType<T>[];\n}\ninterface FlexSectionType<T extends object> {\n label?: string;\n items?: FlexItemType<T>[];\n}\n\nexport type ObjectItemType<T extends object> = StrictOptionType | T;\ntype FlexItemType<T extends object> = ObjectItemType<T> | string;\n\nexport type FlexOptionType<T extends object> =\n | FlexItemType<T>\n | FlexSectionType<T>;\n\nexport type ObjectOptionType<T extends object> =\n | ObjectSectionType<T>\n | ObjectItemType<T>;\n\nexport interface HasOptions<T extends object> {\n options?: FlexOptionType<T>[];\n optionInfo?: (option: FlexOptionType<T>) => StrictOptionType;\n}\n\nexport interface StrictItemType {\n type?: \"option\";\n id: string;\n label?: string;\n isDisabled?: boolean;\n}\n\nexport interface StrictSectionType {\n type: \"option-group\";\n label?: string;\n items?: StrictItemType[];\n key: string;\n}\n\nexport type StrictOptionType = StrictItemType | StrictSectionType;\n\nexport function useStrictOptions<T extends object>(props: HasOptions<T>) {\n const { options, optionInfo } = props;\n return React.useMemo(() => {\n return deriveStrictOptions({ options, optionInfo });\n }, [options, optionInfo]);\n}\n\nexport function deriveStrictOptions<T extends object>(props: HasOptions<T>) {\n const { options, optionInfo } = props;\n let sectionCount = 0;\n\n const makeStrict = (op: FlexOptionType<T>): StrictOptionType | undefined => {\n if (!op) {\n return undefined;\n } else if (typeof op === \"string\" || typeof op === \"number\") {\n const item = {\n id: op,\n };\n return item;\n } else if (optionInfo) {\n const info = optionInfo(op);\n if (info.type === \"option-group\") {\n const section: StrictSectionType = {\n type: \"option-group\",\n items: info.items\n ?.map?.((item) => makeStrict(item) as StrictItemType)\n ?.filter((x) => !!x),\n label: info.label,\n key: `option-group-${sectionCount}`,\n };\n sectionCount += 1;\n return section;\n } else {\n let item = info;\n if (!(\"id\" in item)) {\n item = {\n type: \"option\",\n id: JSON.stringify(item),\n };\n }\n return item;\n }\n } else if (typeof op === \"object\") {\n if (\"items\" in op) {\n const section: StrictSectionType = {\n type: \"option-group\",\n items: op.items\n ?.map?.((item) => makeStrict(item) as StrictItemType)\n ?.filter((x) => !!x),\n label: op.label,\n key: `option-group-${sectionCount}`,\n };\n sectionCount += 1;\n return section;\n } else {\n let item = op;\n if (!(\"id\" in item)) {\n item = {\n type: \"option\",\n id: JSON.stringify(item),\n };\n }\n return item;\n }\n } else {\n return undefined;\n }\n };\n\n const strictOptions = options\n ?.map(makeStrict)\n ?.filter((x): x is StrictOptionType => !!x);\n\n const optionText = (op: StrictItemType) => {\n return op.label ?? op.id;\n };\n\n return { options: strictOptions, optionText };\n}\n\nexport function flattenOptions(\n options: (StrictItemType | StrictSectionType)[] | undefined\n): StrictItemType[] {\n if (!options) {\n return [];\n } else {\n return options.flatMap((op) =>\n op.type === \"option-group\" ? op.items ?? [] : op\n );\n }\n}\n\nexport function makeOptionsPropType() {\n const type: ArrayType<HasOptions<any>> = {\n type: \"array\",\n itemType: {\n type: \"object\",\n nameFunc: (item: any) => item.label || item.id,\n fields: {\n type: {\n type: \"choice\",\n options: [\n { value: \"option\", label: \"Option\" },\n { value: \"option-group\", label: \"Option Group\" },\n ],\n defaultValue: \"option\",\n },\n id: {\n type: \"string\",\n hidden: (_ps: any, _ctx: any, { item }: any) =>\n item.type !== \"option\",\n },\n label: \"string\",\n items: {\n type: \"array\",\n displayName: \"Options\",\n hidden: (_ps: any, _ctx: any, { item }: any) => {\n return item.type !== \"option-group\";\n },\n itemType: {\n type: \"object\",\n nameFunc: (item: any) => item.label || item.id,\n fields: {\n id: \"string\",\n label: \"string\",\n },\n },\n },\n },\n },\n defaultValue: [\n {\n id: \"option1\",\n label: \"Option 1\",\n type: \"option\",\n },\n {\n id: \"option2\",\n label: \"Option 2\",\n type: \"option\",\n },\n ],\n };\n return type;\n}\n\nexport function makeValuePropType() {\n const type: ChoiceType<HasOptions<any>> = {\n type: \"choice\",\n options: (ps: HasOptions<any>) => {\n const { options, optionText } = deriveStrictOptions(ps);\n return flattenOptions(options).map((op) => ({\n value: op.id,\n label: optionText(op),\n }));\n },\n };\n return type;\n}\n"],"names":["_a"],"mappings":";;AA4CO,SAAS,iBAAmC,KAAsB,EAAA;AACvE,EAAM,MAAA,EAAE,OAAS,EAAA,UAAA,EAAe,GAAA,KAAA,CAAA;AAChC,EAAO,OAAA,KAAA,CAAM,QAAQ,MAAM;AACzB,IAAA,OAAO,mBAAoB,CAAA,EAAE,OAAS,EAAA,UAAA,EAAY,CAAA,CAAA;AAAA,GACjD,EAAA,CAAC,OAAS,EAAA,UAAU,CAAC,CAAA,CAAA;AAC1B,CAAA;AAEO,SAAS,oBAAsC,KAAsB,EAAA;AAnD5E,EAAA,IAAA,EAAA,CAAA;AAoDE,EAAM,MAAA,EAAE,OAAS,EAAA,UAAA,EAAe,GAAA,KAAA,CAAA;AAChC,EAAA,IAAI,YAAe,GAAA,CAAA,CAAA;AAEnB,EAAM,MAAA,UAAA,GAAa,CAAC,EAAwD,KAAA;AAvD9E,IAAA,IAAAA,GAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAwDI,IAAA,IAAI,CAAC,EAAI,EAAA;AACP,MAAO,OAAA,KAAA,CAAA,CAAA;AAAA,eACE,OAAO,EAAA,KAAO,QAAY,IAAA,OAAO,OAAO,QAAU,EAAA;AAC3D,MAAA,MAAM,IAAO,GAAA;AAAA,QACX,EAAI,EAAA,EAAA;AAAA,OACN,CAAA;AACA,MAAO,OAAA,IAAA,CAAA;AAAA,eACE,UAAY,EAAA;AACrB,MAAM,MAAA,IAAA,GAAO,WAAW,EAAE,CAAA,CAAA;AAC1B,MAAI,IAAA,IAAA,CAAK,SAAS,cAAgB,EAAA;AAChC,QAAA,MAAM,OAA6B,GAAA;AAAA,UACjC,IAAM,EAAA,cAAA;AAAA,UACN,KAAA,EAAA,CAAO,YAAAA,GAAA,GAAA,IAAA,CAAK,UAAL,IAAAA,GAAAA,K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