@peculiar/react-components 0.2.4 → 0.3.0

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.
Files changed (50) hide show
  1. package/dist/cjs/Menu/menu.js +34 -64
  2. package/dist/cjs/Menu/menu.js.map +1 -1
  3. package/dist/cjs/MenuList/index.js +10 -0
  4. package/dist/cjs/MenuList/index.js.map +1 -0
  5. package/dist/cjs/MenuList/menu_item.js +76 -0
  6. package/dist/cjs/MenuList/menu_item.js.map +1 -0
  7. package/dist/cjs/MenuList/menu_list.js +123 -0
  8. package/dist/cjs/MenuList/menu_list.js.map +1 -0
  9. package/dist/cjs/MenuList/sub_menu_item.js +65 -0
  10. package/dist/cjs/MenuList/sub_menu_item.js.map +1 -0
  11. package/dist/cjs/icons/arrow_rigth.js +22 -0
  12. package/dist/cjs/icons/arrow_rigth.js.map +1 -0
  13. package/dist/cjs/icons/index.js +3 -1
  14. package/dist/cjs/icons/index.js.map +1 -1
  15. package/dist/esm/Menu/menu.js +34 -64
  16. package/dist/esm/Menu/menu.js.map +1 -1
  17. package/dist/esm/MenuList/index.js +4 -0
  18. package/dist/esm/MenuList/index.js.map +1 -0
  19. package/dist/esm/MenuList/menu_item.js +70 -0
  20. package/dist/esm/MenuList/menu_item.js.map +1 -0
  21. package/dist/esm/MenuList/menu_list.js +117 -0
  22. package/dist/esm/MenuList/menu_list.js.map +1 -0
  23. package/dist/esm/MenuList/sub_menu_item.js +59 -0
  24. package/dist/esm/MenuList/sub_menu_item.js.map +1 -0
  25. package/dist/esm/icons/arrow_rigth.js +15 -0
  26. package/dist/esm/icons/arrow_rigth.js.map +1 -0
  27. package/dist/esm/icons/index.js +1 -0
  28. package/dist/esm/icons/index.js.map +1 -1
  29. package/dist/esnext/Menu/menu.js +30 -59
  30. package/dist/esnext/Menu/menu.js.map +1 -1
  31. package/dist/esnext/MenuList/index.js +4 -0
  32. package/dist/esnext/MenuList/index.js.map +1 -0
  33. package/dist/esnext/MenuList/menu_item.js +70 -0
  34. package/dist/esnext/MenuList/menu_item.js.map +1 -0
  35. package/dist/esnext/MenuList/menu_list.js +94 -0
  36. package/dist/esnext/MenuList/menu_list.js.map +1 -0
  37. package/dist/esnext/MenuList/sub_menu_item.js +37 -0
  38. package/dist/esnext/MenuList/sub_menu_item.js.map +1 -0
  39. package/dist/esnext/icons/arrow_rigth.js +4 -0
  40. package/dist/esnext/icons/arrow_rigth.js.map +1 -0
  41. package/dist/esnext/icons/index.js +1 -0
  42. package/dist/esnext/icons/index.js.map +1 -1
  43. package/dist/types/Menu/menu.d.ts +10 -1
  44. package/dist/types/MenuList/index.d.ts +3 -0
  45. package/dist/types/MenuList/menu_item.d.ts +33 -0
  46. package/dist/types/MenuList/menu_list.d.ts +20 -0
  47. package/dist/types/MenuList/sub_menu_item.d.ts +6 -0
  48. package/dist/types/icons/arrow_rigth.d.ts +4 -0
  49. package/dist/types/icons/index.d.ts +1 -0
  50. package/package.json +2 -2
