@warp-ds/elements 2.8.2-next.1 → 2.8.2-next.3
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 +195 -121
- package/dist/index.d.ts +52 -22
- package/dist/packages/affix/affix.hydration.test.d.ts +1 -0
- package/dist/packages/affix/affix.hydration.test.js +33 -0
- package/dist/packages/affix/affix.js +5 -5
- package/dist/packages/affix/affix.js.map +3 -3
- package/dist/packages/alert/alert.d.ts +1 -0
- package/dist/packages/alert/alert.hydration.test.d.ts +1 -0
- package/dist/packages/alert/alert.hydration.test.js +47 -0
- package/dist/packages/alert/alert.js +7 -7
- package/dist/packages/alert/alert.js.map +3 -3
- package/dist/packages/alert/alert.test.js +21 -0
- package/dist/packages/attention/attention.hydration.test.d.ts +1 -0
- package/dist/packages/attention/attention.hydration.test.js +66 -0
- package/dist/packages/attention/attention.js +15 -15
- package/dist/packages/attention/attention.js.map +3 -3
- package/dist/packages/badge/badge.hydration.test.d.ts +1 -0
- package/dist/packages/badge/badge.hydration.test.js +50 -0
- package/dist/packages/badge/badge.js +2 -2
- package/dist/packages/badge/badge.js.map +3 -3
- package/dist/packages/badge/badge.test.js +14 -0
- package/dist/packages/box/box.hydration.test.d.ts +1 -0
- package/dist/packages/box/box.hydration.test.js +37 -0
- package/dist/packages/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/dist/packages/breadcrumbs/breadcrumbs.hydration.test.d.ts +1 -0
- package/dist/packages/breadcrumbs/breadcrumbs.hydration.test.js +141 -0
- package/dist/packages/breadcrumbs/breadcrumbs.js +7 -7
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
- package/dist/packages/breadcrumbs/breadcrumbs.test.js +3 -1
- package/dist/packages/button/button.hydration.test.d.ts +1 -0
- package/dist/packages/button/button.hydration.test.js +43 -0
- package/dist/packages/button/button.js +9 -9
- package/dist/packages/button/button.js.map +3 -3
- package/dist/packages/button/button.react.stories.d.ts +1 -1
- package/dist/packages/card/card.hydration.test.d.ts +1 -0
- package/dist/packages/card/card.hydration.test.js +38 -0
- package/dist/packages/card/card.react.stories.d.ts +1 -1
- package/dist/packages/checkbox/checkbox.d.ts +17 -1
- package/dist/packages/checkbox/checkbox.hydration.test.d.ts +1 -0
- package/dist/packages/checkbox/checkbox.hydration.test.js +47 -0
- package/dist/packages/checkbox/checkbox.js +20 -19
- package/dist/packages/checkbox/checkbox.js.map +3 -3
- package/dist/packages/checkbox/styles.js +10 -9
- package/dist/packages/checkbox-group/checkbox-group.d.ts +7 -0
- package/dist/packages/checkbox-group/checkbox-group.hydration.test.d.ts +2 -0
- package/dist/packages/checkbox-group/checkbox-group.hydration.test.js +40 -0
- package/dist/packages/checkbox-group/checkbox-group.js +14 -14
- package/dist/packages/checkbox-group/checkbox-group.js.map +3 -3
- package/dist/packages/checkbox-group/checkbox-group.test.js +10 -0
- package/dist/packages/combobox/combobox.hydration.test.d.ts +1 -0
- package/dist/packages/combobox/combobox.hydration.test.js +43 -0
- package/dist/packages/combobox/combobox.js +2 -2
- package/dist/packages/combobox/combobox.js.map +2 -2
- package/dist/packages/combobox/combobox.react.stories.d.ts +1 -1
- package/dist/packages/combobox/combobox.test.js +5 -2
- package/dist/packages/datepicker/datepicker.hydration.test.d.ts +1 -0
- package/dist/packages/datepicker/datepicker.hydration.test.js +40 -0
- package/dist/packages/datepicker/datepicker.js +5 -5
- package/dist/packages/datepicker/datepicker.js.map +3 -3
- package/dist/packages/datepicker/datepicker.react.stories.d.ts +1 -1
- package/dist/packages/expandable/expandable.hydration.test.d.ts +1 -0
- package/dist/packages/expandable/expandable.hydration.test.js +47 -0
- package/dist/packages/expandable/expandable.js +12 -12
- package/dist/packages/expandable/expandable.js.map +3 -3
- package/dist/packages/icon/icon.hydration.test.d.ts +1 -0
- package/dist/packages/icon/icon.hydration.test.js +47 -0
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +3 -3
- package/dist/packages/icon/icon.test.d.ts +1 -0
- package/dist/packages/icon/icon.test.js +51 -0
- package/dist/packages/link/link.hydration.test.d.ts +1 -0
- package/dist/packages/link/link.hydration.test.js +54 -0
- package/dist/packages/link/link.js +4 -4
- package/dist/packages/link/link.js.map +3 -3
- package/dist/packages/link/link.test.js +14 -0
- package/dist/packages/modal/modal.hydration.test.d.ts +1 -0
- package/dist/packages/modal/modal.hydration.test.js +25 -0
- package/dist/packages/modal-header/modal-header.js +6 -6
- package/dist/packages/modal-header/modal-header.js.map +3 -3
- package/dist/packages/page-indicator/page-indicator.hydration.test.d.ts +1 -0
- package/dist/packages/page-indicator/page-indicator.hydration.test.js +41 -0
- package/dist/packages/page-indicator/page-indicator.js +7 -7
- package/dist/packages/page-indicator/page-indicator.js.map +3 -3
- package/dist/packages/page-indicator/page-indicator.test.js +23 -0
- package/dist/packages/pagination/pagination.d.ts +4 -0
- package/dist/packages/pagination/pagination.hydration.test.d.ts +1 -0
- package/dist/packages/pagination/pagination.hydration.test.js +38 -0
- package/dist/packages/pagination/pagination.js +20 -20
- package/dist/packages/pagination/pagination.js.map +3 -3
- package/dist/packages/pagination/pagination.react.stories.d.ts +1 -1
- package/dist/packages/pagination/pagination.test.js +18 -0
- package/dist/packages/pill/pill.hydration.test.d.ts +1 -0
- package/dist/packages/pill/pill.hydration.test.js +32 -0
- package/dist/packages/pill/pill.js +5 -5
- package/dist/packages/pill/pill.js.map +3 -3
- package/dist/packages/radio/radio.a11y.test.js +15 -6
- package/dist/packages/radio/radio.d.ts +33 -1
- package/dist/packages/radio/radio.hydration.test.d.ts +1 -0
- package/dist/packages/radio/radio.hydration.test.js +29 -0
- package/dist/packages/radio/radio.js +7 -7
- package/dist/packages/radio/radio.js.map +3 -3
- package/dist/packages/radio/radio.test.js +22 -15
- package/dist/packages/radio-group/radio-group.a11y.test.js +4 -0
- package/dist/packages/radio-group/radio-group.hydration.test.d.ts +2 -0
- package/dist/packages/radio-group/radio-group.hydration.test.js +32 -0
- package/dist/packages/radio-group/radio-group.js +17 -17
- package/dist/packages/radio-group/radio-group.js.map +3 -3
- package/dist/packages/radio-group/radio-group.test.js +3 -2
- package/dist/packages/select/select.hydration.test.d.ts +1 -0
- package/dist/packages/select/select.hydration.test.js +37 -0
- package/dist/packages/select/select.js +13 -13
- package/dist/packages/select/select.js.map +3 -3
- package/dist/packages/select/select.react.stories.d.ts +1 -1
- package/dist/packages/slider/slider.hydration.test.d.ts +1 -0
- package/dist/packages/slider/slider.hydration.test.js +33 -0
- package/dist/packages/slider/slider.js +9 -9
- package/dist/packages/slider/slider.js.map +3 -3
- package/dist/packages/slider/slider.test.js +54 -0
- package/dist/packages/slider-thumb/slider-thumb.hydration.test.d.ts +1 -0
- package/dist/packages/slider-thumb/slider-thumb.hydration.test.js +35 -0
- package/dist/packages/slider-thumb/slider-thumb.js +16 -16
- package/dist/packages/slider-thumb/slider-thumb.js.map +3 -3
- package/dist/packages/step/step.d.ts +1 -0
- package/dist/packages/step/step.hydration.test.d.ts +1 -0
- package/dist/packages/step/step.hydration.test.js +25 -0
- package/dist/packages/step/step.js +4 -4
- package/dist/packages/step/step.js.map +3 -3
- package/dist/packages/step-indicator/step-indicator.a11y.test.js +3 -1
- package/dist/packages/step-indicator/step-indicator.hydration.test.d.ts +1 -0
- package/dist/packages/step-indicator/step-indicator.hydration.test.js +25 -0
- package/dist/packages/switch/switch.a11y.test.js +23 -9
- package/dist/packages/switch/switch.d.ts +6 -0
- package/dist/packages/switch/switch.hydration.test.d.ts +1 -0
- package/dist/packages/switch/switch.hydration.test.js +54 -0
- package/dist/packages/switch/switch.js +7 -13
- package/dist/packages/switch/switch.js.map +3 -3
- package/dist/packages/switch/switch.test.js +0 -5
- package/dist/packages/tab/tab.d.ts +39 -2
- package/dist/packages/tab/tab.hydration.test.d.ts +1 -0
- package/dist/packages/tab/tab.hydration.test.js +25 -0
- package/dist/packages/tab/tab.js +22 -12
- package/dist/packages/tab/tab.js.map +3 -3
- package/dist/packages/tab-panel/tab-panel.d.ts +23 -1
- package/dist/packages/tab-panel/tab-panel.hydration.test.d.ts +1 -0
- package/dist/packages/tab-panel/tab-panel.hydration.test.js +21 -0
- package/dist/packages/tab-panel/tab-panel.js +18 -3
- package/dist/packages/tab-panel/tab-panel.js.map +3 -3
- package/dist/packages/tabs/tabs.a11y.test.js +59 -8
- package/dist/packages/tabs/tabs.hydration.test.d.ts +1 -0
- package/dist/packages/tabs/tabs.hydration.test.js +20 -0
- package/dist/packages/tabs/tabs.js +6 -6
- package/dist/packages/tabs/tabs.js.map +3 -3
- package/dist/packages/tabs/tabs.test.js +93 -1
- package/dist/packages/textarea/textarea.hydration.test.d.ts +1 -0
- package/dist/packages/textarea/textarea.hydration.test.js +43 -0
- package/dist/packages/textarea/textarea.react.stories.d.ts +1 -1
- package/dist/packages/textfield/textfield.hydration.test.d.ts +1 -0
- package/dist/packages/textfield/textfield.hydration.test.js +43 -0
- package/dist/packages/textfield/textfield.js +2 -2
- package/dist/packages/textfield/textfield.js.map +2 -2
- package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
- package/dist/packages/textfield/textfield.test.js +26 -0
- package/dist/packages/toast/toast.js +6 -6
- package/dist/packages/toast/toast.js.map +3 -3
- package/dist/packages/toast/toast.test.d.ts +1 -0
- package/dist/packages/toast/toast.test.js +58 -0
- package/dist/setup-tests.d.ts +2 -1
- package/dist/setup-tests.js +4 -3
- package/dist/tests/react-hydration.d.ts +20 -0
- package/dist/tests/react-hydration.js +138 -0
- package/dist/web-types.json +67 -63
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -451,15 +451,11 @@ export type WarpBoxSolidJsProps = {
|
|
|
451
451
|
};
|
|
452
452
|
|
|
453
453
|
export type WarpBreadcrumbsProps = {
|
|
454
|
-
/** */
|
|
455
|
-
"aria-label"?: WarpBreadcrumbs["ariaLabel"];
|
|
456
454
|
/** */
|
|
457
455
|
ariaLabel?: WarpBreadcrumbs["ariaLabel"];
|
|
458
456
|
};
|
|
459
457
|
|
|
460
458
|
export type WarpBreadcrumbsSolidJsProps = {
|
|
461
|
-
/** */
|
|
462
|
-
"attr:aria-label"?: WarpBreadcrumbs["ariaLabel"];
|
|
463
459
|
/** */
|
|
464
460
|
"prop:ariaLabel"?: WarpBreadcrumbs["ariaLabel"];
|
|
465
461
|
|
|
@@ -1125,6 +1121,12 @@ export type WRadioProps = {
|
|
|
1125
1121
|
required?: WRadio["required"];
|
|
1126
1122
|
/** Draws the radio in an invalid state. */
|
|
1127
1123
|
invalid?: WRadio["invalid"];
|
|
1124
|
+
/** Override tabIndex setter to set _groupTabIndex (for backwards compatibility).
|
|
1125
|
+
Radio-group should use _groupTabIndex directly for clarity. */
|
|
1126
|
+
tabIndex?: WRadio["tabIndex"];
|
|
1127
|
+
/** Internal tabindex for standalone radios (not in a group).
|
|
1128
|
+
Non-reflecting to avoid DOM changes during hydration. */
|
|
1129
|
+
_standaloneTabIndex?: WRadio["_standaloneTabIndex"];
|
|
1128
1130
|
};
|
|
1129
1131
|
|
|
1130
1132
|
export type WRadioSolidJsProps = {
|
|
@@ -1140,6 +1142,12 @@ export type WRadioSolidJsProps = {
|
|
|
1140
1142
|
"prop:required"?: WRadio["required"];
|
|
1141
1143
|
/** Draws the radio in an invalid state. */
|
|
1142
1144
|
"prop:invalid"?: WRadio["invalid"];
|
|
1145
|
+
/** Override tabIndex setter to set _groupTabIndex (for backwards compatibility).
|
|
1146
|
+
Radio-group should use _groupTabIndex directly for clarity. */
|
|
1147
|
+
"prop:tabIndex"?: WRadio["tabIndex"];
|
|
1148
|
+
/** Internal tabindex for standalone radios (not in a group).
|
|
1149
|
+
Non-reflecting to avoid DOM changes during hydration. */
|
|
1150
|
+
"prop:_standaloneTabIndex"?: WRadio["_standaloneTabIndex"];
|
|
1143
1151
|
|
|
1144
1152
|
/** Set the innerHTML of the element */
|
|
1145
1153
|
innerHTML?: string;
|
|
@@ -1636,17 +1644,19 @@ export type WarpTabProps = {
|
|
|
1636
1644
|
/** */
|
|
1637
1645
|
for?: WarpTab["for"];
|
|
1638
1646
|
/** */
|
|
1639
|
-
"aria-
|
|
1647
|
+
"aria-controls"?: WarpTab["_ariaControlsAttr"];
|
|
1640
1648
|
/** */
|
|
1641
|
-
|
|
1649
|
+
_ariaControlsAttr?: WarpTab["_ariaControlsAttr"];
|
|
1642
1650
|
/** */
|
|
1643
|
-
|
|
1651
|
+
"aria-selected"?: WarpTab["ariaSelected"];
|
|
1644
1652
|
/** */
|
|
1645
|
-
|
|
1653
|
+
ariaSelected?: WarpTab["ariaSelected"];
|
|
1646
1654
|
/** @deprecated Use `aria-selected="true"` instead */
|
|
1647
1655
|
active?: WarpTab["active"];
|
|
1648
1656
|
/** */
|
|
1649
1657
|
over?: WarpTab["over"];
|
|
1658
|
+
/** Override tabIndex setter to set _parentTabIndex (for backwards compatibility). */
|
|
1659
|
+
tabIndex?: WarpTab["tabIndex"];
|
|
1650
1660
|
};
|
|
1651
1661
|
|
|
1652
1662
|
export type WarpTabSolidJsProps = {
|
|
@@ -1655,17 +1665,19 @@ export type WarpTabSolidJsProps = {
|
|
|
1655
1665
|
/** */
|
|
1656
1666
|
"prop:for"?: WarpTab["for"];
|
|
1657
1667
|
/** */
|
|
1658
|
-
"attr:aria-
|
|
1668
|
+
"attr:aria-controls"?: WarpTab["_ariaControlsAttr"];
|
|
1659
1669
|
/** */
|
|
1660
|
-
"prop:
|
|
1670
|
+
"prop:_ariaControlsAttr"?: WarpTab["_ariaControlsAttr"];
|
|
1661
1671
|
/** */
|
|
1662
|
-
"attr:
|
|
1672
|
+
"attr:aria-selected"?: WarpTab["ariaSelected"];
|
|
1663
1673
|
/** */
|
|
1664
|
-
"prop:
|
|
1674
|
+
"prop:ariaSelected"?: WarpTab["ariaSelected"];
|
|
1665
1675
|
/** @deprecated Use `aria-selected="true"` instead */
|
|
1666
1676
|
"prop:active"?: WarpTab["active"];
|
|
1667
1677
|
/** */
|
|
1668
1678
|
"prop:over"?: WarpTab["over"];
|
|
1679
|
+
/** Override tabIndex setter to set _parentTabIndex (for backwards compatibility). */
|
|
1680
|
+
"prop:tabIndex"?: WarpTab["tabIndex"];
|
|
1669
1681
|
|
|
1670
1682
|
/** Set the innerHTML of the element */
|
|
1671
1683
|
innerHTML?: string;
|
|
@@ -1674,13 +1686,15 @@ export type WarpTabSolidJsProps = {
|
|
|
1674
1686
|
};
|
|
1675
1687
|
|
|
1676
1688
|
export type WarpTabPanelProps = {
|
|
1677
|
-
/**
|
|
1678
|
-
|
|
1689
|
+
/** Whether this panel is active (visible).
|
|
1690
|
+
Set by parent w-tabs via the _parentActive property. */
|
|
1691
|
+
active?: WarpTabPanel["active"];
|
|
1679
1692
|
};
|
|
1680
1693
|
|
|
1681
1694
|
export type WarpTabPanelSolidJsProps = {
|
|
1682
|
-
/**
|
|
1683
|
-
|
|
1695
|
+
/** Whether this panel is active (visible).
|
|
1696
|
+
Set by parent w-tabs via the _parentActive property. */
|
|
1697
|
+
"prop:active"?: WarpTabPanel["active"];
|
|
1684
1698
|
|
|
1685
1699
|
/** Set the innerHTML of the element */
|
|
1686
1700
|
innerHTML?: string;
|
|
@@ -1986,7 +2000,7 @@ export type CustomElements = {
|
|
|
1986
2000
|
*
|
|
1987
2001
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
1988
2002
|
*
|
|
1989
|
-
* - `
|
|
2003
|
+
* - `ariaLabel`: undefined (property only)
|
|
1990
2004
|
*/
|
|
1991
2005
|
"w-breadcrumbs": Partial<
|
|
1992
2006
|
WarpBreadcrumbsProps & BaseProps<WarpBreadcrumbs> & BaseEvents
|
|
@@ -2029,6 +2043,7 @@ export type CustomElements = {
|
|
|
2029
2043
|
* - `required`: Makes the checkbox a required field.
|
|
2030
2044
|
* - `invalid`: Draws the checkbox in an invalid state.
|
|
2031
2045
|
* - `input`: undefined (property only)
|
|
2046
|
+
* - `_computedInvalid`: Computed invalid state: combines own invalid with group invalid (property only) (readonly)
|
|
2032
2047
|
* - `validationMessage`: Returns the validation message if the checkbox is invalid, otherwise an empty string (property only) (readonly)
|
|
2033
2048
|
* - `validity`: Returns the validity state of the checkbox (property only) (readonly)
|
|
2034
2049
|
*
|
|
@@ -2370,8 +2385,12 @@ export type CustomElements = {
|
|
|
2370
2385
|
* - `disabled`: Disables the radio.
|
|
2371
2386
|
* - `required`: Makes the radio a required field.
|
|
2372
2387
|
* - `invalid`: Draws the radio in an invalid state.
|
|
2388
|
+
* - `tabIndex`: Override tabIndex setter to set _groupTabIndex (for backwards compatibility).
|
|
2389
|
+
* Radio-group should use _groupTabIndex directly for clarity. (property only)
|
|
2373
2390
|
* - `validationMessage`: Returns the validation message if the radio is invalid, otherwise an empty string (property only) (readonly)
|
|
2374
2391
|
* - `validity`: Returns the validity state of the radio (property only) (readonly)
|
|
2392
|
+
* - `_standaloneTabIndex`: Internal tabindex for standalone radios (not in a group).
|
|
2393
|
+
* Non-reflecting to avoid DOM changes during hydration. (property only)
|
|
2375
2394
|
*
|
|
2376
2395
|
* ## Methods
|
|
2377
2396
|
*
|
|
@@ -2675,10 +2694,12 @@ export type CustomElements = {
|
|
|
2675
2694
|
*
|
|
2676
2695
|
* - `id`: undefined
|
|
2677
2696
|
* - `for`: undefined
|
|
2697
|
+
* - `aria-controls`/`_ariaControlsAttr`: undefined
|
|
2678
2698
|
* - `aria-selected`/`ariaSelected`: undefined
|
|
2679
|
-
* - `tabindex`/`tabIndex`: undefined
|
|
2680
2699
|
* - `active`: undefined
|
|
2681
2700
|
* - `over`: undefined
|
|
2701
|
+
* - `tabIndex`: Override tabIndex setter to set _parentTabIndex (for backwards compatibility). (property only)
|
|
2702
|
+
* - `_computedAriaSelected`: Computed aria-selected: prefers parent-managed, falls back to own property (property only) (readonly)
|
|
2682
2703
|
*/
|
|
2683
2704
|
"w-tab": Partial<WarpTabProps & BaseProps<WarpTab> & BaseEvents>;
|
|
2684
2705
|
|
|
@@ -2692,7 +2713,8 @@ export type CustomElements = {
|
|
|
2692
2713
|
*
|
|
2693
2714
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2694
2715
|
*
|
|
2695
|
-
* - `
|
|
2716
|
+
* - `active`: Whether this panel is active (visible).
|
|
2717
|
+
* Set by parent w-tabs via the _parentActive property.
|
|
2696
2718
|
*/
|
|
2697
2719
|
"w-tab-panel": Partial<
|
|
2698
2720
|
WarpTabPanelProps & BaseProps<WarpTabPanel> & BaseEvents
|
|
@@ -2979,7 +3001,7 @@ export type CustomElementsSolidJs = {
|
|
|
2979
3001
|
*
|
|
2980
3002
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2981
3003
|
*
|
|
2982
|
-
* - `
|
|
3004
|
+
* - `ariaLabel`: undefined (property only)
|
|
2983
3005
|
*/
|
|
2984
3006
|
"w-breadcrumbs": Partial<
|
|
2985
3007
|
WarpBreadcrumbsProps &
|
|
@@ -3027,6 +3049,7 @@ export type CustomElementsSolidJs = {
|
|
|
3027
3049
|
* - `required`: Makes the checkbox a required field.
|
|
3028
3050
|
* - `invalid`: Draws the checkbox in an invalid state.
|
|
3029
3051
|
* - `input`: undefined (property only)
|
|
3052
|
+
* - `_computedInvalid`: Computed invalid state: combines own invalid with group invalid (property only) (readonly)
|
|
3030
3053
|
* - `validationMessage`: Returns the validation message if the checkbox is invalid, otherwise an empty string (property only) (readonly)
|
|
3031
3054
|
* - `validity`: Returns the validity state of the checkbox (property only) (readonly)
|
|
3032
3055
|
*
|
|
@@ -3398,8 +3421,12 @@ export type CustomElementsSolidJs = {
|
|
|
3398
3421
|
* - `disabled`: Disables the radio.
|
|
3399
3422
|
* - `required`: Makes the radio a required field.
|
|
3400
3423
|
* - `invalid`: Draws the radio in an invalid state.
|
|
3424
|
+
* - `tabIndex`: Override tabIndex setter to set _groupTabIndex (for backwards compatibility).
|
|
3425
|
+
* Radio-group should use _groupTabIndex directly for clarity. (property only)
|
|
3401
3426
|
* - `validationMessage`: Returns the validation message if the radio is invalid, otherwise an empty string (property only) (readonly)
|
|
3402
3427
|
* - `validity`: Returns the validity state of the radio (property only) (readonly)
|
|
3428
|
+
* - `_standaloneTabIndex`: Internal tabindex for standalone radios (not in a group).
|
|
3429
|
+
* Non-reflecting to avoid DOM changes during hydration. (property only)
|
|
3403
3430
|
*
|
|
3404
3431
|
* ## Methods
|
|
3405
3432
|
*
|
|
@@ -3734,10 +3761,12 @@ export type CustomElementsSolidJs = {
|
|
|
3734
3761
|
*
|
|
3735
3762
|
* - `id`: undefined
|
|
3736
3763
|
* - `for`: undefined
|
|
3764
|
+
* - `aria-controls`/`_ariaControlsAttr`: undefined
|
|
3737
3765
|
* - `aria-selected`/`ariaSelected`: undefined
|
|
3738
|
-
* - `tabindex`/`tabIndex`: undefined
|
|
3739
3766
|
* - `active`: undefined
|
|
3740
3767
|
* - `over`: undefined
|
|
3768
|
+
* - `tabIndex`: Override tabIndex setter to set _parentTabIndex (for backwards compatibility). (property only)
|
|
3769
|
+
* - `_computedAriaSelected`: Computed aria-selected: prefers parent-managed, falls back to own property (property only) (readonly)
|
|
3741
3770
|
*/
|
|
3742
3771
|
"w-tab": Partial<
|
|
3743
3772
|
WarpTabProps & WarpTabSolidJsProps & BaseProps<WarpTab> & BaseEvents
|
|
@@ -3753,7 +3782,8 @@ export type CustomElementsSolidJs = {
|
|
|
3753
3782
|
*
|
|
3754
3783
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
3755
3784
|
*
|
|
3756
|
-
* - `
|
|
3785
|
+
* - `active`: Whether this panel is active (visible).
|
|
3786
|
+
* Set by parent w-tabs via the _parentActive property.
|
|
3757
3787
|
*/
|
|
3758
3788
|
"w-tab-panel": Partial<
|
|
3759
3789
|
WarpTabPanelProps &
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './affix.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { describe, expect, test, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import { setupHydrationWarningCapture, testHydration } from '../../tests/react-hydration';
|
|
3
|
+
import './affix.js';
|
|
4
|
+
describe('w-affix React SSR hydration', () => {
|
|
5
|
+
beforeEach(() => setupHydrationWarningCapture());
|
|
6
|
+
afterEach(() => {
|
|
7
|
+
window.__HYDRATION_WARNINGS__ = [];
|
|
8
|
+
});
|
|
9
|
+
test('default (no attributes) hydrates without warnings', async () => {
|
|
10
|
+
const warnings = await testHydration('w-affix', {});
|
|
11
|
+
expect(warnings).toEqual([]);
|
|
12
|
+
});
|
|
13
|
+
test('with label hydrates without warnings', async () => {
|
|
14
|
+
const warnings = await testHydration('w-affix', {
|
|
15
|
+
label: 'kr',
|
|
16
|
+
});
|
|
17
|
+
expect(warnings).toEqual([]);
|
|
18
|
+
});
|
|
19
|
+
test('with search hydrates without warnings', async () => {
|
|
20
|
+
const warnings = await testHydration('w-affix', {
|
|
21
|
+
search: true,
|
|
22
|
+
'aria-label': 'Search',
|
|
23
|
+
});
|
|
24
|
+
expect(warnings).toEqual([]);
|
|
25
|
+
});
|
|
26
|
+
test('with clear hydrates without warnings', async () => {
|
|
27
|
+
const warnings = await testHydration('w-affix', {
|
|
28
|
+
clear: true,
|
|
29
|
+
'aria-label': 'Clear',
|
|
30
|
+
});
|
|
31
|
+
expect(warnings).toEqual([]);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var L=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var i=(e,o,r,t)=>{for(var a=t>1?void 0:t?E(o,r):o,
|
|
1
|
+
var L=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var i=(e,o,r,t)=>{for(var a=t>1?void 0:t?E(o,r):o,n=e.length-1,c;n>=0;n--)(c=e[n])&&(a=(t?c(o,r,a):c(a))||a);return t&&a&&L(o,r,a),a};var g=function(){for(var e=[],o=arguments.length;o--;)e[o]=arguments[o];return e.reduce(function(r,t){return r.concat(typeof t=="string"?t:Array.isArray(t)?g.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};import{html as b,LitElement as F}from"lit";import{property as p}from"lit/decorators.js";import{ifDefined as z}from"lit/directives/if-defined.js";import{css as w}from"lit";var f=w`
|
|
2
2
|
*,
|
|
3
3
|
:before,
|
|
4
4
|
:after {
|
|
@@ -2462,17 +2462,17 @@ var L=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var i=(e,o,r,t
|
|
|
2462
2462
|
--w-icon-size: 32px;
|
|
2463
2463
|
}
|
|
2464
2464
|
|
|
2465
|
-
`;var v=new Map,T='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function X(e,o={}){var t;let r=(t=o.responseParser)!=null?t:(a=>a.text());return v.has(e)||v.set(e,fetch(e).then(r)),v.get(e)}var
|
|
2465
|
+
`;var v=new Map,T='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function X(e,o={}){var t;let r=(t=o.responseParser)!=null?t:(a=>a.text());return v.has(e)||v.set(e,fetch(e).then(r)),v.get(e)}var s=class extends S{constructor(){super(...arguments);this.svg=null}async fetchIcon(r){let a=`https://assets.finn.no/pkg/eikons/v1/${this.locale||"en"}/${r}.svg`;try{let n=await X(a);return new DOMParser().parseFromString(n,"text/html").body.querySelector("svg")}catch(n){return null}}firstUpdated(){this.loadIcon()}updated(r){(r.has("name")||r.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let r=await this.fetchIcon(this.name);r||(r=new DOMParser().parseFromString(T,"text/html").body.firstElementChild),this.svg=r}render(){let r=this.size||"medium",t=this.name||"",a={"w-icon":!0,"w-icon--s":r==="small","w-icon--m":r==="medium","w-icon--l":r==="large"},n=typeof r=="string"&&r.endsWith("px")?`--w-icon-size: ${r};`:"";return j`<div class="${P(a)}" style="${n}" part="w-${t.toLowerCase()}">${this.svg}</div>`}};s.styles=[k],i([u({type:String,reflect:!0})],s.prototype,"name",2),i([u({type:String,reflect:!0})],s.prototype,"size",2),i([u({type:String,reflect:!0})],s.prototype,"locale",2),i([$()],s.prototype,"svg",2);customElements.get("w-icon")||customElements.define("w-icon",s);var Z=["en","nb","fi","da","sv"],h="en",d=e=>Z.find(o=>e===o||e.toLowerCase().includes(o))||h;function m(){if(typeof window=="undefined"){let e=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return d(e)}try{let e=y(document);if(e)return d(e);let o=C();if(o)return d(o);let r=y(B());return r?d(r):h}catch(e){return console.warn("could not detect locale, falling back to source locale",e),h}}function B(){var e,o;try{return(o=(e=window.parent)==null?void 0:e.document)!=null?o:null}catch(r){return null}}function y(e){var o,r;try{return(r=(o=e==null?void 0:e.documentElement)==null?void 0:o.lang)!=null?r:""}catch(t){return""}}function C(){var e,o,r;try{return(r=(o=(e=window.frameElement)==null?void 0:e.getAttribute)==null?void 0:o.call(e,"lang"))!=null?r:""}catch(t){return""}}var _="absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ",O={wrapper:_+"right-0",wrapperWithLabel:"w-max pr-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs s-text"},R={wrapper:_+"left-0",wrapperWithLabel:"w-max pl-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs s-text"},l=class extends F{constructor(){super(...arguments);this.clear=!1;this.search=!1}get _classBase(){return this.slot==="suffix"?O:R}get _classes(){return g([this._classBase.wrapper,this.label?this._classBase.wrapperWithLabel:this._classBase.wrapperWithIcon])}get _searchButton(){return b`
|
|
2466
2466
|
<button aria-label="${z(this.ariaLabel)}" class="${this._classes}" type="submit">
|
|
2467
2467
|
<w-icon name="Search" size="small" locale="${m()}" class="flex"></w-icon>
|
|
2468
2468
|
</button>
|
|
2469
|
-
`}get _clearButton(){return
|
|
2469
|
+
`}get _clearButton(){return b`
|
|
2470
2470
|
<button aria-label="${z(this.ariaLabel)}" class="${this._classes}" type="reset">
|
|
2471
2471
|
<w-icon name="Close" size="small" locale="${m()}" class="flex"></w-icon>
|
|
2472
2472
|
</button>
|
|
2473
|
-
`}get _text(){return
|
|
2473
|
+
`}get _text(){return b`
|
|
2474
2474
|
<div class="${this._classes}">
|
|
2475
2475
|
<span class="${this._classBase.label}">${this.label}</span>
|
|
2476
2476
|
</div>
|
|
2477
|
-
`}get _markup(){if(this.label)return this._text;if(this.search)return this._searchButton;if(this.clear)return this._clearButton}render(){return
|
|
2477
|
+
`}get _markup(){if(this.label)return this._text;if(this.search)return this._searchButton;if(this.clear)return this._clearButton}render(){return b`${this._markup}`}};l.styles=[f,x],i([p({attribute:"aria-label"})],l.prototype,"ariaLabel",2),i([p({type:Boolean})],l.prototype,"clear",2),i([p({type:Boolean})],l.prototype,"search",2),i([p()],l.prototype,"label",2);customElements.get("w-affix")||customElements.define("w-affix",l);export{l as WarpAffix};
|
|
2478
2478
|
//# sourceMappingURL=affix.js.map
|