@primer/react 0.0.0-20260831205533 → 0.0.0-20260911162708
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 +27 -3
- package/dist/ActionBar/ActionBar.js +2 -2
- package/dist/ActionList/Description.js +3 -3
- package/dist/ActionList/Divider.js +2 -2
- package/dist/ActionList/Group.js +4 -4
- package/dist/ActionList/GroupHeadingTrailingAction.js +2 -2
- package/dist/ActionList/Heading.js +3 -3
- package/dist/ActionList/Item.js +4 -4
- package/dist/ActionList/List.js +3 -3
- package/dist/ActionList/Selection.js +2 -2
- package/dist/ActionList/TrailingAction.js +3 -3
- package/dist/ActionList/Visuals.js +3 -3
- package/dist/ActionMenu/ActionMenu.js +2 -2
- package/dist/AnchoredOverlay/AnchoredOverlay.js +3 -3
- package/dist/Autocomplete/Autocomplete.js +2 -2
- package/dist/Autocomplete/AutocompleteInput.js +1 -1
- package/dist/Autocomplete/AutocompleteMenu.js +3 -3
- package/dist/Autocomplete/AutocompleteOverlay.js +3 -3
- package/dist/Avatar/Avatar.js +3 -3
- package/dist/AvatarStack/AvatarStack.js +3 -3
- package/dist/Banner/Banner.js +3 -3
- package/dist/BaseStyles.js +2 -2
- package/dist/Blankslate/Blankslate.js +3 -3
- package/dist/BranchName/BranchName.js +2 -2
- package/dist/Breadcrumbs/Breadcrumbs.js +3 -3
- package/dist/Button/Button.js +2 -2
- package/dist/Button/ButtonBase.js +4 -4
- package/dist/Button/IconButton.js +3 -3
- package/dist/Button/LinkButton.js +2 -2
- package/dist/ButtonGroup/ButtonGroup.js +3 -3
- package/dist/Card/Card.js +3 -3
- package/dist/Checkbox/Checkbox.js +2 -2
- package/dist/CheckboxGroup/CheckboxGroup.js +2 -2
- package/dist/CircleBadge/CircleBadge.js +2 -2
- package/dist/ConfirmationDialog/ConfirmationDialog.js +2 -2
- package/dist/CounterLabel/CounterLabel.js +3 -3
- package/dist/DataTable/DataTable.js +1 -1
- package/dist/DataTable/ErrorDialog.js +1 -1
- package/dist/DataTable/Pagination.js +5 -5
- package/dist/DataTable/Table-50e68700.css +2 -0
- package/dist/DataTable/Table-50e68700.css.map +1 -0
- package/dist/DataTable/Table.d.ts +1 -0
- package/dist/DataTable/Table.js +74 -44
- package/dist/DataTable/Table.module.css.js +7 -2
- package/dist/DataTable/TableGroup.d.ts +41 -0
- package/dist/DataTable/TableGroup.js +155 -0
- package/dist/DataTable/TableGroupContext.js +5 -0
- package/dist/DataTable/index.d.ts +3 -1
- package/dist/DataTable/index.js +2 -0
- package/dist/DataTable/useTable.js +1 -1
- package/dist/Details/Details.js +3 -3
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/FeatureFlags/DefaultFeatureFlags.js +1 -2
- package/dist/FeatureFlags/FeatureFlags.js +2 -2
- package/dist/FeatureFlags/useFeatureFlag.js +1 -1
- package/dist/FilteredActionList/FilteredActionList.js +2 -2
- package/dist/FilteredActionList/FilteredActionListInput.js +2 -2
- package/dist/FilteredActionList/FilteredActionListLoaders.js +1 -1
- package/dist/Flash/Flash.js +3 -3
- package/dist/FormControl/FormControl.js +4 -4
- package/dist/FormControl/FormControlCaption.js +2 -2
- package/dist/FormControl/FormControlLabel.js +1 -1
- package/dist/FormControl/FormControlLeadingVisual.js +1 -1
- package/dist/FormControl/_FormControlContext.js +1 -1
- package/dist/FormControl/_FormControlValidation.js +1 -1
- package/dist/Header/Header.js +3 -3
- package/dist/Heading/Heading.js +3 -3
- package/dist/Hidden/Hidden.js +2 -2
- package/dist/InlineMessage/InlineMessage.js +2 -2
- package/dist/KeybindingHint/KeybindingHint.js +3 -3
- package/dist/KeybindingHint/components/Chord.js +4 -4
- package/dist/KeybindingHint/components/Key.js +1 -1
- package/dist/KeybindingHint/components/Sequence.js +3 -3
- package/dist/Label/Label.js +3 -3
- package/dist/LabelGroup/LabelGroup.js +2 -2
- package/dist/Link/Link.js +3 -3
- package/dist/NavList/NavList.js +6 -6
- package/dist/Octicon/Octicon.js +2 -2
- package/dist/Overlay/Overlay.js +2 -2
- package/dist/PageHeader/PageHeader.js +4 -4
- package/dist/PageLayout/DragHandle.js +2 -2
- package/dist/PageLayout/PageLayout.js +3 -3
- package/dist/PageLayout/usePaneWidth.js +1 -1
- package/dist/Pagehead/Pagehead.js +2 -2
- package/dist/Pagination/Pagination.js +4 -4
- package/dist/Popover/Popover.js +3 -3
- package/dist/Portal/Portal.js +1 -1
- package/dist/ProgressBar/ProgressBar.js +3 -3
- package/dist/Radio/Radio.js +3 -3
- package/dist/RadioGroup/RadioGroup.js +1 -1
- package/dist/RelativeTime/RelativeTime.js +1 -1
- package/dist/ScrollableRegion/ScrollableRegion.js +3 -3
- package/dist/SegmentedControl/SegmentedControl-e68d4197.css +2 -0
- package/dist/SegmentedControl/SegmentedControl-e68d4197.css.map +1 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts +5 -1
- package/dist/SegmentedControl/SegmentedControl.js +204 -167
- package/dist/SegmentedControl/SegmentedControl.module.css.js +8 -4
- package/dist/SegmentedControl/SegmentedControlAction.d.ts +12 -0
- package/dist/SegmentedControl/SegmentedControlAction.js +111 -0
- package/dist/SegmentedControl/SegmentedControlActionContext.js +5 -0
- package/dist/SegmentedControl/SegmentedControlButton.js +2 -2
- package/dist/SegmentedControl/SegmentedControlDivider.d.ts +9 -0
- package/dist/SegmentedControl/SegmentedControlDivider.js +24 -0
- package/dist/SegmentedControl/SegmentedControlIconButton.js +2 -2
- package/dist/SegmentedControl/index.d.ts +3 -1
- package/dist/Select/Select.js +3 -3
- package/dist/SelectPanel/SelectPanel.js +3 -3
- package/dist/SelectPanel/SelectPanelMessage.js +2 -2
- package/dist/SideNav.js +2 -2
- package/dist/Skeleton/SkeletonBox.js +3 -3
- package/dist/SkeletonAvatar/SkeletonAvatar.js +2 -2
- package/dist/SkeletonText/SkeletonText.js +2 -2
- package/dist/Spinner/Spinner.js +3 -3
- package/dist/SplitPageLayout/SplitPageLayout.js +1 -1
- package/dist/Stack/Stack.js +3 -3
- package/dist/StateLabel/StateLabel.js +3 -3
- package/dist/SubNav/SubNav.js +3 -3
- package/dist/TabNav/TabNav.js +3 -3
- package/dist/Text/Text.js +2 -2
- package/dist/TextInput/TextInput.js +5 -5
- package/dist/TextInputWithTokens/TextInputWithTokens.js +3 -3
- package/dist/Textarea/Textarea.js +4 -4
- package/dist/ThemeProvider.js +2 -2
- package/dist/Timeline/Timeline.js +3 -3
- package/dist/ToggleSwitch/ToggleSwitch.js +4 -4
- package/dist/Token/IssueLabelToken.js +3 -3
- package/dist/Token/Token.js +3 -3
- package/dist/Token/TokenBase.js +3 -3
- package/dist/Token/_RemoveTokenButton.js +1 -1
- package/dist/Token/_TokenTextContainer.js +2 -2
- package/dist/Tooltip/Tooltip.js +2 -2
- package/dist/TooltipV2/Tooltip.js +16 -9
- package/dist/TopicTag/TopicTag.js +2 -2
- package/dist/TopicTag/TopicTagGroup.js +2 -2
- package/dist/TreeView/TreeView.js +9 -9
- package/dist/TreeView/useRovingTabIndex.js +1 -1
- package/dist/TreeView/useTreeItemCache.js +1 -1
- package/dist/TreeView/useTypeahead.js +1 -1
- package/dist/Truncate/Truncate.js +2 -2
- package/dist/UnderlineNav/UnderlineNav.js +3 -3
- package/dist/UnderlineNav/UnderlineNavItem.js +2 -2
- package/dist/VisuallyHidden/VisuallyHidden.js +2 -2
- package/dist/_VisuallyHidden.js +2 -2
- package/dist/deprecated/ActionList/Divider.js +1 -1
- package/dist/deprecated/ActionList/Group.js +1 -1
- package/dist/deprecated/ActionList/Header.js +2 -2
- package/dist/deprecated/ActionList/Item.js +4 -4
- package/dist/deprecated/ActionList/List.js +3 -3
- package/dist/deprecated/ActionMenu.js +2 -2
- package/dist/deprecated/DialogV1/Dialog.js +4 -4
- package/dist/deprecated/FilteredSearch/FilteredSearch.js +2 -2
- package/dist/deprecated/UnderlineNav/UnderlineNav.js +3 -3
- package/dist/experimental/IssueLabel/IssueLabel.js +2 -2
- package/dist/experimental/SelectPanel2/SelectPanel.js +5 -5
- package/dist/experimental/Tabs/Tabs.js +23 -26
- package/dist/experimental/Tabs/useTab.js +1 -1
- package/dist/experimental/Tabs/useTabList.js +17 -21
- package/dist/experimental/Tabs/useTabPanel.js +1 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +10 -15
- package/dist/experimental/index.d.ts +5 -4
- package/dist/experimental/index.js +1 -1
- package/dist/hooks/useDetails.js +1 -1
- package/dist/hooks/useDialog.js +1 -1
- package/dist/hooks/useMedia.js +1 -1
- package/dist/hooks/useMenuInitialFocus.js +1 -1
- package/dist/hooks/useMenuKeyboardNavigation.js +1 -1
- package/dist/hooks/useMergedRefs.js +1 -1
- package/dist/hooks/useMnemonics.js +1 -1
- package/dist/hooks/useOpenAndCloseFocus.js +1 -1
- package/dist/hooks/useOverflow.js +5 -5
- package/dist/hooks/useOverlay.js +1 -1
- package/dist/hooks/useProvidedStateOrCreate.js +1 -1
- package/dist/hooks/useRefObjectAsForwardedRef.js +1 -1
- package/dist/hooks/useRenderForcingRef.js +1 -1
- package/dist/hooks/useScrollFlash.js +1 -1
- package/dist/hooks/useSyncedState.js +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3 -1
- package/dist/internal/components/ButtonReset.js +2 -2
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +4 -4
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +3 -3
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +3 -3
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +2 -2
- package/dist/internal/components/ConditionalWrapper.js +1 -1
- package/dist/internal/components/InputLabel.js +2 -2
- package/dist/internal/components/InputValidation.js +2 -2
- package/dist/internal/components/OverflowObserverProvider.js +2 -2
- package/dist/internal/components/TextInputInnerAction.js +4 -4
- package/dist/internal/components/TextInputInnerVisualSlot.js +2 -2
- package/dist/internal/components/TextInputWrapper.js +3 -3
- package/dist/internal/components/ThemeProviderBase.js +1 -1
- package/dist/internal/components/UnderlineTabbedInterface.js +3 -3
- package/dist/internal/components/UnstyledTextInput.js +3 -3
- package/dist/internal/components/ValidationAnimationContainer.js +2 -2
- package/dist/internal/hooks/useEffectCallback.js +1 -1
- package/dist/internal/hooks/useEffectOnce.js +1 -1
- package/dist/internal/hooks/useOverflowObserver.js +1 -1
- package/dist/internal/hooks/useThemeProvider.js +1 -1
- package/dist/live-region/Announce.js +2 -2
- package/dist/live-region/AriaAlert.d.ts +1 -1
- package/dist/live-region/AriaAlert.js +1 -1
- package/dist/live-region/AriaStatus.js +1 -1
- package/dist/next/ThemeProvider.js +1 -1
- package/dist/utils/descendant-registry.js +2 -2
- package/dist/utils/react-compiler-runtime.js +32 -0
- package/generated/components.json +175 -8
- package/package.json +8 -8
- package/dist/DataTable/Table-7f5cb3e4.css +0 -2
- package/dist/DataTable/Table-7f5cb3e4.css.map +0 -1
- package/dist/SegmentedControl/SegmentedControl-4ef72733.css +0 -2
- package/dist/SegmentedControl/SegmentedControl-4ef72733.css.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SegmentedControl/SegmentedControl.module.css.js"],"names":[],"mappings":"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","file":"SegmentedControl-e68d4197.css","sourcesContent":["@define-mixin subtleVariant {\n --segmented-control-outer-radius: var(--borderRadius-large);\n --segmented-control-button-bg-inset: 0px;\n\n background-color: transparent;\n border: 0;\n\n /* stylelint-disable-next-line nesting-selector-no-missing-scoping-root */\n &::before {\n display: none;\n }\n\n .Item:not(:last-child)::after {\n background-color: transparent;\n }\n\n > [data-component='SegmentedControl.Divider'] {\n display: block;\n }\n\n .Button {\n padding: 0;\n color: var(--fgColor-muted);\n border: 0;\n border-radius: var(--borderRadius-large);\n\n .Content {\n padding-inline: var(--base-size-12);\n border: 0;\n }\n }\n\n .Button[aria-pressed='true'] {\n color: var(--fgColor-default);\n\n .Content {\n background-color: var(--bgColor-muted);\n }\n }\n\n .Button:where(:not([aria-pressed='true'], [aria-disabled='true'])):hover .Content {\n background-color: var(--bgColor-muted);\n background-color: color-mix(in srgb, var(--bgColor-muted) 50%, transparent);\n }\n}\n\n@define-mixin defaultVariant {\n --segmented-control-outer-radius: var(--borderRadius-medium);\n --segmented-control-button-bg-inset: 4px;\n\n background-color: var(--controlTrack-bgColor-rest);\n border: var(--borderWidth-thin) solid var(--controlTrack-borderColor-rest, transparent);\n\n /* stylelint-disable-next-line nesting-selector-no-missing-scoping-root */\n &::before {\n display: block;\n }\n\n .Item:not(:last-child)::after {\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-default);\n }\n\n > [data-component='SegmentedControl.Divider'] {\n display: none;\n }\n\n .Button {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--segmented-control-button-bg-inset);\n color: currentColor;\n /* stylelint-disable-next-line primer/borders */\n border-radius: var(--segmented-control-outer-radius);\n\n .Content {\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: calc(var(--segmented-control-button-inner-padding) - var(--segmented-control-button-bg-inset));\n border: var(--borderWidth-thin) solid transparent;\n }\n }\n\n .Button[aria-pressed='true'] {\n padding: 0;\n color: currentColor;\n\n .Content {\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: var(--segmented-control-button-inner-padding);\n background-color: transparent;\n }\n }\n\n .Button:where(:not([aria-pressed='true'], [aria-disabled='true'])):hover .Content {\n background-color: var(--controlTrack-bgColor-hover);\n }\n}\n\n.SegmentedControl {\n /* TODO: use primitive `control.medium.size` when it is available instead of '32px' */\n --segmented-control-icon-width: 32px;\n --segmented-control-outer-radius: var(--borderRadius-medium);\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 position: relative;\n\n @supports (anchor-name: --value) {\n &::before {\n position-anchor: --segmented-control-current-item;\n content: '';\n position: absolute;\n inset: anchor(top) anchor(right) anchor(bottom) anchor(left);\n background-color: var(--controlKnob-bgColor-rest);\n border: var(--borderWidth-thin) solid var(--controlKnob-borderColor-rest);\n /* stylelint-disable-next-line primer/borders */\n border-radius: var(--segmented-control-outer-radius);\n\n @media (prefers-reduced-motion: no-preference) {\n transition: inset var(--base-duration-200) var(--base-easing-easeInOut);\n }\n }\n\n &[data-disable-knob-transition]::before {\n transition: none;\n }\n }\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 > [data-component='SegmentedControl.Divider'] {\n display: none;\n align-self: stretch;\n width: 1px;\n margin-block: var(--base-size-8);\n margin-inline-start: var(--base-size-8);\n /* stylelint-disable-next-line primer/spacing -- preserve the previous divider's 16px layout footprint */\n margin-inline-end: calc(var(--base-size-8) - 1px);\n list-style: none;\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-default);\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 &:where([data-variant='subtle']) {\n @mixin subtleVariant;\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 &:where([data-variant-narrow='subtle']) {\n @mixin subtleVariant;\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 &:where([data-variant-regular='subtle']) {\n @mixin subtleVariant;\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 &:where([data-variant-wide='subtle']) {\n @mixin subtleVariant;\n }\n\n &:where([data-variant-regular='subtle']):not([data-variant-wide='subtle']) {\n @mixin defaultVariant;\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.DropdownGroup {\n --segmented-control-action-size: 32px;\n --segmented-control-list-flex: 0 1 auto;\n\n display: inline-flex;\n align-items: center;\n gap: var(--base-size-4);\n\n &[data-full-width='true'] {\n width: 100%;\n\n --segmented-control-list-flex: 1 1 auto;\n }\n\n &[data-full-width='false'] {\n width: auto;\n }\n\n @media (--viewportRange-narrow) {\n &[data-full-width-narrow='true'] {\n width: 100%;\n\n --segmented-control-list-flex: 1 1 auto;\n }\n\n &[data-full-width-narrow='false'] {\n width: auto;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-full-width-regular='true'] {\n width: 100%;\n\n --segmented-control-list-flex: 1 1 auto;\n }\n\n &[data-full-width-regular='false'] {\n width: auto;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-full-width-wide='true'] {\n width: 100%;\n\n --segmented-control-list-flex: 1 1 auto;\n }\n\n &[data-full-width-wide='false'] {\n width: auto;\n }\n\n &[data-full-width-regular='true']:not([data-full-width-wide='true']) {\n width: auto;\n\n --segmented-control-list-flex: 0 1 auto;\n }\n }\n\n &[data-size='small'] {\n --segmented-control-action-size: 28px;\n }\n\n > .SegmentedControl {\n min-width: 0;\n flex: var(--segmented-control-list-flex);\n }\n}\n\n.InlineAction {\n display: flex;\n\n &[data-variant='dropdown'] {\n display: none;\n }\n\n @media (--viewportRange-narrow) {\n &[data-variant-narrow='dropdown'] {\n display: none;\n }\n }\n\n @media (--viewportRange-regular) {\n &[data-variant-regular='dropdown'] {\n display: none;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-variant-wide='dropdown'] {\n display: none;\n }\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 /* stylelint-disable-next-line selector-pseudo-class-disallowed-list -- scoped to CSS Module, audited (github/github-ui#17224) */\n &:has(+ [data-selected])::after,\n /* stylelint-disable-next-line selector-pseudo-class-disallowed-list -- account for a hidden divider in the default variant */\n &:has(+ :where([data-component='SegmentedControl.Divider']) + :where([data-selected]))::after,\n &:where([data-selected])::after {\n background-color: transparent;\n }\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.ActionItem {\n display: flex;\n align-items: center;\n margin-inline-start: 0;\n}\n\n.ActionButton {\n width: var(--segmented-control-action-size);\n height: var(--segmented-control-action-size);\n padding: 0;\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\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-pressed='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 background-color: transparent;\n transition: background-color var(--base-duration-200) var(--base-easing-easeInOut);\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-pressed='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 anchor-name: --segmented-control-current-item;\n\n @supports not (anchor-name: --value) {\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\n.Button:not([aria-pressed='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,5 +1,7 @@
|
|
|
1
1
|
import { FCWithSlotMarker } from "../utils/types/Slots.js";
|
|
2
2
|
import { ResponsiveValue } from "../hooks/useResponsiveValue.js";
|
|
3
|
+
import { SegmentedControlDividerProps } from "./SegmentedControlDivider.js";
|
|
4
|
+
import { SegmentedControlActionProps } from "./SegmentedControlAction.js";
|
|
3
5
|
import { SegmentedControlButtonProps } from "./SegmentedControlButton.js";
|
|
4
6
|
import { SegmentedControlIconButtonProps } from "./SegmentedControlIconButton.js";
|
|
5
7
|
import { WidthOnlyViewportRangeKeys } from "../utils/types/ViewportRangeKeys.js";
|
|
@@ -13,12 +15,14 @@ type SegmentedControlProps = {
|
|
|
13
15
|
fullWidth?: boolean | ResponsiveValue<boolean>; /** The handler that gets called when a segment is selected */
|
|
14
16
|
onChange?: (selectedIndex: number) => void; /** The size of the buttons */
|
|
15
17
|
size?: 'small' | 'medium'; /** Configure alternative ways to render the control when it gets rendered in tight spaces */
|
|
16
|
-
variant?: 'default' | Partial<Record<WidthOnlyViewportRangeKeys, 'hideLabels' | 'dropdown' | 'default'>>;
|
|
18
|
+
variant?: 'default' | 'subtle' | Partial<Record<WidthOnlyViewportRangeKeys, 'hideLabels' | 'dropdown' | 'default' | 'subtle'>>;
|
|
17
19
|
className?: string;
|
|
18
20
|
};
|
|
19
21
|
declare const SegmentedControl: React.FC<React.PropsWithChildren<SegmentedControlProps>> & {
|
|
20
22
|
Button: FCWithSlotMarker<React.PropsWithChildren<SegmentedControlButtonProps>>;
|
|
21
23
|
IconButton: FCWithSlotMarker<React.PropsWithChildren<SegmentedControlIconButtonProps>>;
|
|
24
|
+
Divider: FCWithSlotMarker<SegmentedControlDividerProps>;
|
|
25
|
+
Action: FCWithSlotMarker<SegmentedControlActionProps>;
|
|
22
26
|
};
|
|
23
27
|
//#endregion
|
|
24
28
|
export { SegmentedControl, SegmentedControlProps };
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
|
+
import useIsomorphicLayoutEffect from "../utils/useIsomorphicLayoutEffect.js";
|
|
1
3
|
import { isSlot } from "../utils/is-slot.js";
|
|
4
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
2
5
|
import { getResponsiveAttributes } from "../internal/utils/getResponsiveAttributes.js";
|
|
3
6
|
import { ActionList } from "../ActionList/index.js";
|
|
4
7
|
import { ActionMenu } from "../ActionMenu/ActionMenu.js";
|
|
5
8
|
import SegmentedControl_module_css_default from "./SegmentedControl.module.css.js";
|
|
6
9
|
import SegmentedControlButton from "./SegmentedControlButton.js";
|
|
7
10
|
import { SegmentedControlIconButton } from "./SegmentedControlIconButton.js";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
+
import { SegmentedControlActionContext } from "./SegmentedControlActionContext.js";
|
|
12
|
+
import SegmentedControlAction from "./SegmentedControlAction.js";
|
|
13
|
+
import SegmentedControlDivider from "./SegmentedControlDivider.js";
|
|
11
14
|
import React, { useRef, useState } from "react";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { clsx } from "clsx";
|
|
12
17
|
import { isElement } from "react-is";
|
|
13
18
|
//#region src/SegmentedControl/SegmentedControl.tsx
|
|
14
19
|
const Root = (t0) => {
|
|
15
|
-
const $ = c(
|
|
20
|
+
const $ = c(39);
|
|
16
21
|
let ariaLabel;
|
|
17
22
|
let ariaLabelledby;
|
|
18
23
|
let children;
|
|
@@ -48,207 +53,239 @@ const Root = (t0) => {
|
|
|
48
53
|
const variant = t1 === void 0 ? "default" : t1;
|
|
49
54
|
const segmentedControlContainerRef = useRef(null);
|
|
50
55
|
let t2;
|
|
51
|
-
if ($[10]
|
|
52
|
-
t2 =
|
|
53
|
-
$[10] =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57
|
+
t2 = { action: SegmentedControlAction };
|
|
58
|
+
$[10] = t2;
|
|
59
|
+
} else t2 = $[10];
|
|
60
|
+
const [slots, segmentChildren] = useSlots(children, t2);
|
|
61
|
+
const actionChild = slots.action;
|
|
62
|
+
const segments = segmentChildren.filter(_temp);
|
|
63
|
+
const segmentIndices = new Map(segments.map(_temp2));
|
|
64
|
+
const segmentCount = segments.length;
|
|
65
|
+
const previousSegmentCount = useRef(segmentCount);
|
|
66
|
+
useIsomorphicLayoutEffect(() => {
|
|
67
|
+
if (previousSegmentCount.current === segmentCount) return;
|
|
68
|
+
const segmentedControl = segmentedControlContainerRef.current;
|
|
69
|
+
segmentedControl === null || segmentedControl === void 0 || segmentedControl.setAttribute("data-disable-knob-transition", "");
|
|
70
|
+
previousSegmentCount.current = segmentCount;
|
|
71
|
+
const animationFrame = requestAnimationFrame(() => {
|
|
72
|
+
segmentedControl === null || segmentedControl === void 0 || segmentedControl.removeAttribute("data-disable-knob-transition");
|
|
73
|
+
});
|
|
74
|
+
return () => cancelAnimationFrame(animationFrame);
|
|
75
|
+
}, [segmentCount]);
|
|
76
|
+
const isUncontrolled = onChange === void 0 || segments.some(_temp3);
|
|
77
|
+
const selectedSegments = segments.map(_temp4);
|
|
78
|
+
const selectedIndexExternal = selectedSegments.some(_temp5) ? selectedSegments.indexOf(true) : 0;
|
|
66
79
|
const [selectedIndexInternalState, setSelectedIndexInternalState] = useState(selectedIndexExternal);
|
|
67
80
|
const selectedIndex = isUncontrolled ? selectedIndexInternalState : selectedIndexExternal;
|
|
68
|
-
|
|
81
|
+
const selectedChild = /*#__PURE__*/ React.isValidElement(segments[selectedIndex]) ? segments[selectedIndex] : void 0;
|
|
82
|
+
const getChildIcon = _temp6;
|
|
83
|
+
const getChildText = _temp7;
|
|
84
|
+
if (!ariaLabel && !ariaLabelledby) console.warn("Use the `aria-label` or `aria-labelledby` prop to provide an accessible label for assistive technologies");
|
|
85
|
+
const responsiveVariant = typeof variant === "object" ? variant : void 0;
|
|
86
|
+
let t3;
|
|
87
|
+
if ($[11] !== responsiveVariant) {
|
|
88
|
+
t3 = responsiveVariant ? Object.values(responsiveVariant).includes("dropdown") : false;
|
|
89
|
+
$[11] = responsiveVariant;
|
|
90
|
+
$[12] = t3;
|
|
91
|
+
} else t3 = $[12];
|
|
92
|
+
const hasDropdownVariant = t3;
|
|
93
|
+
const dropdownContent = hasDropdownVariant && /*#__PURE__*/ jsx("div", {
|
|
94
|
+
className: SegmentedControl_module_css_default.DropdownContainer,
|
|
95
|
+
...getResponsiveAttributes("variant", variant),
|
|
96
|
+
children: /*#__PURE__*/ jsxs(ActionMenu, { children: [/*#__PURE__*/ jsx(ActionMenu.Button, {
|
|
97
|
+
"aria-label": ariaLabel && `${getChildText(selectedChild)}, ${ariaLabel}`,
|
|
98
|
+
leadingVisual: getChildIcon(selectedChild),
|
|
99
|
+
children: getChildText(selectedChild)
|
|
100
|
+
}), /*#__PURE__*/ jsx(ActionMenu.Overlay, {
|
|
101
|
+
"aria-labelledby": ariaLabelledby,
|
|
102
|
+
children: /*#__PURE__*/ jsxs(ActionList, {
|
|
103
|
+
selectionVariant: "single",
|
|
104
|
+
children: [segmentChildren.map((child_2, index_0) => {
|
|
105
|
+
var _segmentIndices$get;
|
|
106
|
+
if (/*#__PURE__*/ React.isValidElement(child_2) && isSlot(child_2, SegmentedControlDivider)) {
|
|
107
|
+
var _child_2$key;
|
|
108
|
+
return /*#__PURE__*/ jsx(ActionList.Divider, {
|
|
109
|
+
className: child_2.props.className,
|
|
110
|
+
style: child_2.props.style
|
|
111
|
+
}, (_child_2$key = child_2.key) !== null && _child_2$key !== void 0 ? _child_2$key : `segmented-control-divider-${index_0}`);
|
|
112
|
+
}
|
|
113
|
+
const ChildIcon = getChildIcon(child_2);
|
|
114
|
+
if (!/*#__PURE__*/ React.isValidElement(child_2)) return null;
|
|
115
|
+
const segmentIndex = (_segmentIndices$get = segmentIndices.get(child_2)) !== null && _segmentIndices$get !== void 0 ? _segmentIndices$get : -1;
|
|
116
|
+
return /*#__PURE__*/ jsxs(ActionList.Item, {
|
|
117
|
+
selected: segmentIndex === selectedIndex,
|
|
118
|
+
onSelect: (event) => {
|
|
119
|
+
isUncontrolled && setSelectedIndexInternalState(segmentIndex);
|
|
120
|
+
onChange && onChange(segmentIndex);
|
|
121
|
+
child_2.props.onClick && child_2.props.onClick(event);
|
|
122
|
+
},
|
|
123
|
+
children: [
|
|
124
|
+
ChildIcon,
|
|
125
|
+
" ",
|
|
126
|
+
getChildText(child_2)
|
|
127
|
+
]
|
|
128
|
+
}, `segmented-control-action-btn-${index_0}`);
|
|
129
|
+
}), actionChild && /*#__PURE__*/ jsx(SegmentedControlActionContext.Provider, {
|
|
130
|
+
value: "menu",
|
|
131
|
+
children: actionChild
|
|
132
|
+
})]
|
|
133
|
+
})
|
|
134
|
+
})] })
|
|
135
|
+
});
|
|
69
136
|
let t4;
|
|
70
|
-
if ($[
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const responsiveVariant = typeof variant === "object" ? variant : void 0;
|
|
76
|
-
let t5;
|
|
77
|
-
if ($[24] !== responsiveVariant) {
|
|
78
|
-
t5 = responsiveVariant ? Object.values(responsiveVariant).includes("dropdown") : false;
|
|
79
|
-
$[24] = responsiveVariant;
|
|
80
|
-
$[25] = t5;
|
|
81
|
-
} else t5 = $[25];
|
|
82
|
-
hasDropdownVariant = t5;
|
|
83
|
-
t4 = hasDropdownVariant && /*#__PURE__*/ jsx("div", {
|
|
84
|
-
className: SegmentedControl_module_css_default.DropdownContainer,
|
|
85
|
-
...getResponsiveAttributes("variant", variant),
|
|
86
|
-
children: /*#__PURE__*/ jsxs(ActionMenu, { children: [/*#__PURE__*/ jsx(ActionMenu.Button, {
|
|
87
|
-
"aria-label": ariaLabel && `${getChildText(selectedChild)}, ${ariaLabel}`,
|
|
88
|
-
leadingVisual: getChildIcon(selectedChild),
|
|
89
|
-
children: getChildText(selectedChild)
|
|
90
|
-
}), /*#__PURE__*/ jsx(ActionMenu.Overlay, {
|
|
91
|
-
"aria-labelledby": ariaLabelledby,
|
|
92
|
-
children: /*#__PURE__*/ jsx(ActionList, {
|
|
93
|
-
selectionVariant: "single",
|
|
94
|
-
children: React.Children.map(children, (child_1, index) => {
|
|
95
|
-
const ChildIcon = getChildIcon(child_1);
|
|
96
|
-
if (!/*#__PURE__*/ React.isValidElement(child_1)) return null;
|
|
97
|
-
return /*#__PURE__*/ jsxs(ActionList.Item, {
|
|
98
|
-
selected: index === selectedIndex,
|
|
99
|
-
onSelect: (event) => {
|
|
100
|
-
isUncontrolled && setSelectedIndexInternalState(index);
|
|
101
|
-
onChange && onChange(index);
|
|
102
|
-
child_1.props.onClick && child_1.props.onClick(event);
|
|
103
|
-
},
|
|
104
|
-
children: [
|
|
105
|
-
ChildIcon,
|
|
106
|
-
" ",
|
|
107
|
-
getChildText(child_1)
|
|
108
|
-
]
|
|
109
|
-
}, `segmented-control-action-btn-${index}`);
|
|
110
|
-
})
|
|
111
|
-
})
|
|
112
|
-
})] })
|
|
113
|
-
});
|
|
114
|
-
$[15] = ariaLabel;
|
|
115
|
-
$[16] = ariaLabelledby;
|
|
116
|
-
$[17] = children;
|
|
117
|
-
$[18] = isUncontrolled;
|
|
118
|
-
$[19] = onChange;
|
|
119
|
-
$[20] = selectedIndex;
|
|
120
|
-
$[21] = variant;
|
|
121
|
-
$[22] = hasDropdownVariant;
|
|
122
|
-
$[23] = t4;
|
|
123
|
-
} else {
|
|
124
|
-
hasDropdownVariant = $[22];
|
|
125
|
-
t4 = $[23];
|
|
126
|
-
}
|
|
127
|
-
const dropdownContent = t4;
|
|
137
|
+
if ($[13] !== className) {
|
|
138
|
+
t4 = clsx(SegmentedControl_module_css_default.SegmentedControl, className);
|
|
139
|
+
$[13] = className;
|
|
140
|
+
$[14] = t4;
|
|
141
|
+
} else t4 = $[14];
|
|
128
142
|
let t5;
|
|
129
|
-
if ($[
|
|
130
|
-
t5 =
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
} else t5 = $[
|
|
143
|
+
if ($[15] !== fullWidth) {
|
|
144
|
+
t5 = getResponsiveAttributes("full-width", fullWidth);
|
|
145
|
+
$[15] = fullWidth;
|
|
146
|
+
$[16] = t5;
|
|
147
|
+
} else t5 = $[16];
|
|
134
148
|
let t6;
|
|
135
|
-
if ($[
|
|
136
|
-
t6 = getResponsiveAttributes("
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
} else t6 = $[
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
$[37] = isUncontrolled;
|
|
174
|
-
$[38] = onChange;
|
|
175
|
-
$[39] = selectedIndex;
|
|
176
|
-
$[40] = t9;
|
|
177
|
-
} else t9 = $[40];
|
|
178
|
-
t8 = React.Children.map(children, t9);
|
|
179
|
-
$[32] = children;
|
|
180
|
-
$[33] = isUncontrolled;
|
|
181
|
-
$[34] = onChange;
|
|
182
|
-
$[35] = selectedIndex;
|
|
183
|
-
$[36] = t8;
|
|
184
|
-
} else t8 = $[36];
|
|
149
|
+
if ($[17] !== variant) {
|
|
150
|
+
t6 = getResponsiveAttributes("variant", variant);
|
|
151
|
+
$[17] = variant;
|
|
152
|
+
$[18] = t6;
|
|
153
|
+
} else t6 = $[18];
|
|
154
|
+
const t7 = "SegmentedControl";
|
|
155
|
+
const t8 = segmentChildren.map((child_3, index_1) => {
|
|
156
|
+
var _segmentIndices$get2, _child_3$key2;
|
|
157
|
+
if (/*#__PURE__*/ React.isValidElement(child_3) && isSlot(child_3, SegmentedControlDivider)) {
|
|
158
|
+
var _child_3$key;
|
|
159
|
+
return /*#__PURE__*/ React.cloneElement(child_3, { key: (_child_3$key = child_3.key) !== null && _child_3$key !== void 0 ? _child_3$key : `segmented-control-divider-${index_1}` });
|
|
160
|
+
}
|
|
161
|
+
if (!/*#__PURE__*/ React.isValidElement(child_3)) return null;
|
|
162
|
+
const segmentIndex_0 = (_segmentIndices$get2 = segmentIndices.get(child_3)) !== null && _segmentIndices$get2 !== void 0 ? _segmentIndices$get2 : -1;
|
|
163
|
+
const sharedChildProps = {
|
|
164
|
+
onClick: onChange ? (event_0) => {
|
|
165
|
+
if (!(child_3.props.disabled === true || child_3.props["aria-disabled"] === "true" || child_3.props["aria-disabled"] === true)) {
|
|
166
|
+
onChange(segmentIndex_0);
|
|
167
|
+
isUncontrolled && setSelectedIndexInternalState(segmentIndex_0);
|
|
168
|
+
child_3.props.onClick && child_3.props.onClick(event_0);
|
|
169
|
+
}
|
|
170
|
+
} : (event_1) => {
|
|
171
|
+
if (!(child_3.props.disabled === true || child_3.props["aria-disabled"] === "true" || child_3.props["aria-disabled"] === true)) {
|
|
172
|
+
child_3.props.onClick && child_3.props.onClick(event_1);
|
|
173
|
+
isUncontrolled && setSelectedIndexInternalState(segmentIndex_0);
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
selected: segmentIndex_0 === selectedIndex,
|
|
177
|
+
style: {
|
|
178
|
+
"--separator-color": segmentIndex_0 === selectedIndex || segmentIndex_0 === selectedIndex - 1 ? "transparent" : "var(--borderColor-default)",
|
|
179
|
+
...child_3.props.style
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
return /*#__PURE__*/ React.cloneElement(child_3, {
|
|
183
|
+
key: (_child_3$key2 = child_3.key) !== null && _child_3$key2 !== void 0 ? _child_3$key2 : `segmented-control-item-${index_1}`,
|
|
184
|
+
...sharedChildProps
|
|
185
|
+
});
|
|
186
|
+
});
|
|
185
187
|
let t9;
|
|
186
|
-
if ($[
|
|
188
|
+
if ($[19] !== ariaLabel || $[20] !== ariaLabelledby || $[21] !== rest || $[22] !== size || $[23] !== t4 || $[24] !== t5 || $[25] !== t6 || $[26] !== t8) {
|
|
187
189
|
t9 = /*#__PURE__*/ jsx("ul", {
|
|
188
190
|
"aria-label": ariaLabel,
|
|
189
191
|
"aria-labelledby": ariaLabelledby,
|
|
190
192
|
ref: segmentedControlContainerRef,
|
|
191
|
-
className:
|
|
193
|
+
className: t4,
|
|
194
|
+
...t5,
|
|
192
195
|
...t6,
|
|
193
|
-
...t7,
|
|
194
196
|
"data-size": size,
|
|
195
197
|
...rest,
|
|
196
|
-
"data-component":
|
|
198
|
+
"data-component": t7,
|
|
197
199
|
children: t8
|
|
198
200
|
});
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
} else t9 = $[
|
|
201
|
+
$[19] = ariaLabel;
|
|
202
|
+
$[20] = ariaLabelledby;
|
|
203
|
+
$[21] = rest;
|
|
204
|
+
$[22] = size;
|
|
205
|
+
$[23] = t4;
|
|
206
|
+
$[24] = t5;
|
|
207
|
+
$[25] = t6;
|
|
208
|
+
$[26] = t8;
|
|
209
|
+
$[27] = t9;
|
|
210
|
+
} else t9 = $[27];
|
|
209
211
|
const segmentedControlContent = t9;
|
|
210
212
|
let t10;
|
|
211
|
-
if ($[
|
|
212
|
-
t10 =
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
213
|
+
if ($[28] !== actionChild || $[29] !== variant) {
|
|
214
|
+
t10 = actionChild && /*#__PURE__*/ jsx("div", {
|
|
215
|
+
className: SegmentedControl_module_css_default.InlineAction,
|
|
216
|
+
...getResponsiveAttributes("variant", variant),
|
|
217
|
+
children: /*#__PURE__*/ jsx(SegmentedControlActionContext.Provider, {
|
|
218
|
+
value: "inline",
|
|
219
|
+
children: actionChild
|
|
220
|
+
})
|
|
221
|
+
});
|
|
222
|
+
$[28] = actionChild;
|
|
223
|
+
$[29] = variant;
|
|
224
|
+
$[30] = t10;
|
|
225
|
+
} else t10 = $[30];
|
|
226
|
+
const inlineActionContent = t10;
|
|
227
|
+
let t11;
|
|
228
|
+
if ($[31] !== actionChild || $[32] !== dropdownContent || $[33] !== fullWidth || $[34] !== hasDropdownVariant || $[35] !== inlineActionContent || $[36] !== segmentedControlContent || $[37] !== size) {
|
|
229
|
+
t11 = hasDropdownVariant || actionChild ? /*#__PURE__*/ jsxs("div", {
|
|
230
|
+
className: SegmentedControl_module_css_default.DropdownGroup,
|
|
231
|
+
"data-size": size,
|
|
232
|
+
...getResponsiveAttributes("full-width", fullWidth),
|
|
233
|
+
children: [
|
|
234
|
+
dropdownContent,
|
|
235
|
+
segmentedControlContent,
|
|
236
|
+
inlineActionContent
|
|
237
|
+
]
|
|
238
|
+
}) : segmentedControlContent;
|
|
239
|
+
$[31] = actionChild;
|
|
240
|
+
$[32] = dropdownContent;
|
|
241
|
+
$[33] = fullWidth;
|
|
242
|
+
$[34] = hasDropdownVariant;
|
|
243
|
+
$[35] = inlineActionContent;
|
|
244
|
+
$[36] = segmentedControlContent;
|
|
245
|
+
$[37] = size;
|
|
246
|
+
$[38] = t11;
|
|
247
|
+
} else t11 = $[38];
|
|
248
|
+
return t11;
|
|
219
249
|
};
|
|
220
250
|
Root.displayName = "SegmentedControl";
|
|
221
251
|
const SegmentedControl = Object.assign(Root, {
|
|
222
252
|
Button: SegmentedControlButton,
|
|
223
|
-
IconButton: SegmentedControlIconButton
|
|
253
|
+
IconButton: SegmentedControlIconButton,
|
|
254
|
+
Divider: SegmentedControlDivider,
|
|
255
|
+
Action: SegmentedControlAction
|
|
224
256
|
});
|
|
225
257
|
function _temp(child) {
|
|
226
|
-
return /*#__PURE__*/ React.isValidElement(child) && child
|
|
258
|
+
return /*#__PURE__*/ React.isValidElement(child) && !isSlot(child, SegmentedControlDivider);
|
|
259
|
+
}
|
|
260
|
+
function _temp2(segment, index) {
|
|
261
|
+
return [segment, index];
|
|
227
262
|
}
|
|
228
|
-
function
|
|
229
|
-
return /*#__PURE__*/ React.isValidElement(child_0) &&
|
|
263
|
+
function _temp3(child_0) {
|
|
264
|
+
return /*#__PURE__*/ React.isValidElement(child_0) && child_0.props.defaultSelected !== void 0;
|
|
230
265
|
}
|
|
231
|
-
function
|
|
266
|
+
function _temp4(child_1) {
|
|
267
|
+
return /*#__PURE__*/ React.isValidElement(child_1) && (child_1.props.defaultSelected || child_1.props.selected);
|
|
268
|
+
}
|
|
269
|
+
function _temp5(isSelected) {
|
|
232
270
|
return isSelected;
|
|
233
271
|
}
|
|
234
|
-
function
|
|
272
|
+
function _temp6(childArg) {
|
|
235
273
|
if (/*#__PURE__*/ React.isValidElement(childArg) && (childArg.type === SegmentedControlButton || isSlot(childArg, SegmentedControlButton))) {
|
|
236
274
|
var _childArg$props$leadi;
|
|
237
275
|
const leadingVisual = (_childArg$props$leadi = childArg.props.leadingVisual) !== null && _childArg$props$leadi !== void 0 ? _childArg$props$leadi : childArg.props.leadingIcon;
|
|
238
276
|
if (leadingVisual) {
|
|
239
277
|
if (isElement(leadingVisual)) return leadingVisual;
|
|
240
|
-
|
|
278
|
+
return /*#__PURE__*/ jsx(leadingVisual, {});
|
|
241
279
|
}
|
|
242
280
|
}
|
|
243
281
|
if (/*#__PURE__*/ React.isValidElement(childArg) && (childArg.type === SegmentedControlIconButton || isSlot(childArg, SegmentedControlIconButton))) {
|
|
244
|
-
if (isElement(childArg.props.icon))
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
282
|
+
if (isElement(childArg.props.icon)) return childArg.props.icon;
|
|
283
|
+
const Icon = childArg.props.icon;
|
|
284
|
+
return /*#__PURE__*/ jsx(Icon, {});
|
|
248
285
|
}
|
|
249
286
|
return null;
|
|
250
287
|
}
|
|
251
|
-
function
|
|
288
|
+
function _temp7(childArg_0) {
|
|
252
289
|
if (/*#__PURE__*/ React.isValidElement(childArg_0) && (childArg_0.type === SegmentedControlButton || isSlot(childArg_0, SegmentedControlButton))) return childArg_0.props.children;
|
|
253
290
|
return /*#__PURE__*/ React.isValidElement(childArg_0) ? childArg_0.props["aria-label"] : null;
|
|
254
291
|
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import "./SegmentedControl-
|
|
1
|
+
import "./SegmentedControl-e68d4197.css";
|
|
2
2
|
//#region src/SegmentedControl/SegmentedControl.module.css.js
|
|
3
3
|
var SegmentedControl_module_css_default = {
|
|
4
4
|
"SegmentedControl": "prc-SegmentedControl-SegmentedControl-lqIXp",
|
|
5
|
+
"Item": "prc-SegmentedControl-Item-tSCQh",
|
|
6
|
+
"Button": "prc-SegmentedControl-Button-E48xz",
|
|
7
|
+
"Content": "prc-SegmentedControl-Content-1COlk",
|
|
5
8
|
"Text": "prc-SegmentedControl-Text-7S2y2",
|
|
9
|
+
"DropdownGroup": "prc-SegmentedControl-DropdownGroup-9SmpX",
|
|
10
|
+
"InlineAction": "prc-SegmentedControl-InlineAction-4qmw0",
|
|
6
11
|
"DropdownContainer": "prc-SegmentedControl-DropdownContainer-ZaPMn",
|
|
7
|
-
"Item": "prc-SegmentedControl-Item-tSCQh",
|
|
8
12
|
"Counter": "prc-SegmentedControl-Counter-GmZOI",
|
|
9
|
-
"
|
|
13
|
+
"ActionItem": "prc-SegmentedControl-ActionItem-2V1ou",
|
|
14
|
+
"ActionButton": "prc-SegmentedControl-ActionButton-Q5fnw",
|
|
10
15
|
"IconButton": "prc-SegmentedControl-IconButton-tlzDE",
|
|
11
|
-
"Content": "prc-SegmentedControl-Content-1COlk",
|
|
12
16
|
"LeadingIcon": "prc-SegmentedControl-LeadingIcon-74n5s"
|
|
13
17
|
};
|
|
14
18
|
//#endregion
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ElementType } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/SegmentedControl/SegmentedControlAction.d.ts
|
|
4
|
+
interface SegmentedControlActionProps {
|
|
5
|
+
label: string;
|
|
6
|
+
icon: ElementType;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { SegmentedControlActionProps };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
|
+
import { IconButton } from "../Button/IconButton.js";
|
|
3
|
+
import { ActionList } from "../ActionList/index.js";
|
|
4
|
+
import SegmentedControl_module_css_default from "./SegmentedControl.module.css.js";
|
|
5
|
+
import { SegmentedControlActionContext } from "./SegmentedControlActionContext.js";
|
|
6
|
+
import { useContext } from "react";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/SegmentedControl/SegmentedControlAction.tsx
|
|
9
|
+
const SegmentedControlMenuAction = (t0) => {
|
|
10
|
+
const $ = c(6);
|
|
11
|
+
let children;
|
|
12
|
+
let props;
|
|
13
|
+
if ($[0] !== t0) {
|
|
14
|
+
({children, ...props} = t0);
|
|
15
|
+
$[0] = t0;
|
|
16
|
+
$[1] = children;
|
|
17
|
+
$[2] = props;
|
|
18
|
+
} else {
|
|
19
|
+
children = $[1];
|
|
20
|
+
props = $[2];
|
|
21
|
+
}
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[3] !== children || $[4] !== props) {
|
|
24
|
+
t1 = /*#__PURE__*/ jsx("div", {
|
|
25
|
+
...props,
|
|
26
|
+
"data-component": "SegmentedControl.Action",
|
|
27
|
+
children
|
|
28
|
+
});
|
|
29
|
+
$[3] = children;
|
|
30
|
+
$[4] = props;
|
|
31
|
+
$[5] = t1;
|
|
32
|
+
} else t1 = $[5];
|
|
33
|
+
return t1;
|
|
34
|
+
};
|
|
35
|
+
const SegmentedControlAction = (props) => {
|
|
36
|
+
const $ = c(19);
|
|
37
|
+
const { disabled, icon: Icon, label, loading, onClick } = props;
|
|
38
|
+
if (useContext(SegmentedControlActionContext) === "menu") {
|
|
39
|
+
let t0;
|
|
40
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
41
|
+
t0 = /*#__PURE__*/ jsx(ActionList.Divider, {});
|
|
42
|
+
$[0] = t0;
|
|
43
|
+
} else t0 = $[0];
|
|
44
|
+
let t1;
|
|
45
|
+
if ($[1] !== onClick) {
|
|
46
|
+
t1 = (event) => {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
onClick === null || onClick === void 0 || onClick();
|
|
49
|
+
};
|
|
50
|
+
$[1] = onClick;
|
|
51
|
+
$[2] = t1;
|
|
52
|
+
} else t1 = $[2];
|
|
53
|
+
let t2;
|
|
54
|
+
if ($[3] !== Icon) {
|
|
55
|
+
t2 = /*#__PURE__*/ jsx(ActionList.LeadingVisual, { children: /*#__PURE__*/ jsx(Icon, {}) });
|
|
56
|
+
$[3] = Icon;
|
|
57
|
+
$[4] = t2;
|
|
58
|
+
} else t2 = $[4];
|
|
59
|
+
let t3;
|
|
60
|
+
if ($[5] !== disabled || $[6] !== label || $[7] !== loading || $[8] !== t1 || $[9] !== t2) {
|
|
61
|
+
t3 = /*#__PURE__*/ jsxs(Fragment$1, { children: [t0, /*#__PURE__*/ jsxs(ActionList.Item, {
|
|
62
|
+
role: "menuitem",
|
|
63
|
+
disabled,
|
|
64
|
+
loading,
|
|
65
|
+
_PrivateItemWrapper: SegmentedControlMenuAction,
|
|
66
|
+
onSelect: t1,
|
|
67
|
+
children: [t2, label]
|
|
68
|
+
})] });
|
|
69
|
+
$[5] = disabled;
|
|
70
|
+
$[6] = label;
|
|
71
|
+
$[7] = loading;
|
|
72
|
+
$[8] = t1;
|
|
73
|
+
$[9] = t2;
|
|
74
|
+
$[10] = t3;
|
|
75
|
+
} else t3 = $[10];
|
|
76
|
+
return t3;
|
|
77
|
+
}
|
|
78
|
+
let t0;
|
|
79
|
+
if ($[11] !== onClick) {
|
|
80
|
+
t0 = () => onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
81
|
+
$[11] = onClick;
|
|
82
|
+
$[12] = t0;
|
|
83
|
+
} else t0 = $[12];
|
|
84
|
+
let t1;
|
|
85
|
+
if ($[13] !== Icon || $[14] !== disabled || $[15] !== label || $[16] !== loading || $[17] !== t0) {
|
|
86
|
+
t1 = /*#__PURE__*/ jsx("div", {
|
|
87
|
+
className: SegmentedControl_module_css_default.ActionItem,
|
|
88
|
+
"data-component": "SegmentedControl.Action",
|
|
89
|
+
children: /*#__PURE__*/ jsx(IconButton, {
|
|
90
|
+
"aria-label": label,
|
|
91
|
+
className: SegmentedControl_module_css_default.ActionButton,
|
|
92
|
+
disabled,
|
|
93
|
+
icon: Icon,
|
|
94
|
+
loading,
|
|
95
|
+
onClick: t0,
|
|
96
|
+
variant: "invisible"
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
$[13] = Icon;
|
|
100
|
+
$[14] = disabled;
|
|
101
|
+
$[15] = label;
|
|
102
|
+
$[16] = loading;
|
|
103
|
+
$[17] = t0;
|
|
104
|
+
$[18] = t1;
|
|
105
|
+
} else t1 = $[18];
|
|
106
|
+
return t1;
|
|
107
|
+
};
|
|
108
|
+
SegmentedControlAction.displayName = "SegmentedControl.Action";
|
|
109
|
+
SegmentedControlAction.__SLOT__ = Symbol("SegmentedControl.Action");
|
|
110
|
+
//#endregion
|
|
111
|
+
export { SegmentedControlAction as default };
|