@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/.eslintignore
ADDED
package/.eslintrc.js
CHANGED
package/.turbo/turbo-build.log
CHANGED
|
@@ -8,14 +8,14 @@ CLI Target: es2022
|
|
|
8
8
|
CLI Cleaning output folder
|
|
9
9
|
CJS Build start
|
|
10
10
|
ESM Build start
|
|
11
|
-
CJS dist/index.js
|
|
12
|
-
CJS dist/index.js.map
|
|
13
|
-
CJS ⚡️ Build success in
|
|
14
|
-
ESM dist/esm/index.js
|
|
15
|
-
ESM dist/esm/index.js.map
|
|
16
|
-
ESM ⚡️ Build success in
|
|
11
|
+
CJS dist/index.js 85.28 KB
|
|
12
|
+
CJS dist/index.js.map 253.29 KB
|
|
13
|
+
CJS ⚡️ Build success in 188ms
|
|
14
|
+
ESM dist/esm/index.js 80.67 KB
|
|
15
|
+
ESM dist/esm/index.js.map 252.44 KB
|
|
16
|
+
ESM ⚡️ Build success in 210ms
|
|
17
17
|
DTS Build start
|
|
18
|
-
DTS ⚡️ Build success in
|
|
19
|
-
DTS dist/index.d.ts 13.
|
|
20
|
-
DTS dist/index.d.mts 13.
|
|
21
|
-
Done in
|
|
18
|
+
DTS ⚡️ Build success in 3812ms
|
|
19
|
+
DTS dist/index.d.ts 13.45 KB
|
|
20
|
+
DTS dist/index.d.mts 13.45 KB
|
|
21
|
+
Done in 4.69s.
|
package/CHANGELOG.md
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -98,11 +98,7 @@ var require_object_assign = __commonJS({
|
|
|
98
98
|
import { useContext as useContext3 } from "react";
|
|
99
99
|
|
|
100
100
|
// src/MenuContext.tsx
|
|
101
|
-
import {
|
|
102
|
-
createContext,
|
|
103
|
-
useMemo,
|
|
104
|
-
useContext
|
|
105
|
-
} from "react";
|
|
101
|
+
import { createContext, useMemo, useContext } from "react";
|
|
106
102
|
import { jsx } from "react/jsx-runtime";
|
|
107
103
|
var defaultMenuContext = {
|
|
108
104
|
items: [],
|
|
@@ -1701,6 +1697,8 @@ var highlightedStyles = css4`
|
|
|
1701
1697
|
cursor: pointer;
|
|
1702
1698
|
border: 1px solid ${({ theme: theme2 }) => theme2.colors.listItem.border.base};
|
|
1703
1699
|
background-color: ${({ theme: theme2 }) => theme2.colors.listItem.background.hover};
|
|
1700
|
+
color: ${({ theme: theme2 }) => theme2.colors.text.body};
|
|
1701
|
+
text-decoration: none;
|
|
1704
1702
|
`;
|
|
1705
1703
|
var MenuItemContainer = styled.li`
|
|
1706
1704
|
box-sizing: border-box;
|
|
@@ -1862,6 +1860,7 @@ var useOptionProps = ({
|
|
|
1862
1860
|
const { selectedItem, selectedItems, isListbox } = useContext2(MenuContext);
|
|
1863
1861
|
const selected = useMemo2(
|
|
1864
1862
|
() => selectedItem?.id === id || !!selectedItems?.find((item) => item?.id === id),
|
|
1863
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1865
1864
|
[selectedItem, selectedItems]
|
|
1866
1865
|
);
|
|
1867
1866
|
const label = inputLabelId || `menu-item-child-${id}`;
|
|
@@ -1891,9 +1890,12 @@ var MenuItem = ({
|
|
|
1891
1890
|
children,
|
|
1892
1891
|
onClick,
|
|
1893
1892
|
onKeyDown,
|
|
1893
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1894
1894
|
disabled: disabled2 = false,
|
|
1895
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1895
1896
|
ref,
|
|
1896
1897
|
href,
|
|
1898
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1897
1899
|
color: color2,
|
|
1898
1900
|
...props
|
|
1899
1901
|
}) => {
|
|
@@ -2160,20 +2162,33 @@ var Text = ({ fontSize: fontSize2, children, qa, color: color2, ...rest }) => {
|
|
|
2160
2162
|
}
|
|
2161
2163
|
);
|
|
2162
2164
|
};
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
Text.
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
Text.
|
|
2175
|
-
|
|
2176
|
-
|
|
2165
|
+
var withTextLogic = (Component) => {
|
|
2166
|
+
return ({ children, ...props }) => {
|
|
2167
|
+
const qaText = typeof children === "string" ? children : void 0;
|
|
2168
|
+
return /* @__PURE__ */ jsx7(Component, { "data-qa-text": qaText, ...props, children });
|
|
2169
|
+
};
|
|
2170
|
+
};
|
|
2171
|
+
var HeadlineWithLogic = withTextLogic(Headline);
|
|
2172
|
+
HeadlineWithLogic.displayName = "Text.Headline";
|
|
2173
|
+
Text.Headline = HeadlineWithLogic;
|
|
2174
|
+
var SubHeadlineWithLogic = withTextLogic(SubHeadline);
|
|
2175
|
+
SubHeadlineWithLogic.displayName = "Text.SubHeadline";
|
|
2176
|
+
Text.SubHeadline = SubHeadlineWithLogic;
|
|
2177
|
+
var SmallSubHeadlineWithLogic = withTextLogic(SmallSubHeadline);
|
|
2178
|
+
SmallSubHeadlineWithLogic.displayName = "Text.SmallSubHeadline";
|
|
2179
|
+
Text.SmallSubHeadline = SmallSubHeadlineWithLogic;
|
|
2180
|
+
var BylineWithLogic = withTextLogic(Byline);
|
|
2181
|
+
BylineWithLogic.displayName = "Text.Byline";
|
|
2182
|
+
Text.Byline = BylineWithLogic;
|
|
2183
|
+
var SmallBylineWithLogic = withTextLogic(SmallByline);
|
|
2184
|
+
SmallBylineWithLogic.displayName = "Text.SmallByline";
|
|
2185
|
+
Text.SmallByline = SmallBylineWithLogic;
|
|
2186
|
+
var BodyCopyWithLogic = withTextLogic(BodyCopy);
|
|
2187
|
+
BodyCopyWithLogic.displayName = "Text.BodyCopy";
|
|
2188
|
+
Text.BodyCopy = BodyCopyWithLogic;
|
|
2189
|
+
var SmallBodyCopyWithLogic = withTextLogic(SmallBodyCopy);
|
|
2190
|
+
SmallBodyCopyWithLogic.displayName = "Text.SmallBodyCopy";
|
|
2191
|
+
Text.SmallBodyCopy = SmallBodyCopyWithLogic;
|
|
2177
2192
|
var Text_default = Text;
|
|
2178
2193
|
var src_default = Text_default;
|
|
2179
2194
|
|