@veracity/vui 2.18.2-beta.1 → 2.18.2-beta.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veracity/vui",
3
- "version": "2.18.2-beta.1",
3
+ "version": "2.18.2-beta.3",
4
4
  "description": "Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.",
5
5
  "module": "./dist/esm/index.js",
6
6
  "main": "./dist/cjs/index.js",
@@ -21,7 +21,7 @@ const Content = ({ number, variant, size }: { number?: number; variant?: string;
21
21
  * Implements stepper indicator **
22
22
  */
23
23
  export const StepIndicator = vui<'div', StepIndicatorProps>((props, ref) => {
24
- const { icon, number, className, size, variant, ...rest } = props
24
+ const { icon, number, className, size = 'md', variant = 'active', ...rest } = props
25
25
  const styles = useStyleConfig('StepIndicator', props)
26
26
 
27
27
  return icon ? (
@@ -38,7 +38,9 @@ export type TableProps = SystemProps &
38
38
 
39
39
  export type TbodyProps = SystemProps
40
40
 
41
- export type TdProps = SystemProps
41
+ export type TdProps = SystemProps & {
42
+ level?: number
43
+ }
42
44
 
43
45
  export type TfootProps = SystemProps
44
46
 
package/src/table/td.tsx CHANGED
@@ -1,6 +1,5 @@
1
- import React from 'react'
2
-
3
1
  import { styled, useStyleConfig, vui } from '../core'
2
+ import T from '../t'
4
3
  import { cs } from '../utils'
5
4
  import { useTableContext } from './context'
6
5
  import { TdProps } from './table.types'
@@ -11,10 +10,21 @@ export const TdBase = styled.tdBox`
11
10
 
12
11
  /** Displays a cell inside Table row. */
13
12
  export const Td = vui<'td', TdProps>((props, ref) => {
14
- const { className, ...rest } = props
13
+ const { className, level = 0, children, ...rest } = props
15
14
  const styles = useStyleConfig('Table', useTableContext())
16
15
 
17
- return <TdBase className={cs('vui-td', className)} px={2} ref={ref} {...styles.td} {...rest} />
16
+ return (
17
+ <TdBase className={cs('vui-td', className)} px={2} ref={ref} {...styles.td} {...rest}>
18
+ {!!level && (
19
+ <T mr={1}>
20
+ {Array.from({ length: level }).map((_i, key) => (
21
+ <T key={key}>&mdash;</T>
22
+ ))}
23
+ </T>
24
+ )}
25
+ {children}
26
+ </TdBase>
27
+ )
18
28
  })
19
29
 
20
30
  Td.displayName = 'Td'
@@ -9,7 +9,8 @@ import Tr from './tr'
9
9
 
10
10
  /*@formatter:off*/
11
11
  const TheadBase = styled.theadBox`
12
- tr th {
12
+ tr th,
13
+ tr td {
13
14
  border-bottom: 1px solid sandstone.main;
14
15
  }
15
16
  `
package/src/table/tr.tsx CHANGED
@@ -41,7 +41,7 @@ export const Tr = vui<'tr', TrProps>((props, ref) => {
41
41
  rest.children = (
42
42
  <>
43
43
  {nested !== undefined && (
44
- <Td textAlign="center" w={10}>
44
+ <Td maxW={16} px={0} textAlign="center">
45
45
  {nested ? <Button icon={buttonClassName(isExpanded)} onClick={onToggle} variant="subtleBlue" /> : null}
46
46
  </Td>
47
47
  )}