@primer/react 38.3.0 → 38.4.0-rc.aa568eba1
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/CHANGELOG.md +7 -0
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +0 -1
- package/dist/SegmentedControl/{SegmentedControl-5cfe12ab.css → SegmentedControl-6389d0da.css} +2 -2
- package/dist/SegmentedControl/SegmentedControl-6389d0da.css.map +1 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +11 -5
- package/dist/SegmentedControl/SegmentedControl.module.css.js +1 -1
- package/dist/SegmentedControl/SegmentedControlButton.d.ts +2 -0
- package/dist/SegmentedControl/SegmentedControlButton.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlButton.js +104 -82
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts +2 -0
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlIconButton.js +122 -181
- package/package.json +1 -1
- package/dist/SegmentedControl/SegmentedControl-5cfe12ab.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
+
## 38.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#7047](https://github.com/primer/react/pull/7047) [`c07dd71`](https://github.com/primer/react/commit/c07dd71e990323a1c73ec99c44752df43d153090) Thanks [@TylerJDev](https://github.com/TylerJDev)! - Remove the feature flag for `primer_react_segmented_control_tooltip` and GA tooltip by default behavior.
|
|
8
|
+
- Ensure that when `disabled` is applied, the tooltip is still triggered.
|
|
9
|
+
|
|
3
10
|
## 38.3.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/DefaultFeatureFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"DefaultFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/DefaultFeatureFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,kBAO9B,CAAA"}
|
|
@@ -4,7 +4,6 @@ const DefaultFeatureFlags = FeatureFlagScope.create({
|
|
|
4
4
|
primer_react_action_list_item_as_button: false,
|
|
5
5
|
primer_react_breadcrumbs_overflow_menu: false,
|
|
6
6
|
primer_react_overlay_overflow: false,
|
|
7
|
-
primer_react_segmented_control_tooltip: false,
|
|
8
7
|
primer_react_select_panel_fullscreen_on_narrow: false,
|
|
9
8
|
primer_react_select_panel_order_selected_at_top: false,
|
|
10
9
|
primer_react_select_panel_remove_active_descendant: false
|
package/dist/SegmentedControl/{SegmentedControl-5cfe12ab.css → SegmentedControl-6389d0da.css}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.prc-SegmentedControl-SegmentedControl-e7570{--segmented-control-icon-width:32px;background-color:var(--controlTrack-bgColor-rest,var(--color-switch-track-bg));border:var(--borderWidth-thin,.0625rem) solid var(--controlTrack-borderColor-rest,transparent);border-radius:var(--borderRadius-medium,.375rem);display:inline-flex;font-size:var(--text-body-size-medium,.875rem);height:32px;margin:0;padding:0}.prc-SegmentedControl-SegmentedControl-e7570[data-full-width=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-e7570[data-full-width=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-narrow=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-narrow=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}@media (min-width:48rem){.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-regular=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-regular=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}@media (min-width:87.5rem){.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-wide=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-regular=true]:not([data-full-width-wide=true]),.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-wide=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}.prc-SegmentedControl-SegmentedControl-e7570[data-variant=dropdown],.prc-SegmentedControl-SegmentedControl-e7570[data-variant=hideLabels] .prc-SegmentedControl-Text-c5gSh{display:none}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-SegmentedControl-e7570[data-variant-narrow=dropdown],.prc-SegmentedControl-SegmentedControl-e7570[data-variant-narrow=hideLabels] .prc-SegmentedControl-Text-c5gSh{display:none}}@media (min-width:48rem){.prc-SegmentedControl-SegmentedControl-e7570[data-variant-regular=dropdown],.prc-SegmentedControl-SegmentedControl-e7570[data-variant-regular=hideLabels] .prc-SegmentedControl-Text-c5gSh{display:none}}@media (min-width:87.5rem){.prc-SegmentedControl-SegmentedControl-e7570[data-variant-wide=dropdown],.prc-SegmentedControl-SegmentedControl-e7570[data-variant-wide=hideLabels] .prc-SegmentedControl-Text-c5gSh{display:none}}.prc-SegmentedControl-SegmentedControl-e7570:where([data-size=small]){font-size:var(--text-body-size-small,.75rem);height:28px}.prc-SegmentedControl-DropdownContainer-QSnSd{display:none}.prc-SegmentedControl-DropdownContainer-QSnSd[data-variant=dropdown]{display:block}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-DropdownContainer-QSnSd[data-variant-narrow=dropdown]{display:block}}@media (min-width:48rem){.prc-SegmentedControl-DropdownContainer-QSnSd[data-variant-regular=dropdown]{display:block}}@media (min-width:87.5rem){.prc-SegmentedControl-DropdownContainer-QSnSd[data-variant-wide=dropdown]{display:block}}.prc-SegmentedControl-Item-7Aq6h{display:block;flex-grow:1;margin-bottom:-1px;margin-top:-1px;position:relative}.prc-SegmentedControl-Item-7Aq6h:not(:last-child){margin-right:1px}.prc-SegmentedControl-Item-7Aq6h:not(:last-child):after{background-color:var(--borderColor-default,var(--color-border-default));bottom:var(--base-size-8,.5rem);content:"";position:absolute;right:calc(var(--base-size-2,.125rem)*-1);top:var(--base-size-8,.5rem);width:1px}.prc-SegmentedControl-Item-7Aq6h:not(:last-child):has(+[data-selected]):after,.prc-SegmentedControl-Item-7Aq6h:not(:last-child):where([data-selected]):after{background-color:transparent}.prc-SegmentedControl-Item-7Aq6h:focus-within:has(:focus-visible){background-color:transparent}.prc-SegmentedControl-Item-7Aq6h:first-child{margin-left:-1px}.prc-SegmentedControl-Item-7Aq6h:last-child{margin-right:-1px}.prc-SegmentedControl-Item-7Aq6h .prc-SegmentedControl-Counter--H-pM{align-items:center;display:flex;margin-inline-start:var(--base-size-8,.5rem)}.prc-SegmentedControl-Button-ojWXD{--segmented-control-button-inner-padding:12px;--segmented-control-button-bg-inset:4px;--segmented-control-outer-radius:var(--borderRadius-medium,0.375rem);background-color:transparent;border-color:transparent;border-radius:var(--segmented-control-outer-radius);border-width:0;color:currentColor;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:var(--base-text-weight-normal,400);height:100%;padding:var(--segmented-control-button-bg-inset);width:100%}.prc-SegmentedControl-Button-ojWXD svg{fill:var(--fgColor-muted,var(--color-fg-muted));color:var(--fgColor-muted,var(--color-fg-muted))}.prc-SegmentedControl-Button-ojWXD:focus:not(:disabled){box-shadow:none;outline:var(--base-size-2,.125rem) solid var(--fgColor-accent,var(--color-accent-fg));outline-offset:-1px}.prc-SegmentedControl-Button-ojWXD:focus:not(:disabled):not(:focus-visible){outline:1px solid transparent}.prc-SegmentedControl-Button-ojWXD:focus-visible:not(:disabled){box-shadow:none;outline:var(--base-size-2,.125rem) solid var(--fgColor-accent,var(--color-accent-fg));outline-offset:-1px}.prc-SegmentedControl-Button-ojWXD:focus:focus-visible:not(:last-child):after{width:0}@media (pointer:coarse){.prc-SegmentedControl-Button-ojWXD:before{content:"";left:0;min-height:44px;position:absolute;right:0;top:50%;transform:translateY(-50%)}}.prc-SegmentedControl-IconButton-O80Eh{width:var(--segmented-control-icon-width,32px)}.prc-SegmentedControl-Content-gnQ4n{align-items:center;border-color:transparent;border-radius:calc(var(--segmented-control-outer-radius) - var(--segmented-control-button-bg-inset)/2);border-style:solid;border-width:var(--borderWidth-thin,.0625rem);display:flex;height:100%;justify-content:center;padding-left:calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));padding-right:calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset))}.prc-SegmentedControl-Button-ojWXD[aria-current=true]{font-weight:var(--base-text-weight-semibold,600);padding:0}.prc-SegmentedControl-Button-ojWXD[aria-current=true] .prc-SegmentedControl-Content-gnQ4n{background-color:var(--controlKnob-bgColor-rest,var(--color-switch-knob-bg));border-color:var(--controlKnob-borderColor-rest,var(--color-switch-knob-border));border-radius:var(--segmented-control-outer-radius);padding-left:var(--segmented-control-button-inner-padding);padding-right:var(--segmented-control-button-inner-padding)}.prc-SegmentedControl-Button-ojWXD:not([aria-current=true]):hover .prc-SegmentedControl-Content-gnQ4n{background-color:var(--controlTrack-bgColor-hover,var(--color-switch-track-hover-bg))}.prc-SegmentedControl-Button-ojWXD:not([aria-current=true]):active .prc-SegmentedControl-Content-gnQ4n{background-color:var(--controlTrack-bgColor-active,var(--color-switch-track-active-bg))}.prc-SegmentedControl-Text-c5gSh:after{content:attr(data-text);display:block;font-weight:var(--base-text-weight-semibold,600);height:0;overflow:hidden;pointer-events:none;-webkit-user-select:none;user-select:none;visibility:hidden}.prc-SegmentedControl-LeadingIcon-dAHA8{margin-right:var(--base-size-4,.25rem)}
|
|
2
|
-
/*# sourceMappingURL=SegmentedControl-
|
|
1
|
+
.prc-SegmentedControl-SegmentedControl-e7570{--segmented-control-icon-width:32px;background-color:var(--controlTrack-bgColor-rest,var(--color-switch-track-bg));border:var(--borderWidth-thin,.0625rem) solid var(--controlTrack-borderColor-rest,transparent);border-radius:var(--borderRadius-medium,.375rem);display:inline-flex;font-size:var(--text-body-size-medium,.875rem);height:32px;margin:0;padding:0}.prc-SegmentedControl-SegmentedControl-e7570[data-full-width=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-e7570[data-full-width=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-narrow=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-narrow=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}@media (min-width:48rem){.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-regular=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-regular=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}@media (min-width:87.5rem){.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-wide=true]{display:flex;width:100%;--segmented-control-icon-width:100%}.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-regular=true]:not([data-full-width-wide=true]),.prc-SegmentedControl-SegmentedControl-e7570[data-full-width-wide=false]{display:inline-flex;width:auto;--segmented-control-icon-width:32px}}.prc-SegmentedControl-SegmentedControl-e7570[data-variant=dropdown],.prc-SegmentedControl-SegmentedControl-e7570[data-variant=hideLabels] .prc-SegmentedControl-Text-c5gSh{display:none}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-SegmentedControl-e7570[data-variant-narrow=dropdown],.prc-SegmentedControl-SegmentedControl-e7570[data-variant-narrow=hideLabels] .prc-SegmentedControl-Text-c5gSh{display:none}}@media (min-width:48rem){.prc-SegmentedControl-SegmentedControl-e7570[data-variant-regular=dropdown],.prc-SegmentedControl-SegmentedControl-e7570[data-variant-regular=hideLabels] .prc-SegmentedControl-Text-c5gSh{display:none}}@media (min-width:87.5rem){.prc-SegmentedControl-SegmentedControl-e7570[data-variant-wide=dropdown],.prc-SegmentedControl-SegmentedControl-e7570[data-variant-wide=hideLabels] .prc-SegmentedControl-Text-c5gSh{display:none}}.prc-SegmentedControl-SegmentedControl-e7570:where([data-size=small]){font-size:var(--text-body-size-small,.75rem);height:28px}.prc-SegmentedControl-DropdownContainer-QSnSd{display:none}.prc-SegmentedControl-DropdownContainer-QSnSd[data-variant=dropdown]{display:block}@media (max-width:calc(48rem - 0.02px)){.prc-SegmentedControl-DropdownContainer-QSnSd[data-variant-narrow=dropdown]{display:block}}@media (min-width:48rem){.prc-SegmentedControl-DropdownContainer-QSnSd[data-variant-regular=dropdown]{display:block}}@media (min-width:87.5rem){.prc-SegmentedControl-DropdownContainer-QSnSd[data-variant-wide=dropdown]{display:block}}.prc-SegmentedControl-Item-7Aq6h{display:block;flex-grow:1;margin-bottom:-1px;margin-top:-1px;position:relative}.prc-SegmentedControl-Item-7Aq6h:not(:last-child){margin-right:1px}.prc-SegmentedControl-Item-7Aq6h:not(:last-child):after{background-color:var(--borderColor-default,var(--color-border-default));bottom:var(--base-size-8,.5rem);content:"";position:absolute;right:calc(var(--base-size-2,.125rem)*-1);top:var(--base-size-8,.5rem);width:1px}.prc-SegmentedControl-Item-7Aq6h:not(:last-child):has(+[data-selected]):after,.prc-SegmentedControl-Item-7Aq6h:not(:last-child):where([data-selected]):after{background-color:transparent}.prc-SegmentedControl-Item-7Aq6h:focus-within:has(:focus-visible){background-color:transparent}.prc-SegmentedControl-Item-7Aq6h:first-child{margin-left:-1px}.prc-SegmentedControl-Item-7Aq6h:last-child{margin-right:-1px}.prc-SegmentedControl-Item-7Aq6h .prc-SegmentedControl-Counter--H-pM{align-items:center;display:flex;margin-inline-start:var(--base-size-8,.5rem)}.prc-SegmentedControl-Button-ojWXD{--segmented-control-button-inner-padding:12px;--segmented-control-button-bg-inset:4px;--segmented-control-outer-radius:var(--borderRadius-medium,0.375rem);background-color:transparent;border-color:transparent;border-radius:var(--segmented-control-outer-radius);border-width:0;color:currentColor;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:var(--base-text-weight-normal,400);height:100%;padding:var(--segmented-control-button-bg-inset);width:100%}.prc-SegmentedControl-Button-ojWXD svg{fill:var(--fgColor-muted,var(--color-fg-muted));color:var(--fgColor-muted,var(--color-fg-muted))}.prc-SegmentedControl-Button-ojWXD:focus:not(:disabled){box-shadow:none;outline:var(--base-size-2,.125rem) solid var(--fgColor-accent,var(--color-accent-fg));outline-offset:-1px}.prc-SegmentedControl-Button-ojWXD:focus:not(:disabled):not(:focus-visible){outline:1px solid transparent}.prc-SegmentedControl-Button-ojWXD:focus-visible:not(:disabled){box-shadow:none;outline:var(--base-size-2,.125rem) solid var(--fgColor-accent,var(--color-accent-fg));outline-offset:-1px}.prc-SegmentedControl-Button-ojWXD:focus:focus-visible:not(:last-child):after{width:0}.prc-SegmentedControl-Button-ojWXD[aria-disabled=true]:not([aria-current=true]){background-color:transparent;color:var(--fgColor-disabled,var(--color-primer-fg-disabled));cursor:not-allowed}.prc-SegmentedControl-Button-ojWXD[aria-disabled=true]:not([aria-current=true]) svg{fill:var(--fgColor-disabled,var(--color-primer-fg-disabled));color:var(--fgColor-disabled,var(--color-primer-fg-disabled))}@media (pointer:coarse){.prc-SegmentedControl-Button-ojWXD:before{content:"";left:0;min-height:44px;position:absolute;right:0;top:50%;transform:translateY(-50%)}}.prc-SegmentedControl-IconButton-O80Eh{width:var(--segmented-control-icon-width,32px)}.prc-SegmentedControl-Content-gnQ4n{align-items:center;border-color:transparent;border-radius:calc(var(--segmented-control-outer-radius) - var(--segmented-control-button-bg-inset)/2);border-style:solid;border-width:var(--borderWidth-thin,.0625rem);display:flex;height:100%;justify-content:center;padding-left:calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));padding-right:calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset))}.prc-SegmentedControl-Button-ojWXD[aria-current=true]{font-weight:var(--base-text-weight-semibold,600);padding:0}.prc-SegmentedControl-Button-ojWXD[aria-current=true] .prc-SegmentedControl-Content-gnQ4n{background-color:var(--controlKnob-bgColor-rest,var(--color-switch-knob-bg));border-color:var(--controlKnob-borderColor-rest,var(--color-switch-knob-border));border-radius:var(--segmented-control-outer-radius);padding-left:var(--segmented-control-button-inner-padding);padding-right:var(--segmented-control-button-inner-padding)}.prc-SegmentedControl-Button-ojWXD:not([aria-current=true],[aria-disabled=true]):hover .prc-SegmentedControl-Content-gnQ4n{background-color:var(--controlTrack-bgColor-hover,var(--color-switch-track-hover-bg))}.prc-SegmentedControl-Button-ojWXD:not([aria-current=true],[aria-disabled=true]):active .prc-SegmentedControl-Content-gnQ4n{background-color:var(--controlTrack-bgColor-active,var(--color-switch-track-active-bg))}.prc-SegmentedControl-Text-c5gSh:after{content:attr(data-text);display:block;font-weight:var(--base-text-weight-semibold,600);height:0;overflow:hidden;pointer-events:none;-webkit-user-select:none;user-select:none;visibility:hidden}.prc-SegmentedControl-LeadingIcon-dAHA8{margin-right:var(--base-size-4,.25rem)}
|
|
2
|
+
/*# sourceMappingURL=SegmentedControl-6389d0da.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SegmentedControl/SegmentedControl.module.css"],"names":[],"mappings":"AAAA,6CAEE,mCAAoC,CASpC,8EAAkD,CAClD,8FAAuF,CACvF,gDAAyC,CATzC,mBAAoB,CAMpB,8CAAuC,CAHvC,WAAY,CAEZ,QAAS,CADT,SA0HF,CAlHE,mEACE,YAAa,CACb,UAAW,CAEX,mCACF,CAEA,oEACE,mBAAoB,CACpB,UAAW,CAEX,mCACF,CAEA,wCACE,0EACE,YAAa,CACb,UAAW,CAEX,mCACF,CAEA,2EACE,mBAAoB,CACpB,UAAW,CAEX,mCACF,CACF,CAEA,yBACE,2EACE,YAAa,CACb,UAAW,CAEX,mCACF,CAEA,4EACE,mBAAoB,CACpB,UAAW,CAEX,mCACF,CACF,CAEA,2BACE,wEACE,YAAa,CACb,UAAW,CAEX,mCACF,CASA,qLACE,mBAAoB,CACpB,UAAW,CAEX,mCACF,CACF,CAQA,2KACE,YACF,CAEA,wCAKE,yLACE,YACF,CACF,CAEA,yBAKE,2LACE,YACF,CACF,CAEA,2BAKE,qLACE,YACF,CACF,CAEA,sEAGE,4CAAsC,CADtC,WAEF,CAGF,8CACE,YAwBF,CArBE,qEACE,aACF,CAEA,wCACE,4EACE,aACF,CACF,CAEA,yBACE,6EACE,aACF,CACF,CAEA,2BACE,0EACE,aACF,CACF,CAGF,iCAEE,aAAc,CAKd,WAAY,CADZ,kBAAmB,CAFnB,eAAgB,CAHhB,iBAgDF,CAxCE,kDAEE,gBAiBF,CAfE,wDAQE,uEAA4C,CAJ5C,+BAA0B,CAE1B,UAAW,CALX,iBAAkB,CAElB,yCAAoC,CADpC,4BAAuB,CAGvB,SAIF,CAEA,6JAEE,4BACF,CAGF,kEACE,4BACF,CAEA,6CAEE,gBACF,CAEA,4CAEE,iBACF,CAEA,qEAGE,kBAAmB,CADnB,YAAa,CADb,4CAGF,CAGF,mCAEE,6CAA8C,CAC9C,uCAAwC,CACxC,oEAA4D,CAW5D,4BAA6B,CAC7B,wBAAyB,CAGzB,mDAAoD,CAFpD,cAAe,CAJf,kBAAmB,CACnB,cAAe,CAJf,mBAAoB,CACpB,iBAAkB,CAClB,8CAA2C,CAL3C,WAAY,CAEZ,gDAAiD,CAHjD,UAmEF,CApDE,uCACE,+CAA0B,CAC1B,gDACF,CAGA,wDAGE,eAAgB,CAFhB,qFAAuD,CACvD,mBAOF,CAHE,4EACE,6BACF,CAIF,gEAGE,eAAgB,CAFhB,qFAAuD,CACvD,mBAEF,CAGA,8EAEE,OACF,CAEA,gFAGE,4BAA6B,CAD7B,6DAA8B,CAD9B,kBAQF,CAJE,oFACE,4DAA6B,CAC7B,6DACF,CAGF,wBACE,0CAME,UAAW,CAFX,MAAO,CACP,eAAgB,CAJhB,iBAAkB,CAElB,OAAQ,CADR,OAAQ,CAKR,0BACF,CACF,CAGF,uCACE,8CACF,CAEA,oCAiBE,kBAAmB,CAVnB,wBAAyB,CASzB,sGAAyG,CARzG,kBAAmB,CACnB,6CAAqC,CARrC,YAAa,CACb,WAAY,CAgBZ,sBAAuB,CAZvB,2GAA4G,CAF5G,4GAeF,CAEA,sDAEE,gDAA6C,CAD7C,SAaF,CAVE,0FAKE,4EAAiD,CACjD,gFAAiD,CAEjD,mDAAoD,CAJpD,0DAA2D,CAF3D,2DAOF,CAIA,2HACE,qFACF,CAEA,4HACE,uFACF,CAGF,uCAOE,uBAAwB,CANxB,aAAc,CAGd,gDAA6C,CAF7C,QAAS,CACT,eAAgB,CAEhB,mBAAoB,CAGpB,wBAAiB,CAAjB,gBAAiB,CAFjB,iBAGF,CAEA,wCACE,sCACF","file":"SegmentedControl-6389d0da.css","sourcesContent":[".SegmentedControl {\n /* TODO: use primitive `control.medium.size` when it is available instead of '32px' */\n --segmented-control-icon-width: 32px;\n\n display: inline-flex;\n\n /* TODO: use primitive `control.{small|medium}.size` when it is available */\n height: 32px;\n padding: 0;\n margin: 0;\n font-size: var(--text-body-size-medium);\n background-color: var(--controlTrack-bgColor-rest);\n border: var(--borderWidth-thin) solid var(--controlTrack-borderColor-rest, transparent);\n border-radius: var(--borderRadius-medium);\n\n /* Responsive full-width */\n &[data-full-width='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n\n @media (--viewportRange-narrow) {\n &[data-full-width-narrow='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width-narrow='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-full-width-regular='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width-regular='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-full-width-wide='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width-wide='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n\n &[data-full-width-regular='true']:not([data-full-width-wide='true']) {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n }\n\n /* Hide when dropdown variant is active */\n &[data-variant='dropdown'] {\n display: none;\n }\n\n /* Handle hideLabels variant - hide button text */\n &[data-variant='hideLabels'] .Text {\n display: none;\n }\n\n @media (--viewportRange-narrow) {\n &[data-variant-narrow='dropdown'] {\n display: none;\n }\n\n &[data-variant-narrow='hideLabels'] .Text {\n display: none;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-variant-regular='dropdown'] {\n display: none;\n }\n\n &[data-variant-regular='hideLabels'] .Text {\n display: none;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-variant-wide='dropdown'] {\n display: none;\n }\n\n &[data-variant-wide='hideLabels'] .Text {\n display: none;\n }\n }\n\n &:where([data-size='small']) {\n /* TODO: use primitive `control.{small|medium}.size` when it is available */\n height: 28px;\n font-size: var(--text-body-size-small);\n }\n}\n\n.DropdownContainer {\n display: none;\n\n /* Show when dropdown variant is active */\n &[data-variant='dropdown'] {\n display: block;\n }\n\n @media (--viewportRange-narrow) {\n &[data-variant-narrow='dropdown'] {\n display: block;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-variant-regular='dropdown'] {\n display: block;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-variant-wide='dropdown'] {\n display: block;\n }\n }\n}\n\n.Item {\n position: relative;\n display: block;\n /* stylelint-disable-next-line primer/spacing */\n margin-top: -1px;\n /* stylelint-disable-next-line primer/spacing */\n margin-bottom: -1px;\n flex-grow: 1;\n\n &:not(:last-child) {\n /* stylelint-disable-next-line primer/spacing */\n margin-right: 1px;\n\n &::after {\n position: absolute;\n top: var(--base-size-8);\n right: calc(-1 * var(--base-size-2));\n bottom: var(--base-size-8);\n width: 1px;\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-default);\n }\n\n &:has(+ [data-selected])::after,\n &:where([data-selected])::after {\n background-color: transparent;\n }\n }\n\n &:focus-within:has(:focus-visible) {\n background-color: transparent;\n }\n\n &:first-child {\n /* stylelint-disable-next-line primer/spacing */\n margin-left: -1px;\n }\n\n &:last-child {\n /* stylelint-disable-next-line primer/spacing */\n margin-right: -1px;\n }\n\n .Counter {\n margin-inline-start: var(--base-size-8);\n display: flex;\n align-items: center;\n }\n}\n\n.Button {\n /* TODO: use primitive `primer.control.medium.paddingInline.normal` when it is available */\n --segmented-control-button-inner-padding: 12px;\n --segmented-control-button-bg-inset: 4px;\n --segmented-control-outer-radius: var(--borderRadius-medium);\n\n width: 100%;\n height: 100%;\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--segmented-control-button-bg-inset);\n font-family: inherit;\n font-size: inherit;\n font-weight: var(--base-text-weight-normal);\n color: currentColor;\n cursor: pointer;\n background-color: transparent;\n border-color: transparent;\n border-width: 0;\n /* stylelint-disable-next-line primer/borders */\n border-radius: var(--segmented-control-outer-radius);\n\n & svg {\n fill: var(--fgColor-muted);\n color: var(--fgColor-muted);\n }\n\n /* fallback :focus state */\n &:focus:not(:disabled) {\n outline: var(--base-size-2) solid var(--fgColor-accent);\n outline-offset: -1px;\n box-shadow: none;\n\n /* remove fallback :focus if :focus-visible is supported */\n &:not(:focus-visible) {\n outline: solid 1px transparent;\n }\n }\n\n /* default focus state */\n &:focus-visible:not(:disabled) {\n outline: var(--base-size-2) solid var(--fgColor-accent);\n outline-offset: -1px;\n box-shadow: none;\n }\n\n /* stylelint-disable-next-line selector-max-specificity */\n &:focus:focus-visible:not(:last-child)::after {\n /* fixes an issue where the focus outline shows over the pseudo-element */\n width: 0;\n }\n\n &[aria-disabled='true']:not([aria-current='true']) {\n cursor: not-allowed;\n color: var(--fgColor-disabled);\n background-color: transparent;\n\n & svg {\n fill: var(--fgColor-disabled);\n color: var(--fgColor-disabled);\n }\n }\n\n @media (pointer: coarse) {\n &::before {\n position: absolute;\n top: 50%;\n right: 0;\n left: 0;\n min-height: 44px;\n content: '';\n transform: translateY(-50%);\n }\n }\n}\n\n.IconButton {\n width: var(--segmented-control-icon-width, 32px);\n}\n\n.Content {\n display: flex;\n height: 100%;\n /* stylelint-disable-next-line primer/spacing */\n padding-right: calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));\n /* stylelint-disable-next-line primer/spacing */\n padding-left: calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));\n border-color: transparent;\n border-style: solid;\n border-width: var(--borderWidth-thin);\n\n /*\n innerRadius = outerRadius - distance/2\n https://stackoverflow.com/questions/2932146/math-problem-determine-the-corner-radius-of-an-inner-border-based-on-outer-corn\n */\n /* stylelint-disable-next-line primer/borders */\n border-radius: calc(var(--segmented-control-outer-radius) - var(--segmented-control-button-bg-inset) / 2);\n align-items: center;\n justify-content: center;\n}\n\n.Button[aria-current='true'] {\n padding: 0;\n font-weight: var(--base-text-weight-semibold);\n\n .Content {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--segmented-control-button-inner-padding);\n /* stylelint-disable-next-line primer/spacing */\n padding-left: var(--segmented-control-button-inner-padding);\n background-color: var(--controlKnob-bgColor-rest);\n border-color: var(--controlKnob-borderColor-rest);\n /* stylelint-disable-next-line primer/borders */\n border-radius: var(--segmented-control-outer-radius);\n }\n}\n\n.Button:not([aria-current='true'], [aria-disabled='true']) {\n &:hover .Content {\n background-color: var(--controlTrack-bgColor-hover);\n }\n\n &:active .Content {\n background-color: var(--controlTrack-bgColor-active);\n }\n}\n\n.Text::after {\n display: block;\n height: 0;\n overflow: hidden;\n font-weight: var(--base-text-weight-semibold);\n pointer-events: none;\n visibility: hidden;\n content: attr(data-text);\n user-select: none;\n}\n\n.LeadingIcon {\n margin-right: var(--base-size-4);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAC7C,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,0BAA0B,CAAA;AAEzE,OAAO,KAAK,EAAC,+BAA+B,EAAC,MAAM,8BAA8B,CAAA;AAIjF,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAEhE,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAA;AAMhF,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IAC9C,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,8BAA8B;IAC9B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACzB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,0BAA0B,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC,CAAA;IACxG,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAC7C,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,0BAA0B,CAAA;AAEzE,OAAO,KAAK,EAAC,+BAA+B,EAAC,MAAM,8BAA8B,CAAA;AAIjF,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAEhE,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAA;AAMhF,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IAC9C,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,8BAA8B;IAC9B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACzB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,0BAA0B,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC,CAAA;IACxG,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAsMD,eAAO,MAAM,gBAAgB;;;;CAI3B,CAAA"}
|
|
@@ -178,12 +178,18 @@ const Root = t0 => {
|
|
|
178
178
|
}
|
|
179
179
|
const sharedChildProps = {
|
|
180
180
|
onClick: onChange ? event_0 => {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
const isDisabled = child_2.props.disabled === true || child_2.props["aria-disabled"] === "true" || child_2.props["aria-disabled"] === true;
|
|
182
|
+
if (!isDisabled) {
|
|
183
|
+
onChange(index_0);
|
|
184
|
+
isUncontrolled && setSelectedIndexInternalState(index_0);
|
|
185
|
+
child_2.props.onClick && child_2.props.onClick(event_0);
|
|
186
|
+
}
|
|
184
187
|
} : event_1 => {
|
|
185
|
-
child_2.props.
|
|
186
|
-
|
|
188
|
+
const isDisabled_0 = child_2.props.disabled === true || child_2.props["aria-disabled"] === "true" || child_2.props["aria-disabled"] === true;
|
|
189
|
+
if (!isDisabled_0) {
|
|
190
|
+
child_2.props.onClick && child_2.props.onClick(event_1);
|
|
191
|
+
isUncontrolled && setSelectedIndexInternalState(index_0);
|
|
192
|
+
}
|
|
187
193
|
},
|
|
188
194
|
selected: index_0 === selectedIndex,
|
|
189
195
|
style: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './SegmentedControl-
|
|
1
|
+
import './SegmentedControl-6389d0da.css';
|
|
2
2
|
|
|
3
3
|
var classes = {"SegmentedControl":"prc-SegmentedControl-SegmentedControl-e7570","Text":"prc-SegmentedControl-Text-c5gSh","DropdownContainer":"prc-SegmentedControl-DropdownContainer-QSnSd","Item":"prc-SegmentedControl-Item-7Aq6h","Counter":"prc-SegmentedControl-Counter--H-pM","Button":"prc-SegmentedControl-Button-ojWXD","IconButton":"prc-SegmentedControl-IconButton-O80Eh","Content":"prc-SegmentedControl-Content-gnQ4n","LeadingIcon":"prc-SegmentedControl-LeadingIcon-dAHA8"};
|
|
4
4
|
|
|
@@ -13,6 +13,8 @@ export type SegmentedControlButtonProps = {
|
|
|
13
13
|
leadingVisual?: React.FunctionComponent<React.PropsWithChildren<IconProps>> | React.ReactElement<any>;
|
|
14
14
|
/** @deprecated Use `leadingVisual` instead. The leading icon comes before item label */
|
|
15
15
|
leadingIcon?: React.FunctionComponent<React.PropsWithChildren<IconProps>> | React.ReactElement<any>;
|
|
16
|
+
/** Applies `aria-disabled` to the button. This will disable certain functionality, such as `onClick` events. */
|
|
17
|
+
disabled?: boolean;
|
|
16
18
|
/** Optional counter to display on the right side of the button */
|
|
17
19
|
count?: number | string;
|
|
18
20
|
} & ButtonHTMLAttributes<HTMLButtonElement | HTMLLIElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControlButton.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControlButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,OAAO,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAMrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAEpD,MAAM,MAAM,2BAA2B,GAAG;IACxC,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,oKAAoK;IACpK,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sKAAsK;IACtK,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iDAAiD;IAEjD,aAAa,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACrG,wFAAwF;IAExF,WAAW,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACnG,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB,GAAG,oBAAoB,CAAC,iBAAiB,GAAG,aAAa,CAAC,CAAA;AAE3D,QAAA,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,
|
|
1
|
+
{"version":3,"file":"SegmentedControlButton.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControlButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,OAAO,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAMrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAEpD,MAAM,MAAM,2BAA2B,GAAG;IACxC,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,oKAAoK;IACpK,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sKAAsK;IACtK,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iDAAiD;IAEjD,aAAa,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACrG,wFAAwF;IAExF,WAAW,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACnG,gHAAgH;IAChH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB,GAAG,oBAAoB,CAAC,iBAAiB,GAAG,aAAa,CAAC,CAAA;AAE3D,QAAA,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CAyClG,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -7,13 +7,14 @@ import CounterLabel from '../CounterLabel/CounterLabel.js';
|
|
|
7
7
|
|
|
8
8
|
const SegmentedControlButton = t0 => {
|
|
9
9
|
var _leadingVisual;
|
|
10
|
-
const $ = c(
|
|
10
|
+
const $ = c(36);
|
|
11
11
|
let children;
|
|
12
12
|
let className;
|
|
13
13
|
let count;
|
|
14
|
+
let disabled;
|
|
14
15
|
let leadingIcon;
|
|
15
16
|
let leadingVisual;
|
|
16
|
-
let
|
|
17
|
+
let props;
|
|
17
18
|
let selected;
|
|
18
19
|
if ($[0] !== t0) {
|
|
19
20
|
const {
|
|
@@ -22,145 +23,166 @@ const SegmentedControlButton = t0 => {
|
|
|
22
23
|
leadingIcon: t3,
|
|
23
24
|
selected: t4,
|
|
24
25
|
className: t5,
|
|
26
|
+
disabled: t6,
|
|
25
27
|
defaultSelected: _defaultSelected,
|
|
26
|
-
count:
|
|
27
|
-
...
|
|
28
|
+
count: t7,
|
|
29
|
+
...t8
|
|
28
30
|
} = t0;
|
|
29
31
|
children = t1;
|
|
30
32
|
leadingVisual = t2;
|
|
31
33
|
leadingIcon = t3;
|
|
32
34
|
selected = t4;
|
|
33
35
|
className = t5;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
disabled = t6;
|
|
37
|
+
count = t7;
|
|
38
|
+
props = t8;
|
|
36
39
|
$[0] = t0;
|
|
37
40
|
$[1] = children;
|
|
38
41
|
$[2] = className;
|
|
39
42
|
$[3] = count;
|
|
40
|
-
$[4] =
|
|
41
|
-
$[5] =
|
|
42
|
-
$[6] =
|
|
43
|
-
$[7] =
|
|
43
|
+
$[4] = disabled;
|
|
44
|
+
$[5] = leadingIcon;
|
|
45
|
+
$[6] = leadingVisual;
|
|
46
|
+
$[7] = props;
|
|
47
|
+
$[8] = selected;
|
|
44
48
|
} else {
|
|
45
49
|
children = $[1];
|
|
46
50
|
className = $[2];
|
|
47
51
|
count = $[3];
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
disabled = $[4];
|
|
53
|
+
leadingIcon = $[5];
|
|
54
|
+
leadingVisual = $[6];
|
|
55
|
+
props = $[7];
|
|
56
|
+
selected = $[8];
|
|
57
|
+
}
|
|
58
|
+
let ariaDisabled;
|
|
59
|
+
let rest;
|
|
60
|
+
if ($[9] !== props) {
|
|
61
|
+
({
|
|
62
|
+
"aria-disabled": ariaDisabled,
|
|
63
|
+
...rest
|
|
64
|
+
} = props);
|
|
65
|
+
$[9] = props;
|
|
66
|
+
$[10] = ariaDisabled;
|
|
67
|
+
$[11] = rest;
|
|
68
|
+
} else {
|
|
69
|
+
ariaDisabled = $[10];
|
|
70
|
+
rest = $[11];
|
|
52
71
|
}
|
|
53
72
|
const LeadingVisual = (_leadingVisual = leadingVisual) !== null && _leadingVisual !== void 0 ? _leadingVisual : leadingIcon;
|
|
54
73
|
let t1;
|
|
55
|
-
if ($[
|
|
74
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
56
75
|
t1 = clsx(classes.Item);
|
|
57
|
-
$[
|
|
76
|
+
$[12] = t1;
|
|
58
77
|
} else {
|
|
59
|
-
t1 = $[
|
|
78
|
+
t1 = $[12];
|
|
60
79
|
}
|
|
61
80
|
const t2 = selected ? "" : undefined;
|
|
62
|
-
|
|
63
|
-
if ($[9] !== className) {
|
|
64
|
-
t3 = clsx(classes.Button, className);
|
|
65
|
-
$[9] = className;
|
|
66
|
-
$[10] = t3;
|
|
67
|
-
} else {
|
|
68
|
-
t3 = $[10];
|
|
69
|
-
}
|
|
81
|
+
const t3 = disabled || ariaDisabled || undefined;
|
|
70
82
|
let t4;
|
|
71
|
-
if ($[
|
|
72
|
-
t4 = clsx(classes.
|
|
73
|
-
$[
|
|
83
|
+
if ($[13] !== className) {
|
|
84
|
+
t4 = clsx(classes.Button, className);
|
|
85
|
+
$[13] = className;
|
|
86
|
+
$[14] = t4;
|
|
74
87
|
} else {
|
|
75
|
-
t4 = $[
|
|
88
|
+
t4 = $[14];
|
|
76
89
|
}
|
|
77
90
|
let t5;
|
|
78
|
-
if ($[
|
|
79
|
-
t5 =
|
|
91
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
92
|
+
t5 = clsx(classes.Content, "segmentedControl-content");
|
|
93
|
+
$[15] = t5;
|
|
94
|
+
} else {
|
|
95
|
+
t5 = $[15];
|
|
96
|
+
}
|
|
97
|
+
let t6;
|
|
98
|
+
if ($[16] !== LeadingVisual) {
|
|
99
|
+
t6 = LeadingVisual && /*#__PURE__*/jsx("div", {
|
|
80
100
|
className: classes.LeadingIcon,
|
|
81
101
|
children: isElement(LeadingVisual) ? LeadingVisual : /*#__PURE__*/jsx(LeadingVisual, {})
|
|
82
102
|
});
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
103
|
+
$[16] = LeadingVisual;
|
|
104
|
+
$[17] = t6;
|
|
85
105
|
} else {
|
|
86
|
-
|
|
106
|
+
t6 = $[17];
|
|
87
107
|
}
|
|
88
|
-
let
|
|
89
|
-
if ($[
|
|
90
|
-
|
|
91
|
-
$[
|
|
108
|
+
let t7;
|
|
109
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
110
|
+
t7 = clsx(classes.Text, "segmentedControl-text");
|
|
111
|
+
$[18] = t7;
|
|
92
112
|
} else {
|
|
93
|
-
|
|
113
|
+
t7 = $[18];
|
|
94
114
|
}
|
|
95
|
-
let
|
|
96
|
-
if ($[
|
|
97
|
-
|
|
98
|
-
className:
|
|
115
|
+
let t8;
|
|
116
|
+
if ($[19] !== children) {
|
|
117
|
+
t8 = /*#__PURE__*/jsx("div", {
|
|
118
|
+
className: t7,
|
|
99
119
|
"data-text": children,
|
|
100
120
|
children: children
|
|
101
121
|
});
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
122
|
+
$[19] = children;
|
|
123
|
+
$[20] = t8;
|
|
104
124
|
} else {
|
|
105
|
-
|
|
125
|
+
t8 = $[20];
|
|
106
126
|
}
|
|
107
|
-
let
|
|
108
|
-
if ($[
|
|
109
|
-
|
|
127
|
+
let t9;
|
|
128
|
+
if ($[21] !== count) {
|
|
129
|
+
t9 = count !== undefined && /*#__PURE__*/jsx("span", {
|
|
110
130
|
className: classes.Counter,
|
|
111
131
|
children: /*#__PURE__*/jsx(CounterLabel, {
|
|
112
132
|
children: count
|
|
113
133
|
})
|
|
114
134
|
});
|
|
115
|
-
$[
|
|
116
|
-
$[18] = t8;
|
|
117
|
-
} else {
|
|
118
|
-
t8 = $[18];
|
|
119
|
-
}
|
|
120
|
-
let t9;
|
|
121
|
-
if ($[19] !== t5 || $[20] !== t7 || $[21] !== t8) {
|
|
122
|
-
t9 = /*#__PURE__*/jsxs("span", {
|
|
123
|
-
className: t4,
|
|
124
|
-
children: [t5, t7, t8]
|
|
125
|
-
});
|
|
126
|
-
$[19] = t5;
|
|
127
|
-
$[20] = t7;
|
|
128
|
-
$[21] = t8;
|
|
135
|
+
$[21] = count;
|
|
129
136
|
$[22] = t9;
|
|
130
137
|
} else {
|
|
131
138
|
t9 = $[22];
|
|
132
139
|
}
|
|
133
140
|
let t10;
|
|
134
|
-
if ($[23] !==
|
|
135
|
-
t10 = /*#__PURE__*/
|
|
141
|
+
if ($[23] !== t6 || $[24] !== t8 || $[25] !== t9) {
|
|
142
|
+
t10 = /*#__PURE__*/jsxs("span", {
|
|
143
|
+
className: t5,
|
|
144
|
+
children: [t6, t8, t9]
|
|
145
|
+
});
|
|
146
|
+
$[23] = t6;
|
|
147
|
+
$[24] = t8;
|
|
148
|
+
$[25] = t9;
|
|
149
|
+
$[26] = t10;
|
|
150
|
+
} else {
|
|
151
|
+
t10 = $[26];
|
|
152
|
+
}
|
|
153
|
+
let t11;
|
|
154
|
+
if ($[27] !== rest || $[28] !== selected || $[29] !== t10 || $[30] !== t3 || $[31] !== t4) {
|
|
155
|
+
t11 = /*#__PURE__*/jsx("button", {
|
|
136
156
|
"aria-current": selected,
|
|
137
|
-
|
|
157
|
+
"aria-disabled": t3,
|
|
158
|
+
className: t4,
|
|
138
159
|
type: "button",
|
|
139
160
|
...rest,
|
|
140
|
-
children:
|
|
161
|
+
children: t10
|
|
141
162
|
});
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
163
|
+
$[27] = rest;
|
|
164
|
+
$[28] = selected;
|
|
165
|
+
$[29] = t10;
|
|
166
|
+
$[30] = t3;
|
|
167
|
+
$[31] = t4;
|
|
168
|
+
$[32] = t11;
|
|
147
169
|
} else {
|
|
148
|
-
|
|
170
|
+
t11 = $[32];
|
|
149
171
|
}
|
|
150
|
-
let
|
|
151
|
-
if ($[
|
|
152
|
-
|
|
172
|
+
let t12;
|
|
173
|
+
if ($[33] !== t11 || $[34] !== t2) {
|
|
174
|
+
t12 = /*#__PURE__*/jsx("li", {
|
|
153
175
|
className: t1,
|
|
154
176
|
"data-selected": t2,
|
|
155
|
-
children:
|
|
177
|
+
children: t11
|
|
156
178
|
});
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
179
|
+
$[33] = t11;
|
|
180
|
+
$[34] = t2;
|
|
181
|
+
$[35] = t12;
|
|
160
182
|
} else {
|
|
161
|
-
|
|
183
|
+
t12 = $[35];
|
|
162
184
|
}
|
|
163
|
-
return
|
|
185
|
+
return t12;
|
|
164
186
|
};
|
|
165
187
|
SegmentedControlButton.__SLOT__ = Symbol('SegmentedControl.Button');
|
|
166
188
|
|
|
@@ -15,6 +15,8 @@ export type SegmentedControlIconButtonProps = {
|
|
|
15
15
|
description?: string;
|
|
16
16
|
/** The direction for the tooltip.*/
|
|
17
17
|
tooltipDirection?: TooltipDirection;
|
|
18
|
+
/** Whether the button is disabled. */
|
|
19
|
+
disabled?: boolean;
|
|
18
20
|
} & ButtonHTMLAttributes<HTMLButtonElement | HTMLLIElement>;
|
|
19
21
|
export declare const SegmentedControlIconButton: FCWithSlotMarker<React.PropsWithChildren<SegmentedControlIconButtonProps>>;
|
|
20
22
|
export default SegmentedControlIconButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControlIconButton.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControlIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,OAAO,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"SegmentedControlIconButton.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControlIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,OAAO,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAErD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAA;AAIlD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAEpD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,0DAA0D;IAE1D,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAC3F,8JAA8J;IAC9J,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kKAAkK;IAClK,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,GAAG,oBAAoB,CAAC,iBAAiB,GAAG,aAAa,CAAC,CAAA;AAE3D,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,+BAA+B,CAAC,CAiCjH,CAAA;AAID,eAAe,0BAA0B,CAAA"}
|
|
@@ -3,16 +3,16 @@ import { isElement } from 'react-is';
|
|
|
3
3
|
import classes from './SegmentedControl.module.css.js';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
7
6
|
import { Tooltip } from '../TooltipV2/Tooltip.js';
|
|
8
7
|
|
|
9
8
|
const SegmentedControlIconButton = t0 => {
|
|
10
|
-
const $ = c(
|
|
9
|
+
const $ = c(35);
|
|
11
10
|
let Icon;
|
|
12
11
|
let ariaLabel;
|
|
13
12
|
let className;
|
|
14
13
|
let description;
|
|
15
|
-
let
|
|
14
|
+
let disabled;
|
|
15
|
+
let props;
|
|
16
16
|
let selected;
|
|
17
17
|
let tooltipDirection;
|
|
18
18
|
if ($[0] !== t0) {
|
|
@@ -23,198 +23,139 @@ const SegmentedControlIconButton = t0 => {
|
|
|
23
23
|
className,
|
|
24
24
|
description,
|
|
25
25
|
tooltipDirection,
|
|
26
|
-
|
|
26
|
+
disabled,
|
|
27
|
+
...props
|
|
27
28
|
} = t0);
|
|
28
29
|
$[0] = t0;
|
|
29
30
|
$[1] = Icon;
|
|
30
31
|
$[2] = ariaLabel;
|
|
31
32
|
$[3] = className;
|
|
32
33
|
$[4] = description;
|
|
33
|
-
$[5] =
|
|
34
|
-
$[6] =
|
|
35
|
-
$[7] =
|
|
34
|
+
$[5] = disabled;
|
|
35
|
+
$[6] = props;
|
|
36
|
+
$[7] = selected;
|
|
37
|
+
$[8] = tooltipDirection;
|
|
36
38
|
} else {
|
|
37
39
|
Icon = $[1];
|
|
38
40
|
ariaLabel = $[2];
|
|
39
41
|
className = $[3];
|
|
40
42
|
description = $[4];
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
disabled = $[5];
|
|
44
|
+
props = $[6];
|
|
45
|
+
selected = $[7];
|
|
46
|
+
tooltipDirection = $[8];
|
|
47
|
+
}
|
|
48
|
+
let ariaDisabled;
|
|
49
|
+
let rest;
|
|
50
|
+
if ($[9] !== props) {
|
|
51
|
+
({
|
|
52
|
+
"aria-disabled": ariaDisabled,
|
|
53
|
+
...rest
|
|
54
|
+
} = props);
|
|
55
|
+
$[9] = props;
|
|
56
|
+
$[10] = ariaDisabled;
|
|
57
|
+
$[11] = rest;
|
|
58
|
+
} else {
|
|
59
|
+
ariaDisabled = $[10];
|
|
60
|
+
rest = $[11];
|
|
61
|
+
}
|
|
62
|
+
let t1;
|
|
63
|
+
if ($[12] !== className) {
|
|
64
|
+
t1 = clsx(classes.Item, className);
|
|
65
|
+
$[12] = className;
|
|
66
|
+
$[13] = t1;
|
|
67
|
+
} else {
|
|
68
|
+
t1 = $[13];
|
|
69
|
+
}
|
|
70
|
+
const t2 = selected || undefined;
|
|
71
|
+
const t3 = description ? undefined : "label";
|
|
72
|
+
const t4 = description ? description : ariaLabel;
|
|
73
|
+
const t5 = description ? ariaLabel : undefined;
|
|
74
|
+
const t6 = disabled || ariaDisabled || undefined;
|
|
75
|
+
let t7;
|
|
76
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
77
|
+
t7 = clsx(classes.Button, classes.IconButton);
|
|
78
|
+
$[14] = t7;
|
|
79
|
+
} else {
|
|
80
|
+
t7 = $[14];
|
|
81
|
+
}
|
|
82
|
+
let t8;
|
|
83
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
84
|
+
t8 = clsx(classes.Content, "segmentedControl-content");
|
|
85
|
+
$[15] = t8;
|
|
86
|
+
} else {
|
|
87
|
+
t8 = $[15];
|
|
88
|
+
}
|
|
89
|
+
let t9;
|
|
90
|
+
if ($[16] !== Icon) {
|
|
91
|
+
t9 = isElement(Icon) ? Icon : /*#__PURE__*/jsx(Icon, {});
|
|
92
|
+
$[16] = Icon;
|
|
93
|
+
$[17] = t9;
|
|
94
|
+
} else {
|
|
95
|
+
t9 = $[17];
|
|
96
|
+
}
|
|
97
|
+
let t10;
|
|
98
|
+
if ($[18] !== t9) {
|
|
99
|
+
t10 = /*#__PURE__*/jsx("span", {
|
|
100
|
+
className: t8,
|
|
101
|
+
children: t9
|
|
102
|
+
});
|
|
103
|
+
$[18] = t9;
|
|
104
|
+
$[19] = t10;
|
|
105
|
+
} else {
|
|
106
|
+
t10 = $[19];
|
|
107
|
+
}
|
|
108
|
+
let t11;
|
|
109
|
+
if ($[20] !== rest || $[21] !== selected || $[22] !== t10 || $[23] !== t5 || $[24] !== t6) {
|
|
110
|
+
t11 = /*#__PURE__*/jsx("button", {
|
|
111
|
+
type: "button",
|
|
112
|
+
"aria-current": selected,
|
|
113
|
+
"aria-label": t5,
|
|
114
|
+
"aria-disabled": t6,
|
|
115
|
+
className: t7,
|
|
116
|
+
...rest,
|
|
117
|
+
children: t10
|
|
118
|
+
});
|
|
119
|
+
$[20] = rest;
|
|
120
|
+
$[21] = selected;
|
|
121
|
+
$[22] = t10;
|
|
122
|
+
$[23] = t5;
|
|
123
|
+
$[24] = t6;
|
|
124
|
+
$[25] = t11;
|
|
125
|
+
} else {
|
|
126
|
+
t11 = $[25];
|
|
127
|
+
}
|
|
128
|
+
let t12;
|
|
129
|
+
if ($[26] !== t11 || $[27] !== t3 || $[28] !== t4 || $[29] !== tooltipDirection) {
|
|
130
|
+
t12 = /*#__PURE__*/jsx(Tooltip, {
|
|
131
|
+
type: t3,
|
|
132
|
+
text: t4,
|
|
133
|
+
direction: tooltipDirection,
|
|
134
|
+
children: t11
|
|
135
|
+
});
|
|
136
|
+
$[26] = t11;
|
|
137
|
+
$[27] = t3;
|
|
138
|
+
$[28] = t4;
|
|
139
|
+
$[29] = tooltipDirection;
|
|
140
|
+
$[30] = t12;
|
|
141
|
+
} else {
|
|
142
|
+
t12 = $[30];
|
|
44
143
|
}
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const t3 = description ? undefined : "label";
|
|
57
|
-
const t4 = description ? description : ariaLabel;
|
|
58
|
-
const t5 = description ? ariaLabel : undefined;
|
|
59
|
-
let t6;
|
|
60
|
-
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
61
|
-
t6 = clsx(classes.Button, classes.IconButton);
|
|
62
|
-
$[10] = t6;
|
|
63
|
-
} else {
|
|
64
|
-
t6 = $[10];
|
|
65
|
-
}
|
|
66
|
-
let t7;
|
|
67
|
-
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
68
|
-
t7 = clsx(classes.Content, "segmentedControl-content");
|
|
69
|
-
$[11] = t7;
|
|
70
|
-
} else {
|
|
71
|
-
t7 = $[11];
|
|
72
|
-
}
|
|
73
|
-
let t8;
|
|
74
|
-
if ($[12] !== Icon) {
|
|
75
|
-
t8 = isElement(Icon) ? Icon : /*#__PURE__*/jsx(Icon, {});
|
|
76
|
-
$[12] = Icon;
|
|
77
|
-
$[13] = t8;
|
|
78
|
-
} else {
|
|
79
|
-
t8 = $[13];
|
|
80
|
-
}
|
|
81
|
-
let t9;
|
|
82
|
-
if ($[14] !== t8) {
|
|
83
|
-
t9 = /*#__PURE__*/jsx("span", {
|
|
84
|
-
className: t7,
|
|
85
|
-
children: t8
|
|
86
|
-
});
|
|
87
|
-
$[14] = t8;
|
|
88
|
-
$[15] = t9;
|
|
89
|
-
} else {
|
|
90
|
-
t9 = $[15];
|
|
91
|
-
}
|
|
92
|
-
let t10;
|
|
93
|
-
if ($[16] !== rest || $[17] !== selected || $[18] !== t5 || $[19] !== t9) {
|
|
94
|
-
t10 = /*#__PURE__*/jsx("button", {
|
|
95
|
-
type: "button",
|
|
96
|
-
"aria-current": selected,
|
|
97
|
-
"aria-label": t5,
|
|
98
|
-
className: t6,
|
|
99
|
-
...rest,
|
|
100
|
-
children: t9
|
|
101
|
-
});
|
|
102
|
-
$[16] = rest;
|
|
103
|
-
$[17] = selected;
|
|
104
|
-
$[18] = t5;
|
|
105
|
-
$[19] = t9;
|
|
106
|
-
$[20] = t10;
|
|
107
|
-
} else {
|
|
108
|
-
t10 = $[20];
|
|
109
|
-
}
|
|
110
|
-
let t11;
|
|
111
|
-
if ($[21] !== t10 || $[22] !== t3 || $[23] !== t4 || $[24] !== tooltipDirection) {
|
|
112
|
-
t11 = /*#__PURE__*/jsx(Tooltip, {
|
|
113
|
-
type: t3,
|
|
114
|
-
text: t4,
|
|
115
|
-
direction: tooltipDirection,
|
|
116
|
-
children: t10
|
|
117
|
-
});
|
|
118
|
-
$[21] = t10;
|
|
119
|
-
$[22] = t3;
|
|
120
|
-
$[23] = t4;
|
|
121
|
-
$[24] = tooltipDirection;
|
|
122
|
-
$[25] = t11;
|
|
123
|
-
} else {
|
|
124
|
-
t11 = $[25];
|
|
125
|
-
}
|
|
126
|
-
let t12;
|
|
127
|
-
if ($[26] !== t1 || $[27] !== t11 || $[28] !== t2) {
|
|
128
|
-
t12 = /*#__PURE__*/jsx("li", {
|
|
129
|
-
className: t1,
|
|
130
|
-
"data-selected": t2,
|
|
131
|
-
children: t11
|
|
132
|
-
});
|
|
133
|
-
$[26] = t1;
|
|
134
|
-
$[27] = t11;
|
|
135
|
-
$[28] = t2;
|
|
136
|
-
$[29] = t12;
|
|
137
|
-
} else {
|
|
138
|
-
t12 = $[29];
|
|
139
|
-
}
|
|
140
|
-
return t12;
|
|
144
|
+
let t13;
|
|
145
|
+
if ($[31] !== t1 || $[32] !== t12 || $[33] !== t2) {
|
|
146
|
+
t13 = /*#__PURE__*/jsx("li", {
|
|
147
|
+
className: t1,
|
|
148
|
+
"data-selected": t2,
|
|
149
|
+
children: t12
|
|
150
|
+
});
|
|
151
|
+
$[31] = t1;
|
|
152
|
+
$[32] = t12;
|
|
153
|
+
$[33] = t2;
|
|
154
|
+
$[34] = t13;
|
|
141
155
|
} else {
|
|
142
|
-
|
|
143
|
-
if ($[30] !== className) {
|
|
144
|
-
t1 = clsx(classes.Item, className);
|
|
145
|
-
$[30] = className;
|
|
146
|
-
$[31] = t1;
|
|
147
|
-
} else {
|
|
148
|
-
t1 = $[31];
|
|
149
|
-
}
|
|
150
|
-
const t2 = selected || undefined;
|
|
151
|
-
let t3;
|
|
152
|
-
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
153
|
-
t3 = clsx(classes.Button, classes.IconButton);
|
|
154
|
-
$[32] = t3;
|
|
155
|
-
} else {
|
|
156
|
-
t3 = $[32];
|
|
157
|
-
}
|
|
158
|
-
let t4;
|
|
159
|
-
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
|
160
|
-
t4 = clsx(classes.Content, "segmentedControl-content");
|
|
161
|
-
$[33] = t4;
|
|
162
|
-
} else {
|
|
163
|
-
t4 = $[33];
|
|
164
|
-
}
|
|
165
|
-
let t5;
|
|
166
|
-
if ($[34] !== Icon) {
|
|
167
|
-
t5 = isElement(Icon) ? Icon : /*#__PURE__*/jsx(Icon, {});
|
|
168
|
-
$[34] = Icon;
|
|
169
|
-
$[35] = t5;
|
|
170
|
-
} else {
|
|
171
|
-
t5 = $[35];
|
|
172
|
-
}
|
|
173
|
-
let t6;
|
|
174
|
-
if ($[36] !== t5) {
|
|
175
|
-
t6 = /*#__PURE__*/jsx("span", {
|
|
176
|
-
className: t4,
|
|
177
|
-
children: t5
|
|
178
|
-
});
|
|
179
|
-
$[36] = t5;
|
|
180
|
-
$[37] = t6;
|
|
181
|
-
} else {
|
|
182
|
-
t6 = $[37];
|
|
183
|
-
}
|
|
184
|
-
let t7;
|
|
185
|
-
if ($[38] !== ariaLabel || $[39] !== rest || $[40] !== selected || $[41] !== t6) {
|
|
186
|
-
t7 = /*#__PURE__*/jsx("button", {
|
|
187
|
-
type: "button",
|
|
188
|
-
"aria-label": ariaLabel,
|
|
189
|
-
"aria-current": selected,
|
|
190
|
-
className: t3,
|
|
191
|
-
...rest,
|
|
192
|
-
children: t6
|
|
193
|
-
});
|
|
194
|
-
$[38] = ariaLabel;
|
|
195
|
-
$[39] = rest;
|
|
196
|
-
$[40] = selected;
|
|
197
|
-
$[41] = t6;
|
|
198
|
-
$[42] = t7;
|
|
199
|
-
} else {
|
|
200
|
-
t7 = $[42];
|
|
201
|
-
}
|
|
202
|
-
let t8;
|
|
203
|
-
if ($[43] !== t1 || $[44] !== t2 || $[45] !== t7) {
|
|
204
|
-
t8 = /*#__PURE__*/jsx("li", {
|
|
205
|
-
className: t1,
|
|
206
|
-
"data-selected": t2,
|
|
207
|
-
children: t7
|
|
208
|
-
});
|
|
209
|
-
$[43] = t1;
|
|
210
|
-
$[44] = t2;
|
|
211
|
-
$[45] = t7;
|
|
212
|
-
$[46] = t8;
|
|
213
|
-
} else {
|
|
214
|
-
t8 = $[46];
|
|
215
|
-
}
|
|
216
|
-
return t8;
|
|
156
|
+
t13 = $[34];
|
|
217
157
|
}
|
|
158
|
+
return t13;
|
|
218
159
|
};
|
|
219
160
|
SegmentedControlIconButton.__SLOT__ = Symbol('SegmentedControl.IconButton');
|
|
220
161
|
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/SegmentedControl/SegmentedControl.module.css"],"names":[],"mappings":"AAAA,6CAEE,mCAAoC,CASpC,8EAAkD,CAClD,8FAAuF,CACvF,gDAAyC,CATzC,mBAAoB,CAMpB,8CAAuC,CAHvC,WAAY,CAEZ,QAAS,CADT,SA0HF,CAlHE,mEACE,YAAa,CACb,UAAW,CAEX,mCACF,CAEA,oEACE,mBAAoB,CACpB,UAAW,CAEX,mCACF,CAEA,wCACE,0EACE,YAAa,CACb,UAAW,CAEX,mCACF,CAEA,2EACE,mBAAoB,CACpB,UAAW,CAEX,mCACF,CACF,CAEA,yBACE,2EACE,YAAa,CACb,UAAW,CAEX,mCACF,CAEA,4EACE,mBAAoB,CACpB,UAAW,CAEX,mCACF,CACF,CAEA,2BACE,wEACE,YAAa,CACb,UAAW,CAEX,mCACF,CASA,qLACE,mBAAoB,CACpB,UAAW,CAEX,mCACF,CACF,CAQA,2KACE,YACF,CAEA,wCAKE,yLACE,YACF,CACF,CAEA,yBAKE,2LACE,YACF,CACF,CAEA,2BAKE,qLACE,YACF,CACF,CAEA,sEAGE,4CAAsC,CADtC,WAEF,CAGF,8CACE,YAwBF,CArBE,qEACE,aACF,CAEA,wCACE,4EACE,aACF,CACF,CAEA,yBACE,6EACE,aACF,CACF,CAEA,2BACE,0EACE,aACF,CACF,CAGF,iCAEE,aAAc,CAKd,WAAY,CADZ,kBAAmB,CAFnB,eAAgB,CAHhB,iBAgDF,CAxCE,kDAEE,gBAiBF,CAfE,wDAQE,uEAA4C,CAJ5C,+BAA0B,CAE1B,UAAW,CALX,iBAAkB,CAElB,yCAAoC,CADpC,4BAAuB,CAGvB,SAIF,CAEA,6JAEE,4BACF,CAGF,kEACE,4BACF,CAEA,6CAEE,gBACF,CAEA,4CAEE,iBACF,CAEA,qEAGE,kBAAmB,CADnB,YAAa,CADb,4CAGF,CAGF,mCAEE,6CAA8C,CAC9C,uCAAwC,CACxC,oEAA4D,CAW5D,4BAA6B,CAC7B,wBAAyB,CAGzB,mDAAoD,CAFpD,cAAe,CAJf,kBAAmB,CACnB,cAAe,CAJf,mBAAoB,CACpB,iBAAkB,CAClB,8CAA2C,CAL3C,WAAY,CAEZ,gDAAiD,CAHjD,UAwDF,CAzCE,uCACE,+CAA0B,CAC1B,gDACF,CAGA,wDAGE,eAAgB,CAFhB,qFAAuD,CACvD,mBAOF,CAHE,4EACE,6BACF,CAIF,gEAGE,eAAgB,CAFhB,qFAAuD,CACvD,mBAEF,CAGA,8EAEE,OACF,CAEA,wBACE,0CAME,UAAW,CAFX,MAAO,CACP,eAAgB,CAJhB,iBAAkB,CAElB,OAAQ,CADR,OAAQ,CAKR,0BACF,CACF,CAGF,uCACE,8CACF,CAEA,oCAiBE,kBAAmB,CAVnB,wBAAyB,CASzB,sGAAyG,CARzG,kBAAmB,CACnB,6CAAqC,CARrC,YAAa,CACb,WAAY,CAgBZ,sBAAuB,CAZvB,2GAA4G,CAF5G,4GAeF,CAEA,sDAEE,gDAA6C,CAD7C,SAaF,CAVE,0FAKE,4EAAiD,CACjD,gFAAiD,CAEjD,mDAAoD,CAJpD,0DAA2D,CAF3D,2DAOF,CAIA,sGACE,qFACF,CAEA,uGACE,uFACF,CAGF,uCAOE,uBAAwB,CANxB,aAAc,CAGd,gDAA6C,CAF7C,QAAS,CACT,eAAgB,CAEhB,mBAAoB,CAGpB,wBAAiB,CAAjB,gBAAiB,CAFjB,iBAGF,CAEA,wCACE,sCACF","file":"SegmentedControl-5cfe12ab.css","sourcesContent":[".SegmentedControl {\n /* TODO: use primitive `control.medium.size` when it is available instead of '32px' */\n --segmented-control-icon-width: 32px;\n\n display: inline-flex;\n\n /* TODO: use primitive `control.{small|medium}.size` when it is available */\n height: 32px;\n padding: 0;\n margin: 0;\n font-size: var(--text-body-size-medium);\n background-color: var(--controlTrack-bgColor-rest);\n border: var(--borderWidth-thin) solid var(--controlTrack-borderColor-rest, transparent);\n border-radius: var(--borderRadius-medium);\n\n /* Responsive full-width */\n &[data-full-width='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n\n @media (--viewportRange-narrow) {\n &[data-full-width-narrow='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width-narrow='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-full-width-regular='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width-regular='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-full-width-wide='true'] {\n display: flex;\n width: 100%;\n\n --segmented-control-icon-width: 100%;\n }\n\n &[data-full-width-wide='false'] {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n\n &[data-full-width-regular='true']:not([data-full-width-wide='true']) {\n display: inline-flex;\n width: auto;\n\n --segmented-control-icon-width: 32px;\n }\n }\n\n /* Hide when dropdown variant is active */\n &[data-variant='dropdown'] {\n display: none;\n }\n\n /* Handle hideLabels variant - hide button text */\n &[data-variant='hideLabels'] .Text {\n display: none;\n }\n\n @media (--viewportRange-narrow) {\n &[data-variant-narrow='dropdown'] {\n display: none;\n }\n\n &[data-variant-narrow='hideLabels'] .Text {\n display: none;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-variant-regular='dropdown'] {\n display: none;\n }\n\n &[data-variant-regular='hideLabels'] .Text {\n display: none;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-variant-wide='dropdown'] {\n display: none;\n }\n\n &[data-variant-wide='hideLabels'] .Text {\n display: none;\n }\n }\n\n &:where([data-size='small']) {\n /* TODO: use primitive `control.{small|medium}.size` when it is available */\n height: 28px;\n font-size: var(--text-body-size-small);\n }\n}\n\n.DropdownContainer {\n display: none;\n\n /* Show when dropdown variant is active */\n &[data-variant='dropdown'] {\n display: block;\n }\n\n @media (--viewportRange-narrow) {\n &[data-variant-narrow='dropdown'] {\n display: block;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-variant-regular='dropdown'] {\n display: block;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-variant-wide='dropdown'] {\n display: block;\n }\n }\n}\n\n.Item {\n position: relative;\n display: block;\n /* stylelint-disable-next-line primer/spacing */\n margin-top: -1px;\n /* stylelint-disable-next-line primer/spacing */\n margin-bottom: -1px;\n flex-grow: 1;\n\n &:not(:last-child) {\n /* stylelint-disable-next-line primer/spacing */\n margin-right: 1px;\n\n &::after {\n position: absolute;\n top: var(--base-size-8);\n right: calc(-1 * var(--base-size-2));\n bottom: var(--base-size-8);\n width: 1px;\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-default);\n }\n\n &:has(+ [data-selected])::after,\n &:where([data-selected])::after {\n background-color: transparent;\n }\n }\n\n &:focus-within:has(:focus-visible) {\n background-color: transparent;\n }\n\n &:first-child {\n /* stylelint-disable-next-line primer/spacing */\n margin-left: -1px;\n }\n\n &:last-child {\n /* stylelint-disable-next-line primer/spacing */\n margin-right: -1px;\n }\n\n .Counter {\n margin-inline-start: var(--base-size-8);\n display: flex;\n align-items: center;\n }\n}\n\n.Button {\n /* TODO: use primitive `primer.control.medium.paddingInline.normal` when it is available */\n --segmented-control-button-inner-padding: 12px;\n --segmented-control-button-bg-inset: 4px;\n --segmented-control-outer-radius: var(--borderRadius-medium);\n\n width: 100%;\n height: 100%;\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--segmented-control-button-bg-inset);\n font-family: inherit;\n font-size: inherit;\n font-weight: var(--base-text-weight-normal);\n color: currentColor;\n cursor: pointer;\n background-color: transparent;\n border-color: transparent;\n border-width: 0;\n /* stylelint-disable-next-line primer/borders */\n border-radius: var(--segmented-control-outer-radius);\n\n & svg {\n fill: var(--fgColor-muted);\n color: var(--fgColor-muted);\n }\n\n /* fallback :focus state */\n &:focus:not(:disabled) {\n outline: var(--base-size-2) solid var(--fgColor-accent);\n outline-offset: -1px;\n box-shadow: none;\n\n /* remove fallback :focus if :focus-visible is supported */\n &:not(:focus-visible) {\n outline: solid 1px transparent;\n }\n }\n\n /* default focus state */\n &:focus-visible:not(:disabled) {\n outline: var(--base-size-2) solid var(--fgColor-accent);\n outline-offset: -1px;\n box-shadow: none;\n }\n\n /* stylelint-disable-next-line selector-max-specificity */\n &:focus:focus-visible:not(:last-child)::after {\n /* fixes an issue where the focus outline shows over the pseudo-element */\n width: 0;\n }\n\n @media (pointer: coarse) {\n &::before {\n position: absolute;\n top: 50%;\n right: 0;\n left: 0;\n min-height: 44px;\n content: '';\n transform: translateY(-50%);\n }\n }\n}\n\n.IconButton {\n width: var(--segmented-control-icon-width, 32px);\n}\n\n.Content {\n display: flex;\n height: 100%;\n /* stylelint-disable-next-line primer/spacing */\n padding-right: calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));\n /* stylelint-disable-next-line primer/spacing */\n padding-left: calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));\n border-color: transparent;\n border-style: solid;\n border-width: var(--borderWidth-thin);\n\n /*\n innerRadius = outerRadius - distance/2\n https://stackoverflow.com/questions/2932146/math-problem-determine-the-corner-radius-of-an-inner-border-based-on-outer-corn\n */\n /* stylelint-disable-next-line primer/borders */\n border-radius: calc(var(--segmented-control-outer-radius) - var(--segmented-control-button-bg-inset) / 2);\n align-items: center;\n justify-content: center;\n}\n\n.Button[aria-current='true'] {\n padding: 0;\n font-weight: var(--base-text-weight-semibold);\n\n .Content {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--segmented-control-button-inner-padding);\n /* stylelint-disable-next-line primer/spacing */\n padding-left: var(--segmented-control-button-inner-padding);\n background-color: var(--controlKnob-bgColor-rest);\n border-color: var(--controlKnob-borderColor-rest);\n /* stylelint-disable-next-line primer/borders */\n border-radius: var(--segmented-control-outer-radius);\n }\n}\n\n.Button:not([aria-current='true']) {\n &:hover .Content {\n background-color: var(--controlTrack-bgColor-hover);\n }\n\n &:active .Content {\n background-color: var(--controlTrack-bgColor-active);\n }\n}\n\n.Text::after {\n display: block;\n height: 0;\n overflow: hidden;\n font-weight: var(--base-text-weight-semibold);\n pointer-events: none;\n visibility: hidden;\n content: attr(data-text);\n user-select: none;\n}\n\n.LeadingIcon {\n margin-right: var(--base-size-4);\n}\n"]}
|