@@ -0,0 +1,94 @@
1
+ import React from 'react';
2
+ import { css, cx } from '../styles';
3
+ import { useMergedRef, useEnhancedEffect } from '../hooks';
4
+ import { ownerDocument } from '../utils/owner_document';
5
+ function nextItem(list, item) {
6
+ if (list === item) {
7
+ return list.firstChild;
8
+ }
9
+ if (item && item.nextElementSibling) {
10
+ return item.nextElementSibling;
11
+ }
12
+ return null;
13
+ }
14
+ function previousItem(list, item) {
15
+ if (list === item) {
16
+ return list.firstChild;
17
+ }
18
+ if (item && item.previousElementSibling) {
19
+ return item.previousElementSibling;
20
+ }
21
+ return null;
22
+ }
23
+ function moveFocus(list, currentFocus, traversalFunction) {
24
+ let wrappedOnce = false;
25
+ let nextFocus = traversalFunction(list, currentFocus, false);
26
+ while (nextFocus) {
27
+ // Prevent infinite loop.
28
+ if (nextFocus === list.firstChild) {
29
+ if (wrappedOnce) {
30
+ return false;
31
+ }
32
+ wrappedOnce = true;
33
+ }
34
+ // Same logic as useAutocomplete.js
35
+ const nextFocusDisabled = nextFocus.disabled || nextFocus.getAttribute('aria-disabled') === 'true';
36
+ if (!nextFocus.hasAttribute('tabindex')
37
+ || nextFocusDisabled) {
38
+ // Move to the next element.
39
+ nextFocus = traversalFunction(list, nextFocus);
40
+ }
41
+ else {
42
+ nextFocus.focus();
43
+ return true;
44
+ }
45
+ }
46
+ return false;
47
+ }
48
+ /**
49
+ *
50
+ */
51
+ /**
52
+ * Styles.
53
+ */
54
+ const stylesBase = () => css({
55
+ label: 'MenuList',
56
+ padding: 'var(--pv-size-base-2) 0px',
57
+ outline: 'none',
58
+ listStyle: 'none',
59
+ margin: 0,
60
+ });
61
+ /**
62
+ *
63
+ */
64
+ export const MenuList = React.forwardRef((props, ref) => {
65
+ const { children, className, component, ...other } = props;
66
+ const rootRef = React.useRef(null);
67
+ const multiRef = useMergedRef(rootRef, ref);
68
+ const Component = component || 'ul';
69
+ const handleKeyDown = (event) => {
70
+ const list = rootRef.current;
71
+ const { key } = event;
72
+ const currentFocus = ownerDocument(list).activeElement;
73
+ if (key === 'ArrowDown') {
74
+ // Prevent scroll of the page
75
+ event.preventDefault();
76
+ event.stopPropagation();
77
+ moveFocus(list, currentFocus, nextItem);
78
+ }
79
+ else if (key === 'ArrowUp') {
80
+ event.preventDefault();
81
+ event.stopPropagation();
82
+ moveFocus(list, currentFocus, previousItem);
83
+ }
84
+ };
85
+ useEnhancedEffect(() => {
86
+ rootRef.current.focus();
87
+ }, []);
88
+ return (React.createElement(Component, { ref: multiRef, role: "menu", tabIndex: -1, className: cx({
89
+ [stylesBase()]: true,
90
+ [className]: !!className,
91
+ }), onKeyDown: handleKeyDown, ...other }, children));
92
+ });
93
+ MenuList.displayName = 'MenuList';
94
+ //# sourceMappingURL=menu_list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu_list.js","sourceRoot":"","sources":["../../../src/MenuList/menu_list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,EAAE,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K,CAAC,eAAe,EAAE,CAAC;YACxB,SAAS,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;SAC7C;IACH,CAAC,CAAC;IAEF,iBAAiB,CAAC,GAAG,EAAE;QACrB,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,CAAC,CAAC,EACZ,SAAS,EAAE,EAAE,CAAC;YACZ,CAAC,UAAU,EAAE,CAAC,EAAE,IAAI;YACpB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS;SACzB,CAAC,EACF,SAAS,EAAE,aAAa,KACpB,KAAK,IAER,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAA0C,CAAC;AAE5C,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { Popper } from '../Popper';
3
+ import { Box } from '../Box';
4
+ import { useMergedRef } from '../hooks';
5
+ import { ArrowRightIcon } from '../icons';
6
+ import { css } from '../styles';
7
+ import { MenuItem } from './menu_item';
8
+ import { MenuList } from './menu_list';
9
+ /**
10
+ *
11
+ */
12
+ /**
13
+ * Styles.
14
+ */
15
+ const stylesBase = () => css({
16
+ label: 'SubMenu-MenuList',
17
+ minWidth: '16px',
18
+ minHeight: '16px',
19
+ boxShadow: 'var(--pv-shadow-light-low)',
20
+ });
21
+ /**
22
+ *
23
+ */
24
+ export const SubMenuItem = React.forwardRef((props, ref) => {
25
+ const { label, children, ...other } = props;
26
+ const [open, setOpen] = React.useState(false);
27
+ const rootRef = React.useRef(null);
28
+ const multiRef = useMergedRef(ref, rootRef);
29
+ const handleMouseEnter = React.useCallback(() => setOpen(true), []);
30
+ const handleMouseLeave = React.useCallback(() => setOpen(false), []);
31
+ return (React.createElement(MenuItem, { ...other, endIcon: React.createElement(ArrowRightIcon, null), ref: multiRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onClick: handleMouseEnter },
32
+ label,
33
+ React.createElement(Popper, { open: open, anchorEl: rootRef.current, placement: "right-start", disablePortal: true, onMouseLeave: handleMouseLeave },
34
+ React.createElement(Box, { component: MenuList, borderRadius: 4, background: "white", className: stylesBase() }, children))));
35
+ });
36
+ SubMenuItem.displayName = 'SubMenuItem';
37
+ //# sourceMappingURL=sub_menu_item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sub_menu_item.js","sourceRoot":"","sources":["../../../src/MenuList/sub_menu_item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AASvC;;GAEG;AAEH;;GAEG;AACH,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC;IAC3B,KAAK,EAAE,kBAAkB;IACzB,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,4BAA4B;CACxC,CAAC,CAAC;AACH;;GAEG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAwB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAChF,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAc,IAAI,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAE5C,MAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEpE,MAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IAErE,OAAO,CACL,oBAAC,QAAQ,OACH,KAAK,EACT,OAAO,EAAE,oBAAC,cAAc,OAAG,EAC3B,GAAG,EAAE,QAAQ,EACb,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,OAAO,EAAE,gBAAgB;QAExB,KAAK;QACN,oBAAC,MAAM,IACL,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,OAAO,CAAC,OAAO,EACzB,SAAS,EAAC,aAAa,EACvB,aAAa,QACb,YAAY,EAAE,gBAAgB;YAE9B,oBAAC,GAAG,IACF,SAAS,EAAE,QAAQ,EACnB,YAAY,EAAE,CAAC,EACf,UAAU,EAAC,OAAO,EAClB,SAAS,EAAE,UAAU,EAAE,IAEtB,QAAQ,CACL,CACC,CACA,CACZ,CAAC;AACJ,CAAC,CAA0C,CAAC;AAE5C,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export const ArrowRightIcon = (props) => (React.createElement("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", width: "24px", height: "24px" },
3
+ React.createElement("path", { stroke: "currentColor", strokeWidth: "1.5", d: "m10 18 6-6-6-6" })));
4
+ //# sourceMappingURL=arrow_rigth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow_rigth.js","sourceRoot":"","sources":["../../../src/icons/arrow_rigth.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,CAAC,MAAM,cAAc,GAAwB,CAAC,KAAK,EAAE,EAAE,CAAC,CAC5D,gCACM,KAAK,EACT,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,MAAM;IAEb,8BACE,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,CAAC,EAAC,gBAAgB,GAClB,CACE,CACP,CAAC"}
@@ -7,4 +7,5 @@ export { CloseCircleIcon } from './close_circle_icon';
7
7
  export { WarningIcon } from './warning_icon';
