@smwb/ui-solid 1.0.0 → 2.0.0
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/assets/styles/less/components/badge/badge.entry.css +1 -1
- package/dist/assets/styles/less/components/tabs/tab/tab.entry.css +1 -1
- package/dist/assets/styles/less/tokens.entry.css +1 -1
- package/dist/components/dataDisplay/badge/badge.d.ts +2 -1
- package/dist/components/dataDisplay/badge/badge.js.map +1 -1
- package/dist/components/navigation/tabs/tabs.d.ts +4 -1
- package/dist/components/navigation/tabs/tabs.js.map +1 -1
- package/dist/headless/components/dataDisplay/badge/badge.js.map +1 -1
- package/dist/headless/components/navigation/tabs/tabs.js.map +1 -1
- package/dist/headless/source/components/dataDisplay/badge/badge.jsx.map +1 -1
- package/dist/headless/source/components/navigation/tabs/tabs.jsx.map +1 -1
- package/dist/source/components/dataDisplay/badge/badge.jsx.map +1 -1
- package/dist/source/components/navigation/tabs/tabs.jsx.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
.smwb-badge{border-radius:10px;z-index:2;font-weight:500;font-size:.75rem;padding:0 6px;color:#fff;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;height:20px;min-width:20px}.smwb-badge_outside{position:absolute}.smwb-badge_outside_top{top:0}.smwb-badge_outside_top_left{transform:scale(1) translate(-50%,-50%);left:-2px}.smwb-badge_outside_top_right{right:-2px;transform:scale(1) translate(50%,-50%)}.smwb-badge_outside_bottom{bottom:0}.smwb-badge_outside_bottom_right{right:-2px;transform:scale(1) translate(50%,50%)}.smwb-badge_outside_bottom_left{transform:scale(1) translate(-50%,50%);left:-2px}.smwb-badge_inside{position:static}.smwb-badge_success{background-color:var(--smui-successColor)}.smwb-badge_danger{background-color:var(--smui-errorColor)}.smwb-badge_primary{background-color:var(--smui-primaryColor)}.smwb-badge_no-content{padding:0;width:8px;height:8px;min-width:auto}.smwb-badge__wrapper{position:relative;display:inline-flex;align-items:center}
|
|
1
|
+
.smwb-badge{border-radius:10px;z-index:2;font-weight:500;font-size:.75rem;padding:0 6px;color:#fff;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;height:20px;min-width:20px}.smwb-badge_outside{position:absolute}.smwb-badge_outside_top{top:0}.smwb-badge_outside_top_left{transform:scale(1) translate(-50%,-50%);left:-2px}.smwb-badge_outside_top_right{right:-2px;transform:scale(1) translate(50%,-50%)}.smwb-badge_outside_bottom{bottom:0}.smwb-badge_outside_bottom_right{right:-2px;transform:scale(1) translate(50%,50%)}.smwb-badge_outside_bottom_left{transform:scale(1) translate(-50%,50%);left:-2px}.smwb-badge_inside{position:static}.smwb-badge_success{background-color:var(--smui-successColor)}.smwb-badge_danger{background-color:var(--smui-errorColor)}.smwb-badge_primary{background-color:var(--smui-primaryColor)}.smwb-badge_warning{background-color:var(--smui-warningColor);color:var(--smui-badgeWarningColor, #1c1b1f)}.smwb-badge_no-content{padding:0;width:8px;height:8px;min-width:auto}.smwb-badge__wrapper{position:relative;display:inline-flex;align-items:center}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.smwb-tab{position:relative;display:flex;align-items:center;flex:1 0 auto;justify-content:center;box-sizing:border-box;margin:0;padding:0 24px;min-height:48px;border:none;outline:none;background:none;text-align:center;white-space:nowrap;cursor:pointer;font-size:.875rem;line-height:2.25rem;font-weight:600;letter-spacing:.08928571em;text-decoration:none;text-transform:uppercase;-webkit-appearance:none;z-index:1}.smwb-tab:before{position:absolute;inset:0;opacity:0;content:"";transition:opacity 15ms linear,background-color 15ms linear;z-index:1;background-color:#6750a4}.smwb-tab:hover:before{opacity:.04}.smwb-tab:focus:before{opacity:.12;transition-duration:75ms}.smwb-tab:focus-visible{outline:2px solid var(--smui-primaryColor);outline-offset:-2px}.smwb-tab__content{position:relative;display:flex;align-items:center;justify-content:center;height:inherit}.smwb-tab__text-label{display:inline-block;line-height:1;color:var(--smui-tabColorDefault);transition:color .15s linear;z-index:2}.smwb-tab__icon{color:var(--smui-tabIconColor);fill:currentColor;width:24px;height:24px;font-size:24px;transition:color .15s linear;z-index:2;display:inline-flex;align-items:center;justify-content:center}.smwb-tab--active .smwb-tab__text-label,.smwb-tab--active .smwb-tab__icon{transition-delay:.1s;color:var(--smui-primaryColor)}.smwb-tab--stacked{height:72px}.smwb-tab--stacked .smwb-tab__text-label{padding-top:6px;padding-bottom:4px}.smwb-tab--stacked .smwb-tab__content{flex-direction:column}.smwb-tab:not(.smwb-tab--stacked) .smwb-tab__icon+.smwb-tab__text-label{padding-left:8px}.smwb-tab__ripple-child{color:#6750a4}.smwb-tab--disabled{opacity:.5;pointer-events:none;cursor:default}.smwb-tab-item{position:relative;display:flex;align-items:center;flex:1 0 auto}.smwb-tab-item:before{position:absolute;inset:0;opacity:0;content:"";pointer-events:none;transition:opacity 15ms linear;background-color:#6750a4}.smwb-tab-item:hover:not(.smwb-tab-item--disabled):before{opacity:.04}.smwb-tab-item>.smwb-tab:hover:before{opacity:0}.smwb-tab-item>.smwb-tab:focus:before{opacity:.12}.smwb-tab-item>.smwb-tab:not(:last-child){padding-right:8px}.smwb-tab__close,.smwb-tab__actions{position:relative;z-index:1;flex:0 0 auto;margin-right:4px}.smwb-tab__actions{display:inline-flex;align-items:center}.smwb-tab__close{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:24px;height:24px;padding:0;border:none;border-radius:50%;background:none;color:var(--smui-onSurfaceVariant);cursor:pointer}.smwb-tab__close:hover:not(:disabled){background-color:var(--smui-onSurfaceHover)}.smwb-tab__close:focus-visible{outline:2px solid var(--smui-primaryColor);outline-offset:-2px}.smwb-tab__close:disabled{opacity:.38;cursor:default}.smwb-tabs--dense .smwb-tab{padding:0 12px;font-weight:500;letter-spacing:normal;text-transform:none}.smwb-tabs .smwb-tab__close{opacity:0;pointer-events:none;transition:opacity .15s linear}.smwb-tabs .smwb-tab-item:hover:not(.smwb-tab-item--disabled) .smwb-tab__close:not(:disabled),.smwb-tabs .smwb-tab-item--active .smwb-tab__close:not(:disabled),.smwb-tabs .smwb-tab-item:focus-within .smwb-tab__close:not(:disabled){opacity:1;pointer-events:auto}.smwb-tabs .smwb-tab-item--dragging{opacity:.6}.smwb-tabs .smwb-tab-item--drop-target:after{content:"";position:absolute;top:0;bottom:0;left:0;width:2px;background-color:var(--smui-primaryColor);pointer-events:none}
|
|
1
|
+
.smwb-tab{position:relative;display:flex;align-items:center;flex:1 0 auto;justify-content:center;box-sizing:border-box;margin:0;padding:0 24px;min-height:48px;border:none;outline:none;background:none;text-align:center;white-space:nowrap;cursor:pointer;font-size:.875rem;line-height:2.25rem;font-weight:600;letter-spacing:.08928571em;text-decoration:none;text-transform:uppercase;-webkit-appearance:none;z-index:1}.smwb-tab:before{position:absolute;inset:0;opacity:0;content:"";transition:opacity 15ms linear,background-color 15ms linear;z-index:1;background-color:#6750a4}.smwb-tab:hover:before{opacity:.04}.smwb-tab:focus:before{opacity:.12;transition-duration:75ms}.smwb-tab:focus-visible{outline:2px solid var(--smui-primaryColor);outline-offset:-2px}.smwb-tab__content{position:relative;display:flex;align-items:center;justify-content:center;height:inherit}.smwb-tab__text-label{display:inline-block;line-height:1;color:var(--smui-tabColorDefault);transition:color .15s linear;z-index:2}.smwb-tab__icon{color:var(--smui-tabIconColor);fill:currentColor;width:24px;height:24px;font-size:24px;transition:color .15s linear;z-index:2;display:inline-flex;align-items:center;justify-content:center}.smwb-tab--active .smwb-tab__text-label,.smwb-tab--active .smwb-tab__icon{transition-delay:.1s;color:var(--smui-primaryColor)}.smwb-tab--stacked{height:72px}.smwb-tab--stacked .smwb-tab__text-label{padding-top:6px;padding-bottom:4px}.smwb-tab--stacked .smwb-tab__content{flex-direction:column}.smwb-tab:not(.smwb-tab--stacked) .smwb-tab__icon+.smwb-tab__text-label{padding-left:8px}.smwb-tab__ripple-child{color:#6750a4}.smwb-tab--disabled{opacity:.5;pointer-events:none;cursor:default}.smwb-tab-item{position:relative;display:flex;align-items:center;flex:1 0 auto}.smwb-tab-item:before{position:absolute;inset:0;opacity:0;content:"";pointer-events:none;transition:opacity 15ms linear;background-color:#6750a4}.smwb-tab-item:hover:not(.smwb-tab-item--disabled):before{opacity:.04}.smwb-tab-item>.smwb-tab:hover:before{opacity:0}.smwb-tab-item>.smwb-tab:focus:before{opacity:.12}.smwb-tab-item>.smwb-tab:not(:last-child){padding-right:8px}.smwb-tab__close,.smwb-tab__actions{position:relative;z-index:1;flex:0 0 auto;margin-right:4px}.smwb-tab__actions{display:inline-flex;align-items:center}.smwb-tab__close{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:24px;height:24px;padding:0;border:none;border-radius:50%;background:none;color:var(--smui-onSurfaceVariant);cursor:pointer}.smwb-tab__close:hover:not(:disabled){background-color:var(--smui-onSurfaceHover)}.smwb-tab__close:focus-visible{outline:2px solid var(--smui-primaryColor);outline-offset:-2px}.smwb-tab__close:disabled{opacity:.38;cursor:default}.smwb-tabs--dense .smwb-tab{min-height:var(--smui-tabDenseHeight, 36px);padding:0 12px;font-weight:500;letter-spacing:normal;text-transform:none}.smwb-tabs .smwb-tab__close{opacity:0;pointer-events:none;transition:opacity .15s linear}.smwb-tabs .smwb-tab-item:hover:not(.smwb-tab-item--disabled) .smwb-tab__close:not(:disabled),.smwb-tabs .smwb-tab-item--active .smwb-tab__close:not(:disabled),.smwb-tabs .smwb-tab-item:focus-within .smwb-tab__close:not(:disabled){opacity:1;pointer-events:auto}.smwb-tabs .smwb-tab-item--dragging{opacity:.6}.smwb-tabs .smwb-tab-item--drop-target:after{content:"";position:absolute;top:0;bottom:0;left:0;width:2px;background-color:var(--smui-primaryColor);pointer-events:none}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:where(:root){--smui-onSurfaceVariant: #49454e;--smui-onSurfaceColor: #1c1b1f;--smui-primaryColor: #6750a4;--smui-fontFamily: "Roboto", sans-serif;--smui-pageBackground: #fff;--smui-scrollThumbColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-surfaceBackground: #fffbfe;--smui-primaryTextColor: #000;--smui-onPrimaryColor: #fff;--smui-disabledTextColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-outlineColor: #79747e;--smui-onSurfaceHover: color-mix(in srgb, #1c1b1f 8%, transparent);--smui-onSurfaceActive: color-mix(in srgb, #1c1b1f 12%, transparent);--smui-onSurfaceFocus: color-mix(in srgb, #1c1b1f 12%, transparent);--smui-surfaceVariant: #e7e0ec;--smui-disabledBgColor: color-mix(in srgb, #1c1b1f 12%, transparent);--smui-primaryContainer: #eaddff;--smui-onPrimaryContainer: #21005e;--smui-onPrimaryContainerHover: color-mix(in srgb, #000 2%, #eaddff);--smui-onPrimaryContainerActive: color-mix(in srgb, #000 4%, #eaddff);--smui-primaryColorHover: color-mix(in srgb, #6750a4 8%, transparent);--smui-primaryColorActive: color-mix(in srgb, #6750a4 14%, transparent);--smui-primaryColorFocus: color-mix(in srgb, #6750a4 12%, transparent);--smui-secondaryColor: #625b71;--smui-errorColor: red;--smui-successColor: #36913b;--smui-warningColor: #ed6c02;--smui-infoColor: #0288d1;--smui-onSecondaryColor: #fff;--smui-onErrorColor: #fff;--smui-onSuccessColor: #fff;--smui-onWarningColor: #fff;--smui-onInfoColor: #fff;--smui-secondaryColorHover: color-mix(in srgb, #625b71 8%, transparent);--smui-secondaryColorActive: color-mix(in srgb, #625b71 14%, transparent);--smui-secondaryColorFocus: color-mix(in srgb, #625b71 12%, transparent);--smui-errorColorHover: color-mix(in srgb, red 8%, transparent);--smui-errorColorActive: color-mix(in srgb, red 14%, transparent);--smui-errorColorFocus: color-mix(in srgb, red 12%, transparent);--smui-successColorHover: color-mix(in srgb, #36913b 8%, transparent);--smui-successColorActive: color-mix(in srgb, #36913b 14%, transparent);--smui-successColorFocus: color-mix(in srgb, #36913b 12%, transparent);--smui-warningColorHover: color-mix(in srgb, #ed6c02 8%, transparent);--smui-warningColorActive: color-mix(in srgb, #ed6c02 14%, transparent);--smui-warningColorFocus: color-mix(in srgb, #ed6c02 12%, transparent);--smui-infoColorHover: color-mix(in srgb, #0288d1 8%, transparent);--smui-infoColorActive: color-mix(in srgb, #0288d1 14%, transparent);--smui-infoColorFocus: color-mix(in srgb, #0288d1 12%, transparent);--smui-dividerColor: rgba(0, 0, 0, .12);--smui-buttonOutlinedHoverBg: color-mix(in srgb, #6750a4 8%, transparent);--smui-buttonOutlinedActiveBg: color-mix(in srgb, #6750a4 12%, transparent);--smui-buttonOutlinedFocusBg: color-mix(in srgb, #6750a4 12%, transparent);--smui-buttonContainedHoverBg: color-mix(in srgb, #fff 4%, #6750a4);--smui-buttonContainedActiveBg: color-mix(in srgb, #fff 10%, #6750a4);--smui-buttonContainedFocusBg: color-mix(in srgb, #fff 10%, #6750a4);--smui-buttonDisabledBg: color-mix(in srgb, #1c1b1f 12%, transparent);--smui-checkboxBorderColor: #1c1b1f;--smui-checkboxDisabledColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-checkboxCheckedBg: #6750a4;--smui-toggleTrackColor: #e7e0ec;--smui-toggleThumbActiveColor: #fffbfe;--smui-toggleTrackActiveColor: #6750a4;--smui-toggleBorderColor: #79747e;--smui-chipsBg: #fffbfe;--smui-chipsIconColorHover: #6750a4;--smui-chipsIconColor: #6750a4;--smui-chipsOutlinedBorder: #79747e;--smui-chipsHoverBg: color-mix(in srgb, #1c1b1f 8%, transparent);--smui-chipsActiveBg: color-mix(in srgb, #1c1b1f 12%, transparent);--smui-chipsSelectedBg: #e8def8;--smui-menuTextColor: #1c1b1f;--smui-menuDividerColor: rgba(0, 0, 0, .12);--smui-menuDisabledTextColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-tabIconColor: #49454e;--smui-tabColorDefault: #49454e;--smui-sliderColor: #6750a4;--smui-sliderDisabledColor: #9e9e9e;--smui-fabFocusBg: color-mix(in srgb, #000 4%, #eaddff);--smui-fabActiveBg: color-mix(in srgb, #000 4%, #eaddff);--smui-fabHoverBg: color-mix(in srgb, #000 2%, #eaddff);--smui-indicatorTrackBg: #e7e0ec;--smui-appBarBg: #fffbfe;--smui-appBarContentColor: #49454e;--smui-navItemActiveBg: color-mix(in srgb, #6750a4 8%, transparent);--smui-tableBorderColor: color-mix(in srgb, #000 12%, transparent);--smui-tooltipBg: #6d6d6d;--smui-tooltipTextColor: #fff;--smui-textFieldLabelColor: rgba(0, 0, 0, .6);--smui-textFieldLabelDisabledColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-textFieldInputColor: rgba(0, 0, 0, .87);--smui-textFieldInputDisabledColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-textFieldNotchedColor: rgba(0, 0, 0, .38);--smui-textFieldNotchedHoverColor: #000;--smui-textFieldNotchedDisabledColor: rgba(0, 0, 0, .26);--smui-textFieldHelperTextColor: rgba(0, 0, 0, .6);--smui-textFieldHelperTextDisabledColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-textFieldFilledBorderColor: rgba(0, 0, 0, .42);--smui-textFieldFilledHoverBorderColor: #000;--smui-textFieldFilledDisabledBorderColor: rgba(0, 0, 0, .26);--smui-textFieldFilledBgColor: rgba(0, 0, 0, .05);--smui-textFieldFilledHoverBgColor: rgba(0, 0, 0, .07);--smui-textFieldFilledFocusedBgColor: rgba(0, 0, 0, .12);--smui-textFieldFilledDisabledBgColor: rgba(0, 0, 0, .045);--smui-selectFieldSearchMenuColor: rgba(0, 0, 0, .87);--smui-dataPickerIconDisabledColor: rgba(0, 0, 0, .26);--smui-dataPickerWeekDayColor: rgba(0, 0, 0, .6);--smui-messageBackground: color-mix(in srgb, #6750a4 10%, transparent);--smui-spacing-unit: 4px;--smui-space-xxs: 2px;--smui-space-xs: 4px;--smui-space-sm: 8px;--smui-space-md: 12px;--smui-space-lg: 16px;--smui-space-xl: 20px;--smui-space-xxl: 24px;--smui-space-xxxl: 32px;--smui-control-h-sm: 32px;--smui-control-h-md: 40px;--smui-control-h-lg: 48px;--smui-radius-xs: 2px;--smui-radius-sm: 4px;--smui-radius-md: 8px;--smui-radius-lg: 12px;--smui-radius-xl: 16px;--smui-radius-xxl: 28px;--smui-elevation-1: 0 2px 1px -1px rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 1px 3px 0 rgba(0, 0, 0, .12);--smui-elevation-2: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12);--smui-elevation-4: 0 2px 4px -1px rgba(0, 0, 0, .2), 0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12);--smui-elevation-6: 0 3px 5px -1px rgba(0, 0, 0, .2), 0 6px 10px 0 rgba(0, 0, 0, .14), 0 1px 18px 0 rgba(0, 0, 0, .12);--smui-elevation-8: 0 5px 5px -3px rgba(0, 0, 0, .2), 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12);--smui-elevation-12: 0 7px 8px -4px rgba(0, 0, 0, .2), 0 12px 17px 2px rgba(0, 0, 0, .14), 0 5px 22px 4px rgba(0, 0, 0, .12);--smui-elevation-24: 0 11px 15px -7px rgba(0, 0, 0, .2), 0 24px 38px 3px rgba(0, 0, 0, .14), 0 9px 46px 8px rgba(0, 0, 0, .12);--smui-bp-sm: 420px;--smui-bp-md: 768px;--smui-bp-lg: 1024px;--smui-bp-xl: 1200px}:where(:root[data-theme=dark]){--smui-onSurfaceVariant: #cac4d0;--smui-onSurfaceColor: #e6e1e5;--smui-primaryColor: #d0bcff;--smui-fontFamily: "Roboto", sans-serif;--smui-pageBackground: #1f1f1f;--smui-scrollThumbColor: rgba(255, 255, 255, .3);--smui-surfaceBackground: #1c1b1f;--smui-primaryTextColor: #fff;--smui-onPrimaryColor: #371e73;--smui-disabledTextColor: color-mix(in srgb, #e6e1e5 38%, transparent);--smui-outlineColor: #938f99;--smui-onSurfaceHover: color-mix(in srgb, #e6e1e5 8%, transparent);--smui-onSurfaceActive: color-mix(in srgb, #e6e1e5 12%, transparent);--smui-onSurfaceFocus: color-mix(in srgb, #e6e1e5 12%, transparent);--smui-surfaceVariant: #49454f;--smui-disabledBgColor: color-mix(in srgb, #e6e1e5 12%, transparent);--smui-primaryContainer: #4f378b;--smui-onPrimaryContainer: #eaddff;--smui-onPrimaryContainerHover: color-mix(in srgb, #fff 6%, #4f378b);--smui-onPrimaryContainerActive: color-mix(in srgb, #fff 10%, #4f378b);--smui-primaryColorHover: color-mix(in srgb, #d0bcff 8%, transparent);--smui-primaryColorActive: color-mix(in srgb, #d0bcff 14%, transparent);--smui-primaryColorFocus: color-mix(in srgb, #d0bcff 12%, transparent);--smui-dividerColor: rgba(255, 255, 255, .12);--smui-buttonOutlinedHoverBg: color-mix(in srgb, #d0bcff 8%, transparent);--smui-buttonOutlinedActiveBg: color-mix(in srgb, #d0bcff 12%, transparent);--smui-buttonOutlinedFocusBg: color-mix(in srgb, #d0bcff 12%, transparent);--smui-buttonContainedHoverBg: color-mix(in srgb, #fff 4%, #d0bcff);--smui-buttonContainedActiveBg: color-mix(in srgb, #fff 8%, #d0bcff);--smui-buttonContainedFocusBg: color-mix(in srgb, #fff 8%, #d0bcff);--smui-buttonDisabledBg: color-mix(in srgb, #e6e1e5 12%, transparent);--smui-checkboxBorderColor: #e6e1e5;--smui-checkboxDisabledColor: rgba(255, 255, 255, .3);--smui-checkboxCheckedBg: #d0bcff;--smui-toggleTrackColor: #49454f;--smui-toggleThumbActiveColor: #6750a4;--smui-toggleTrackActiveColor: #eaddff;--smui-toggleBorderColor: #938f99;--smui-chipsBg: color-mix(in srgb, #e6e1e5 8%, transparent);--smui-chipsIconColorHover: #e6e1e5;--smui-chipsIconColor: color-mix(in srgb, #e6e1e5 60%, transparent);--smui-chipsOutlinedBorder: #938f99;--smui-chipsHoverBg: color-mix(in srgb, #e6e1e5 12%, transparent);--smui-chipsActiveBg: color-mix(in srgb, #e6e1e5 16%, transparent);--smui-chipsSelectedBg: color-mix(in srgb, #e6e1e5 16%, transparent);--smui-menuTextColor: #e6e1e5;--smui-menuDividerColor: rgba(255, 255, 255, .12);--smui-menuDisabledTextColor: rgba(255, 255, 255, .3);--smui-tabIconColor: color-mix(in srgb, #fff 70%, transparent);--smui-tabColorDefault: color-mix(in srgb, #fff 70%, transparent);--smui-tableBorderColor: color-mix(in srgb, #fff 12%, transparent);--smui-sliderColor: #6750a4;--smui-sliderDisabledColor: #9e9e9e;--smui-fabFocusBg: color-mix(in srgb, #fff 10%, #4f378b);--smui-fabActiveBg: color-mix(in srgb, #fff 10%, #4f378b);--smui-fabHoverBg: color-mix(in srgb, #fff 6%, #4f378b);--smui-indicatorTrackBg: #49454f;--smui-appBarBg: #1c1b1f;--smui-appBarContentColor: #cac4d0;--smui-navItemActiveBg: transparent;--smui-tooltipBg: #fff;--smui-tooltipTextColor: #000;--smui-textFieldLabelColor: rgba(255, 255, 255, .7);--smui-textFieldLabelDisabledColor: rgba(255, 255, 255, .5);--smui-textFieldInputColor: #fff;--smui-textFieldInputDisabledColor: rgba(255, 255, 255, .5);--smui-textFieldNotchedColor: rgba(255, 255, 255, .3);--smui-textFieldNotchedHoverColor: #fff;--smui-textFieldNotchedDisabledColor: rgba(255, 255, 255, .3);--smui-textFieldHelperTextColor: rgba(255, 255, 255, .7);--smui-textFieldHelperTextDisabledColor: rgba(255, 255, 255, .5);--smui-textFieldFilledBorderColor: rgba(255, 255, 255, .7);--smui-textFieldFilledHoverBorderColor: #fff;--smui-textFieldFilledDisabledBorderColor: rgba(255, 255, 255, .5);--smui-textFieldFilledBgColor: rgba(255, 255, 255, .09);--smui-textFieldFilledHoverBgColor: rgba(255, 255, 255, .13);--smui-textFieldFilledFocusedBgColor: rgba(255, 255, 255, .13);--smui-textFieldFilledDisabledBgColor: rgba(255, 255, 255, .045);--smui-selectFieldSearchMenuColor: #fff;--smui-dataPickerIconDisabledColor: rgba(255, 255, 255, .5);--smui-dataPickerWeekDayColor: rgba(255, 255, 255, .6);--smui-messageBackground: #323232}
|
|
1
|
+
:where(:root){--smui-onSurfaceVariant: #49454e;--smui-onSurfaceColor: #1c1b1f;--smui-primaryColor: #6750a4;--smui-fontFamily: "Roboto", sans-serif;--smui-pageBackground: #fff;--smui-scrollThumbColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-surfaceBackground: #fffbfe;--smui-primaryTextColor: #000;--smui-onPrimaryColor: #fff;--smui-disabledTextColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-outlineColor: #79747e;--smui-onSurfaceHover: color-mix(in srgb, #1c1b1f 8%, transparent);--smui-onSurfaceActive: color-mix(in srgb, #1c1b1f 12%, transparent);--smui-onSurfaceFocus: color-mix(in srgb, #1c1b1f 12%, transparent);--smui-surfaceVariant: #e7e0ec;--smui-disabledBgColor: color-mix(in srgb, #1c1b1f 12%, transparent);--smui-primaryContainer: #eaddff;--smui-onPrimaryContainer: #21005e;--smui-onPrimaryContainerHover: color-mix(in srgb, #000 2%, #eaddff);--smui-onPrimaryContainerActive: color-mix(in srgb, #000 4%, #eaddff);--smui-primaryColorHover: color-mix(in srgb, #6750a4 8%, transparent);--smui-primaryColorActive: color-mix(in srgb, #6750a4 14%, transparent);--smui-primaryColorFocus: color-mix(in srgb, #6750a4 12%, transparent);--smui-secondaryColor: #625b71;--smui-errorColor: red;--smui-successColor: #36913b;--smui-warningColor: #ed6c02;--smui-infoColor: #0288d1;--smui-onSecondaryColor: #fff;--smui-onErrorColor: #fff;--smui-onSuccessColor: #fff;--smui-onWarningColor: #fff;--smui-onInfoColor: #fff;--smui-secondaryColorHover: color-mix(in srgb, #625b71 8%, transparent);--smui-secondaryColorActive: color-mix(in srgb, #625b71 14%, transparent);--smui-secondaryColorFocus: color-mix(in srgb, #625b71 12%, transparent);--smui-errorColorHover: color-mix(in srgb, red 8%, transparent);--smui-errorColorActive: color-mix(in srgb, red 14%, transparent);--smui-errorColorFocus: color-mix(in srgb, red 12%, transparent);--smui-successColorHover: color-mix(in srgb, #36913b 8%, transparent);--smui-successColorActive: color-mix(in srgb, #36913b 14%, transparent);--smui-successColorFocus: color-mix(in srgb, #36913b 12%, transparent);--smui-warningColorHover: color-mix(in srgb, #ed6c02 8%, transparent);--smui-warningColorActive: color-mix(in srgb, #ed6c02 14%, transparent);--smui-warningColorFocus: color-mix(in srgb, #ed6c02 12%, transparent);--smui-infoColorHover: color-mix(in srgb, #0288d1 8%, transparent);--smui-infoColorActive: color-mix(in srgb, #0288d1 14%, transparent);--smui-infoColorFocus: color-mix(in srgb, #0288d1 12%, transparent);--smui-dividerColor: rgba(0, 0, 0, .12);--smui-badgeWarningColor: #1c1b1f;--smui-buttonOutlinedHoverBg: color-mix(in srgb, #6750a4 8%, transparent);--smui-buttonOutlinedActiveBg: color-mix(in srgb, #6750a4 12%, transparent);--smui-buttonOutlinedFocusBg: color-mix(in srgb, #6750a4 12%, transparent);--smui-buttonContainedHoverBg: color-mix(in srgb, #fff 4%, #6750a4);--smui-buttonContainedActiveBg: color-mix(in srgb, #fff 10%, #6750a4);--smui-buttonContainedFocusBg: color-mix(in srgb, #fff 10%, #6750a4);--smui-buttonDisabledBg: color-mix(in srgb, #1c1b1f 12%, transparent);--smui-checkboxBorderColor: #1c1b1f;--smui-checkboxDisabledColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-checkboxCheckedBg: #6750a4;--smui-toggleTrackColor: #e7e0ec;--smui-toggleThumbActiveColor: #fffbfe;--smui-toggleTrackActiveColor: #6750a4;--smui-toggleBorderColor: #79747e;--smui-chipsBg: #fffbfe;--smui-chipsIconColorHover: #6750a4;--smui-chipsIconColor: #6750a4;--smui-chipsOutlinedBorder: #79747e;--smui-chipsHoverBg: color-mix(in srgb, #1c1b1f 8%, transparent);--smui-chipsActiveBg: color-mix(in srgb, #1c1b1f 12%, transparent);--smui-chipsSelectedBg: #e8def8;--smui-menuTextColor: #1c1b1f;--smui-menuDividerColor: rgba(0, 0, 0, .12);--smui-menuDisabledTextColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-tabIconColor: #49454e;--smui-tabColorDefault: #49454e;--smui-tabDenseHeight: 36px;--smui-sliderColor: #6750a4;--smui-sliderDisabledColor: #9e9e9e;--smui-fabFocusBg: color-mix(in srgb, #000 4%, #eaddff);--smui-fabActiveBg: color-mix(in srgb, #000 4%, #eaddff);--smui-fabHoverBg: color-mix(in srgb, #000 2%, #eaddff);--smui-indicatorTrackBg: #e7e0ec;--smui-appBarBg: #fffbfe;--smui-appBarContentColor: #49454e;--smui-navItemActiveBg: color-mix(in srgb, #6750a4 8%, transparent);--smui-tableBorderColor: color-mix(in srgb, #000 12%, transparent);--smui-tooltipBg: #6d6d6d;--smui-tooltipTextColor: #fff;--smui-textFieldLabelColor: rgba(0, 0, 0, .6);--smui-textFieldLabelDisabledColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-textFieldInputColor: rgba(0, 0, 0, .87);--smui-textFieldInputDisabledColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-textFieldNotchedColor: rgba(0, 0, 0, .38);--smui-textFieldNotchedHoverColor: #000;--smui-textFieldNotchedDisabledColor: rgba(0, 0, 0, .26);--smui-textFieldHelperTextColor: rgba(0, 0, 0, .6);--smui-textFieldHelperTextDisabledColor: color-mix(in srgb, #1c1b1f 38%, transparent);--smui-textFieldFilledBorderColor: rgba(0, 0, 0, .42);--smui-textFieldFilledHoverBorderColor: #000;--smui-textFieldFilledDisabledBorderColor: rgba(0, 0, 0, .26);--smui-textFieldFilledBgColor: rgba(0, 0, 0, .05);--smui-textFieldFilledHoverBgColor: rgba(0, 0, 0, .07);--smui-textFieldFilledFocusedBgColor: rgba(0, 0, 0, .12);--smui-textFieldFilledDisabledBgColor: rgba(0, 0, 0, .045);--smui-selectFieldSearchMenuColor: rgba(0, 0, 0, .87);--smui-dataPickerIconDisabledColor: rgba(0, 0, 0, .26);--smui-dataPickerWeekDayColor: rgba(0, 0, 0, .6);--smui-messageBackground: color-mix(in srgb, #6750a4 10%, transparent);--smui-spacing-unit: 4px;--smui-space-xxs: 2px;--smui-space-xs: 4px;--smui-space-sm: 8px;--smui-space-md: 12px;--smui-space-lg: 16px;--smui-space-xl: 20px;--smui-space-xxl: 24px;--smui-space-xxxl: 32px;--smui-control-h-sm: 32px;--smui-control-h-md: 40px;--smui-control-h-lg: 48px;--smui-radius-xs: 2px;--smui-radius-sm: 4px;--smui-radius-md: 8px;--smui-radius-lg: 12px;--smui-radius-xl: 16px;--smui-radius-xxl: 28px;--smui-elevation-1: 0 2px 1px -1px rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 1px 3px 0 rgba(0, 0, 0, .12);--smui-elevation-2: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12);--smui-elevation-4: 0 2px 4px -1px rgba(0, 0, 0, .2), 0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12);--smui-elevation-6: 0 3px 5px -1px rgba(0, 0, 0, .2), 0 6px 10px 0 rgba(0, 0, 0, .14), 0 1px 18px 0 rgba(0, 0, 0, .12);--smui-elevation-8: 0 5px 5px -3px rgba(0, 0, 0, .2), 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12);--smui-elevation-12: 0 7px 8px -4px rgba(0, 0, 0, .2), 0 12px 17px 2px rgba(0, 0, 0, .14), 0 5px 22px 4px rgba(0, 0, 0, .12);--smui-elevation-24: 0 11px 15px -7px rgba(0, 0, 0, .2), 0 24px 38px 3px rgba(0, 0, 0, .14), 0 9px 46px 8px rgba(0, 0, 0, .12);--smui-bp-sm: 420px;--smui-bp-md: 768px;--smui-bp-lg: 1024px;--smui-bp-xl: 1200px}:where(:root[data-theme=dark]){--smui-onSurfaceVariant: #cac4d0;--smui-onSurfaceColor: #e6e1e5;--smui-primaryColor: #d0bcff;--smui-fontFamily: "Roboto", sans-serif;--smui-pageBackground: #1f1f1f;--smui-scrollThumbColor: rgba(255, 255, 255, .3);--smui-surfaceBackground: #1c1b1f;--smui-primaryTextColor: #fff;--smui-onPrimaryColor: #371e73;--smui-disabledTextColor: color-mix(in srgb, #e6e1e5 38%, transparent);--smui-outlineColor: #938f99;--smui-onSurfaceHover: color-mix(in srgb, #e6e1e5 8%, transparent);--smui-onSurfaceActive: color-mix(in srgb, #e6e1e5 12%, transparent);--smui-onSurfaceFocus: color-mix(in srgb, #e6e1e5 12%, transparent);--smui-surfaceVariant: #49454f;--smui-disabledBgColor: color-mix(in srgb, #e6e1e5 12%, transparent);--smui-primaryContainer: #4f378b;--smui-onPrimaryContainer: #eaddff;--smui-onPrimaryContainerHover: color-mix(in srgb, #fff 6%, #4f378b);--smui-onPrimaryContainerActive: color-mix(in srgb, #fff 10%, #4f378b);--smui-primaryColorHover: color-mix(in srgb, #d0bcff 8%, transparent);--smui-primaryColorActive: color-mix(in srgb, #d0bcff 14%, transparent);--smui-primaryColorFocus: color-mix(in srgb, #d0bcff 12%, transparent);--smui-dividerColor: rgba(255, 255, 255, .12);--smui-buttonOutlinedHoverBg: color-mix(in srgb, #d0bcff 8%, transparent);--smui-buttonOutlinedActiveBg: color-mix(in srgb, #d0bcff 12%, transparent);--smui-buttonOutlinedFocusBg: color-mix(in srgb, #d0bcff 12%, transparent);--smui-buttonContainedHoverBg: color-mix(in srgb, #fff 4%, #d0bcff);--smui-buttonContainedActiveBg: color-mix(in srgb, #fff 8%, #d0bcff);--smui-buttonContainedFocusBg: color-mix(in srgb, #fff 8%, #d0bcff);--smui-buttonDisabledBg: color-mix(in srgb, #e6e1e5 12%, transparent);--smui-checkboxBorderColor: #e6e1e5;--smui-checkboxDisabledColor: rgba(255, 255, 255, .3);--smui-checkboxCheckedBg: #d0bcff;--smui-toggleTrackColor: #49454f;--smui-toggleThumbActiveColor: #6750a4;--smui-toggleTrackActiveColor: #eaddff;--smui-toggleBorderColor: #938f99;--smui-chipsBg: color-mix(in srgb, #e6e1e5 8%, transparent);--smui-chipsIconColorHover: #e6e1e5;--smui-chipsIconColor: color-mix(in srgb, #e6e1e5 60%, transparent);--smui-chipsOutlinedBorder: #938f99;--smui-chipsHoverBg: color-mix(in srgb, #e6e1e5 12%, transparent);--smui-chipsActiveBg: color-mix(in srgb, #e6e1e5 16%, transparent);--smui-chipsSelectedBg: color-mix(in srgb, #e6e1e5 16%, transparent);--smui-menuTextColor: #e6e1e5;--smui-menuDividerColor: rgba(255, 255, 255, .12);--smui-menuDisabledTextColor: rgba(255, 255, 255, .3);--smui-tabIconColor: color-mix(in srgb, #fff 70%, transparent);--smui-tabColorDefault: color-mix(in srgb, #fff 70%, transparent);--smui-tableBorderColor: color-mix(in srgb, #fff 12%, transparent);--smui-sliderColor: #6750a4;--smui-sliderDisabledColor: #9e9e9e;--smui-fabFocusBg: color-mix(in srgb, #fff 10%, #4f378b);--smui-fabActiveBg: color-mix(in srgb, #fff 10%, #4f378b);--smui-fabHoverBg: color-mix(in srgb, #fff 6%, #4f378b);--smui-indicatorTrackBg: #49454f;--smui-appBarBg: #1c1b1f;--smui-appBarContentColor: #cac4d0;--smui-navItemActiveBg: transparent;--smui-tooltipBg: #fff;--smui-tooltipTextColor: #000;--smui-textFieldLabelColor: rgba(255, 255, 255, .7);--smui-textFieldLabelDisabledColor: rgba(255, 255, 255, .5);--smui-textFieldInputColor: #fff;--smui-textFieldInputDisabledColor: rgba(255, 255, 255, .5);--smui-textFieldNotchedColor: rgba(255, 255, 255, .3);--smui-textFieldNotchedHoverColor: #fff;--smui-textFieldNotchedDisabledColor: rgba(255, 255, 255, .3);--smui-textFieldHelperTextColor: rgba(255, 255, 255, .7);--smui-textFieldHelperTextDisabledColor: rgba(255, 255, 255, .5);--smui-textFieldFilledBorderColor: rgba(255, 255, 255, .7);--smui-textFieldFilledHoverBorderColor: #fff;--smui-textFieldFilledDisabledBorderColor: rgba(255, 255, 255, .5);--smui-textFieldFilledBgColor: rgba(255, 255, 255, .09);--smui-textFieldFilledHoverBgColor: rgba(255, 255, 255, .13);--smui-textFieldFilledFocusedBgColor: rgba(255, 255, 255, .13);--smui-textFieldFilledDisabledBgColor: rgba(255, 255, 255, .045);--smui-selectFieldSearchMenuColor: #fff;--smui-dataPickerIconDisabledColor: rgba(255, 255, 255, .5);--smui-dataPickerWeekDayColor: rgba(255, 255, 255, .6);--smui-messageBackground: #323232}
|
|
@@ -2,7 +2,8 @@ import { type JSX, type ParentProps } from "solid-js";
|
|
|
2
2
|
import { type Ref } from "../../../primitives/mergeRefs";
|
|
3
3
|
export interface BadgeProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
4
4
|
badgeContent?: JSX.Element | number | string;
|
|
5
|
-
color
|
|
5
|
+
/** Semantic color; `warning` is amber, and carries dark ink to stay readable at this size. */
|
|
6
|
+
color?: "primary" | "success" | "danger" | "warning";
|
|
6
7
|
variant?: "inside" | "outside";
|
|
7
8
|
vertical?: "top" | "bottom";
|
|
8
9
|
horizontal?: "right" | "left";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sources":["../../../../src/components/dataDisplay/badge/badge.tsx"],"sourcesContent":["import { type JSX, type ParentProps, Show, children, mergeProps, splitProps } from \"solid-js\";\nimport cn from \"clsx\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\n\nexport interface BadgeProps extends JSX.HTMLAttributes<HTMLSpanElement> {\n badgeContent?: JSX.Element | number | string;\n color?: \"primary\" | \"success\" | \"danger\";\n variant?: \"inside\" | \"outside\";\n vertical?: \"top\" | \"bottom\";\n horizontal?: \"right\" | \"left\";\n /** Cap numeric content, rendering `{max}+` when exceeded. */\n max?: number;\n /** Render the badge even when content is 0. */\n showZero?: boolean;\n /** Accessible label for the badge value. */\n badgeAriaLabel?: string;\n ref?: Ref<HTMLSpanElement>;\n}\n\nexport function Badge(props: ParentProps<BadgeProps>): JSX.Element {\n const merged = mergeProps(\n {\n color: \"primary\" as const,\n variant: \"outside\" as const,\n vertical: \"top\" as const,\n horizontal: \"right\" as const,\n showZero: false,\n },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"color\",\n \"badgeContent\",\n \"variant\",\n \"vertical\",\n \"horizontal\",\n \"max\",\n \"showZero\",\n \"badgeAriaLabel\",\n \"children\",\n \"ref\",\n ]);\n\n // Read the content once: markup passed as a prop is created anew on every\n // read, and during hydration a copy the server never rendered has no DOM node.\n const content = children(() => local.badgeContent);\n const isZero = (): boolean => content() === 0 || content() === \"0\";\n const hidden = (): boolean => content() === undefined || content() === null || (isZero() && !local.showZero);\n\n const display = (): JSX.Element => {\n const value = content();\n return typeof value === \"number\" && local.max !== undefined && value > local.max ? `${local.max}+` : value;\n };\n\n return (\n <span class=\"smwb-badge__wrapper\" data-testid=\"badge\">\n {local.children}\n <span\n {...rest}\n ref={mergeRefs(local.ref)}\n class={cn(\n \"smwb-badge\",\n `smwb-badge_${local.color}`,\n `smwb-badge_${local.variant}`,\n `smwb-badge_${local.variant}_${local.vertical}`,\n `smwb-badge_${local.variant}_${local.vertical}_${local.horizontal}`,\n local.class,\n { \"smwb-badge_no-content\": hidden() }\n )}\n aria-label={local.badgeAriaLabel}\n >\n <Show when={!hidden()}>{display()}</Show>\n </span>\n </span>\n );\n}\n\nexport default Badge;\n"],"names":["Badge","props","merged","mergeProps","color","variant","vertical","horizontal","showZero","local","rest","splitProps","content","children","badgeContent","isZero","hidden","undefined","display","value","max","_el$","_tmpl$","_el$2","firstChild","_$insert","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","class","badgeAriaLabel","_$createComponent","Show","when"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../../src/components/dataDisplay/badge/badge.tsx"],"sourcesContent":["import { type JSX, type ParentProps, Show, children, mergeProps, splitProps } from \"solid-js\";\nimport cn from \"clsx\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\n\nexport interface BadgeProps extends JSX.HTMLAttributes<HTMLSpanElement> {\n badgeContent?: JSX.Element | number | string;\n /** Semantic color; `warning` is amber, and carries dark ink to stay readable at this size. */\n color?: \"primary\" | \"success\" | \"danger\" | \"warning\";\n variant?: \"inside\" | \"outside\";\n vertical?: \"top\" | \"bottom\";\n horizontal?: \"right\" | \"left\";\n /** Cap numeric content, rendering `{max}+` when exceeded. */\n max?: number;\n /** Render the badge even when content is 0. */\n showZero?: boolean;\n /** Accessible label for the badge value. */\n badgeAriaLabel?: string;\n ref?: Ref<HTMLSpanElement>;\n}\n\nexport function Badge(props: ParentProps<BadgeProps>): JSX.Element {\n const merged = mergeProps(\n {\n color: \"primary\" as const,\n variant: \"outside\" as const,\n vertical: \"top\" as const,\n horizontal: \"right\" as const,\n showZero: false,\n },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"color\",\n \"badgeContent\",\n \"variant\",\n \"vertical\",\n \"horizontal\",\n \"max\",\n \"showZero\",\n \"badgeAriaLabel\",\n \"children\",\n \"ref\",\n ]);\n\n // Read the content once: markup passed as a prop is created anew on every\n // read, and during hydration a copy the server never rendered has no DOM node.\n const content = children(() => local.badgeContent);\n const isZero = (): boolean => content() === 0 || content() === \"0\";\n const hidden = (): boolean => content() === undefined || content() === null || (isZero() && !local.showZero);\n\n const display = (): JSX.Element => {\n const value = content();\n return typeof value === \"number\" && local.max !== undefined && value > local.max ? `${local.max}+` : value;\n };\n\n return (\n <span class=\"smwb-badge__wrapper\" data-testid=\"badge\">\n {local.children}\n <span\n {...rest}\n ref={mergeRefs(local.ref)}\n class={cn(\n \"smwb-badge\",\n `smwb-badge_${local.color}`,\n `smwb-badge_${local.variant}`,\n `smwb-badge_${local.variant}_${local.vertical}`,\n `smwb-badge_${local.variant}_${local.vertical}_${local.horizontal}`,\n local.class,\n { \"smwb-badge_no-content\": hidden() }\n )}\n aria-label={local.badgeAriaLabel}\n >\n <Show when={!hidden()}>{display()}</Show>\n </span>\n </span>\n );\n}\n\nexport default Badge;\n"],"names":["Badge","props","merged","mergeProps","color","variant","vertical","horizontal","showZero","local","rest","splitProps","content","children","badgeContent","isZero","hidden","undefined","display","value","max","_el$","_tmpl$","_el$2","firstChild","_$insert","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","class","badgeAriaLabel","_$createComponent","Show","when"],"mappings":";;;;;;;AAsBO,SAASA,EAAMC,GAA6C;AACjE,QAAMC,IAASC,EACb;AAAA,IACEC,OAAO;AAAA,IACPC,SAAS;AAAA,IACTC,UAAU;AAAA,IACVC,YAAY;AAAA,IACZC,UAAU;AAAA,EAAA,GAEZP,CACF,GACM,CAACQ,GAAOC,CAAI,IAAIC,EAAWT,GAAQ,CACvC,SACA,SACA,gBACA,WACA,YACA,cACA,OACA,YACA,kBACA,YACA,KAAK,CACN,GAIKU,IAAUC,EAAS,MAAMJ,EAAMK,YAAY,GAC3CC,IAASA,MAAeH,EAAAA,MAAc,KAAKA,QAAc,KACzDI,IAASA,MAAeJ,EAAAA,MAAcK,UAAaL,QAAc,QAASG,EAAAA,KAAY,CAACN,EAAMD,UAE7FU,IAAUA,MAAmB;AACjC,UAAMC,IAAQP,EAAAA;AACd,WAAO,OAAOO,KAAU,YAAYV,EAAMW,QAAQH,UAAaE,IAAQV,EAAMW,MAAM,GAAGX,EAAMW,GAAG,MAAMD;AAAAA,EACvG;AAEA,UAAA,MAAA;AAAA,QAAAE,IAAAC,EAAAA,GAAAC,IAAAF,EAAAG;AAAAC,IAAAA,EAAAJ,GAAA,MAEKZ,EAAMI,UAAQU,CAAA;AAAA,QAAAG,IAGRC,EAAUlB,EAAMmB,GAAG;AAAC,kBAAAF,KAAA,cAAAG,EAAAH,GAAAH,CAAA,GAAAO,EAAAP,GAAAQ,EADrBrB,GAAI;AAAA,MAAA,IAAA,QAAA;AAAA,eAEDsB,EACL,cACA,cAAcvB,EAAML,KAAK,IACzB,cAAcK,EAAMJ,OAAO,IAC3B,cAAcI,EAAMJ,OAAO,IAAII,EAAMH,QAAQ,IAC7C,cAAcG,EAAMJ,OAAO,IAAII,EAAMH,QAAQ,IAAIG,EAAMF,UAAU,IACjEE,EAAMwB,OACN;AAAA,UAAE,yBAAyBjB,EAAAA;AAAAA,QAAO,CACpC;AAAA,MAAC;AAAA,MAAA,IAAA,eAAA;AAAA,eACWP,EAAMyB;AAAAA,MAAc;AAAA,IAAA,CAAA,GAAA,IAAA,EAAA,GAAAT,EAAAF,GAAAY,EAE/BC,GAAI;AAAA,MAAA,IAACC,OAAI;AAAA,eAAE,CAACrB,EAAAA;AAAAA,MAAQ;AAAA,MAAA,IAAAH,WAAA;AAAA,eAAGK,EAAAA;AAAAA,MAAS;AAAA,IAAA,CAAA,CAAA,GAAAG;AAAAA,EAAA,GAAA;AAIzC;"}
|
|
@@ -92,7 +92,10 @@ export interface TabsProps {
|
|
|
92
92
|
overflowMenu?: boolean;
|
|
93
93
|
/** Accessible label of the overflow-menu trigger. English by default; set it to localise. */
|
|
94
94
|
overflowMenuAriaLabel?: string;
|
|
95
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* Compact tabs: a shorter row — `--smui-tabDenseHeight` (36px) — with labels as written (no
|
|
97
|
+
* capitals, no letter spacing) and less padding.
|
|
98
|
+
*/
|
|
96
99
|
dense?: boolean;
|
|
97
100
|
/** Accessible label of the button that scrolls back. */
|
|
98
101
|
scrollBackAriaLabel?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sources":["../../../../src/components/navigation/tabs/tabs.tsx"],"sourcesContent":["import {\n type Accessor,\n type JSX,\n type ParentProps,\n For,\n Show,\n children,\n createComputed,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n mergeProps,\n on,\n onCleanup,\n onMount,\n splitProps,\n} from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport cn from \"clsx\";\nimport { debounce } from \"../../../utils/debounce\";\nimport { animate } from \"../../../utils/animate\";\nimport { matchesKeyboardShortcut } from \"../../../utils/keyboardShortcut\";\nimport { TabsContext, type TabInfo, type TabsContextValue } from \"./tabsContext\";\nimport { Tab } from \"./tab/tab\";\nimport { getHiddenIndexes } from \"./tabs.utils\";\nimport { Menu } from \"../menu\";\nimport { MenuItem } from \"../menu/menuItem\";\nimport { Icon } from \"../../base/icon\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\nimport { createRovingTabIndex } from \"../../../primitives/createRovingTabIndex\";\n\n/**\n * Tabs follow the WAI-ARIA tabs pattern with manual activation. The selected tab is the row's one\n * tab stop (`tabindex` 0, the others -1). The arrow keys along the row's `orientation` move focus to\n * the next or the previous tab (wrapping at the ends), Home and End to the first and the last one;\n * disabled tabs are skipped. Enter or Space then selects the focused tab, as a click does:\n * `onChange` is called for it, with the key's click. Moving focus changes nothing by itself, so a\n * row of link tabs does not navigate as the arrows pass them. Tab leaves the row for what follows\n * it, the selected `TabPanel` first when `panels` are given.\n *\n * A `Tab` can be `closable` and take `actions`; they sit beside the tab and out of the Tab order.\n * Delete on the focused tab, its close button or its `actions` (through `close`) ask `onClose` to\n * close it, and when it goes, focus moves to the tab that takes its place instead of falling to the\n * page. A middle click on a closable tab closes it too.\n *\n * With `onReorder` the row's tabs drag onto one another to reorder: `onReorder(from, to)` reports\n * the drop and the owner moves the tabs; dropping the selected tab reports its new index through\n * `onChange` as well, so the selection follows the moved tab. With `overflowMenu` a scrollable\n * row that overflows gains\n * a trigger beside it listing the clipped tabs. The chords Mod+W (close the focused closable tab)\n * and Mod+Shift+[ / Mod+Shift+] (switch to the previous / next tab) are handled on the row, as\n * best-effort: a browser of its own tabs reserves them.\n */\nexport interface TabsProps {\n /**\n * Index of the selected tab: its position in the row. Tabs count in the order they\n * render, so a tab behind a `<Show>` that is off takes no index, and tabs added,\n * removed or reordered count by their new place.\n */\n value: number;\n /**\n * Called with the index of the clicked tab, counted as for `value`. A tab chosen from the keyboard\n * (Enter or Space on the focused tab) calls it with that click too. A modified or non-primary\n * click (Ctrl, Meta, Shift or Alt held, or a button other than the main one) on a link tab\n * (`Tab` with `href`) is the browser's, as \"open in a new tab\": it does not call `onChange`.\n */\n onChange: (event: MouseEvent & { currentTarget: HTMLElement; target: Element }, index: number) => void;\n /**\n * Which way the tabs run. It sets `aria-orientation` on the tab list and picks the arrow keys that\n * move between tabs: Left and Right when horizontal, Up and Down when vertical. The styles draw\n * a horizontal row; a vertical list is yours to lay out.\n */\n orientation?: \"horizontal\" | \"vertical\";\n /**\n * The content of the tabs: `TabPanel`s, rendered after the tab row. With them each tab gets\n * `aria-controls` its panel and each panel `aria-labelledby` its tab. Without them the tabs link\n * to nothing, as before. Give a panel to every tab: a tab whose panel is left out still names it.\n * A `TabPanel` placed anywhere else is not linked to the tabs and is always shown.\n */\n panels?: JSX.Element;\n /**\n * Base of the ids that link tabs and panels: tab `n` is `{id}-tab-{n}`, its panel `{id}-panel-{n}`.\n * It is also the id of the root element. A generated one by default.\n */\n id?: string;\n /** Draw the indicator as wide as the selected tab's label rather than the whole tab. */\n indicatorContent?: boolean;\n /**\n * Let the tab row scroll sideways instead of clipping it. The edge beyond which\n * more tabs are hidden fades out.\n */\n scrollable?: boolean;\n /**\n * With `scrollable`: buttons at both ends that scroll the row while it overflows. They are for\n * the pointer and stay out of the Tab order: the arrow keys reach every tab and scroll it into\n * view.\n */\n scrollButtons?: boolean;\n /**\n * Present ⇒ the row is reorderable by dragging a tab onto another (pointer-only; there is no\n * keyboard reorder). `Tabs` does not move the tabs itself: it reports the drag with\n * `onReorder(from, to)` — indexes counted as for `value` — and the owner reorders its state.\n * The tabs keep their focus through a reorder; when the moved tab is the selected one,\n * `onChange` reports its new index too, so a controlled owner keeps it selected. That `onChange`\n * carries the drop's own event standing in for the click's: the index argument is authoritative —\n * `currentTarget` is the scroll area the drop delegates to, not the tab.\n */\n onReorder?: (from: number, to: number) => void;\n /**\n * With `scrollable`: when the row overflows, a trigger button is rendered beside the scroller\n * (in the scroll buttons' spot) that opens a menu of the tabs the viewport clips — any clipped\n * part beyond a 1px tolerance counts. Each entry shows the tab's icon and label, the selected one is marked\n * `aria-current=\"true\"`, and choosing one calls `onChange` for it and scrolls it into view.\n * The trigger appears only after the browser has measured an overflow, so the server markup\n * shows none.\n */\n overflowMenu?: boolean;\n /** Accessible label of the overflow-menu trigger. English by default; set it to localise. */\n overflowMenuAriaLabel?: string;\n /** Compact tabs: labels as written (no capitals, no letter spacing) and less padding. */\n dense?: boolean;\n /** Accessible label of the button that scrolls back. */\n scrollBackAriaLabel?: string;\n /** Accessible label of the button that scrolls forward. */\n scrollForwardAriaLabel?: string;\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\ninterface IndicatorStyle {\n root: { left?: number; width?: number };\n content?: { width: number };\n}\n\nconst VIEW_NEXT_TAB_PX = 40;\n/** A scroll button moves the row by this share of its visible width. */\nconst SCROLL_PAGE = 0.8;\n\n/** What Tabs knows of each of its tabs. */\ninterface Registration extends TabInfo {\n index: Accessor<number>;\n}\n\n/**\n * The tab list's children, resolved once, with their elements reported in order\n * whenever they change. It renders inside the context provider, so the tabs it\n * creates find their Tabs.\n */\nfunction TabListItems(props: { children?: JSX.Element; onItems: (items: Element[]) => void }): JSX.Element {\n const resolved = children(() => props.children);\n if (!isServer) {\n createComputed(() => props.onItems(resolved.toArray().filter((node) => node instanceof Element)));\n }\n return <>{resolved()}</>;\n}\n\n/**\n * The `panels`, resolved once, inside the context provider so that the panels find their Tabs, and\n * before the tab row renders so that the tabs know whether they control anything. It draws\n * nothing itself: Tabs places what it reports after the row.\n */\nfunction PanelsResolver(props: {\n children?: JSX.Element;\n onPanels: (panels: JSX.Element, has: boolean) => void;\n}): null {\n const resolved = children(() => props.children);\n createComputed(() =>\n props.onPanels(\n resolved(),\n resolved.toArray().some((node) => node != null && node !== false && node !== \"\")\n )\n );\n return null;\n}\n\nexport function Tabs(props: ParentProps<TabsProps>): JSX.Element {\n const merged = mergeProps(\n {\n indicatorContent: false,\n scrollable: false,\n scrollButtons: false,\n overflowMenu: false,\n dense: false,\n orientation: \"horizontal\" as const,\n scrollBackAriaLabel: \"Scroll tabs back\",\n scrollForwardAriaLabel: \"Scroll tabs forward\",\n overflowMenuAriaLabel: \"More tabs\",\n },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"children\",\n \"onChange\",\n \"value\",\n \"indicatorContent\",\n \"scrollable\",\n \"scrollButtons\",\n \"onReorder\",\n \"overflowMenu\",\n \"overflowMenuAriaLabel\",\n \"dense\",\n \"orientation\",\n \"panels\",\n \"id\",\n \"scrollBackAriaLabel\",\n \"scrollForwardAriaLabel\",\n \"aria-label\",\n \"ref\",\n ]);\n\n const generatedId = createUniqueId();\n const baseId = (): string => local.id ?? generatedId;\n const [registrations, setRegistrations] = createSignal<Registration[]>([]);\n // A tab's own id is the one its panel is labelled by.\n const tabId = (index: number): string =>\n registrations()\n .find((registration) => registration.index() === index)\n ?.id() ?? `${baseId()}-tab-${index}`;\n const panelId = (index: number): string => `${baseId()}-panel-${index}`;\n const [panels, setPanels] = createSignal<JSX.Element>();\n const [hasPanels, setHasPanels] = createSignal(false);\n // The tab that has focus while focus is in the tab list: it is the row's tab stop then, so\n // Tab from there leaves the row instead of landing on the selected tab again.\n const [focusedIndex, setFocusedIndex] = createSignal<number | null>(null);\n\n const [mounted, setMounted] = createSignal(false);\n const [indicatorStyle, setIndicatorStyle] = createSignal<IndicatorStyle>({ root: {} });\n // Whether tabs are hidden past the start / the end of a scrollable row. Only\n // measured in the browser, so the server markup shows neither.\n const [overflowStart, setOverflowStart] = createSignal(false);\n const [overflowEnd, setOverflowEnd] = createSignal(false);\n // The indexes of the tabs the scroller's viewport clips: what the overflow menu lists.\n // Empty on the server and until the first measurement, like the overflow state.\n const [hiddenIndexes, setHiddenIndexes] = createSignal<number[]>([]);\n // The overflow-menu trigger and its menu, composed here when `overflowMenu` is on.\n const [overflowOpen, setOverflowOpen] = createSignal(false);\n let overflowTriggerEl: HTMLButtonElement | undefined;\n\n let tabsEl: HTMLDivElement | undefined;\n let tabListEl: HTMLDivElement | undefined;\n // The tab the user asked to close while it, or something beside it, had focus: its item, which\n // goes with it, and its place. If it goes while focus is lost with it, focus moves on to a neighbour.\n let closingTab: { item: Element; index: number } | null = null;\n // The tab list's elements in order, known once its children have resolved in\n // the browser. Before that, and on the server, a tab's index is the order it\n // was created in, which is its order in the markup.\n const [items, setItems] = createSignal<Element[]>();\n let created = 0;\n\n const getTabsMeta = () => {\n let tabsMeta: { clientWidth: number; scrollLeft: number; left: number; right: number } | undefined;\n if (tabsEl) {\n const rect = tabsEl.getBoundingClientRect();\n tabsMeta = { clientWidth: tabsEl.clientWidth, scrollLeft: tabsEl.scrollLeft, left: rect.left, right: rect.right };\n }\n let tabMeta: DOMRect | null = null;\n let tabContentMeta: DOMRect | null = null;\n if (tabsEl && tabListEl && tabListEl.children.length > 0) {\n const tab = tabListEl.children[local.value];\n tabMeta = tab ? tab.getBoundingClientRect() : null;\n if (local.indicatorContent) {\n tabContentMeta = tab?.querySelector(\".smwb-tab__content\")?.getBoundingClientRect() ?? null;\n }\n }\n return { tabsMeta, tabMeta, tabContentMeta };\n };\n\n const updateIndicatorState = (): void => {\n const { tabsMeta, tabMeta, tabContentMeta } = getTabsMeta();\n let startValue = 0;\n if (tabMeta && tabsMeta) {\n startValue = tabMeta.left - tabsMeta.left + tabsMeta.scrollLeft;\n }\n const next: IndicatorStyle = { root: { left: startValue, width: tabMeta ? tabMeta.width : 0 } };\n if (local.indicatorContent && tabContentMeta) {\n next.content = { width: tabContentMeta.width };\n }\n const prev = indicatorStyle();\n if (prev.root.left === undefined || prev.root.width === undefined) {\n setIndicatorStyle(next);\n return;\n }\n const dStart = Math.abs((prev.root.left ?? 0) - (next.root.left ?? 0));\n const dSize = Math.abs((prev.root.width ?? 0) - (next.root.width ?? 0));\n if (dStart >= 1 || dSize >= 1) {\n setIndicatorStyle(next);\n }\n };\n\n const updateOverflow = (): void => {\n if (!tabsEl || !local.scrollable) {\n setOverflowStart(false);\n setOverflowEnd(false);\n setHiddenIndexes((prev) => (prev.length === 0 ? prev : []));\n return;\n }\n const max = tabsEl.scrollWidth - tabsEl.clientWidth;\n setOverflowStart(tabsEl.scrollLeft > 1);\n setOverflowEnd(tabsEl.scrollLeft < max - 1);\n // Which tabs the viewport clips, measured the same way: the scroller is `position: relative`,\n // so a tab's `offsetLeft` is its place in the row's content. Only the menu needs the list,\n // so nothing is measured without it. Kept by identity when unchanged, because this runs on\n // every scroll tick.\n const hidden = local.overflowMenu\n ? getHiddenIndexes(\n tabListEl\n ? Array.from(tabListEl.children).map((child) => {\n const item = child as HTMLElement;\n return { offsetLeft: item.offsetLeft, offsetWidth: item.offsetWidth };\n })\n : [],\n tabsEl.scrollLeft,\n tabsEl.clientWidth\n )\n : [];\n setHiddenIndexes((prev) =>\n prev.length === hidden.length && prev.every((index, at) => index === hidden[at]) ? prev : hidden\n );\n };\n\n const scroll = (scrollValue: number): void => {\n if (!tabsEl) return;\n animate(tabsEl, \"scrollLeft\", scrollValue, { duration: 300 });\n };\n\n const scrollByPage = (direction: -1 | 1): void => {\n if (!tabsEl) return;\n scroll(tabsEl.scrollLeft + direction * tabsEl.clientWidth * SCROLL_PAGE);\n };\n\n const scrollIndexIntoView = (index: number): void => {\n if (!tabsEl || !tabListEl) return;\n const tab = tabListEl.children[index];\n if (!tab) return;\n const tabsRect = tabsEl.getBoundingClientRect();\n const tabRect = tab.getBoundingClientRect();\n if (tabRect.left < tabsRect.left) {\n scroll(tabsEl.scrollLeft + (tabRect.left - tabsRect.left) - VIEW_NEXT_TAB_PX);\n } else if (tabRect.right > tabsRect.right) {\n scroll(tabsEl.scrollLeft + (tabRect.right - tabsRect.right) + VIEW_NEXT_TAB_PX);\n }\n };\n\n const scrollSelectedIntoView = (): void => {\n scrollIndexIntoView(local.value);\n };\n\n onMount(() => setMounted(true));\n\n // Re-measure when the active value or the tabs change (and on mount).\n createEffect(\n on([() => local.value, items], () => {\n updateIndicatorState();\n updateOverflow();\n })\n );\n\n // Keep the indicator and the overflow state in sync with resizes: of the\n // window, of the row, and of each tab (a label can grow with its data).\n onMount(() => {\n const onResize = debounce(() => {\n updateIndicatorState();\n updateOverflow();\n }, 166);\n const view = tabsEl?.ownerDocument.defaultView;\n view?.addEventListener(\"resize\", onResize);\n tabsEl?.addEventListener(\"scroll\", updateOverflow, { passive: true });\n let resizeObserver: ResizeObserver | undefined;\n if (typeof ResizeObserver !== \"undefined\" && tabListEl) {\n resizeObserver = new ResizeObserver(onResize);\n if (tabsEl) resizeObserver.observe(tabsEl);\n Array.from(tabListEl.children).forEach((child) => resizeObserver?.observe(child));\n }\n updateOverflow();\n onCleanup(() => {\n onResize.cancel();\n view?.removeEventListener(\"resize\", onResize);\n tabsEl?.removeEventListener(\"scroll\", updateOverflow);\n resizeObserver?.disconnect();\n });\n });\n\n // Scroll the selected tab into view when the indicator moves.\n createEffect(() => {\n indicatorStyle();\n scrollSelectedIntoView();\n });\n\n // The tabs in the DOM, by what they are: their indexes are the ones `value` counts.\n const getTabNodes = (): HTMLElement[] => Array.from(tabListEl?.querySelectorAll<HTMLElement>('[role=\"tab\"]') ?? []);\n // A tab with a close button or actions sits in an item with them: focus on any of it is focus on the tab.\n const itemOf = (tab: HTMLElement): HTMLElement => tab.closest<HTMLElement>(\".smwb-tab-item\") ?? tab;\n const indexOfFocus = (target: Node | null | undefined): number =>\n target ? getTabNodes().findIndex((node) => itemOf(node).contains(target)) : -1;\n const isNodeDisabled = (node: HTMLElement | undefined): boolean =>\n !node || node.getAttribute(\"aria-disabled\") === \"true\" || (node as HTMLButtonElement).disabled === true;\n\n // The selected tab is the stop; a value that points at no tab leaves the first one, and a\n // disabled one, which cannot take focus, leaves the first tab that can.\n const selectedStop = (): number => {\n const count = items()?.length;\n const candidate = count === undefined || (local.value >= 0 && local.value < count) ? local.value : 0;\n const list = registrations();\n if (!list.some((registration) => registration.index() === candidate && registration.disabled())) return candidate;\n const enabled = list\n .filter((registration) => !registration.disabled())\n .map((registration) => registration.index())\n .filter((index) => index >= 0);\n return enabled.length > 0 ? Math.min(...enabled) : candidate;\n };\n const stopIndex = (): number => focusedIndex() ?? selectedStop();\n\n const onRovingKeyDown = createRovingTabIndex({\n count: () => getTabNodes().length,\n activeIndex: stopIndex,\n get orientation() {\n return local.orientation;\n },\n onMove: (next) => getTabNodes()[next]?.focus(),\n isDisabled: (index) => isNodeDisabled(getTabNodes()[index]),\n });\n\n // Drag-to-reorder (with `onReorder`): the drag's source and drop target are the tab items,\n // tracked here on the row; Tabs only reports `onReorder(from, to)` — and, when the moved tab\n // is the selected one, its new index through `onChange` — and keeps the tabs' focus alone;\n // the owner moves the tabs in its state.\n // Only while `onReorder` is given do the items carry `draggable`, and a disabled tab\n // never: the attribute is rendered declaratively by each `Tab` on its item (the wrapper,\n // or the bare tab when there is none), so it is part of the server markup — as in React.\n let dragSourceIndex: number | null = null;\n let draggingItem: HTMLElement | null = null;\n let dropTargetItem: HTMLElement | null = null;\n const dragItemOf = (target: EventTarget | null): HTMLElement | null =>\n target instanceof Element ? itemOf(target as HTMLElement) : null;\n const clearDragMarks = (): void => {\n draggingItem?.classList.remove(\"smwb-tab-item--dragging\");\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n draggingItem = null;\n dropTargetItem = null;\n };\n\n const onItemDragStart: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (!local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n const index = indexOfFocus(item);\n if (index < 0 || isNodeDisabled(getTabNodes()[index])) return;\n dragSourceIndex = index;\n draggingItem = item;\n item.classList.add(\"smwb-tab-item--dragging\");\n // Firefox wants the drag given something to carry.\n event.dataTransfer?.setData(\"text/plain\", String(index));\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = \"move\";\n }\n };\n\n const onItemDragOver: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null || !local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n // Without it the drop is not allowed here.\n event.preventDefault();\n if (item === dropTargetItem) return;\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n dropTargetItem = item;\n item.classList.add(\"smwb-tab-item--drop-target\");\n };\n\n const onItemDrop: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null) return;\n const from = dragSourceIndex;\n dragSourceIndex = null;\n const to = indexOfFocus(dragItemOf(event.target));\n // Read before the drop is reported: the owner may answer `onReorder` synchronously and move\n // `value` with the tab, and moving a node in the DOM loses the focus in some environments.\n const sourceItem = draggingItem;\n const wasSelected = from === local.value;\n const doc = sourceItem?.ownerDocument;\n const hadFocus = Boolean(sourceItem && doc?.activeElement && sourceItem.contains(doc.activeElement));\n clearDragMarks();\n event.preventDefault();\n if (to >= 0 && to !== from) {\n local.onReorder?.(from, to);\n // The selection belongs to the tab: when the moved tab is the selected one, report its\n // new index as a click would, so a controlled owner moves the value with the tab. The\n // drop's event stands in for the click's, as the overflow menu's choice does.\n if (wasSelected) {\n local.onChange(event as unknown as MouseEvent & { currentTarget: HTMLElement; target: Element }, to);\n }\n // The focus belongs to the tab too: put it back on the moved tab when it had it. The\n // check that the node landed at `to` keeps this honest when the owner reorders later.\n if (hadFocus) {\n const moved = getTabNodes()[to];\n if (moved && itemOf(moved) === sourceItem) moved.focus();\n }\n }\n };\n\n const onItemDragEnd: JSX.EventHandler<HTMLDivElement, DragEvent> = () => {\n dragSourceIndex = null;\n clearDragMarks();\n };\n\n // Select the enabled tab `delta` places from the focused one, wrapping at the ends and\n // skipping disabled tabs: as Enter or Space would, through a synthesized click on the tab.\n const switchByChord = (event: KeyboardEvent & { target: Element }, delta: -1 | 1): void => {\n const nodes = getTabNodes();\n const from = indexOfFocus(event.target);\n if (from < 0 || nodes.length === 0) return;\n for (let step = 1; step <= nodes.length; step += 1) {\n const next = (from + delta * step + nodes.length) % nodes.length;\n const node = nodes[next];\n if (node && !isNodeDisabled(node)) {\n node.focus();\n node.click();\n return;\n }\n }\n };\n\n const onTabListKeyDown = (event: KeyboardEvent & { currentTarget: HTMLElement; target: Element }): void => {\n if (event.defaultPrevented) return;\n // The tabs' chords, ahead of the \"chords belong to the browser\" guard below. They are\n // best-effort: a browser of its own tabs reserves Mod+W and Mod+Shift+[/], and they\n // bite only in an embedded webview.\n if ((event.ctrlKey || event.metaKey) && !event.altKey && indexOfFocus(event.target) >= 0) {\n const index = indexOfFocus(event.target);\n const registration = registrations().find((candidate) => candidate.index() === index);\n if (matchesKeyboardShortcut(event, [\"Mod\", \"W\"])) {\n if (registration && !registration.disabled() && registration.closable()) {\n event.preventDefault();\n registration.requestClose(event);\n }\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"[\"])) {\n event.preventDefault();\n switchByChord(event, -1);\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"]\"])) {\n event.preventDefault();\n switchByChord(event, 1);\n return;\n }\n }\n // Chords belong to the browser; a handler that took the key first keeps it.\n if (event.ctrlKey || event.metaKey || event.altKey || event.shiftKey) return;\n if (!event.target.closest('[role=\"tab\"]')) return;\n onRovingKeyDown(event);\n };\n\n // Focus can leave the row without a focusout: the focused tab is removed, and the browser moves\n // focus to the body. The row keeps the focused tab as its stop only while focus is in it, on\n // the tab that has it now (tabs before it may have come or gone).\n createEffect(\n on(\n items,\n () => {\n const doc = tabListEl?.ownerDocument;\n const closing = closingTab;\n if (doc && closing && !closing.item.isConnected) {\n closingTab = null;\n // A tab the user closed took the focus with it: the tab that takes its place gets it (the\n // previous one if it was last), the nearest that is not disabled. Focus that went anywhere\n // else meanwhile stays there.\n if (!doc.activeElement || doc.activeElement === doc.body) {\n const nodes = getTabNodes();\n const from = Math.min(closing.index, nodes.length - 1);\n const candidates = [...nodes.keys()].filter((index) => !isNodeDisabled(nodes[index]));\n const target = candidates.find((index) => index >= from) ?? candidates[candidates.length - 1];\n if (target !== undefined) {\n nodes[target]?.focus();\n setFocusedIndex(target);\n return;\n }\n }\n }\n if (focusedIndex() === null) return;\n const index = indexOfFocus(doc?.activeElement);\n setFocusedIndex(index >= 0 ? index : null);\n },\n { defer: true }\n )\n );\n\n const onTabListFocusIn = (event: FocusEvent): void => {\n const index = indexOfFocus(event.target as Node);\n if (index >= 0) setFocusedIndex(index);\n if (closingTab && !closingTab.item.contains(event.target as Node)) closingTab = null;\n };\n\n const onTabListFocusOut = (event: FocusEvent & { currentTarget: HTMLElement }): void => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n setFocusedIndex(null);\n // Chromium fires this too as the focused tab is removed, just before it goes, and the removal\n // is what the marker is for: it stays until the effect that follows the removal has used it.\n // One still standing once the current task's microtasks run was a real blur: that close no\n // longer takes the focus anywhere.\n queueMicrotask(() => {\n if (closingTab?.item.isConnected) closingTab = null;\n });\n }\n };\n\n const contextValue: TabsContextValue = {\n value: () => local.value,\n tabStop: (index) => stopIndex() === index,\n tabId,\n panelId,\n hasPanels,\n reorderable: () => local.onReorder !== undefined,\n onChange: local.onChange,\n closing: (index, reason) => {\n const tab = getTabNodes()[index];\n const active = tab?.ownerDocument.activeElement;\n // Focus in the item is focus on the tab. A close from the tab's own `actions` is the user's\n // wherever focus is: it is in the menu then, which is drawn outside the row.\n const focused = reason === \"actions\" || Boolean(active && tab && itemOf(tab).contains(active));\n closingTab = tab && focused ? { item: itemOf(tab), index } : null;\n },\n registerTab: (element, info) => {\n const order = created++;\n const index = createMemo(() => {\n const list = items();\n if (!list) return order;\n const el = element();\n return el ? list.findIndex((item) => item.contains(el)) : -1;\n });\n const registration: Registration = { ...info, index };\n setRegistrations((list) => [...list, registration]);\n onCleanup(() => setRegistrations((list) => list.filter((item) => item !== registration)));\n return index;\n },\n };\n\n const showScrollButtons = (): boolean =>\n local.scrollable && local.scrollButtons && (overflowStart() || overflowEnd());\n\n // The overflow menu's trigger appears only once the browser has measured a clipped tab,\n // so the server markup — and the first client render — shows none.\n const showOverflowTrigger = (): boolean =>\n local.scrollable && local.overflowMenu && hiddenIndexes().length > 0;\n\n // The menu lists what the viewport clips; each entry shows a copy of the tab's icon and\n // label (the live nodes belong to the row, so they are cloned into the entry, not moved),\n // kept in step with the tab while the menu is open.\n const overflowItemIcon = (node: HTMLElement | undefined): Element | undefined =>\n node?.querySelector(\".smwb-tab__icon\") ?? undefined;\n const overflowItemLabel = (node: HTMLElement | undefined): string =>\n node?.querySelector(\".smwb-tab__text-label\")?.textContent ?? \"\";\n const cloneIconInto = (el: HTMLElement, node: HTMLElement | undefined): void => {\n const source = overflowItemIcon(node);\n if (!source) return;\n Array.from(source.childNodes).forEach((child) => el.appendChild(child.cloneNode(true)));\n };\n\n const chooseOverflowItem = (\n event: MouseEvent & { currentTarget: HTMLLIElement; target: Element },\n index: number\n ): void => {\n setOverflowOpen(false);\n local.onChange(event, index);\n scrollIndexIntoView(index);\n };\n\n return (\n <TabsContext.Provider value={contextValue}>\n <PanelsResolver onPanels={(resolved, has) => (setPanels(() => resolved), setHasPanels(has))}>\n {local.panels}\n </PanelsResolver>\n <div\n {...rest}\n id={local.id}\n class={cn(\n \"smwb-tabs\",\n {\n \"smwb-tabs--dense\": local.dense,\n \"smwb-tabs--overflow-start\": overflowStart(),\n \"smwb-tabs--overflow-end\": overflowEnd(),\n },\n local.class\n )}\n ref={mergeRefs(local.ref)}\n >\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--start\"\n aria-label={local.scrollBackAriaLabel}\n disabled={!overflowStart()}\n tabindex={-1}\n onClick={() => scrollByPage(-1)}\n >\n <Icon name=\"chevron_left\" size={20} />\n </button>\n </Show>\n {/* The scroller's class is static so it is on the element from the start:\n a ref on Tabs can find the row by class right away. */}\n <div\n class=\"smwb-tabs__scroller\"\n classList={{ \"smwb-tabs__scroller--scrollable\": local.scrollable }}\n ref={(el) => (tabsEl = el)}\n >\n <div\n class=\"smwb-tabs__scroll-area\"\n ref={(el) => (tabListEl = el)}\n role=\"tablist\"\n aria-label={local[\"aria-label\"]}\n aria-orientation={local.orientation}\n onKeyDown={onTabListKeyDown}\n onFocusIn={onTabListFocusIn}\n onFocusOut={onTabListFocusOut}\n onDragStart={onItemDragStart}\n onDragOver={onItemDragOver}\n onDrop={onItemDrop}\n onDragEnd={onItemDragEnd}\n >\n <TabListItems onItems={setItems}>{local.children}</TabListItems>\n </div>\n <Show when={mounted()}>\n <span\n class=\"smwb-tabs__indicator\"\n style={{\n left: `${indicatorStyle().root.left ?? 0}px`,\n width: `${indicatorStyle().root.width ?? 0}px`,\n }}\n >\n <span\n class=\"smwb-tabs__indicator-content\"\n style={indicatorStyle().content ? { width: `${indicatorStyle().content?.width ?? 0}px` } : {}}\n />\n </span>\n </Show>\n </div>\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--end\"\n aria-label={local.scrollForwardAriaLabel}\n disabled={!overflowEnd()}\n tabindex={-1}\n onClick={() => scrollByPage(1)}\n >\n <Icon name=\"chevron_right\" size={20} />\n </button>\n </Show>\n <Show when={showOverflowTrigger()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__overflow-trigger\"\n aria-haspopup=\"menu\"\n aria-expanded={overflowOpen()}\n aria-label={local.overflowMenuAriaLabel}\n tabindex={-1}\n ref={(el) => (overflowTriggerEl = el)}\n onClick={() => setOverflowOpen((open) => !open)}\n >\n <Icon name=\"more_horiz\" size={20} />\n </button>\n <Menu\n anchorElement={overflowTriggerEl ?? null}\n isOpen={overflowOpen()}\n onClose={() => setOverflowOpen(false)}\n placement=\"bottom-end\"\n >\n <For each={hiddenIndexes()}>\n {(index) => {\n // The entry mirrors the tab it stands for. Solid children resolve to DOM, not to\n // prop objects, so the tab's own node is the source for the label and the icon;\n // a MutationObserver keeps the entry in step with renames and re-icons while the\n // menu is open. Disabled follows the tab's registration, as in the row's other\n // disabled bookkeeping, so a tab that flips `disabled` in place greys its entry out.\n //\n // Which node that is cannot be settled once, when the entry is drawn: an owner that\n // keys its list by value replaces the tab's node when its label changes, while the\n // clipped set — and so this entry — keeps its identity. `items` and `registrations`\n // are what announce the row moving, and the effect below reads the node from the row\n // when it runs, which is after Solid has landed that move in the DOM; a node sampled\n // earlier, into a memo or into a const, is the detached one by then.\n const nodeNow = (): HTMLElement | undefined => getTabNodes()[index];\n // What the row shows at this index as the entry is drawn, so its first paint is not\n // an empty entry; the effect below keeps it current from then on.\n const drawn = nodeNow();\n const [label, setLabel] = createSignal(overflowItemLabel(drawn));\n const [hasIcon, setHasIcon] = createSignal(Boolean(overflowItemIcon(drawn)));\n const disabled = createMemo(() => {\n const registration = registrations().find((candidate) => candidate.index() === index);\n return registration ? registration.disabled() : isNodeDisabled(nodeNow());\n });\n let iconEl: HTMLSpanElement | undefined;\n // The node the entry's content was last taken from: the icon span copies from it\n // when it is drawn, which is after the sync that asked for it.\n let shownNode = drawn;\n const syncIcon = (node: HTMLElement | undefined): void => {\n shownNode = node;\n const source = overflowItemIcon(node);\n setHasIcon(Boolean(source));\n if (iconEl && source) {\n iconEl.textContent = \"\";\n cloneIconInto(iconEl, node);\n }\n };\n createEffect(\n on([items, registrations], () => {\n const node = nodeNow();\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n const item = node ? itemOf(node) : null;\n const view = item?.ownerDocument.defaultView;\n if (!item || !view || typeof view.MutationObserver === \"undefined\") return;\n const observer = new view.MutationObserver(() => {\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n });\n observer.observe(item, { subtree: true, childList: true, characterData: true });\n onCleanup(() => observer.disconnect());\n })\n );\n return (\n <MenuItem\n disabled={disabled()}\n aria-current={index === local.value ? \"true\" : undefined}\n onClick={(event) => chooseOverflowItem(event, index)}\n >\n <Show when={hasIcon()}>\n <span\n class=\"smwb-tab__icon\"\n aria-hidden=\"true\"\n ref={(el) => {\n iconEl = el;\n // The span is drawn by the flag the sync above sets, so it is born after\n // that sync: it copies the icon of the node the entry last followed.\n if (overflowItemIcon(shownNode)) cloneIconInto(el, shownNode);\n }}\n />\n </Show>\n <span class=\"smwb-tab__text-label\">{label()}</span>\n </MenuItem>\n );\n }}\n </For>\n </Menu>\n </Show>\n </div>\n {panels()}\n </TabsContext.Provider>\n );\n}\n\nexport { Tab };\nexport type { TabProps, TabActionsApi, TabCloseReason } from \"./tab/tab\";\nexport default Tabs;\n"],"names":["VIEW_NEXT_TAB_PX","SCROLL_PAGE","TabListItems","props","resolved","children","isServer","createComputed","onItems","toArray","filter","node","Element","_$memo","PanelsResolver","onPanels","some","Tabs","merged","mergeProps","indicatorContent","scrollable","scrollButtons","overflowMenu","dense","orientation","scrollBackAriaLabel","scrollForwardAriaLabel","overflowMenuAriaLabel","local","rest","splitProps","generatedId","createUniqueId","baseId","id","registrations","setRegistrations","createSignal","tabId","index","find","registration","panelId","panels","setPanels","hasPanels","setHasPanels","focusedIndex","setFocusedIndex","mounted","setMounted","indicatorStyle","setIndicatorStyle","root","overflowStart","setOverflowStart","overflowEnd","setOverflowEnd","hiddenIndexes","setHiddenIndexes","overflowOpen","setOverflowOpen","overflowTriggerEl","tabsEl","tabListEl","closingTab","items","setItems","created","getTabsMeta","tabsMeta","rect","getBoundingClientRect","clientWidth","scrollLeft","left","right","tabMeta","tabContentMeta","length","tab","value","querySelector","updateIndicatorState","startValue","next","width","content","prev","undefined","dStart","Math","abs","dSize","updateOverflow","max","scrollWidth","hidden","getHiddenIndexes","Array","from","map","child","item","offsetLeft","offsetWidth","every","at","scroll","scrollValue","animate","duration","scrollByPage","direction","scrollIndexIntoView","tabsRect","tabRect","scrollSelectedIntoView","onMount","createEffect","on","onResize","debounce","view","ownerDocument","defaultView","addEventListener","passive","resizeObserver","ResizeObserver","observe","forEach","onCleanup","cancel","removeEventListener","disconnect","getTabNodes","querySelectorAll","itemOf","closest","indexOfFocus","target","findIndex","contains","isNodeDisabled","getAttribute","disabled","selectedStop","count","candidate","list","enabled","min","stopIndex","onRovingKeyDown","createRovingTabIndex","activeIndex","onMove","focus","isDisabled","dragSourceIndex","draggingItem","dropTargetItem","dragItemOf","clearDragMarks","classList","remove","onItemDragStart","event","onReorder","add","dataTransfer","setData","String","effectAllowed","onItemDragOver","preventDefault","onItemDrop","to","sourceItem","wasSelected","doc","hadFocus","Boolean","activeElement","onChange","moved","onItemDragEnd","switchByChord","delta","nodes","step","click","onTabListKeyDown","defaultPrevented","ctrlKey","metaKey","altKey","matchesKeyboardShortcut","closable","requestClose","shiftKey","closing","isConnected","body","candidates","keys","defer","onTabListFocusIn","onTabListFocusOut","currentTarget","relatedTarget","queueMicrotask","contextValue","tabStop","reorderable","reason","active","focused","registerTab","element","info","order","createMemo","el","showScrollButtons","showOverflowTrigger","overflowItemIcon","overflowItemLabel","textContent","cloneIconInto","source","childNodes","appendChild","cloneNode","chooseOverflowItem","_$createComponent","TabsContext","Provider","has","_el$","_tmpl$5","_el$3","firstChild","_el$4","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","class","_$insert","Show","when","_el$2","_tmpl$","$$click","Icon","name","size","_$effect","_p$","_v$","_v$2","e","_$setAttribute","t","$$focusout","$$focusin","$$keydown","_el$5","_tmpl$2","_el$6","_v$3","_v$4","_v$5","_$setStyleProperty","a","_$style","_el$7","_tmpl$3","_v$6","_v$7","_el$8","_tmpl$4","open","_v$8","_v$9","Menu","anchorElement","isOpen","onClose","placement","For","each","nodeNow","drawn","label","setLabel","hasIcon","setHasIcon","iconEl","shownNode","syncIcon","MutationObserver","observer","subtree","childList","characterData","MenuItem","onClick","_el$9","_tmpl$6","_el$0","_tmpl$7","_v$0","_v$1","_v$10","toggle","_$delegateEvents"],"mappings":";;;;;;;;;;;;;;;;AA2IA,MAAMA,KAAmB,IAEnBC,KAAc;AAYpB,SAASC,GAAaC,GAAqF;AACzG,QAAMC,IAAWC,GAAS,MAAMF,EAAME,QAAQ;AAC9C,SAAKC,MACHC,GAAe,MAAMJ,EAAMK,QAAQJ,EAASK,QAAAA,EAAUC,OAAQC,CAAAA,MAASA,aAAgBC,OAAO,CAAC,CAAC,GAElGC,GAAUT,CAAQ;AACpB;AAOA,SAASU,GAAeX,GAGf;AACP,QAAMC,IAAWC,GAAS,MAAMF,EAAME,QAAQ;AAC9CE,SAA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,cAAAmB,EAAAK,IAAAkD,CAAA,GAAAC,MAAAxD,EAAAgB,KAAAZ,EAAAvB,GAAA,oBAAAmB,EAAAgB,IAAAwC,CAAA,GAAAxD;AAAAA,QAAA,GAAA;AAAA,UAAAG,GAAAjL;AAAAA,UAAAmL,GAAAnL;AAAAA,UAAA8L,GAAA9L;AAAAA,QAAAA,CAAA,GAAAuJ;AAAAA,MAAA,MAAApO,GAAA,MAwIxC+B,GAAAA,CAAQ,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAGf;AAIoBsR,GAAA,CAAA,SAAA,WAAA,WAAA,UAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"tabs.js","sources":["../../../../src/components/navigation/tabs/tabs.tsx"],"sourcesContent":["import {\n type Accessor,\n type JSX,\n type ParentProps,\n For,\n Show,\n children,\n createComputed,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n mergeProps,\n on,\n onCleanup,\n onMount,\n splitProps,\n} from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport cn from \"clsx\";\nimport { debounce } from \"../../../utils/debounce\";\nimport { animate } from \"../../../utils/animate\";\nimport { matchesKeyboardShortcut } from \"../../../utils/keyboardShortcut\";\nimport { TabsContext, type TabInfo, type TabsContextValue } from \"./tabsContext\";\nimport { Tab } from \"./tab/tab\";\nimport { getHiddenIndexes } from \"./tabs.utils\";\nimport { Menu } from \"../menu\";\nimport { MenuItem } from \"../menu/menuItem\";\nimport { Icon } from \"../../base/icon\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\nimport { createRovingTabIndex } from \"../../../primitives/createRovingTabIndex\";\n\n/**\n * Tabs follow the WAI-ARIA tabs pattern with manual activation. The selected tab is the row's one\n * tab stop (`tabindex` 0, the others -1). The arrow keys along the row's `orientation` move focus to\n * the next or the previous tab (wrapping at the ends), Home and End to the first and the last one;\n * disabled tabs are skipped. Enter or Space then selects the focused tab, as a click does:\n * `onChange` is called for it, with the key's click. Moving focus changes nothing by itself, so a\n * row of link tabs does not navigate as the arrows pass them. Tab leaves the row for what follows\n * it, the selected `TabPanel` first when `panels` are given.\n *\n * A `Tab` can be `closable` and take `actions`; they sit beside the tab and out of the Tab order.\n * Delete on the focused tab, its close button or its `actions` (through `close`) ask `onClose` to\n * close it, and when it goes, focus moves to the tab that takes its place instead of falling to the\n * page. A middle click on a closable tab closes it too.\n *\n * With `onReorder` the row's tabs drag onto one another to reorder: `onReorder(from, to)` reports\n * the drop and the owner moves the tabs; dropping the selected tab reports its new index through\n * `onChange` as well, so the selection follows the moved tab. With `overflowMenu` a scrollable\n * row that overflows gains\n * a trigger beside it listing the clipped tabs. The chords Mod+W (close the focused closable tab)\n * and Mod+Shift+[ / Mod+Shift+] (switch to the previous / next tab) are handled on the row, as\n * best-effort: a browser of its own tabs reserves them.\n */\nexport interface TabsProps {\n /**\n * Index of the selected tab: its position in the row. Tabs count in the order they\n * render, so a tab behind a `<Show>` that is off takes no index, and tabs added,\n * removed or reordered count by their new place.\n */\n value: number;\n /**\n * Called with the index of the clicked tab, counted as for `value`. A tab chosen from the keyboard\n * (Enter or Space on the focused tab) calls it with that click too. A modified or non-primary\n * click (Ctrl, Meta, Shift or Alt held, or a button other than the main one) on a link tab\n * (`Tab` with `href`) is the browser's, as \"open in a new tab\": it does not call `onChange`.\n */\n onChange: (event: MouseEvent & { currentTarget: HTMLElement; target: Element }, index: number) => void;\n /**\n * Which way the tabs run. It sets `aria-orientation` on the tab list and picks the arrow keys that\n * move between tabs: Left and Right when horizontal, Up and Down when vertical. The styles draw\n * a horizontal row; a vertical list is yours to lay out.\n */\n orientation?: \"horizontal\" | \"vertical\";\n /**\n * The content of the tabs: `TabPanel`s, rendered after the tab row. With them each tab gets\n * `aria-controls` its panel and each panel `aria-labelledby` its tab. Without them the tabs link\n * to nothing, as before. Give a panel to every tab: a tab whose panel is left out still names it.\n * A `TabPanel` placed anywhere else is not linked to the tabs and is always shown.\n */\n panels?: JSX.Element;\n /**\n * Base of the ids that link tabs and panels: tab `n` is `{id}-tab-{n}`, its panel `{id}-panel-{n}`.\n * It is also the id of the root element. A generated one by default.\n */\n id?: string;\n /** Draw the indicator as wide as the selected tab's label rather than the whole tab. */\n indicatorContent?: boolean;\n /**\n * Let the tab row scroll sideways instead of clipping it. The edge beyond which\n * more tabs are hidden fades out.\n */\n scrollable?: boolean;\n /**\n * With `scrollable`: buttons at both ends that scroll the row while it overflows. They are for\n * the pointer and stay out of the Tab order: the arrow keys reach every tab and scroll it into\n * view.\n */\n scrollButtons?: boolean;\n /**\n * Present ⇒ the row is reorderable by dragging a tab onto another (pointer-only; there is no\n * keyboard reorder). `Tabs` does not move the tabs itself: it reports the drag with\n * `onReorder(from, to)` — indexes counted as for `value` — and the owner reorders its state.\n * The tabs keep their focus through a reorder; when the moved tab is the selected one,\n * `onChange` reports its new index too, so a controlled owner keeps it selected. That `onChange`\n * carries the drop's own event standing in for the click's: the index argument is authoritative —\n * `currentTarget` is the scroll area the drop delegates to, not the tab.\n */\n onReorder?: (from: number, to: number) => void;\n /**\n * With `scrollable`: when the row overflows, a trigger button is rendered beside the scroller\n * (in the scroll buttons' spot) that opens a menu of the tabs the viewport clips — any clipped\n * part beyond a 1px tolerance counts. Each entry shows the tab's icon and label, the selected one is marked\n * `aria-current=\"true\"`, and choosing one calls `onChange` for it and scrolls it into view.\n * The trigger appears only after the browser has measured an overflow, so the server markup\n * shows none.\n */\n overflowMenu?: boolean;\n /** Accessible label of the overflow-menu trigger. English by default; set it to localise. */\n overflowMenuAriaLabel?: string;\n /**\n * Compact tabs: a shorter row — `--smui-tabDenseHeight` (36px) — with labels as written (no\n * capitals, no letter spacing) and less padding.\n */\n dense?: boolean;\n /** Accessible label of the button that scrolls back. */\n scrollBackAriaLabel?: string;\n /** Accessible label of the button that scrolls forward. */\n scrollForwardAriaLabel?: string;\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\ninterface IndicatorStyle {\n root: { left?: number; width?: number };\n content?: { width: number };\n}\n\nconst VIEW_NEXT_TAB_PX = 40;\n/** A scroll button moves the row by this share of its visible width. */\nconst SCROLL_PAGE = 0.8;\n\n/** What Tabs knows of each of its tabs. */\ninterface Registration extends TabInfo {\n index: Accessor<number>;\n}\n\n/**\n * The tab list's children, resolved once, with their elements reported in order\n * whenever they change. It renders inside the context provider, so the tabs it\n * creates find their Tabs.\n */\nfunction TabListItems(props: { children?: JSX.Element; onItems: (items: Element[]) => void }): JSX.Element {\n const resolved = children(() => props.children);\n if (!isServer) {\n createComputed(() => props.onItems(resolved.toArray().filter((node) => node instanceof Element)));\n }\n return <>{resolved()}</>;\n}\n\n/**\n * The `panels`, resolved once, inside the context provider so that the panels find their Tabs, and\n * before the tab row renders so that the tabs know whether they control anything. It draws\n * nothing itself: Tabs places what it reports after the row.\n */\nfunction PanelsResolver(props: {\n children?: JSX.Element;\n onPanels: (panels: JSX.Element, has: boolean) => void;\n}): null {\n const resolved = children(() => props.children);\n createComputed(() =>\n props.onPanels(\n resolved(),\n resolved.toArray().some((node) => node != null && node !== false && node !== \"\")\n )\n );\n return null;\n}\n\nexport function Tabs(props: ParentProps<TabsProps>): JSX.Element {\n const merged = mergeProps(\n {\n indicatorContent: false,\n scrollable: false,\n scrollButtons: false,\n overflowMenu: false,\n dense: false,\n orientation: \"horizontal\" as const,\n scrollBackAriaLabel: \"Scroll tabs back\",\n scrollForwardAriaLabel: \"Scroll tabs forward\",\n overflowMenuAriaLabel: \"More tabs\",\n },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"children\",\n \"onChange\",\n \"value\",\n \"indicatorContent\",\n \"scrollable\",\n \"scrollButtons\",\n \"onReorder\",\n \"overflowMenu\",\n \"overflowMenuAriaLabel\",\n \"dense\",\n \"orientation\",\n \"panels\",\n \"id\",\n \"scrollBackAriaLabel\",\n \"scrollForwardAriaLabel\",\n \"aria-label\",\n \"ref\",\n ]);\n\n const generatedId = createUniqueId();\n const baseId = (): string => local.id ?? generatedId;\n const [registrations, setRegistrations] = createSignal<Registration[]>([]);\n // A tab's own id is the one its panel is labelled by.\n const tabId = (index: number): string =>\n registrations()\n .find((registration) => registration.index() === index)\n ?.id() ?? `${baseId()}-tab-${index}`;\n const panelId = (index: number): string => `${baseId()}-panel-${index}`;\n const [panels, setPanels] = createSignal<JSX.Element>();\n const [hasPanels, setHasPanels] = createSignal(false);\n // The tab that has focus while focus is in the tab list: it is the row's tab stop then, so\n // Tab from there leaves the row instead of landing on the selected tab again.\n const [focusedIndex, setFocusedIndex] = createSignal<number | null>(null);\n\n const [mounted, setMounted] = createSignal(false);\n const [indicatorStyle, setIndicatorStyle] = createSignal<IndicatorStyle>({ root: {} });\n // Whether tabs are hidden past the start / the end of a scrollable row. Only\n // measured in the browser, so the server markup shows neither.\n const [overflowStart, setOverflowStart] = createSignal(false);\n const [overflowEnd, setOverflowEnd] = createSignal(false);\n // The indexes of the tabs the scroller's viewport clips: what the overflow menu lists.\n // Empty on the server and until the first measurement, like the overflow state.\n const [hiddenIndexes, setHiddenIndexes] = createSignal<number[]>([]);\n // The overflow-menu trigger and its menu, composed here when `overflowMenu` is on.\n const [overflowOpen, setOverflowOpen] = createSignal(false);\n let overflowTriggerEl: HTMLButtonElement | undefined;\n\n let tabsEl: HTMLDivElement | undefined;\n let tabListEl: HTMLDivElement | undefined;\n // The tab the user asked to close while it, or something beside it, had focus: its item, which\n // goes with it, and its place. If it goes while focus is lost with it, focus moves on to a neighbour.\n let closingTab: { item: Element; index: number } | null = null;\n // The tab list's elements in order, known once its children have resolved in\n // the browser. Before that, and on the server, a tab's index is the order it\n // was created in, which is its order in the markup.\n const [items, setItems] = createSignal<Element[]>();\n let created = 0;\n\n const getTabsMeta = () => {\n let tabsMeta: { clientWidth: number; scrollLeft: number; left: number; right: number } | undefined;\n if (tabsEl) {\n const rect = tabsEl.getBoundingClientRect();\n tabsMeta = { clientWidth: tabsEl.clientWidth, scrollLeft: tabsEl.scrollLeft, left: rect.left, right: rect.right };\n }\n let tabMeta: DOMRect | null = null;\n let tabContentMeta: DOMRect | null = null;\n if (tabsEl && tabListEl && tabListEl.children.length > 0) {\n const tab = tabListEl.children[local.value];\n tabMeta = tab ? tab.getBoundingClientRect() : null;\n if (local.indicatorContent) {\n tabContentMeta = tab?.querySelector(\".smwb-tab__content\")?.getBoundingClientRect() ?? null;\n }\n }\n return { tabsMeta, tabMeta, tabContentMeta };\n };\n\n const updateIndicatorState = (): void => {\n const { tabsMeta, tabMeta, tabContentMeta } = getTabsMeta();\n let startValue = 0;\n if (tabMeta && tabsMeta) {\n startValue = tabMeta.left - tabsMeta.left + tabsMeta.scrollLeft;\n }\n const next: IndicatorStyle = { root: { left: startValue, width: tabMeta ? tabMeta.width : 0 } };\n if (local.indicatorContent && tabContentMeta) {\n next.content = { width: tabContentMeta.width };\n }\n const prev = indicatorStyle();\n if (prev.root.left === undefined || prev.root.width === undefined) {\n setIndicatorStyle(next);\n return;\n }\n const dStart = Math.abs((prev.root.left ?? 0) - (next.root.left ?? 0));\n const dSize = Math.abs((prev.root.width ?? 0) - (next.root.width ?? 0));\n if (dStart >= 1 || dSize >= 1) {\n setIndicatorStyle(next);\n }\n };\n\n const updateOverflow = (): void => {\n if (!tabsEl || !local.scrollable) {\n setOverflowStart(false);\n setOverflowEnd(false);\n setHiddenIndexes((prev) => (prev.length === 0 ? prev : []));\n return;\n }\n const max = tabsEl.scrollWidth - tabsEl.clientWidth;\n setOverflowStart(tabsEl.scrollLeft > 1);\n setOverflowEnd(tabsEl.scrollLeft < max - 1);\n // Which tabs the viewport clips, measured the same way: the scroller is `position: relative`,\n // so a tab's `offsetLeft` is its place in the row's content. Only the menu needs the list,\n // so nothing is measured without it. Kept by identity when unchanged, because this runs on\n // every scroll tick.\n const hidden = local.overflowMenu\n ? getHiddenIndexes(\n tabListEl\n ? Array.from(tabListEl.children).map((child) => {\n const item = child as HTMLElement;\n return { offsetLeft: item.offsetLeft, offsetWidth: item.offsetWidth };\n })\n : [],\n tabsEl.scrollLeft,\n tabsEl.clientWidth\n )\n : [];\n setHiddenIndexes((prev) =>\n prev.length === hidden.length && prev.every((index, at) => index === hidden[at]) ? prev : hidden\n );\n };\n\n const scroll = (scrollValue: number): void => {\n if (!tabsEl) return;\n animate(tabsEl, \"scrollLeft\", scrollValue, { duration: 300 });\n };\n\n const scrollByPage = (direction: -1 | 1): void => {\n if (!tabsEl) return;\n scroll(tabsEl.scrollLeft + direction * tabsEl.clientWidth * SCROLL_PAGE);\n };\n\n const scrollIndexIntoView = (index: number): void => {\n if (!tabsEl || !tabListEl) return;\n const tab = tabListEl.children[index];\n if (!tab) return;\n const tabsRect = tabsEl.getBoundingClientRect();\n const tabRect = tab.getBoundingClientRect();\n if (tabRect.left < tabsRect.left) {\n scroll(tabsEl.scrollLeft + (tabRect.left - tabsRect.left) - VIEW_NEXT_TAB_PX);\n } else if (tabRect.right > tabsRect.right) {\n scroll(tabsEl.scrollLeft + (tabRect.right - tabsRect.right) + VIEW_NEXT_TAB_PX);\n }\n };\n\n const scrollSelectedIntoView = (): void => {\n scrollIndexIntoView(local.value);\n };\n\n onMount(() => setMounted(true));\n\n // Re-measure when the active value or the tabs change (and on mount).\n createEffect(\n on([() => local.value, items], () => {\n updateIndicatorState();\n updateOverflow();\n })\n );\n\n // Keep the indicator and the overflow state in sync with resizes: of the\n // window, of the row, and of each tab (a label can grow with its data).\n onMount(() => {\n const onResize = debounce(() => {\n updateIndicatorState();\n updateOverflow();\n }, 166);\n const view = tabsEl?.ownerDocument.defaultView;\n view?.addEventListener(\"resize\", onResize);\n tabsEl?.addEventListener(\"scroll\", updateOverflow, { passive: true });\n let resizeObserver: ResizeObserver | undefined;\n if (typeof ResizeObserver !== \"undefined\" && tabListEl) {\n resizeObserver = new ResizeObserver(onResize);\n if (tabsEl) resizeObserver.observe(tabsEl);\n Array.from(tabListEl.children).forEach((child) => resizeObserver?.observe(child));\n }\n updateOverflow();\n onCleanup(() => {\n onResize.cancel();\n view?.removeEventListener(\"resize\", onResize);\n tabsEl?.removeEventListener(\"scroll\", updateOverflow);\n resizeObserver?.disconnect();\n });\n });\n\n // Scroll the selected tab into view when the indicator moves.\n createEffect(() => {\n indicatorStyle();\n scrollSelectedIntoView();\n });\n\n // The tabs in the DOM, by what they are: their indexes are the ones `value` counts.\n const getTabNodes = (): HTMLElement[] => Array.from(tabListEl?.querySelectorAll<HTMLElement>('[role=\"tab\"]') ?? []);\n // A tab with a close button or actions sits in an item with them: focus on any of it is focus on the tab.\n const itemOf = (tab: HTMLElement): HTMLElement => tab.closest<HTMLElement>(\".smwb-tab-item\") ?? tab;\n const indexOfFocus = (target: Node | null | undefined): number =>\n target ? getTabNodes().findIndex((node) => itemOf(node).contains(target)) : -1;\n const isNodeDisabled = (node: HTMLElement | undefined): boolean =>\n !node || node.getAttribute(\"aria-disabled\") === \"true\" || (node as HTMLButtonElement).disabled === true;\n\n // The selected tab is the stop; a value that points at no tab leaves the first one, and a\n // disabled one, which cannot take focus, leaves the first tab that can.\n const selectedStop = (): number => {\n const count = items()?.length;\n const candidate = count === undefined || (local.value >= 0 && local.value < count) ? local.value : 0;\n const list = registrations();\n if (!list.some((registration) => registration.index() === candidate && registration.disabled())) return candidate;\n const enabled = list\n .filter((registration) => !registration.disabled())\n .map((registration) => registration.index())\n .filter((index) => index >= 0);\n return enabled.length > 0 ? Math.min(...enabled) : candidate;\n };\n const stopIndex = (): number => focusedIndex() ?? selectedStop();\n\n const onRovingKeyDown = createRovingTabIndex({\n count: () => getTabNodes().length,\n activeIndex: stopIndex,\n get orientation() {\n return local.orientation;\n },\n onMove: (next) => getTabNodes()[next]?.focus(),\n isDisabled: (index) => isNodeDisabled(getTabNodes()[index]),\n });\n\n // Drag-to-reorder (with `onReorder`): the drag's source and drop target are the tab items,\n // tracked here on the row; Tabs only reports `onReorder(from, to)` — and, when the moved tab\n // is the selected one, its new index through `onChange` — and keeps the tabs' focus alone;\n // the owner moves the tabs in its state.\n // Only while `onReorder` is given do the items carry `draggable`, and a disabled tab\n // never: the attribute is rendered declaratively by each `Tab` on its item (the wrapper,\n // or the bare tab when there is none), so it is part of the server markup — as in React.\n let dragSourceIndex: number | null = null;\n let draggingItem: HTMLElement | null = null;\n let dropTargetItem: HTMLElement | null = null;\n const dragItemOf = (target: EventTarget | null): HTMLElement | null =>\n target instanceof Element ? itemOf(target as HTMLElement) : null;\n const clearDragMarks = (): void => {\n draggingItem?.classList.remove(\"smwb-tab-item--dragging\");\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n draggingItem = null;\n dropTargetItem = null;\n };\n\n const onItemDragStart: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (!local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n const index = indexOfFocus(item);\n if (index < 0 || isNodeDisabled(getTabNodes()[index])) return;\n dragSourceIndex = index;\n draggingItem = item;\n item.classList.add(\"smwb-tab-item--dragging\");\n // Firefox wants the drag given something to carry.\n event.dataTransfer?.setData(\"text/plain\", String(index));\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = \"move\";\n }\n };\n\n const onItemDragOver: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null || !local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n // Without it the drop is not allowed here.\n event.preventDefault();\n if (item === dropTargetItem) return;\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n dropTargetItem = item;\n item.classList.add(\"smwb-tab-item--drop-target\");\n };\n\n const onItemDrop: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null) return;\n const from = dragSourceIndex;\n dragSourceIndex = null;\n const to = indexOfFocus(dragItemOf(event.target));\n // Read before the drop is reported: the owner may answer `onReorder` synchronously and move\n // `value` with the tab, and moving a node in the DOM loses the focus in some environments.\n const sourceItem = draggingItem;\n const wasSelected = from === local.value;\n const doc = sourceItem?.ownerDocument;\n const hadFocus = Boolean(sourceItem && doc?.activeElement && sourceItem.contains(doc.activeElement));\n clearDragMarks();\n event.preventDefault();\n if (to >= 0 && to !== from) {\n local.onReorder?.(from, to);\n // The selection belongs to the tab: when the moved tab is the selected one, report its\n // new index as a click would, so a controlled owner moves the value with the tab. The\n // drop's event stands in for the click's, as the overflow menu's choice does.\n if (wasSelected) {\n local.onChange(event as unknown as MouseEvent & { currentTarget: HTMLElement; target: Element }, to);\n }\n // The focus belongs to the tab too: put it back on the moved tab when it had it. The\n // check that the node landed at `to` keeps this honest when the owner reorders later.\n if (hadFocus) {\n const moved = getTabNodes()[to];\n if (moved && itemOf(moved) === sourceItem) moved.focus();\n }\n }\n };\n\n const onItemDragEnd: JSX.EventHandler<HTMLDivElement, DragEvent> = () => {\n dragSourceIndex = null;\n clearDragMarks();\n };\n\n // Select the enabled tab `delta` places from the focused one, wrapping at the ends and\n // skipping disabled tabs: as Enter or Space would, through a synthesized click on the tab.\n const switchByChord = (event: KeyboardEvent & { target: Element }, delta: -1 | 1): void => {\n const nodes = getTabNodes();\n const from = indexOfFocus(event.target);\n if (from < 0 || nodes.length === 0) return;\n for (let step = 1; step <= nodes.length; step += 1) {\n const next = (from + delta * step + nodes.length) % nodes.length;\n const node = nodes[next];\n if (node && !isNodeDisabled(node)) {\n node.focus();\n node.click();\n return;\n }\n }\n };\n\n const onTabListKeyDown = (event: KeyboardEvent & { currentTarget: HTMLElement; target: Element }): void => {\n if (event.defaultPrevented) return;\n // The tabs' chords, ahead of the \"chords belong to the browser\" guard below. They are\n // best-effort: a browser of its own tabs reserves Mod+W and Mod+Shift+[/], and they\n // bite only in an embedded webview.\n if ((event.ctrlKey || event.metaKey) && !event.altKey && indexOfFocus(event.target) >= 0) {\n const index = indexOfFocus(event.target);\n const registration = registrations().find((candidate) => candidate.index() === index);\n if (matchesKeyboardShortcut(event, [\"Mod\", \"W\"])) {\n if (registration && !registration.disabled() && registration.closable()) {\n event.preventDefault();\n registration.requestClose(event);\n }\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"[\"])) {\n event.preventDefault();\n switchByChord(event, -1);\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"]\"])) {\n event.preventDefault();\n switchByChord(event, 1);\n return;\n }\n }\n // Chords belong to the browser; a handler that took the key first keeps it.\n if (event.ctrlKey || event.metaKey || event.altKey || event.shiftKey) return;\n if (!event.target.closest('[role=\"tab\"]')) return;\n onRovingKeyDown(event);\n };\n\n // Focus can leave the row without a focusout: the focused tab is removed, and the browser moves\n // focus to the body. The row keeps the focused tab as its stop only while focus is in it, on\n // the tab that has it now (tabs before it may have come or gone).\n createEffect(\n on(\n items,\n () => {\n const doc = tabListEl?.ownerDocument;\n const closing = closingTab;\n if (doc && closing && !closing.item.isConnected) {\n closingTab = null;\n // A tab the user closed took the focus with it: the tab that takes its place gets it (the\n // previous one if it was last), the nearest that is not disabled. Focus that went anywhere\n // else meanwhile stays there.\n if (!doc.activeElement || doc.activeElement === doc.body) {\n const nodes = getTabNodes();\n const from = Math.min(closing.index, nodes.length - 1);\n const candidates = [...nodes.keys()].filter((index) => !isNodeDisabled(nodes[index]));\n const target = candidates.find((index) => index >= from) ?? candidates[candidates.length - 1];\n if (target !== undefined) {\n nodes[target]?.focus();\n setFocusedIndex(target);\n return;\n }\n }\n }\n if (focusedIndex() === null) return;\n const index = indexOfFocus(doc?.activeElement);\n setFocusedIndex(index >= 0 ? index : null);\n },\n { defer: true }\n )\n );\n\n const onTabListFocusIn = (event: FocusEvent): void => {\n const index = indexOfFocus(event.target as Node);\n if (index >= 0) setFocusedIndex(index);\n if (closingTab && !closingTab.item.contains(event.target as Node)) closingTab = null;\n };\n\n const onTabListFocusOut = (event: FocusEvent & { currentTarget: HTMLElement }): void => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n setFocusedIndex(null);\n // Chromium fires this too as the focused tab is removed, just before it goes, and the removal\n // is what the marker is for: it stays until the effect that follows the removal has used it.\n // One still standing once the current task's microtasks run was a real blur: that close no\n // longer takes the focus anywhere.\n queueMicrotask(() => {\n if (closingTab?.item.isConnected) closingTab = null;\n });\n }\n };\n\n const contextValue: TabsContextValue = {\n value: () => local.value,\n tabStop: (index) => stopIndex() === index,\n tabId,\n panelId,\n hasPanels,\n reorderable: () => local.onReorder !== undefined,\n onChange: local.onChange,\n closing: (index, reason) => {\n const tab = getTabNodes()[index];\n const active = tab?.ownerDocument.activeElement;\n // Focus in the item is focus on the tab. A close from the tab's own `actions` is the user's\n // wherever focus is: it is in the menu then, which is drawn outside the row.\n const focused = reason === \"actions\" || Boolean(active && tab && itemOf(tab).contains(active));\n closingTab = tab && focused ? { item: itemOf(tab), index } : null;\n },\n registerTab: (element, info) => {\n const order = created++;\n const index = createMemo(() => {\n const list = items();\n if (!list) return order;\n const el = element();\n return el ? list.findIndex((item) => item.contains(el)) : -1;\n });\n const registration: Registration = { ...info, index };\n setRegistrations((list) => [...list, registration]);\n onCleanup(() => setRegistrations((list) => list.filter((item) => item !== registration)));\n return index;\n },\n };\n\n const showScrollButtons = (): boolean =>\n local.scrollable && local.scrollButtons && (overflowStart() || overflowEnd());\n\n // The overflow menu's trigger appears only once the browser has measured a clipped tab,\n // so the server markup — and the first client render — shows none.\n const showOverflowTrigger = (): boolean =>\n local.scrollable && local.overflowMenu && hiddenIndexes().length > 0;\n\n // The menu lists what the viewport clips; each entry shows a copy of the tab's icon and\n // label (the live nodes belong to the row, so they are cloned into the entry, not moved),\n // kept in step with the tab while the menu is open.\n const overflowItemIcon = (node: HTMLElement | undefined): Element | undefined =>\n node?.querySelector(\".smwb-tab__icon\") ?? undefined;\n const overflowItemLabel = (node: HTMLElement | undefined): string =>\n node?.querySelector(\".smwb-tab__text-label\")?.textContent ?? \"\";\n const cloneIconInto = (el: HTMLElement, node: HTMLElement | undefined): void => {\n const source = overflowItemIcon(node);\n if (!source) return;\n Array.from(source.childNodes).forEach((child) => el.appendChild(child.cloneNode(true)));\n };\n\n const chooseOverflowItem = (\n event: MouseEvent & { currentTarget: HTMLLIElement; target: Element },\n index: number\n ): void => {\n setOverflowOpen(false);\n local.onChange(event, index);\n scrollIndexIntoView(index);\n };\n\n return (\n <TabsContext.Provider value={contextValue}>\n <PanelsResolver onPanels={(resolved, has) => (setPanels(() => resolved), setHasPanels(has))}>\n {local.panels}\n </PanelsResolver>\n <div\n {...rest}\n id={local.id}\n class={cn(\n \"smwb-tabs\",\n {\n \"smwb-tabs--dense\": local.dense,\n \"smwb-tabs--overflow-start\": overflowStart(),\n \"smwb-tabs--overflow-end\": overflowEnd(),\n },\n local.class\n )}\n ref={mergeRefs(local.ref)}\n >\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--start\"\n aria-label={local.scrollBackAriaLabel}\n disabled={!overflowStart()}\n tabindex={-1}\n onClick={() => scrollByPage(-1)}\n >\n <Icon name=\"chevron_left\" size={20} />\n </button>\n </Show>\n {/* The scroller's class is static so it is on the element from the start:\n a ref on Tabs can find the row by class right away. */}\n <div\n class=\"smwb-tabs__scroller\"\n classList={{ \"smwb-tabs__scroller--scrollable\": local.scrollable }}\n ref={(el) => (tabsEl = el)}\n >\n <div\n class=\"smwb-tabs__scroll-area\"\n ref={(el) => (tabListEl = el)}\n role=\"tablist\"\n aria-label={local[\"aria-label\"]}\n aria-orientation={local.orientation}\n onKeyDown={onTabListKeyDown}\n onFocusIn={onTabListFocusIn}\n onFocusOut={onTabListFocusOut}\n onDragStart={onItemDragStart}\n onDragOver={onItemDragOver}\n onDrop={onItemDrop}\n onDragEnd={onItemDragEnd}\n >\n <TabListItems onItems={setItems}>{local.children}</TabListItems>\n </div>\n <Show when={mounted()}>\n <span\n class=\"smwb-tabs__indicator\"\n style={{\n left: `${indicatorStyle().root.left ?? 0}px`,\n width: `${indicatorStyle().root.width ?? 0}px`,\n }}\n >\n <span\n class=\"smwb-tabs__indicator-content\"\n style={indicatorStyle().content ? { width: `${indicatorStyle().content?.width ?? 0}px` } : {}}\n />\n </span>\n </Show>\n </div>\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--end\"\n aria-label={local.scrollForwardAriaLabel}\n disabled={!overflowEnd()}\n tabindex={-1}\n onClick={() => scrollByPage(1)}\n >\n <Icon name=\"chevron_right\" size={20} />\n </button>\n </Show>\n <Show when={showOverflowTrigger()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__overflow-trigger\"\n aria-haspopup=\"menu\"\n aria-expanded={overflowOpen()}\n aria-label={local.overflowMenuAriaLabel}\n tabindex={-1}\n ref={(el) => (overflowTriggerEl = el)}\n onClick={() => setOverflowOpen((open) => !open)}\n >\n <Icon name=\"more_horiz\" size={20} />\n </button>\n <Menu\n anchorElement={overflowTriggerEl ?? null}\n isOpen={overflowOpen()}\n onClose={() => setOverflowOpen(false)}\n placement=\"bottom-end\"\n >\n <For each={hiddenIndexes()}>\n {(index) => {\n // The entry mirrors the tab it stands for. Solid children resolve to DOM, not to\n // prop objects, so the tab's own node is the source for the label and the icon;\n // a MutationObserver keeps the entry in step with renames and re-icons while the\n // menu is open. Disabled follows the tab's registration, as in the row's other\n // disabled bookkeeping, so a tab that flips `disabled` in place greys its entry out.\n //\n // Which node that is cannot be settled once, when the entry is drawn: an owner that\n // keys its list by value replaces the tab's node when its label changes, while the\n // clipped set — and so this entry — keeps its identity. `items` and `registrations`\n // are what announce the row moving, and the effect below reads the node from the row\n // when it runs, which is after Solid has landed that move in the DOM; a node sampled\n // earlier, into a memo or into a const, is the detached one by then.\n const nodeNow = (): HTMLElement | undefined => getTabNodes()[index];\n // What the row shows at this index as the entry is drawn, so its first paint is not\n // an empty entry; the effect below keeps it current from then on.\n const drawn = nodeNow();\n const [label, setLabel] = createSignal(overflowItemLabel(drawn));\n const [hasIcon, setHasIcon] = createSignal(Boolean(overflowItemIcon(drawn)));\n const disabled = createMemo(() => {\n const registration = registrations().find((candidate) => candidate.index() === index);\n return registration ? registration.disabled() : isNodeDisabled(nodeNow());\n });\n let iconEl: HTMLSpanElement | undefined;\n // The node the entry's content was last taken from: the icon span copies from it\n // when it is drawn, which is after the sync that asked for it.\n let shownNode = drawn;\n const syncIcon = (node: HTMLElement | undefined): void => {\n shownNode = node;\n const source = overflowItemIcon(node);\n setHasIcon(Boolean(source));\n if (iconEl && source) {\n iconEl.textContent = \"\";\n cloneIconInto(iconEl, node);\n }\n };\n createEffect(\n on([items, registrations], () => {\n const node = nodeNow();\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n const item = node ? itemOf(node) : null;\n const view = item?.ownerDocument.defaultView;\n if (!item || !view || typeof view.MutationObserver === \"undefined\") return;\n const observer = new view.MutationObserver(() => {\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n });\n observer.observe(item, { subtree: true, childList: true, characterData: true });\n onCleanup(() => observer.disconnect());\n })\n );\n return (\n <MenuItem\n disabled={disabled()}\n aria-current={index === local.value ? \"true\" : undefined}\n onClick={(event) => chooseOverflowItem(event, index)}\n >\n <Show when={hasIcon()}>\n <span\n class=\"smwb-tab__icon\"\n aria-hidden=\"true\"\n ref={(el) => {\n iconEl = el;\n // The span is drawn by the flag the sync above sets, so it is born after\n // that sync: it copies the icon of the node the entry last followed.\n if (overflowItemIcon(shownNode)) cloneIconInto(el, shownNode);\n }}\n />\n </Show>\n <span class=\"smwb-tab__text-label\">{label()}</span>\n </MenuItem>\n );\n }}\n </For>\n </Menu>\n </Show>\n </div>\n {panels()}\n </TabsContext.Provider>\n );\n}\n\nexport { Tab };\nexport type { TabProps, TabActionsApi, TabCloseReason } from \"./tab/tab\";\nexport default Tabs;\n"],"names":["VIEW_NEXT_TAB_PX","SCROLL_PAGE","TabListItems","props","resolved","children","isServer","createComputed","onItems","toArray","filter","node","Element","_$memo","PanelsResolver","onPanels","some","Tabs","merged","mergeProps","indicatorContent","scrollable","scrollButtons","overflowMenu","dense","orientation","scrollBackAriaLabel","scrollForwardAriaLabel","overflowMenuAriaLabel","local","rest","splitProps","generatedId","createUniqueId","baseId","id","registrations","setRegistrations","createSignal","tabId","index","find","registration","panelId","panels","setPanels","hasPanels","setHasPanels","focusedIndex","setFocusedIndex","mounted","setMounted","indicatorStyle","setIndicatorStyle","root","overflowStart","setOverflowStart","overflowEnd","setOverflowEnd","hiddenIndexes","setHiddenIndexes","overflowOpen","setOverflowOpen","overflowTriggerEl","tabsEl","tabListEl","closingTab","items","setItems","created","getTabsMeta","tabsMeta","rect","getBoundingClientRect","clientWidth","scrollLeft","left","right","tabMeta","tabContentMeta","length","tab","value","querySelector","updateIndicatorState","startValue","next","width","content","prev","undefined","dStart","Math","abs","dSize","updateOverflow","max","scrollWidth","hidden","getHiddenIndexes","Array","from","map","child","item","offsetLeft","offsetWidth","every","at","scroll","scrollValue","animate","duration","scrollByPage","direction","scrollIndexIntoView","tabsRect","tabRect","scrollSelectedIntoView","onMount","createEffect","on","onResize","debounce","view","ownerDocument","defaultView","addEventListener","passive","resizeObserver","ResizeObserver","observe","forEach","onCleanup","cancel","removeEventListener","disconnect","getTabNodes","querySelectorAll","itemOf","closest","indexOfFocus","target","findIndex","contains","isNodeDisabled","getAttribute","disabled","selectedStop","count","candidate","list","enabled","min","stopIndex","onRovingKeyDown","createRovingTabIndex","activeIndex","onMove","focus","isDisabled","dragSourceIndex","draggingItem","dropTargetItem","dragItemOf","clearDragMarks","classList","remove","onItemDragStart","event","onReorder","add","dataTransfer","setData","String","effectAllowed","onItemDragOver","preventDefault","onItemDrop","to","sourceItem","wasSelected","doc","hadFocus","Boolean","activeElement","onChange","moved","onItemDragEnd","switchByChord","delta","nodes","step","click","onTabListKeyDown","defaultPrevented","ctrlKey","metaKey","altKey","matchesKeyboardShortcut","closable","requestClose","shiftKey","closing","isConnected","body","candidates","keys","defer","onTabListFocusIn","onTabListFocusOut","currentTarget","relatedTarget","queueMicrotask","contextValue","tabStop","reorderable","reason","active","focused","registerTab","element","info","order","createMemo","el","showScrollButtons","showOverflowTrigger","overflowItemIcon","overflowItemLabel","textContent","cloneIconInto","source","childNodes","appendChild","cloneNode","chooseOverflowItem","_$createComponent","TabsContext","Provider","has","_el$","_tmpl$5","_el$3","firstChild","_el$4","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","class","_$insert","Show","when","_el$2","_tmpl$","$$click","Icon","name","size","_$effect","_p$","_v$","_v$2","e","_$setAttribute","t","$$focusout","$$focusin","$$keydown","_el$5","_tmpl$2","_el$6","_v$3","_v$4","_v$5","_$setStyleProperty","a","_$style","_el$7","_tmpl$3","_v$6","_v$7","_el$8","_tmpl$4","open","_v$8","_v$9","Menu","anchorElement","isOpen","onClose","placement","For","each","nodeNow","drawn","label","setLabel","hasIcon","setHasIcon","iconEl","shownNode","syncIcon","MutationObserver","observer","subtree","childList","characterData","MenuItem","onClick","_el$9","_tmpl$6","_el$0","_tmpl$7","_v$0","_v$1","_v$10","toggle","_$delegateEvents"],"mappings":";;;;;;;;;;;;;;;;AA8IA,MAAMA,KAAmB,IAEnBC,KAAc;AAYpB,SAASC,GAAaC,GAAqF;AACzG,QAAMC,IAAWC,GAAS,MAAMF,EAAME,QAAQ;AAC9C,SAAKC,MACHC,GAAe,MAAMJ,EAAMK,QAAQJ,EAASK,QAAAA,EAAUC,OAAQC,CAAAA,MAASA,aAAgBC,OAAO,CAAC,CAAC,GAElGC,GAAUT,CAAQ;AACpB;AAOA,SAASU,GAAeX,GAGf;AACP,QAAMC,IAAWC,GAAS,MAAMF,EAAME,QAAQ;AAC9CE,SAAAA,GAAe,MACbJ,EAAMY,SACJX,EAAAA,GACAA,EAASK,UAAUO,KAAML,CAAAA,MAASA,KAAQ,QAAQA,MAAS,MAASA,MAAS,EAAE,CACjF,CACF,GACO;AACT;AAEO,SAASM,GAAKd,GAA4C;AAC/D,QAAMe,IAASC,GACb;AAAA,IACEC,kBAAkB;AAAA,IAClBC,YAAY;AAAA,IACZC,eAAe;AAAA,IACfC,cAAc;AAAA,IACdC,OAAO;AAAA,IACPC,aAAa;AAAA,IACbC,qBAAqB;AAAA,IACrBC,wBAAwB;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,GAAA,CAAA,SAAA,WAAA,WAAA,UAAA,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sources":["../../../../../src/components/dataDisplay/badge/badge.tsx"],"sourcesContent":["import { type JSX, type ParentProps, Show, children, mergeProps, splitProps } from \"solid-js\";\nimport cn from \"clsx\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\n\nexport interface BadgeProps extends JSX.HTMLAttributes<HTMLSpanElement> {\n badgeContent?: JSX.Element | number | string;\n color?: \"primary\" | \"success\" | \"danger\";\n variant?: \"inside\" | \"outside\";\n vertical?: \"top\" | \"bottom\";\n horizontal?: \"right\" | \"left\";\n /** Cap numeric content, rendering `{max}+` when exceeded. */\n max?: number;\n /** Render the badge even when content is 0. */\n showZero?: boolean;\n /** Accessible label for the badge value. */\n badgeAriaLabel?: string;\n ref?: Ref<HTMLSpanElement>;\n}\n\nexport function Badge(props: ParentProps<BadgeProps>): JSX.Element {\n const merged = mergeProps(\n {\n color: \"primary\" as const,\n variant: \"outside\" as const,\n vertical: \"top\" as const,\n horizontal: \"right\" as const,\n showZero: false,\n },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"color\",\n \"badgeContent\",\n \"variant\",\n \"vertical\",\n \"horizontal\",\n \"max\",\n \"showZero\",\n \"badgeAriaLabel\",\n \"children\",\n \"ref\",\n ]);\n\n // Read the content once: markup passed as a prop is created anew on every\n // read, and during hydration a copy the server never rendered has no DOM node.\n const content = children(() => local.badgeContent);\n const isZero = (): boolean => content() === 0 || content() === \"0\";\n const hidden = (): boolean => content() === undefined || content() === null || (isZero() && !local.showZero);\n\n const display = (): JSX.Element => {\n const value = content();\n return typeof value === \"number\" && local.max !== undefined && value > local.max ? `${local.max}+` : value;\n };\n\n return (\n <span class=\"smwb-badge__wrapper\" data-testid=\"badge\">\n {local.children}\n <span\n {...rest}\n ref={mergeRefs(local.ref)}\n class={cn(\n \"smwb-badge\",\n `smwb-badge_${local.color}`,\n `smwb-badge_${local.variant}`,\n `smwb-badge_${local.variant}_${local.vertical}`,\n `smwb-badge_${local.variant}_${local.vertical}_${local.horizontal}`,\n local.class,\n { \"smwb-badge_no-content\": hidden() }\n )}\n aria-label={local.badgeAriaLabel}\n >\n <Show when={!hidden()}>{display()}</Show>\n </span>\n </span>\n );\n}\n\nexport default Badge;\n"],"names":["Badge","props","merged","mergeProps","color","variant","vertical","horizontal","showZero","local","rest","splitProps","content","children","badgeContent","isZero","hidden","undefined","display","value","max","_el$","_tmpl$","_el$2","firstChild","_$insert","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","class","badgeAriaLabel","_$createComponent","Show","when"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../../../src/components/dataDisplay/badge/badge.tsx"],"sourcesContent":["import { type JSX, type ParentProps, Show, children, mergeProps, splitProps } from \"solid-js\";\nimport cn from \"clsx\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\n\nexport interface BadgeProps extends JSX.HTMLAttributes<HTMLSpanElement> {\n badgeContent?: JSX.Element | number | string;\n /** Semantic color; `warning` is amber, and carries dark ink to stay readable at this size. */\n color?: \"primary\" | \"success\" | \"danger\" | \"warning\";\n variant?: \"inside\" | \"outside\";\n vertical?: \"top\" | \"bottom\";\n horizontal?: \"right\" | \"left\";\n /** Cap numeric content, rendering `{max}+` when exceeded. */\n max?: number;\n /** Render the badge even when content is 0. */\n showZero?: boolean;\n /** Accessible label for the badge value. */\n badgeAriaLabel?: string;\n ref?: Ref<HTMLSpanElement>;\n}\n\nexport function Badge(props: ParentProps<BadgeProps>): JSX.Element {\n const merged = mergeProps(\n {\n color: \"primary\" as const,\n variant: \"outside\" as const,\n vertical: \"top\" as const,\n horizontal: \"right\" as const,\n showZero: false,\n },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"color\",\n \"badgeContent\",\n \"variant\",\n \"vertical\",\n \"horizontal\",\n \"max\",\n \"showZero\",\n \"badgeAriaLabel\",\n \"children\",\n \"ref\",\n ]);\n\n // Read the content once: markup passed as a prop is created anew on every\n // read, and during hydration a copy the server never rendered has no DOM node.\n const content = children(() => local.badgeContent);\n const isZero = (): boolean => content() === 0 || content() === \"0\";\n const hidden = (): boolean => content() === undefined || content() === null || (isZero() && !local.showZero);\n\n const display = (): JSX.Element => {\n const value = content();\n return typeof value === \"number\" && local.max !== undefined && value > local.max ? `${local.max}+` : value;\n };\n\n return (\n <span class=\"smwb-badge__wrapper\" data-testid=\"badge\">\n {local.children}\n <span\n {...rest}\n ref={mergeRefs(local.ref)}\n class={cn(\n \"smwb-badge\",\n `smwb-badge_${local.color}`,\n `smwb-badge_${local.variant}`,\n `smwb-badge_${local.variant}_${local.vertical}`,\n `smwb-badge_${local.variant}_${local.vertical}_${local.horizontal}`,\n local.class,\n { \"smwb-badge_no-content\": hidden() }\n )}\n aria-label={local.badgeAriaLabel}\n >\n <Show when={!hidden()}>{display()}</Show>\n </span>\n </span>\n );\n}\n\nexport default Badge;\n"],"names":["Badge","props","merged","mergeProps","color","variant","vertical","horizontal","showZero","local","rest","splitProps","content","children","badgeContent","isZero","hidden","undefined","display","value","max","_el$","_tmpl$","_el$2","firstChild","_$insert","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","class","badgeAriaLabel","_$createComponent","Show","when"],"mappings":";;;;;AAoBO,SAASA,EAAMC,GAA6C;AACjE,QAAMC,IAASC,EACb;AAAA,IACEC,OAAO;AAAA,IACPC,SAAS;AAAA,IACTC,UAAU;AAAA,IACVC,YAAY;AAAA,IACZC,UAAU;AAAA,EAAA,GAEZP,CACF,GACM,CAACQ,GAAOC,CAAI,IAAIC,EAAWT,GAAQ,CACvC,SACA,SACA,gBACA,WACA,YACA,cACA,OACA,YACA,kBACA,YACA,KAAK,CACN,GAIKU,IAAUC,EAAS,MAAMJ,EAAMK,YAAY,GAC3CC,IAASA,MAAeH,EAAAA,MAAc,KAAKA,QAAc,KACzDI,IAASA,M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