@primer/react 0.0.0-20260831205533 → 0.0.0-20260915162741
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 +39 -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-b44e29d1.css → ButtonBase-faef2674.css} +2 -2
- package/dist/Button/ButtonBase-faef2674.css.map +1 -0
- package/dist/Button/ButtonBase.js +4 -4
- package/dist/Button/ButtonBase.module.css.js +1 -1
- 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.d.ts +20 -20
- package/dist/DataTable/DataTable.js +42 -27
- 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 +159 -0
- package/dist/DataTable/TableGroupContext.js +5 -0
- package/dist/DataTable/index.d.ts +4 -2
- package/dist/DataTable/index.js +2 -0
- package/dist/DataTable/row.d.ts +24 -1
- package/dist/DataTable/useTable.js +157 -80
- package/dist/DataTable/utils.d.ts +4 -2
- 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 +21 -11
- 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 +6 -5
- 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 +185 -10
- package/package.json +8 -8
- package/dist/Button/ButtonBase-b44e29d1.css.map +0 -1
- 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
|
@@ -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 };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import CounterLabel from "../CounterLabel/CounterLabel.js";
|
|
2
3
|
import SegmentedControl_module_css_default from "./SegmentedControl.module.css.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
|
-
import { clsx } from "clsx";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
6
|
import { isElement } from "react-is";
|
|
7
7
|
//#region src/SegmentedControl/SegmentedControlButton.tsx
|
|
8
8
|
const SegmentedControlButton = (t0) => {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/SegmentedControl/SegmentedControlDivider.tsx
|
|
4
|
+
const SegmentedControlDivider = (t0) => {
|
|
5
|
+
const $ = c(3);
|
|
6
|
+
const { className, style } = t0;
|
|
7
|
+
let t1;
|
|
8
|
+
if ($[0] !== className || $[1] !== style) {
|
|
9
|
+
t1 = /*#__PURE__*/ jsx("li", {
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
className,
|
|
12
|
+
"data-component": "SegmentedControl.Divider",
|
|
13
|
+
style
|
|
14
|
+
});
|
|
15
|
+
$[0] = className;
|
|
16
|
+
$[1] = style;
|
|
17
|
+
$[2] = t1;
|
|
18
|
+
} else t1 = $[2];
|
|
19
|
+
return t1;
|
|
20
|
+
};
|
|
21
|
+
SegmentedControlDivider.displayName = "SegmentedControl.Divider";
|
|
22
|
+
SegmentedControlDivider.__SLOT__ = Symbol("SegmentedControl.Divider");
|
|
23
|
+
//#endregion
|
|
24
|
+
export { SegmentedControlDivider as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { Tooltip } from "../TooltipV2/Tooltip.js";
|
|
2
3
|
import SegmentedControl_module_css_default from "./SegmentedControl.module.css.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
|
-
import { clsx } from "clsx";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
6
|
import { isElement } from "react-is";
|
|
7
7
|
//#region src/SegmentedControl/SegmentedControlIconButton.tsx
|
|
8
8
|
const SegmentedControlIconButton = (t0) => {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { SegmentedControlDividerProps } from "./SegmentedControlDivider.js";
|
|
2
|
+
import { SegmentedControlActionProps } from "./SegmentedControlAction.js";
|
|
1
3
|
import { SegmentedControlButtonProps } from "./SegmentedControlButton.js";
|
|
2
4
|
import { SegmentedControlIconButtonProps } from "./SegmentedControlIconButton.js";
|
|
3
5
|
import { SegmentedControl, SegmentedControlProps } from "./SegmentedControl.js";
|
|
4
|
-
export { SegmentedControl, type SegmentedControlButtonProps, type SegmentedControlIconButtonProps, SegmentedControlProps };
|
|
6
|
+
export { SegmentedControl, type SegmentedControlActionProps, type SegmentedControlButtonProps, type SegmentedControlDividerProps, type SegmentedControlIconButtonProps, SegmentedControlProps };
|