@warp-ds/elements 2.9.1-next.5 → 2.9.1-next.6
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/custom-elements.json +25 -20
- package/dist/docs/slider/examples.md +30 -75
- package/dist/docs/slider/slider.md +30 -75
- package/dist/docs/step/api.md +11 -9
- package/dist/docs/step/step.md +11 -15
- package/dist/docs/step-indicator/api.md +4 -4
- package/dist/docs/step-indicator/examples.md +81 -0
- package/dist/docs/step-indicator/step-indicator.md +97 -6
- package/dist/docs/step-indicator/usage.md +12 -0
- package/dist/docs/switch/accessibility.md +2 -0
- package/dist/docs/switch/api.md +11 -17
- package/dist/docs/switch/examples.md +16 -0
- package/dist/docs/switch/switch.md +36 -18
- package/dist/docs/switch/usage.md +6 -0
- package/dist/index.d.ts +64 -56
- package/dist/packages/affix/affix.react.stories.d.ts +3 -1
- package/dist/packages/affix/affix.react.test.d.ts +1 -0
- package/dist/packages/affix/affix.react.test.js +3 -0
- package/dist/packages/affix/react.d.ts +4 -1
- package/dist/packages/affix/react.js +7 -1
- package/dist/packages/attention/attention.react.test.d.ts +1 -0
- package/dist/packages/attention/attention.react.test.js +8 -0
- package/dist/packages/attention/react.d.ts +2 -2
- package/dist/packages/attention/react.js +10 -1
- package/dist/packages/checkbox-group/checkbox-group.react.test.d.ts +1 -0
- package/dist/packages/checkbox-group/checkbox-group.react.test.js +5 -0
- package/dist/packages/checkbox-group/react.d.ts +4 -1
- package/dist/packages/checkbox-group/react.js +7 -1
- package/dist/packages/combobox/combobox.react.stories.d.ts +20 -8
- package/dist/packages/combobox/combobox.react.test.d.ts +1 -0
- package/dist/packages/combobox/combobox.react.test.js +9 -0
- package/dist/packages/combobox/react.d.ts +13 -6
- package/dist/packages/combobox/react.js +11 -1
- package/dist/packages/datepicker/datepicker.react.stories.d.ts +18 -10
- package/dist/packages/datepicker/datepicker.react.test.d.ts +1 -0
- package/dist/packages/datepicker/datepicker.react.test.js +7 -0
- package/dist/packages/datepicker/react.d.ts +13 -8
- package/dist/packages/datepicker/react.js +9 -1
- package/dist/packages/expandable/expandable.react.stories.d.ts +12 -2
- package/dist/packages/expandable/expandable.react.test.d.ts +1 -0
- package/dist/packages/expandable/expandable.react.test.js +8 -0
- package/dist/packages/expandable/react.d.ts +7 -1
- package/dist/packages/expandable/react.js +10 -1
- package/dist/packages/link/link.react.stories.d.ts +6 -2
- package/dist/packages/link/link.react.test.d.ts +1 -0
- package/dist/packages/link/link.react.test.js +3 -0
- package/dist/packages/link/react.d.ts +4 -1
- package/dist/packages/link/react.js +7 -1
- package/dist/packages/modal/modal.react.stories.d.ts +10 -6
- package/dist/packages/modal/modal.react.test.d.ts +1 -0
- package/dist/packages/modal/modal.react.test.js +6 -0
- package/dist/packages/modal/react.d.ts +10 -6
- package/dist/packages/modal/react.js +8 -1
- package/dist/packages/modal-header/modal-header.react.test.d.ts +1 -0
- package/dist/packages/modal-header/modal-header.react.test.js +3 -0
- package/dist/packages/modal-header/react.d.ts +7 -4
- package/dist/packages/modal-header/react.js +7 -1
- package/dist/packages/page-indicator/page-indicator.react.stories.d.ts +8 -2
- package/dist/packages/page-indicator/page-indicator.react.test.d.ts +1 -0
- package/dist/packages/page-indicator/page-indicator.react.test.js +6 -0
- package/dist/packages/page-indicator/react.d.ts +5 -1
- package/dist/packages/page-indicator/react.js +8 -1
- package/dist/packages/pagination/pagination.react.stories.d.ts +14 -6
- package/dist/packages/pagination/pagination.react.test.d.ts +1 -0
- package/dist/packages/pagination/pagination.react.test.js +7 -0
- package/dist/packages/pagination/react.d.ts +9 -4
- package/dist/packages/pagination/react.js +9 -1
- package/dist/packages/pill/pill.react.stories.d.ts +20 -8
- package/dist/packages/pill/pill.react.test.d.ts +1 -0
- package/dist/packages/pill/pill.react.test.js +9 -0
- package/dist/packages/pill/react.d.ts +13 -6
- package/dist/packages/pill/react.js +11 -1
- package/dist/packages/radio-group/radio-group.react.test.d.ts +1 -0
- package/dist/packages/radio-group/radio-group.react.test.js +5 -0
- package/dist/packages/radio-group/react.d.ts +9 -6
- package/dist/packages/radio-group/react.js +7 -1
- package/dist/packages/select/react.d.ts +9 -4
- package/dist/packages/select/react.js +9 -1
- package/dist/packages/select/select.react.stories.d.ts +14 -6
- package/dist/packages/select/select.react.test.d.ts +1 -0
- package/dist/packages/select/select.react.test.js +7 -0
- package/dist/packages/slider/react.d.ts +6 -1
- package/dist/packages/slider/react.js +9 -1
- package/dist/packages/slider/slider.react.stories.d.ts +6 -1
- package/dist/packages/slider/slider.react.test.d.ts +1 -0
- package/dist/packages/slider/slider.react.test.js +7 -0
- package/dist/packages/slider-thumb/react.d.ts +8 -5
- package/dist/packages/slider-thumb/react.js +8 -1
- package/dist/packages/slider-thumb/slider-thumb.react.test.d.ts +1 -0
- package/dist/packages/slider-thumb/slider-thumb.react.test.js +6 -0
- package/dist/packages/step/step.d.ts +8 -4
- package/dist/packages/step/step.js.map +2 -2
- package/dist/packages/step-indicator/step-indicator.d.ts +5 -6
- package/dist/packages/step-indicator/step-indicator.js.map +2 -2
- package/dist/packages/switch/switch.d.ts +21 -8
- package/dist/packages/switch/switch.js +1 -1
- package/dist/packages/switch/switch.js.map +2 -2
- package/dist/packages/tab/react.d.ts +9 -6
- package/dist/packages/tab/react.js +7 -1
- package/dist/packages/tab/tab.react.test.d.ts +1 -0
- package/dist/packages/tab/tab.react.test.js +3 -0
- package/dist/packages/textarea/react.d.ts +16 -10
- package/dist/packages/textarea/react.js +10 -1
- package/dist/packages/textarea/textarea.react.stories.d.ts +22 -12
- package/dist/packages/textarea/textarea.react.test.d.ts +1 -0
- package/dist/packages/textarea/textarea.react.test.js +8 -0
- package/dist/packages/textfield/react.d.ts +16 -10
- package/dist/packages/textfield/react.js +10 -1
- package/dist/packages/textfield/textfield.react.stories.d.ts +22 -12
- package/dist/packages/textfield/textfield.react.test.d.ts +1 -0
- package/dist/packages/textfield/textfield.react.test.js +8 -0
- package/dist/tests/react-ssr-attributes.d.ts +8 -0
- package/dist/tests/react-ssr-attributes.js +12 -0
- package/dist/web-types.json +73 -15
- package/package.json +1 -1
- package/dist/docs/step/accessibility.md +0 -1
- package/dist/docs/step/examples.md +0 -1
- package/dist/docs/step/usage.md +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1634,16 +1634,24 @@ Use in open-ended sliders to show for example "300+ hk" instead of "Max" in the
|
|
|
1634
1634
|
};
|
|
1635
1635
|
|
|
1636
1636
|
export type WarpStepProps = {
|
|
1637
|
-
/**
|
|
1637
|
+
/** Whether this step is active.
|
|
1638
|
+
|
|
1639
|
+
The active step displays a filled indicator. */
|
|
1638
1640
|
active?: WarpStep["active"];
|
|
1639
|
-
/**
|
|
1641
|
+
/** Whether this step is completed.
|
|
1642
|
+
|
|
1643
|
+
Completed steps display a checkmark icon and a filled indicator. */
|
|
1640
1644
|
completed?: WarpStep["completed"];
|
|
1641
1645
|
};
|
|
1642
1646
|
|
|
1643
1647
|
export type WarpStepSolidJsProps = {
|
|
1644
|
-
/**
|
|
1648
|
+
/** Whether this step is active.
|
|
1649
|
+
|
|
1650
|
+
The active step displays a filled indicator. */
|
|
1645
1651
|
"prop:active"?: WarpStep["active"];
|
|
1646
|
-
/**
|
|
1652
|
+
/** Whether this step is completed.
|
|
1653
|
+
|
|
1654
|
+
Completed steps display a checkmark icon and a filled indicator. */
|
|
1647
1655
|
"prop:completed"?: WarpStep["completed"];
|
|
1648
1656
|
|
|
1649
1657
|
/** Set the innerHTML of the element */
|
|
@@ -1653,16 +1661,16 @@ export type WarpStepSolidJsProps = {
|
|
|
1653
1661
|
};
|
|
1654
1662
|
|
|
1655
1663
|
export type WarpStepIndicatorProps = {
|
|
1656
|
-
/**
|
|
1664
|
+
/** Display steps horizontally instead of vertically */
|
|
1657
1665
|
horizontal?: WarpStepIndicator["horizontal"];
|
|
1658
|
-
/**
|
|
1666
|
+
/** Align steps to the right (vertical layout only) */
|
|
1659
1667
|
right?: WarpStepIndicator["right"];
|
|
1660
1668
|
};
|
|
1661
1669
|
|
|
1662
1670
|
export type WarpStepIndicatorSolidJsProps = {
|
|
1663
|
-
/**
|
|
1671
|
+
/** Display steps horizontally instead of vertically */
|
|
1664
1672
|
"prop:horizontal"?: WarpStepIndicator["horizontal"];
|
|
1665
|
-
/**
|
|
1673
|
+
/** Align steps to the right (vertical layout only) */
|
|
1666
1674
|
"prop:right"?: WarpStepIndicator["right"];
|
|
1667
1675
|
|
|
1668
1676
|
/** Set the innerHTML of the element */
|
|
@@ -1672,30 +1680,34 @@ export type WarpStepIndicatorSolidJsProps = {
|
|
|
1672
1680
|
};
|
|
1673
1681
|
|
|
1674
1682
|
export type WarpSwitchProps = {
|
|
1675
|
-
/**
|
|
1683
|
+
/** Name used when submitting an HTML form. */
|
|
1676
1684
|
name?: WarpSwitch["name"];
|
|
1677
|
-
/**
|
|
1685
|
+
/** Value submitted when the switch is checked.
|
|
1686
|
+
|
|
1687
|
+
The component reports `null` as the value in the `change` event when `value` is an empty string. */
|
|
1678
1688
|
value?: WarpSwitch["value"];
|
|
1679
|
-
/**
|
|
1689
|
+
/** Whether the switch is on (checked). */
|
|
1680
1690
|
checked?: WarpSwitch["checked"];
|
|
1681
|
-
/**
|
|
1691
|
+
/** Whether the switch is disabled. */
|
|
1682
1692
|
disabled?: WarpSwitch["disabled"];
|
|
1683
1693
|
|
|
1684
|
-
/**
|
|
1685
|
-
onchange?: (e:
|
|
1694
|
+
/** Dispatched when the switch toggles. Includes boolean `checked` and string/null `value` on `details`. */
|
|
1695
|
+
onchange?: (e: WarpSwitchChangeEvent) => void;
|
|
1686
1696
|
};
|
|
1687
1697
|
|
|
1688
1698
|
export type WarpSwitchSolidJsProps = {
|
|
1689
|
-
/**
|
|
1699
|
+
/** Name used when submitting an HTML form. */
|
|
1690
1700
|
"prop:name"?: WarpSwitch["name"];
|
|
1691
|
-
/**
|
|
1701
|
+
/** Value submitted when the switch is checked.
|
|
1702
|
+
|
|
1703
|
+
The component reports `null` as the value in the `change` event when `value` is an empty string. */
|
|
1692
1704
|
"prop:value"?: WarpSwitch["value"];
|
|
1693
|
-
/**
|
|
1705
|
+
/** Whether the switch is on (checked). */
|
|
1694
1706
|
"prop:checked"?: WarpSwitch["checked"];
|
|
1695
|
-
/**
|
|
1707
|
+
/** Whether the switch is disabled. */
|
|
1696
1708
|
"prop:disabled"?: WarpSwitch["disabled"];
|
|
1697
|
-
/**
|
|
1698
|
-
"on:change"?: (e:
|
|
1709
|
+
/** Dispatched when the switch toggles. Includes boolean `checked` and string/null `value` on `details`. */
|
|
1710
|
+
"on:change"?: (e: WarpSwitchChangeEvent) => void;
|
|
1699
1711
|
|
|
1700
1712
|
/** Set the innerHTML of the element */
|
|
1701
1713
|
innerHTML?: string;
|
|
@@ -2691,8 +2703,12 @@ export type CustomElements = {
|
|
|
2691
2703
|
*
|
|
2692
2704
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2693
2705
|
*
|
|
2694
|
-
* - `active`:
|
|
2695
|
-
*
|
|
2706
|
+
* - `active`: Whether this step is active.
|
|
2707
|
+
*
|
|
2708
|
+
* The active step displays a filled indicator.
|
|
2709
|
+
* - `completed`: Whether this step is completed.
|
|
2710
|
+
*
|
|
2711
|
+
* Completed steps display a checkmark icon and a filled indicator.
|
|
2696
2712
|
*
|
|
2697
2713
|
* ## Methods
|
|
2698
2714
|
*
|
|
@@ -2706,42 +2722,36 @@ export type CustomElements = {
|
|
|
2706
2722
|
/**
|
|
2707
2723
|
* Steps are used to show progress through a process or to guide users through a multi-step task.
|
|
2708
2724
|
*
|
|
2709
|
-
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/components-steps--docs)
|
|
2710
|
-
*
|
|
2711
2725
|
* ## Attributes & Properties
|
|
2712
2726
|
*
|
|
2713
2727
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2714
2728
|
*
|
|
2715
|
-
* - `horizontal`:
|
|
2716
|
-
* - `right`:
|
|
2717
|
-
*
|
|
2718
|
-
* ## Methods
|
|
2719
|
-
*
|
|
2720
|
-
* Methods that can be called to access component functionality.
|
|
2721
|
-
*
|
|
2722
|
-
* - `updateStepsContext() => void`: undefined
|
|
2729
|
+
* - `horizontal`: Display steps horizontally instead of vertically
|
|
2730
|
+
* - `right`: Align steps to the right (vertical layout only)
|
|
2723
2731
|
*/
|
|
2724
2732
|
"w-step-indicator": Partial<
|
|
2725
2733
|
WarpStepIndicatorProps & BaseProps<WarpStepIndicator> & BaseEvents
|
|
2726
2734
|
>;
|
|
2727
2735
|
|
|
2728
2736
|
/**
|
|
2729
|
-
*
|
|
2737
|
+
* The Switch component allows users to toggle between two states.
|
|
2730
2738
|
*
|
|
2731
2739
|
* ## Attributes & Properties
|
|
2732
2740
|
*
|
|
2733
2741
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2734
2742
|
*
|
|
2735
|
-
* - `name`:
|
|
2736
|
-
* - `value`:
|
|
2737
|
-
*
|
|
2738
|
-
*
|
|
2743
|
+
* - `name`: Name used when submitting an HTML form.
|
|
2744
|
+
* - `value`: Value submitted when the switch is checked.
|
|
2745
|
+
*
|
|
2746
|
+
* The component reports `null` as the value in the `change` event when `value` is an empty string.
|
|
2747
|
+
* - `checked`: Whether the switch is on (checked).
|
|
2748
|
+
* - `disabled`: Whether the switch is disabled.
|
|
2739
2749
|
*
|
|
2740
2750
|
* ## Events
|
|
2741
2751
|
*
|
|
2742
2752
|
* Events that will be emitted by the component.
|
|
2743
2753
|
*
|
|
2744
|
-
* - `change`:
|
|
2754
|
+
* - `change`: Dispatched when the switch toggles. Includes boolean `checked` and string/null `value` on `details`.
|
|
2745
2755
|
*
|
|
2746
2756
|
* ## Methods
|
|
2747
2757
|
*
|
|
@@ -3758,8 +3768,12 @@ export type CustomElementsSolidJs = {
|
|
|
3758
3768
|
*
|
|
3759
3769
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
3760
3770
|
*
|
|
3761
|
-
* - `active`:
|
|
3762
|
-
*
|
|
3771
|
+
* - `active`: Whether this step is active.
|
|
3772
|
+
*
|
|
3773
|
+
* The active step displays a filled indicator.
|
|
3774
|
+
* - `completed`: Whether this step is completed.
|
|
3775
|
+
*
|
|
3776
|
+
* Completed steps display a checkmark icon and a filled indicator.
|
|
3763
3777
|
*
|
|
3764
3778
|
* ## Methods
|
|
3765
3779
|
*
|
|
@@ -3775,20 +3789,12 @@ export type CustomElementsSolidJs = {
|
|
|
3775
3789
|
/**
|
|
3776
3790
|
* Steps are used to show progress through a process or to guide users through a multi-step task.
|
|
3777
3791
|
*
|
|
3778
|
-
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/components-steps--docs)
|
|
3779
|
-
*
|
|
3780
3792
|
* ## Attributes & Properties
|
|
3781
3793
|
*
|
|
3782
3794
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
3783
3795
|
*
|
|
3784
|
-
* - `horizontal`:
|
|
3785
|
-
* - `right`:
|
|
3786
|
-
*
|
|
3787
|
-
* ## Methods
|
|
3788
|
-
*
|
|
3789
|
-
* Methods that can be called to access component functionality.
|
|
3790
|
-
*
|
|
3791
|
-
* - `updateStepsContext() => void`: undefined
|
|
3796
|
+
* - `horizontal`: Display steps horizontally instead of vertically
|
|
3797
|
+
* - `right`: Align steps to the right (vertical layout only)
|
|
3792
3798
|
*/
|
|
3793
3799
|
"w-step-indicator": Partial<
|
|
3794
3800
|
WarpStepIndicatorProps &
|
|
@@ -3798,22 +3804,24 @@ export type CustomElementsSolidJs = {
|
|
|
3798
3804
|
>;
|
|
3799
3805
|
|
|
3800
3806
|
/**
|
|
3801
|
-
*
|
|
3807
|
+
* The Switch component allows users to toggle between two states.
|
|
3802
3808
|
*
|
|
3803
3809
|
* ## Attributes & Properties
|
|
3804
3810
|
*
|
|
3805
3811
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
3806
3812
|
*
|
|
3807
|
-
* - `name`:
|
|
3808
|
-
* - `value`:
|
|
3809
|
-
*
|
|
3810
|
-
*
|
|
3813
|
+
* - `name`: Name used when submitting an HTML form.
|
|
3814
|
+
* - `value`: Value submitted when the switch is checked.
|
|
3815
|
+
*
|
|
3816
|
+
* The component reports `null` as the value in the `change` event when `value` is an empty string.
|
|
3817
|
+
* - `checked`: Whether the switch is on (checked).
|
|
3818
|
+
* - `disabled`: Whether the switch is disabled.
|
|
3811
3819
|
*
|
|
3812
3820
|
* ## Events
|
|
3813
3821
|
*
|
|
3814
3822
|
* Events that will be emitted by the component.
|
|
3815
3823
|
*
|
|
3816
|
-
* - `change`:
|
|
3824
|
+
* - `change`: Dispatched when the switch toggles. Includes boolean `checked` and string/null `value` on `details`.
|
|
3817
3825
|
*
|
|
3818
3826
|
* ## Methods
|
|
3819
3827
|
*
|
|
@@ -2,7 +2,9 @@ import { StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { Affix } from './react';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: import("
|
|
5
|
+
component: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").HTMLAttributes<import("./affix").WarpAffix>, "form" | "label" | "search" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "clear" | "icon" | "_classBase" | "_classes" | "resetContainingTextField" | "submitContainingForm" | "_searchButton" | "_clearButton" | "_icon" | "_text" | "_markup"> & {} & Partial<Omit<import("./affix").WarpAffix, keyof HTMLElement>> & import("react").RefAttributes<import("./affix").WarpAffix>, "ref">, "aria-label"> & {
|
|
6
|
+
ariaLabel?: string | null;
|
|
7
|
+
} & import("react").RefAttributes<import("./affix").WarpAffix>>;
|
|
6
8
|
};
|
|
7
9
|
export default _default;
|
|
8
10
|
export type Story = StoryObj<typeof Affix>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { WarpAffix } from './affix.js';
|
|
2
|
-
export declare const Affix:
|
|
3
|
+
export declare const Affix: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<WarpAffix>, "form" | "label" | "search" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "clear" | "icon" | "_classBase" | "_classes" | "resetContainingTextField" | "submitContainingForm" | "_searchButton" | "_clearButton" | "_icon" | "_text" | "_markup"> & {} & Partial<Omit<WarpAffix, keyof HTMLElement>> & React.RefAttributes<WarpAffix>, "ref">, "aria-label"> & {
|
|
4
|
+
ariaLabel?: string | null;
|
|
5
|
+
} & React.RefAttributes<WarpAffix>>;
|
|
@@ -5,7 +5,7 @@ import React from 'react';
|
|
|
5
5
|
// they should be getting it from Eik.
|
|
6
6
|
class Component extends LitElement {
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
const BaseAffix = createComponent({
|
|
9
9
|
tagName: 'w-affix',
|
|
10
10
|
// This tricks TS into thinking the stub we created above is still the actual implementation
|
|
11
11
|
// This ensures devs can import the react wrapper and use it with the full intellisense experience
|
|
@@ -13,3 +13,9 @@ export const Affix = createComponent({
|
|
|
13
13
|
elementClass: Component,
|
|
14
14
|
react: React,
|
|
15
15
|
});
|
|
16
|
+
export const Affix = React.forwardRef(({ ariaLabel, ...props }, ref) => React.createElement(BaseAffix, {
|
|
17
|
+
...props,
|
|
18
|
+
...(ariaLabel !== undefined ? { 'aria-label': ariaLabel } : {}),
|
|
19
|
+
ref,
|
|
20
|
+
}));
|
|
21
|
+
Affix.displayName = 'Affix';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { describeReactSsrAttributeMapping } from '../../tests/react-ssr-attributes';
|
|
2
|
+
import { Attention } from './react.js';
|
|
3
|
+
describeReactSsrAttributeMapping('Attention', Attention, [
|
|
4
|
+
{ propName: 'canClose', attrName: 'can-close' },
|
|
5
|
+
{ propName: 'noArrow', attrName: 'no-arrow' },
|
|
6
|
+
{ propName: 'crossAxis', attrName: 'cross-axis' },
|
|
7
|
+
{ propName: 'fallbackPlacements', attrName: 'fallback-placements', value: ['top', 'bottom'] },
|
|
8
|
+
]);
|
|
@@ -7,8 +7,8 @@ declare const BaseAttention: import("@lit/react").ReactWebComponent<Component, {
|
|
|
7
7
|
onClose: string;
|
|
8
8
|
onclose: string;
|
|
9
9
|
}>;
|
|
10
|
-
type BaseProps = React.
|
|
11
|
-
export type AttentionProps = Omit<BaseProps, 'popover'> & {
|
|
10
|
+
type BaseProps = React.ComponentPropsWithoutRef<typeof BaseAttention>;
|
|
11
|
+
export type AttentionProps = Omit<BaseProps, 'popover' | 'can-close' | 'no-arrow' | 'cross-axis' | 'fallback-placements'> & {
|
|
12
12
|
popover?: boolean;
|
|
13
13
|
} & Partial<Omit<WarpAttention, keyof HTMLElement>>;
|
|
14
14
|
export declare const Attention: React.FC<AttentionProps>;
|
|
@@ -14,4 +14,13 @@ const BaseAttention = createComponent({
|
|
|
14
14
|
onclose: 'close',
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
const ForwardedAttention = React.forwardRef(({ canClose, noArrow, crossAxis, fallbackPlacements, ...props }, ref) => React.createElement(BaseAttention, {
|
|
18
|
+
...props,
|
|
19
|
+
...(canClose ? { 'can-close': true } : {}),
|
|
20
|
+
...(noArrow ? { 'no-arrow': true } : {}),
|
|
21
|
+
...(crossAxis ? { 'cross-axis': true } : {}),
|
|
22
|
+
...(fallbackPlacements !== undefined ? { 'fallback-placements': JSON.stringify(fallbackPlacements) } : {}),
|
|
23
|
+
ref,
|
|
24
|
+
}));
|
|
25
|
+
export const Attention = ForwardedAttention;
|
|
26
|
+
Attention.displayName = 'Attention';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { describeReactSsrAttributeMapping } from '../../tests/react-ssr-attributes';
|
|
2
|
+
import { CheckboxGroup } from './react.js';
|
|
3
|
+
describeReactSsrAttributeMapping('CheckboxGroup', CheckboxGroup, [
|
|
4
|
+
{ propName: 'helpText', attrName: 'help-text', value: 'Help text' },
|
|
5
|
+
]);
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { WCheckboxGroup } from './checkbox-group.js';
|
|
2
|
-
export declare const CheckboxGroup:
|
|
3
|
+
export declare const CheckboxGroup: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<WCheckboxGroup>, "form" | "label" | "name" | "invalid" | "helpText" | "required" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "updated" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "reportValidity" | "optional"> & {} & Partial<Omit<WCheckboxGroup, keyof HTMLElement>> & React.RefAttributes<WCheckboxGroup>, "ref">, "help-text"> & {
|
|
4
|
+
helpText?: string;
|
|
5
|
+
} & React.RefAttributes<WCheckboxGroup>>;
|
|
@@ -4,8 +4,14 @@ import React from 'react';
|
|
|
4
4
|
// decouple from CDN by providing a dummy class
|
|
5
5
|
class Component extends LitElement {
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
const BaseCheckboxGroup = createComponent({
|
|
8
8
|
tagName: 'w-checkbox-group',
|
|
9
9
|
elementClass: Component,
|
|
10
10
|
react: React,
|
|
11
11
|
});
|
|
12
|
+
export const CheckboxGroup = React.forwardRef(({ helpText, ...props }, ref) => React.createElement(BaseCheckboxGroup, {
|
|
13
|
+
...props,
|
|
14
|
+
...(helpText !== undefined ? { 'help-text': helpText } : {}),
|
|
15
|
+
ref,
|
|
16
|
+
}));
|
|
17
|
+
CheckboxGroup.displayName = 'CheckboxGroup';
|
|
@@ -3,18 +3,30 @@ import React from 'react';
|
|
|
3
3
|
import { Combobox } from './react';
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
|
-
component:
|
|
7
|
-
onSelect: string;
|
|
8
|
-
onselect: string;
|
|
9
|
-
onChange: string;
|
|
10
|
-
onchange: string;
|
|
11
|
-
}>;
|
|
12
|
-
render(args: Omit<React.HTMLAttributes<import("./combobox").WarpCombobox>, "value" | "form" | "label" | "name" | "disabled" | "invalid" | "helpText" | "placeholder" | "required" | "autocomplete" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onchange" | "onselect" | "updated" | "firstUpdated" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onChange" | "onSelect" | "optional" | "options" | "openOnFocus" | "selectOnBlur" | "matchTextSegments" | "disableStaticFiltering"> & {
|
|
6
|
+
component: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<import("./combobox").WarpCombobox>, "value" | "form" | "label" | "name" | "disabled" | "invalid" | "helpText" | "placeholder" | "required" | "autocomplete" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onchange" | "onselect" | "updated" | "firstUpdated" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onChange" | "onSelect" | "optional" | "options" | "openOnFocus" | "selectOnBlur" | "matchTextSegments" | "disableStaticFiltering"> & {
|
|
13
7
|
onSelect?: (e: Event) => void;
|
|
14
8
|
onselect?: (e: Event) => void;
|
|
15
9
|
onChange?: (e: Event) => void;
|
|
16
10
|
onchange?: (e: Event) => void;
|
|
17
|
-
} & Partial<Omit<import("./combobox").WarpCombobox, keyof HTMLElement>> & React.RefAttributes<import("./combobox").WarpCombobox>
|
|
11
|
+
} & Partial<Omit<import("./combobox").WarpCombobox, keyof HTMLElement>> & React.RefAttributes<import("./combobox").WarpCombobox>, "ref">, "help-text" | "open-on-focus" | "select-on-blur" | "match-text-segments" | "disable-static-filtering"> & {
|
|
12
|
+
openOnFocus?: boolean;
|
|
13
|
+
selectOnBlur?: boolean;
|
|
14
|
+
matchTextSegments?: boolean;
|
|
15
|
+
disableStaticFiltering?: boolean;
|
|
16
|
+
helpText?: string;
|
|
17
|
+
} & React.RefAttributes<import("./combobox").WarpCombobox>>;
|
|
18
|
+
render(args: Omit<Omit<Omit<React.HTMLAttributes<import("./combobox").WarpCombobox>, "value" | "form" | "label" | "name" | "disabled" | "invalid" | "helpText" | "placeholder" | "required" | "autocomplete" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onchange" | "onselect" | "updated" | "firstUpdated" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onChange" | "onSelect" | "optional" | "options" | "openOnFocus" | "selectOnBlur" | "matchTextSegments" | "disableStaticFiltering"> & {
|
|
19
|
+
onSelect?: (e: Event) => void;
|
|
20
|
+
onselect?: (e: Event) => void;
|
|
21
|
+
onChange?: (e: Event) => void;
|
|
22
|
+
onchange?: (e: Event) => void;
|
|
23
|
+
} & Partial<Omit<import("./combobox").WarpCombobox, keyof HTMLElement>> & React.RefAttributes<import("./combobox").WarpCombobox>, "ref">, "help-text" | "open-on-focus" | "select-on-blur" | "match-text-segments" | "disable-static-filtering"> & {
|
|
24
|
+
openOnFocus?: boolean;
|
|
25
|
+
selectOnBlur?: boolean;
|
|
26
|
+
matchTextSegments?: boolean;
|
|
27
|
+
disableStaticFiltering?: boolean;
|
|
28
|
+
helpText?: string;
|
|
29
|
+
} & React.RefAttributes<import("./combobox").WarpCombobox>): React.JSX.Element;
|
|
18
30
|
};
|
|
19
31
|
export default _default;
|
|
20
32
|
export type Story = StoryObj<typeof Combobox>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { describeReactSsrAttributeMapping } from '../../tests/react-ssr-attributes';
|
|
2
|
+
import { Combobox } from './react.js';
|
|
3
|
+
describeReactSsrAttributeMapping('Combobox', Combobox, [
|
|
4
|
+
{ propName: 'openOnFocus', attrName: 'open-on-focus' },
|
|
5
|
+
{ propName: 'selectOnBlur', attrName: 'select-on-blur' },
|
|
6
|
+
{ propName: 'matchTextSegments', attrName: 'match-text-segments' },
|
|
7
|
+
{ propName: 'disableStaticFiltering', attrName: 'disable-static-filtering' },
|
|
8
|
+
{ propName: 'helpText', attrName: 'help-text', value: 'Help text' },
|
|
9
|
+
]);
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { WarpCombobox } from './combobox.js';
|
|
2
|
-
export declare const Combobox:
|
|
3
|
-
onSelect:
|
|
4
|
-
onselect:
|
|
5
|
-
onChange:
|
|
6
|
-
onchange:
|
|
7
|
-
}
|
|
3
|
+
export declare const Combobox: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<WarpCombobox>, "value" | "form" | "label" | "name" | "disabled" | "invalid" | "helpText" | "placeholder" | "required" | "autocomplete" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onchange" | "onselect" | "updated" | "firstUpdated" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onChange" | "onSelect" | "optional" | "options" | "openOnFocus" | "selectOnBlur" | "matchTextSegments" | "disableStaticFiltering"> & {
|
|
4
|
+
onSelect?: (e: Event) => void;
|
|
5
|
+
onselect?: (e: Event) => void;
|
|
6
|
+
onChange?: (e: Event) => void;
|
|
7
|
+
onchange?: (e: Event) => void;
|
|
8
|
+
} & Partial<Omit<WarpCombobox, keyof HTMLElement>> & React.RefAttributes<WarpCombobox>, "ref">, "help-text" | "open-on-focus" | "select-on-blur" | "match-text-segments" | "disable-static-filtering"> & {
|
|
9
|
+
openOnFocus?: boolean;
|
|
10
|
+
selectOnBlur?: boolean;
|
|
11
|
+
matchTextSegments?: boolean;
|
|
12
|
+
disableStaticFiltering?: boolean;
|
|
13
|
+
helpText?: string;
|
|
14
|
+
} & React.RefAttributes<WarpCombobox>>;
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
// decouple from CDN by providing a dummy class
|
|
5
5
|
class Component extends LitElement {
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
const BaseCombobox = createComponent({
|
|
8
8
|
tagName: 'w-combobox',
|
|
9
9
|
elementClass: Component,
|
|
10
10
|
react: React,
|
|
@@ -15,3 +15,13 @@ export const Combobox = createComponent({
|
|
|
15
15
|
onchange: 'change',
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
|
+
export const Combobox = React.forwardRef(({ openOnFocus, selectOnBlur, matchTextSegments, disableStaticFiltering, helpText, ...props }, ref) => React.createElement(BaseCombobox, {
|
|
19
|
+
...props,
|
|
20
|
+
...(openOnFocus ? { 'open-on-focus': true } : {}),
|
|
21
|
+
...(selectOnBlur ? { 'select-on-blur': true } : {}),
|
|
22
|
+
...(matchTextSegments ? { 'match-text-segments': true } : {}),
|
|
23
|
+
...(disableStaticFiltering ? { 'disable-static-filtering': true } : {}),
|
|
24
|
+
...(helpText !== undefined ? { 'help-text': helpText } : {}),
|
|
25
|
+
ref,
|
|
26
|
+
}));
|
|
27
|
+
Combobox.displayName = 'Combobox';
|
|
@@ -3,22 +3,30 @@ import React from 'react';
|
|
|
3
3
|
import { DatePicker } from './react';
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
|
-
render(args: Omit<React.HTMLAttributes<import("./datepicker").WarpDatepicker>, "value" | "input" | "form" | "label" | "name" | "locale" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "oninput" | "updated" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onBlur" | "onChange" | "onInput" | "month" | "calendar" | "wrapper" | "headerFormat" | "weekdayFormat" | "isDayDisabled" | "dayFormat" | "isCalendarOpen" | "navigationDate" | "selectedDate" | "weeks" | "toggleButton" | "previousMonthButton" | "todayCell" | "selectedCell"> & {
|
|
6
|
+
render(args: Omit<Omit<Omit<React.HTMLAttributes<import("./datepicker").WarpDatepicker>, "value" | "input" | "form" | "label" | "name" | "locale" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "oninput" | "updated" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onBlur" | "onChange" | "onInput" | "month" | "calendar" | "wrapper" | "headerFormat" | "weekdayFormat" | "isDayDisabled" | "dayFormat" | "isCalendarOpen" | "navigationDate" | "selectedDate" | "weeks" | "toggleButton" | "previousMonthButton" | "todayCell" | "selectedCell"> & {
|
|
7
7
|
onChange?: (e: Event) => void;
|
|
8
8
|
onchange?: (e: Event) => void;
|
|
9
9
|
onBlur?: (e: Event) => void;
|
|
10
10
|
onblur?: (e: Event) => void;
|
|
11
11
|
onInput?: (e: Event) => void;
|
|
12
12
|
oninput?: (e: Event) => void;
|
|
13
|
-
} & Partial<Omit<import("./datepicker").WarpDatepicker, keyof HTMLElement>> & React.RefAttributes<import("./datepicker").WarpDatepicker>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
} & Partial<Omit<import("./datepicker").WarpDatepicker, keyof HTMLElement>> & React.RefAttributes<import("./datepicker").WarpDatepicker>, "ref">, "header-format" | "weekday-format" | "day-format"> & {
|
|
14
|
+
headerFormat?: string;
|
|
15
|
+
weekdayFormat?: string;
|
|
16
|
+
dayFormat?: string;
|
|
17
|
+
} & React.RefAttributes<import("./datepicker").WarpDatepicker>): React.JSX.Element;
|
|
18
|
+
component: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<import("./datepicker").WarpDatepicker>, "value" | "input" | "form" | "label" | "name" | "locale" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "oninput" | "updated" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onBlur" | "onChange" | "onInput" | "month" | "calendar" | "wrapper" | "headerFormat" | "weekdayFormat" | "isDayDisabled" | "dayFormat" | "isCalendarOpen" | "navigationDate" | "selectedDate" | "weeks" | "toggleButton" | "previousMonthButton" | "todayCell" | "selectedCell"> & {
|
|
19
|
+
onChange?: (e: Event) => void;
|
|
20
|
+
onchange?: (e: Event) => void;
|
|
21
|
+
onBlur?: (e: Event) => void;
|
|
22
|
+
onblur?: (e: Event) => void;
|
|
23
|
+
onInput?: (e: Event) => void;
|
|
24
|
+
oninput?: (e: Event) => void;
|
|
25
|
+
} & Partial<Omit<import("./datepicker").WarpDatepicker, keyof HTMLElement>> & React.RefAttributes<import("./datepicker").WarpDatepicker>, "ref">, "header-format" | "weekday-format" | "day-format"> & {
|
|
26
|
+
headerFormat?: string;
|
|
27
|
+
weekdayFormat?: string;
|
|
28
|
+
dayFormat?: string;
|
|
29
|
+
} & React.RefAttributes<import("./datepicker").WarpDatepicker>>;
|
|
22
30
|
};
|
|
23
31
|
export default _default;
|
|
24
32
|
export type Story = StoryObj<typeof DatePicker>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { describeReactSsrAttributeMapping } from '../../tests/react-ssr-attributes';
|
|
2
|
+
import { DatePicker } from './react.js';
|
|
3
|
+
describeReactSsrAttributeMapping('DatePicker', DatePicker, [
|
|
4
|
+
{ propName: 'headerFormat', attrName: 'header-format', value: 'short' },
|
|
5
|
+
{ propName: 'weekdayFormat', attrName: 'weekday-format', value: 'narrow' },
|
|
6
|
+
{ propName: 'dayFormat', attrName: 'day-format', value: 'numeric' },
|
|
7
|
+
]);
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { WarpDatepicker } from './datepicker.js';
|
|
2
|
-
export declare const DatePicker:
|
|
3
|
-
onChange:
|
|
4
|
-
onchange:
|
|
5
|
-
onBlur:
|
|
6
|
-
onblur:
|
|
7
|
-
onInput:
|
|
8
|
-
oninput:
|
|
9
|
-
}
|
|
3
|
+
export declare const DatePicker: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<WarpDatepicker>, "value" | "input" | "form" | "label" | "name" | "locale" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "oninput" | "updated" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onBlur" | "onChange" | "onInput" | "month" | "calendar" | "wrapper" | "headerFormat" | "weekdayFormat" | "isDayDisabled" | "dayFormat" | "isCalendarOpen" | "navigationDate" | "selectedDate" | "weeks" | "toggleButton" | "previousMonthButton" | "todayCell" | "selectedCell"> & {
|
|
4
|
+
onChange?: (e: Event) => void;
|
|
5
|
+
onchange?: (e: Event) => void;
|
|
6
|
+
onBlur?: (e: Event) => void;
|
|
7
|
+
onblur?: (e: Event) => void;
|
|
8
|
+
onInput?: (e: Event) => void;
|
|
9
|
+
oninput?: (e: Event) => void;
|
|
10
|
+
} & Partial<Omit<WarpDatepicker, keyof HTMLElement>> & React.RefAttributes<WarpDatepicker>, "ref">, "header-format" | "weekday-format" | "day-format"> & {
|
|
11
|
+
headerFormat?: string;
|
|
12
|
+
weekdayFormat?: string;
|
|
13
|
+
dayFormat?: string;
|
|
14
|
+
} & React.RefAttributes<WarpDatepicker>>;
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
// decouple from CDN by providing a dummy class
|
|
5
5
|
class Component extends LitElement {
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
const BaseDatePicker = createComponent({
|
|
8
8
|
tagName: 'w-datepicker',
|
|
9
9
|
elementClass: Component,
|
|
10
10
|
react: React,
|
|
@@ -17,3 +17,11 @@ export const DatePicker = createComponent({
|
|
|
17
17
|
oninput: 'input',
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
|
+
export const DatePicker = React.forwardRef(({ headerFormat, weekdayFormat, dayFormat, ...props }, ref) => React.createElement(BaseDatePicker, {
|
|
21
|
+
...props,
|
|
22
|
+
...(headerFormat !== undefined ? { 'header-format': headerFormat } : {}),
|
|
23
|
+
...(weekdayFormat !== undefined ? { 'weekday-format': weekdayFormat } : {}),
|
|
24
|
+
...(dayFormat !== undefined ? { 'day-format': dayFormat } : {}),
|
|
25
|
+
ref,
|
|
26
|
+
}));
|
|
27
|
+
DatePicker.displayName = 'DatePicker';
|
|
@@ -3,8 +3,18 @@ import React from 'react';
|
|
|
3
3
|
import { Expandable } from './react';
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
|
-
render(args: Omit<React.HTMLAttributes<import("./expandable").WarpExpandable>, "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "updated" | "firstUpdated" | "render" | "renderOptions" | "buttonClass" | "bleed" | "expanded" | "box" | "contentClass" | "noChevron" | "animated" | "headingLevel" | "_hasTitle" | "_showChevronUp" | "_expandableSlot"> & {} & Partial<Omit<import("./expandable").WarpExpandable, keyof HTMLElement>> & React.RefAttributes<import("./expandable").WarpExpandable>
|
|
7
|
-
|
|
6
|
+
render(args: Omit<Omit<Omit<React.HTMLAttributes<import("./expandable").WarpExpandable>, "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "updated" | "firstUpdated" | "render" | "renderOptions" | "buttonClass" | "bleed" | "expanded" | "box" | "contentClass" | "noChevron" | "animated" | "headingLevel" | "_hasTitle" | "_showChevronUp" | "_expandableSlot"> & {} & Partial<Omit<import("./expandable").WarpExpandable, keyof HTMLElement>> & React.RefAttributes<import("./expandable").WarpExpandable>, "ref">, "button-class" | "content-class" | "no-chevron" | "heading-level"> & {
|
|
7
|
+
buttonClass?: string;
|
|
8
|
+
contentClass?: string;
|
|
9
|
+
noChevron?: boolean;
|
|
10
|
+
headingLevel?: number;
|
|
11
|
+
} & React.RefAttributes<import("./expandable").WarpExpandable>): React.JSX.Element;
|
|
12
|
+
component: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<import("./expandable").WarpExpandable>, "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "updated" | "firstUpdated" | "render" | "renderOptions" | "buttonClass" | "bleed" | "expanded" | "box" | "contentClass" | "noChevron" | "animated" | "headingLevel" | "_hasTitle" | "_showChevronUp" | "_expandableSlot"> & {} & Partial<Omit<import("./expandable").WarpExpandable, keyof HTMLElement>> & React.RefAttributes<import("./expandable").WarpExpandable>, "ref">, "button-class" | "content-class" | "no-chevron" | "heading-level"> & {
|
|
13
|
+
buttonClass?: string;
|
|
14
|
+
contentClass?: string;
|
|
15
|
+
noChevron?: boolean;
|
|
16
|
+
headingLevel?: number;
|
|
17
|
+
} & React.RefAttributes<import("./expandable").WarpExpandable>>;
|
|
8
18
|
};
|
|
9
19
|
export default _default;
|
|
10
20
|
export type Story = StoryObj<typeof Expandable>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { describeReactSsrAttributeMapping } from '../../tests/react-ssr-attributes';
|
|
2
|
+
import { Expandable } from './react.js';
|
|
3
|
+
describeReactSsrAttributeMapping('Expandable', Expandable, [
|
|
4
|
+
{ propName: 'buttonClass', attrName: 'button-class', value: 'button-class-name' },
|
|
5
|
+
{ propName: 'contentClass', attrName: 'content-class', value: 'content-class-name' },
|
|
6
|
+
{ propName: 'noChevron', attrName: 'no-chevron' },
|
|
7
|
+
{ propName: 'headingLevel', attrName: 'heading-level', value: 2 },
|
|
8
|
+
]);
|