@rango-dev/ui 0.29.1-next.13 → 0.29.1-next.14

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.
@@ -6,6 +6,8 @@ export type ListItemProps = {
6
6
  end?: React.ReactNode;
7
7
  as?: 'div' | 'li';
8
8
  onClick?: () => void;
9
+ onKeyUp?: React.KeyboardEventHandler<HTMLLIElement>;
9
10
  hasDivider?: boolean;
11
+ tabIndex?: number;
10
12
  };
11
13
  //# sourceMappingURL=ListItem.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItem/ListItem.types.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"ListItem.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItem/ListItem.types.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ListItemButton.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItemButton/ListItemButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAgBjD;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"ListItemButton.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItemButton/ListItemButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAoBjD;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
- export declare const BaseListItemButton: import("@stitches/react/types/styled-component").StyledComponent<"button", {
2
- hasDivider?: boolean | "true" | undefined;
1
+ import { ListItem } from '../ListItem/ListItem';
2
+ export declare const BaseListItemButton: import("@stitches/react/types/styled-component").StyledComponent<typeof ListItem, {
3
3
  selected?: boolean | "true" | "false" | undefined;
4
4
  }, {
5
5
  xs: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ListItemButton.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItemButton/ListItemButton.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAgD7B,CAAC"}
1
+ {"version":3,"file":"ListItemButton.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItemButton/ListItemButton.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DA+B7B,CAAC"}
@@ -4,7 +4,6 @@ export type ListItemButtonProps = Omit<ListItemProps, 'onClick'> & {
4
4
  id: string;
5
5
  onClick: (id: string) => void;
6
6
  style?: CSSProperties;
7
- hasDivider?: boolean;
8
7
  selected?: boolean;
9
8
  };
10
9
  //# sourceMappingURL=ListItemButton.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListItemButton.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItemButton/ListItemButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"ListItemButton.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ListItemButton/ListItemButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/ui",
3
- "version": "0.29.1-next.13",
3
+ "version": "0.29.1-next.14",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -5,5 +5,7 @@ export type ListItemProps = {
5
5
  end?: React.ReactNode;
6
6
  as?: 'div' | 'li';
7
7
  onClick?: () => void;
8
+ onKeyUp?: React.KeyboardEventHandler<HTMLLIElement>;
8
9
  hasDivider?: boolean;
10
+ tabIndex?: number;
9
11
  };
@@ -1,26 +1,10 @@
1
1
  import { darkTheme, styled } from '../../theme';
2
+ import { ListItem } from '../ListItem/ListItem';
2
3
 
3
- export const BaseListItemButton = styled('button', {
4
+ export const BaseListItemButton = styled(ListItem, {
4
5
  transition: 'all 0.35s',
5
- border: 0,
6
- width: '100%',
7
- backgroundColor: 'transparent',
8
- fontFamily: 'inherit',
9
- padding: 'unset',
10
- '&:focus-visible': {
11
- borderRadius: '$xs',
12
-
13
- outline: 0,
14
- $$color: '$colors$info100',
15
- [`.${darkTheme} &`]: {
16
- $$color: '$colors$info700',
17
- },
18
- backgroundColor: '$$color',
19
- },
20
6
  '&:hover': {
21
7
  $$color: '$colors$info100',
22
- borderRadius: '$xs',
23
-
24
8
  [`.${darkTheme} &`]: {
25
9
  $$color: '$colors$neutral100',
26
10
  },
@@ -30,19 +14,19 @@ export const BaseListItemButton = styled('button', {
30
14
  '&:active': {
31
15
  transform: 'scale(0.99)',
32
16
  },
33
- variants: {
34
- hasDivider: {
35
- true: {
36
- borderBottom: '1px solid',
37
- $$color: '$colors$neutral300',
38
- [`.${darkTheme} &`]: {
39
- $$color: '$colors$neutral400',
40
- },
41
- borderColor: '$$color',
42
- borderBottomRightRadius: 0,
43
- borderBottomLeftRadius: 0,
44
- },
17
+
18
+ '&:focus-visible': {
19
+ borderRadius: '$xs',
20
+
21
+ outline: 0,
22
+ $$color: '$colors$info100',
23
+ [`.${darkTheme} &`]: {
24
+ $$color: '$colors$info700',
45
25
  },
26
+ backgroundColor: '$$color',
27
+ },
28
+
29
+ variants: {
46
30
  selected: {
47
31
  true: { outline: '1px solid $secondary500' },
48
32
  false: { outline: 0 },
@@ -2,25 +2,27 @@ import type { ListItemButtonProps } from './ListItemButton.types';
2
2
 
3
3
  import React from 'react';
4
4
 
5
- import { ListItem } from '../ListItem/ListItem';
6
-
7
5
  import { BaseListItemButton } from './ListItemButton.styles';
8
6
 
9
7
  function ListItemButton(props: ListItemButtonProps) {
10
- const { onClick, id, style, hasDivider, selected, ...restProps } = props;
8
+ const { onClick, id, selected, ...restProps } = props;
11
9
  const onClickWithKey = () => {
12
10
  if (onClick) {
13
11
  onClick(id);
14
12
  }
15
13
  };
14
+
16
15
  return (
17
16
  <BaseListItemButton
18
- hasDivider={hasDivider}
19
- selected={selected}
20
17
  onClick={onClickWithKey}
21
- style={style}>
22
- <ListItem {...restProps} />
23
- </BaseListItemButton>
18
+ aria-label="button"
19
+ selected={selected}
20
+ onKeyUp={(e: { key: string }) => {
21
+ e.key === 'Enter' && onClickWithKey();
22
+ }}
23
+ tabIndex={0}
24
+ {...restProps}
25
+ />
24
26
  );
25
27
  }
26
28
 
@@ -5,6 +5,5 @@ export type ListItemButtonProps = Omit<ListItemProps, 'onClick'> & {
5
5
  id: string;
6
6
  onClick: (id: string) => void;
7
7
  style?: CSSProperties;
8
- hasDivider?: boolean;
9
8
  selected?: boolean;
10
9
  };