@plasmicapp/react-web 0.2.301 → 0.2.302

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.
package/dist/all.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import * as React$1 from 'react';
3
- import React__default, { AriaAttributes, DOMAttributes as DOMAttributes$1, AriaRole, CSSProperties as CSSProperties$1, Key, ReactNode, ReactElement, FocusEvent, KeyboardEvent as KeyboardEvent$1, SyntheticEvent } from 'react';
3
+ import React__default, { AriaAttributes, DOMAttributes as DOMAttributes$1, AriaRole, CSSProperties as CSSProperties$1, Key, ReactNode, ReactElement, FocusEvent, KeyboardEvent as KeyboardEvent$3, SyntheticEvent } from 'react';
4
4
 
5
5
  // LICENSE is MIT
6
6
  //
@@ -11472,6 +11472,10 @@ interface PropTypeBase<P> {
11472
11472
  * (This behavior only applies to canvas)
11473
11473
  */
11474
11474
  forceRemount?: boolean;
11475
+ /**
11476
+ * If true, the prop can't be overriden in different variants.
11477
+ */
11478
+ invariantable?: boolean;
11475
11479
  }
11476
11480
  interface Defaultable<P, T> {
11477
11481
  /**
@@ -12474,7 +12478,7 @@ declare const Stack: (<T extends keyof JSX.IntrinsicElements = "div">(props: {
12474
12478
 
12475
12479
 
12476
12480
 
12477
- interface AriaLabelingProps {
12481
+ interface AriaLabelingProps$2 {
12478
12482
  /**
12479
12483
  * Defines a string value that labels the current element.
12480
12484
  */
@@ -12496,24 +12500,16 @@ interface AriaLabelingProps {
12496
12500
  'aria-details'?: string
12497
12501
  }
12498
12502
 
12499
- interface AriaValidationProps {
12500
- // https://www.w3.org/TR/wai-aria-1.2/#aria-errormessage
12501
- /**
12502
- * Identifies the element that provides an error message for the object.
12503
- */
12504
- 'aria-errormessage'?: string
12505
- }
12506
-
12507
12503
  // A set of common DOM props that are allowed on any component
12508
12504
  // Ensure this is synced with DOMPropNames in filterDOMProps
12509
- interface DOMProps {
12505
+ interface DOMProps$2 {
12510
12506
  /**
12511
12507
  * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
12512
12508
  */
12513
12509
  id?: string
12514
12510
  }
12515
12511
 
12516
- interface FocusableDOMProps extends DOMProps {
12512
+ interface FocusableDOMProps$2 extends DOMProps$2 {
12517
12513
  /**
12518
12514
  * Whether to exclude the element from the sequential tab order. If true,
12519
12515
  * the element will not be focusable via the keyboard by tabbing. This should
@@ -12523,13 +12519,6 @@ interface FocusableDOMProps extends DOMProps {
12523
12519
  excludeFromTabOrder?: boolean
12524
12520
  }
12525
12521
 
12526
- interface InputDOMProps {
12527
- /**
12528
- * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
12529
- */
12530
- name?: string
12531
- }
12532
-
12533
12522
  /** Any focusable element, including both HTML and SVG elements. */
12534
12523
  interface FocusableElement extends Element, HTMLOrSVGElement {}
12535
12524
 
@@ -12556,18 +12545,7 @@ interface DOMAttributes<T = FocusableElement> extends AriaAttributes, DOMAttribu
12556
12545
 
12557
12546
 
12558
12547
 
12559
- type ValidationState = 'valid' | 'invalid';
12560
-
12561
- interface Validation {
12562
- /** Whether user input is required on the input before form submission. */
12563
- isRequired?: boolean,
12564
- /** Whether the input value is invalid. */
12565
- isInvalid?: boolean,
12566
- /** @deprecated Use `isInvalid` instead. */
12567
- validationState?: ValidationState
12568
- }
12569
-
12570
- interface InputBase {
12548
+ interface InputBase$2 {
12571
12549
  /** Whether the input is disabled. */
12572
12550
  isDisabled?: boolean,
12573
12551
  /** Whether the input can be selected but not changed by the user. */
@@ -12699,7 +12677,7 @@ interface Node<T> {
12699
12677
 
12700
12678
  // Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
12701
12679
  // is not to propagate. This can be overridden by calling continuePropagation() on the event.
12702
- type BaseEvent<T extends SyntheticEvent> = T & {
12680
+ type BaseEvent$2<T extends SyntheticEvent> = T & {
12703
12681
  /**
12704
12682
  * Use continuePropagation.
12705
12683
  * @deprecated */
@@ -12707,7 +12685,7 @@ type BaseEvent<T extends SyntheticEvent> = T & {
12707
12685
  continuePropagation(): void
12708
12686
  }
12709
12687
 
12710
- type KeyboardEvent = BaseEvent<KeyboardEvent$1<any>>;
12688
+ type KeyboardEvent$2 = BaseEvent$2<KeyboardEvent$3<any>>;
12711
12689
 
12712
12690
  type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';
12713
12691
 
@@ -12739,14 +12717,14 @@ interface LongPressEvent extends Omit<PressEvent, 'type' | 'continuePropagation'
12739
12717
  type: 'longpressstart' | 'longpressend' | 'longpress'
12740
12718
  }
12741
12719
 
12742
- interface KeyboardEvents {
12720
+ interface KeyboardEvents$2 {
12743
12721
  /** Handler that is called when a key is pressed. */
12744
- onKeyDown?: (e: KeyboardEvent) => void,
12722
+ onKeyDown?: (e: KeyboardEvent$2) => void,
12745
12723
  /** Handler that is called when a key is released. */
12746
- onKeyUp?: (e: KeyboardEvent) => void
12724
+ onKeyUp?: (e: KeyboardEvent$2) => void
12747
12725
  }
12748
12726
 
12749
- interface FocusEvents<Target = Element> {
12727
+ interface FocusEvents$2<Target = Element> {
12750
12728
  /** Handler that is called when the element receives focus. */
12751
12729
  onFocus?: (e: FocusEvent<Target>) => void,
12752
12730
  /** Handler that is called when the element loses focus. */
@@ -12755,7 +12733,7 @@ interface FocusEvents<Target = Element> {
12755
12733
  onFocusChange?: (isFocused: boolean) => void
12756
12734
  }
12757
12735
 
12758
- interface FocusableProps<Target = Element> extends FocusEvents<Target>, KeyboardEvents {
12736
+ interface FocusableProps$2<Target = Element> extends FocusEvents$2<Target>, KeyboardEvents$2 {
12759
12737
  /** Whether the element should receive focus on render. */
12760
12738
  autoFocus?: boolean
12761
12739
  }
@@ -12886,7 +12864,172 @@ declare function useButton<P extends PlumeButtonProps, C extends AnyPlasmicClass
12886
12864
 
12887
12865
 
12888
12866
 
12889
- interface ToggleProps extends InputBase, Validation, FocusableProps {
12867
+ interface AriaLabelingProps$1 {
12868
+ /**
12869
+ * Defines a string value that labels the current element.
12870
+ */
12871
+ 'aria-label'?: string,
12872
+
12873
+ /**
12874
+ * Identifies the element (or elements) that labels the current element.
12875
+ */
12876
+ 'aria-labelledby'?: string,
12877
+
12878
+ /**
12879
+ * Identifies the element (or elements) that describes the object.
12880
+ */
12881
+ 'aria-describedby'?: string,
12882
+
12883
+ /**
12884
+ * Identifies the element (or elements) that provide a detailed, extended description for the object.
12885
+ */
12886
+ 'aria-details'?: string
12887
+ }
12888
+
12889
+ interface AriaValidationProps {
12890
+ // https://www.w3.org/TR/wai-aria-1.2/#aria-errormessage
12891
+ /**
12892
+ * Identifies the element that provides an error message for the object.
12893
+ */
12894
+ 'aria-errormessage'?: string
12895
+ }
12896
+
12897
+ // A set of common DOM props that are allowed on any component
12898
+ // Ensure this is synced with DOMPropNames in filterDOMProps
12899
+ interface DOMProps$1 {
12900
+ /**
12901
+ * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
12902
+ */
12903
+ id?: string
12904
+ }
12905
+
12906
+ interface FocusableDOMProps$1 extends DOMProps$1 {
12907
+ /**
12908
+ * Whether to exclude the element from the sequential tab order. If true,
12909
+ * the element will not be focusable via the keyboard by tabbing. This should
12910
+ * be avoided except in rare scenarios where an alternative means of accessing
12911
+ * the element or its functionality via the keyboard is available.
12912
+ */
12913
+ excludeFromTabOrder?: boolean
12914
+ }
12915
+
12916
+ interface InputDOMProps$1 {
12917
+ /**
12918
+ * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
12919
+ */
12920
+ name?: string
12921
+ }
12922
+
12923
+ /*
12924
+ * Copyright 2020 Adobe. All rights reserved.
12925
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12926
+ * you may not use this file except in compliance with the License. You may obtain a copy
12927
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
12928
+ *
12929
+ * Unless required by applicable law or agreed to in writing, software distributed under
12930
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12931
+ * OF ANY KIND, either express or implied. See the License for the specific language
12932
+ * governing permissions and limitations under the License.
12933
+ */
12934
+
12935
+
12936
+
12937
+ type ValidationState = 'valid' | 'invalid';
12938
+
12939
+ type ValidationError = string | string[];
12940
+
12941
+ interface Validation<T> {
12942
+ /** Whether user input is required on the input before form submission. */
12943
+ isRequired?: boolean,
12944
+ /** Whether the input value is invalid. */
12945
+ isInvalid?: boolean,
12946
+ /** @deprecated Use `isInvalid` instead. */
12947
+ validationState?: ValidationState,
12948
+ /**
12949
+ * Whether to use native HTML form validation to prevent form submission
12950
+ * when the value is missing or invalid, or mark the field as required
12951
+ * or invalid via ARIA.
12952
+ * @default 'aria'
12953
+ */
12954
+ validationBehavior?: 'aria' | 'native',
12955
+ /**
12956
+ * A function that returns an error message if a given value is invalid.
12957
+ * Validation errors are displayed to the user when the form is submitted
12958
+ * if `validationBehavior="native"`. For realtime validation, use the `isInvalid`
12959
+ * prop instead.
12960
+ */
12961
+ validate?: (value: T) => ValidationError | true | null | undefined
12962
+ }
12963
+
12964
+ interface InputBase$1 {
12965
+ /** Whether the input is disabled. */
12966
+ isDisabled?: boolean,
12967
+ /** Whether the input can be selected but not changed by the user. */
12968
+ isReadOnly?: boolean
12969
+ }
12970
+
12971
+ /*
12972
+ * Copyright 2020 Adobe. All rights reserved.
12973
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12974
+ * you may not use this file except in compliance with the License. You may obtain a copy
12975
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
12976
+ *
12977
+ * Unless required by applicable law or agreed to in writing, software distributed under
12978
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12979
+ * OF ANY KIND, either express or implied. See the License for the specific language
12980
+ * governing permissions and limitations under the License.
12981
+ */
12982
+
12983
+
12984
+
12985
+ // Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
12986
+ // is not to propagate. This can be overridden by calling continuePropagation() on the event.
12987
+ type BaseEvent$1<T extends SyntheticEvent> = T & {
12988
+ /**
12989
+ * Use continuePropagation.
12990
+ * @deprecated */
12991
+ stopPropagation(): void,
12992
+ continuePropagation(): void
12993
+ }
12994
+
12995
+ type KeyboardEvent$1 = BaseEvent$1<KeyboardEvent$3<any>>;
12996
+
12997
+ interface KeyboardEvents$1 {
12998
+ /** Handler that is called when a key is pressed. */
12999
+ onKeyDown?: (e: KeyboardEvent$1) => void,
13000
+ /** Handler that is called when a key is released. */
13001
+ onKeyUp?: (e: KeyboardEvent$1) => void
13002
+ }
13003
+
13004
+ interface FocusEvents$1<Target = Element> {
13005
+ /** Handler that is called when the element receives focus. */
13006
+ onFocus?: (e: FocusEvent<Target>) => void,
13007
+ /** Handler that is called when the element loses focus. */
13008
+ onBlur?: (e: FocusEvent<Target>) => void,
13009
+ /** Handler that is called when the element's focus status changes. */
13010
+ onFocusChange?: (isFocused: boolean) => void
13011
+ }
13012
+
13013
+ interface FocusableProps$1<Target = Element> extends FocusEvents$1<Target>, KeyboardEvents$1 {
13014
+ /** Whether the element should receive focus on render. */
13015
+ autoFocus?: boolean
13016
+ }
13017
+
13018
+ /*
13019
+ * Copyright 2020 Adobe. All rights reserved.
13020
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13021
+ * you may not use this file except in compliance with the License. You may obtain a copy
13022
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
13023
+ *
13024
+ * Unless required by applicable law or agreed to in writing, software distributed under
13025
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13026
+ * OF ANY KIND, either express or implied. See the License for the specific language
13027
+ * governing permissions and limitations under the License.
13028
+ */
13029
+
13030
+
13031
+
13032
+ interface ToggleProps extends InputBase$1, Validation<boolean>, FocusableProps$1 {
12890
13033
  /**
12891
13034
  * The label for the element.
12892
13035
  */
@@ -12909,7 +13052,7 @@ interface ToggleProps extends InputBase, Validation, FocusableProps {
12909
13052
  value?: string
12910
13053
  }
12911
13054
 
12912
- interface AriaToggleProps extends ToggleProps, FocusableDOMProps, AriaLabelingProps, AriaValidationProps, InputDOMProps {
13055
+ interface AriaToggleProps extends ToggleProps, FocusableDOMProps$1, AriaLabelingProps$1, AriaValidationProps, InputDOMProps$1 {
12913
13056
  /**
12914
13057
  * Identifies the element (or elements) whose contents or presence are controlled by the current element.
12915
13058
  */
@@ -12975,7 +13118,7 @@ declare function useCheckbox<P extends CheckboxProps, C extends AnyPlasmicClass>
12975
13118
  state: CheckboxState;
12976
13119
  };
12977
13120
 
12978
- interface BaseMenuProps extends DOMProps, AriaLabelingProps, StyleProps {
13121
+ interface BaseMenuProps extends DOMProps$2, AriaLabelingProps$2, StyleProps {
12979
13122
  /**
12980
13123
  * List of `Menu.Item`s or `Menu.Group`s that make up the menu
12981
13124
  */
@@ -13217,7 +13360,7 @@ interface DropdownMenuProps {
13217
13360
  }
13218
13361
  declare function DropdownMenu(props: DropdownMenuProps): React$1.JSX.Element;
13219
13362
 
13220
- interface BaseMenuButtonProps extends DOMProps, FocusableProps, StyleProps, Pick<React$1.ComponentProps<"button">, "title"> {
13363
+ interface BaseMenuButtonProps extends DOMProps$2, FocusableProps$2, StyleProps, Pick<React$1.ComponentProps<"button">, "title"> {
13221
13364
  /**
13222
13365
  * The menu to show; can either be a Menu instance, or a function that returns a Menu
13223
13366
  * instance if you want to defer creating the instance till when it's opened.
@@ -13283,7 +13426,7 @@ declare function useMenuButton<P extends BaseMenuButtonProps, C extends AnyPlasm
13283
13426
  state: MenuButtonState;
13284
13427
  };
13285
13428
 
13286
- interface BaseSelectProps extends DOMProps, AriaLabelingProps, FocusableDOMProps, InputBase, FocusableProps, StyleProps {
13429
+ interface BaseSelectProps extends DOMProps$2, AriaLabelingProps$2, FocusableDOMProps$2, InputBase$2, FocusableProps$2, StyleProps {
13287
13430
  /**
13288
13431
  * Key of the currently selected value
13289
13432
  */
@@ -13640,6 +13783,136 @@ declare const SelectContext: React$1.Context<ListState<any> | undefined>;
13640
13783
 
13641
13784
 
13642
13785
 
13786
+ interface AriaLabelingProps {
13787
+ /**
13788
+ * Defines a string value that labels the current element.
13789
+ */
13790
+ 'aria-label'?: string,
13791
+
13792
+ /**
13793
+ * Identifies the element (or elements) that labels the current element.
13794
+ */
13795
+ 'aria-labelledby'?: string,
13796
+
13797
+ /**
13798
+ * Identifies the element (or elements) that describes the object.
13799
+ */
13800
+ 'aria-describedby'?: string,
13801
+
13802
+ /**
13803
+ * Identifies the element (or elements) that provide a detailed, extended description for the object.
13804
+ */
13805
+ 'aria-details'?: string
13806
+ }
13807
+
13808
+ // A set of common DOM props that are allowed on any component
13809
+ // Ensure this is synced with DOMPropNames in filterDOMProps
13810
+ interface DOMProps {
13811
+ /**
13812
+ * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
13813
+ */
13814
+ id?: string
13815
+ }
13816
+
13817
+ interface FocusableDOMProps extends DOMProps {
13818
+ /**
13819
+ * Whether to exclude the element from the sequential tab order. If true,
13820
+ * the element will not be focusable via the keyboard by tabbing. This should
13821
+ * be avoided except in rare scenarios where an alternative means of accessing
13822
+ * the element or its functionality via the keyboard is available.
13823
+ */
13824
+ excludeFromTabOrder?: boolean
13825
+ }
13826
+
13827
+ interface InputDOMProps {
13828
+ /**
13829
+ * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
13830
+ */
13831
+ name?: string
13832
+ }
13833
+
13834
+ /*
13835
+ * Copyright 2020 Adobe. All rights reserved.
13836
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13837
+ * you may not use this file except in compliance with the License. You may obtain a copy
13838
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
13839
+ *
13840
+ * Unless required by applicable law or agreed to in writing, software distributed under
13841
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13842
+ * OF ANY KIND, either express or implied. See the License for the specific language
13843
+ * governing permissions and limitations under the License.
13844
+ */
13845
+
13846
+
13847
+
13848
+ interface InputBase {
13849
+ /** Whether the input is disabled. */
13850
+ isDisabled?: boolean,
13851
+ /** Whether the input can be selected but not changed by the user. */
13852
+ isReadOnly?: boolean
13853
+ }
13854
+
13855
+ /*
13856
+ * Copyright 2020 Adobe. All rights reserved.
13857
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13858
+ * you may not use this file except in compliance with the License. You may obtain a copy
13859
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
13860
+ *
13861
+ * Unless required by applicable law or agreed to in writing, software distributed under
13862
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13863
+ * OF ANY KIND, either express or implied. See the License for the specific language
13864
+ * governing permissions and limitations under the License.
13865
+ */
13866
+
13867
+
13868
+
13869
+ // Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
13870
+ // is not to propagate. This can be overridden by calling continuePropagation() on the event.
13871
+ type BaseEvent<T extends SyntheticEvent> = T & {
13872
+ /**
13873
+ * Use continuePropagation.
13874
+ * @deprecated */
13875
+ stopPropagation(): void,
13876
+ continuePropagation(): void
13877
+ }
13878
+
13879
+ type KeyboardEvent = BaseEvent<KeyboardEvent$3<any>>;
13880
+
13881
+ interface KeyboardEvents {
13882
+ /** Handler that is called when a key is pressed. */
13883
+ onKeyDown?: (e: KeyboardEvent) => void,
13884
+ /** Handler that is called when a key is released. */
13885
+ onKeyUp?: (e: KeyboardEvent) => void
13886
+ }
13887
+
13888
+ interface FocusEvents<Target = Element> {
13889
+ /** Handler that is called when the element receives focus. */
13890
+ onFocus?: (e: FocusEvent<Target>) => void,
13891
+ /** Handler that is called when the element loses focus. */
13892
+ onBlur?: (e: FocusEvent<Target>) => void,
13893
+ /** Handler that is called when the element's focus status changes. */
13894
+ onFocusChange?: (isFocused: boolean) => void
13895
+ }
13896
+
13897
+ interface FocusableProps<Target = Element> extends FocusEvents<Target>, KeyboardEvents {
13898
+ /** Whether the element should receive focus on render. */
13899
+ autoFocus?: boolean
13900
+ }
13901
+
13902
+ /*
13903
+ * Copyright 2020 Adobe. All rights reserved.
13904
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13905
+ * you may not use this file except in compliance with the License. You may obtain a copy
13906
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
13907
+ *
13908
+ * Unless required by applicable law or agreed to in writing, software distributed under
13909
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13910
+ * OF ANY KIND, either express or implied. See the License for the specific language
13911
+ * governing permissions and limitations under the License.
13912
+ */
13913
+
13914
+
13915
+
13643
13916
  interface SwitchBase extends InputBase, FocusableProps {
13644
13917
  /**
13645
13918
  * The content to render as the Switch's label.
@@ -13744,7 +14017,7 @@ declare function useTextInput<P extends PlumeTextInputProps, C extends AnyPlasmi
13744
14017
  };
13745
14018
  };
13746
14019
 
13747
- interface BaseTriggeredOverlayProps extends StyleProps, DOMProps {
14020
+ interface BaseTriggeredOverlayProps extends StyleProps, DOMProps$2 {
13748
14021
  children?: React$1.ReactNode;
13749
14022
  }
13750
14023
  interface TriggeredOverlayConfig<C extends AnyPlasmicClass> {
package/dist/index.cjs.js CHANGED
@@ -1591,6 +1591,9 @@ function maybeAsString(node) {
1591
1591
  if (typeof node === "string") {
1592
1592
  return node;
1593
1593
  }
1594
+ if (typeof node === "number") {
1595
+ return "".concat(node);
1596
+ }
1594
1597
  if (Array.isArray(node) && node.length === 1 && typeof node[0] === "string") {
1595
1598
  return node[0];
1596
1599
  }