8
8
  export { DotIcon } from './dot_icon';
9
9
  export { PlusIcon } from './plus_icon';
10
+ export { ArrowRightIcon } from './arrow_rigth';
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  import { PopoverProps } from '../Popover';
3
3
  import { TypographyType } from '../styles';
4
+ /**
5
+ * Types.
6
+ */
4
7
  declare type OptionBaseProps = {
5
8
  label: string;
6
9
  disabled?: boolean;
@@ -12,6 +15,9 @@ declare type OptionBaseProps = {
12
15
  textVariant?: TypographyType;
13
16
  };
14
17
  declare type OptionProps = OptionBaseProps & Omit<React.AllHTMLAttributes<HTMLElement>, 'children'>;
18
+ declare type MenuOptionProps = OptionProps & {
19
+ subOptions?: OptionProps[];
20
+ };
15
21
  declare type BaseProps = {
16
22
  /**
17
23
  * Menu reference element.
@@ -20,7 +26,7 @@ declare type BaseProps = {
20
26
  /**
21
27
  * Menu contents.
22
28
  */
23
- options: OptionProps[];
29
+ options: MenuOptionProps[];
24
30
  /**
25
31
  * Callback fired when the component requests to be closed.
26
32
  */
@@ -31,5 +37,8 @@ declare type BaseProps = {
31
37
  popoverProps?: Partial<PopoverProps>;
32
38
  };
33
39
  export declare type MenuProps = BaseProps;
40
+ /**
41
+ *
42
+ */
34
43
  export declare const Menu: React.ForwardRefExoticComponent<BaseProps & React.RefAttributes<HTMLDivElement>>;
35
44
  export {};
@@ -0,0 +1,3 @@
1
+ export { MenuList } from './menu_list';
2
+ export { MenuItem } from './menu_item';
3
+ export { SubMenuItem } from './sub_menu_item';
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { OverridableComponent, OverrideProps } from '../OverridableComponent';
3
+ import { TypographyType } from '../styles';
4
+ /**
5
+ * Types.
6
+ */
7
+ declare type MenuItemOwnProps = {
8
+ children: React.ReactNode;
9
+ /**
10
+ * If `true`, the component is disabled.
11
+ */
12
+ disabled?: boolean;
13
+ /**
14
+ * The variant of text to use.
15
+ */
16
+ textVariant?: TypographyType;
17
+ /**
18
+ * Element placed after the children.
19
+ */
20
+ endIcon?: React.ReactNode;
21
+ };
22
+ export interface MenuItemTypeMap<P = {}, D extends React.ElementType = 'li'> {
23
+ props: P & MenuItemOwnProps;
24
+ defaultComponent: D;
25
+ }
26
+ export declare type MenuItemProps<D extends React.ElementType = MenuItemTypeMap['defaultComponent']> = OverrideProps<MenuItemTypeMap<{}, D>, D> & {
27
+ component?: D;
28
+ };
29
+ /**
30
+ *
31
+ */
32
+ export declare const MenuItem: OverridableComponent<MenuItemTypeMap<{}, "li">>;
33
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { OverridableComponent, OverrideProps } from '../OverridableComponent';
3
+ /**
4
+ * Types.
5
+ */
6
+ declare type MenuListOwnProps = {
7
+ children: React.ReactElement[];
8
+ };
9
+ export interface MenuListTypeMap<P = {}, D extends React.ElementType = 'ul'> {
10
+ props: P & MenuListOwnProps;
11
+ defaultComponent: D;
12
+ }
13
+ export declare type MenuListProps<D extends React.ElementType = MenuListTypeMap['defaultComponent']> = OverrideProps<MenuListTypeMap<{}, D>, D> & {
14
+ component?: D;
15
+ };
16
+ /**
17
+ *
18
+ */
19
+ export declare const MenuList: OverridableComponent<MenuListTypeMap<{}, "ul">>;
20
+ export {};
@@ -0,0 +1,6 @@
1
+ import { OverridableComponent } from '../OverridableComponent';
2
+ import type { MenuItemTypeMap } from './menu_item';
3
+ /**
4
+ *
5
+ */
6
+ export declare const SubMenuItem: OverridableComponent<MenuItemTypeMap<{}, "li">>;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare type IconProps = React.HTMLAttributes<HTMLOrSVGElement>;
3
+ export declare const ArrowRightIcon: React.FC<IconProps>;
4
+ export {};
@@ -7,3 +7,4 @@ export { CloseCircleIcon } from './close_circle_icon';
7
7
  export { WarningIcon } from './warning_icon';
8
8
  export { DotIcon } from './dot_icon';
9
9
  export { PlusIcon } from './plus_icon';
10
+ export { ArrowRightIcon } from './arrow_rigth';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@peculiar/react-components",
3
3
  "private": false,
4
- "version": "0.2.4",
4
+ "version": "0.3.0",
5
5
  "author": "PeculiarVentures Team",
6
6
  "description": "A simple and customizable component library to build faster, beautiful, and more accessible React applications.",
7
7
  "keywords": [
@@ -93,5 +93,5 @@
93
93
  "node": ">=12.x"
94
94
  },
95
95
  "license": "MIT",
96
- "gitHead": "4d304ae5b1a50ae2b2c0d9495d9e3cee83d60aa0"
96
+ "gitHead": "d15470d62773bcbe5f960b2a78d2310b27432be0"
97
97
  }