@sproutsocial/seeds-react-menu 0.2.0 → 0.2.1
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/.eslintignore +6 -0
- package/.eslintrc.js +6 -2
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +6 -0
- package/dist/esm/index.js +34 -19
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -14
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
- package/src/ActionMenu/ActionMenu.tsx +1 -0
- package/src/MenuContent/MenuContentTypes.ts +1 -2
- package/src/MenuContext.tsx +1 -6
- package/src/MenuGroup/MenuGroupTypes.ts +1 -0
- package/src/MenuGroup/__tests__/MenuGroup.test.tsx +1 -0
- package/src/MenuHeader/__tests__/MenuHeader.typetest.tsx +1 -0
- package/src/MenuItem/MenuItem.tsx +4 -0
- package/src/MenuItem/styles.tsx +2 -0
- package/src/MenuItem/useOptionProps.tsx +1 -0
- package/src/MenuRoot/MenuRoot.feature +20 -10
- package/src/MenuRoot/MenuRoot.tsx +2 -1
- package/src/MenuRoot/__tests__/MenuRoot.test.tsx +165 -31
- package/src/MultiSelectMenu/MultiSelectMenu.feature +2 -13
- package/src/MultiSelectMenu/MultiSelectMenu.tsx +1 -0
- package/src/MultiSelectMenu/__tests__/MultiSelectMenu.test.tsx +141 -140
- package/src/SingleSelectMenu/SingleSelectMenu.tsx +1 -0
- package/src/hooks/useItemsFromChildren.tsx +1 -0
- package/tsconfig.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -144,7 +144,7 @@ interface TypeMenuGroupProps extends TypeMenuGroupStyledProps, Omit<React.Compon
|
|
|
144
144
|
declare const MenuGroup: ({ titleAs, children, title, color, ...rest }: TypeMenuGroupProps) => react_jsx_runtime.JSX.Element;
|
|
145
145
|
|
|
146
146
|
declare const StyledMenuGroup: styled_components.StyledComponent<"li", styled_components.DefaultTheme, TypeMenuGroupProps, never>;
|
|
147
|
-
declare const StyledTitle: styled_components.StyledComponent<
|
|
147
|
+
declare const StyledTitle: styled_components.StyledComponent<React$1.FC<_sproutsocial_seeds_react_text.TypeTextProps>, styled_components.DefaultTheme, {}, never>;
|
|
148
148
|
declare const StyledMenuGroupUl: styled_components.StyledComponent<"ul", styled_components.DefaultTheme, {}, never>;
|
|
149
149
|
|
|
150
150
|
interface TypeDownshiftMultiSelectProps extends Partial<UseSelectProps<TypeDefaultItemProps>>, Partial<Omit<UseMultipleSelectionProps<TypeDefaultItemProps>, "stateReducer" | "onStateChange" | "getA11yStatusMessage">> {
|
package/dist/index.d.ts
CHANGED
|
@@ -144,7 +144,7 @@ interface TypeMenuGroupProps extends TypeMenuGroupStyledProps, Omit<React.Compon
|
|
|
144
144
|
declare const MenuGroup: ({ titleAs, children, title, color, ...rest }: TypeMenuGroupProps) => react_jsx_runtime.JSX.Element;
|
|
145
145
|
|
|
146
146
|
declare const StyledMenuGroup: styled_components.StyledComponent<"li", styled_components.DefaultTheme, TypeMenuGroupProps, never>;
|
|
147
|
-
declare const StyledTitle: styled_components.StyledComponent<
|
|
147
|
+
declare const StyledTitle: styled_components.StyledComponent<React$1.FC<_sproutsocial_seeds_react_text.TypeTextProps>, styled_components.DefaultTheme, {}, never>;
|
|
148
148
|
declare const StyledMenuGroupUl: styled_components.StyledComponent<"ul", styled_components.DefaultTheme, {}, never>;
|
|
149
149
|
|
|
150
150
|
interface TypeDownshiftMultiSelectProps extends Partial<UseSelectProps<TypeDefaultItemProps>>, Partial<Omit<UseMultipleSelectionProps<TypeDefaultItemProps>, "stateReducer" | "onStateChange" | "getA11yStatusMessage">> {
|
package/dist/index.js
CHANGED
|
@@ -1729,6 +1729,8 @@ var highlightedStyles = import_styled_components2.css`
|
|
|
1729
1729
|
cursor: pointer;
|
|
1730
1730
|
border: 1px solid ${({ theme: theme2 }) => theme2.colors.listItem.border.base};
|
|
1731
1731
|
background-color: ${({ theme: theme2 }) => theme2.colors.listItem.background.hover};
|
|
1732
|
+
color: ${({ theme: theme2 }) => theme2.colors.text.body};
|
|
1733
|
+
text-decoration: none;
|
|
1732
1734
|
`;
|
|
1733
1735
|
var MenuItemContainer = import_styled_components2.default.li`
|
|
1734
1736
|
box-sizing: border-box;
|
|
@@ -1890,6 +1892,7 @@ var useOptionProps = ({
|
|
|
1890
1892
|
const { selectedItem, selectedItems, isListbox } = (0, import_react2.useContext)(MenuContext);
|
|
1891
1893
|
const selected = (0, import_react2.useMemo)(
|
|
1892
1894
|
() => selectedItem?.id === id || !!selectedItems?.find((item) => item?.id === id),
|
|
1895
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1893
1896
|
[selectedItem, selectedItems]
|
|
1894
1897
|
);
|
|
1895
1898
|
const label = inputLabelId || `menu-item-child-${id}`;
|
|
@@ -1919,9 +1922,12 @@ var MenuItem = ({
|
|
|
1919
1922
|
children,
|
|
1920
1923
|
onClick,
|
|
1921
1924
|
onKeyDown,
|
|
1925
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1922
1926
|
disabled: disabled2 = false,
|
|
1927
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1923
1928
|
ref,
|
|
1924
1929
|
href,
|
|
1930
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1925
1931
|
color: color2,
|
|
1926
1932
|
...props
|
|
1927
1933
|
}) => {
|
|
@@ -2182,20 +2188,33 @@ var Text = ({ fontSize: fontSize2, children, qa, color: color2, ...rest }) => {
|
|
|
2182
2188
|
}
|
|
2183
2189
|
);
|
|
2184
2190
|
};
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
Text.
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
Text.
|
|
2197
|
-
|
|
2198
|
-
|
|
2191
|
+
var withTextLogic = (Component) => {
|
|
2192
|
+
return ({ children, ...props }) => {
|
|
2193
|
+
const qaText = typeof children === "string" ? children : void 0;
|
|
2194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Component, { "data-qa-text": qaText, ...props, children });
|
|
2195
|
+
};
|
|
2196
|
+
};
|
|
2197
|
+
var HeadlineWithLogic = withTextLogic(Headline);
|
|
2198
|
+
HeadlineWithLogic.displayName = "Text.Headline";
|
|
2199
|
+
Text.Headline = HeadlineWithLogic;
|
|
2200
|
+
var SubHeadlineWithLogic = withTextLogic(SubHeadline);
|
|
2201
|
+
SubHeadlineWithLogic.displayName = "Text.SubHeadline";
|
|
2202
|
+
Text.SubHeadline = SubHeadlineWithLogic;
|
|
2203
|
+
var SmallSubHeadlineWithLogic = withTextLogic(SmallSubHeadline);
|
|
2204
|
+
SmallSubHeadlineWithLogic.displayName = "Text.SmallSubHeadline";
|
|
2205
|
+
Text.SmallSubHeadline = SmallSubHeadlineWithLogic;
|
|
2206
|
+
var BylineWithLogic = withTextLogic(Byline);
|
|
2207
|
+
BylineWithLogic.displayName = "Text.Byline";
|
|
2208
|
+
Text.Byline = BylineWithLogic;
|
|
2209
|
+
var SmallBylineWithLogic = withTextLogic(SmallByline);
|
|
2210
|
+
SmallBylineWithLogic.displayName = "Text.SmallByline";
|
|
2211
|
+
Text.SmallByline = SmallBylineWithLogic;
|
|
2212
|
+
var BodyCopyWithLogic = withTextLogic(BodyCopy);
|
|
2213
|
+
BodyCopyWithLogic.displayName = "Text.BodyCopy";
|
|
2214
|
+
Text.BodyCopy = BodyCopyWithLogic;
|
|
2215
|
+
var SmallBodyCopyWithLogic = withTextLogic(SmallBodyCopy);
|
|
2216
|
+
SmallBodyCopyWithLogic.displayName = "Text.SmallBodyCopy";
|
|
2217
|
+
Text.SmallBodyCopy = SmallBodyCopyWithLogic;
|
|
2199
2218
|
var Text_default = Text;
|
|
2200
2219
|
var src_default = Text_default;
|
|
2201
2220
|
|