@duro-app/ui 3.4.2 → 3.6.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.
- package/dist/{Table-P-UHkEqJ.js → Table-B4F8XyqK.js} +222 -216
- package/dist/{Table-P-UHkEqJ.js.map → Table-B4F8XyqK.js.map} +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.stories.d.ts +1 -0
- package/dist/components/InputGroup/InputGroup.stories.d.ts.map +1 -1
- package/dist/components/Tree/Tree.d.ts +35 -0
- package/dist/components/Tree/Tree.d.ts.map +1 -0
- package/dist/components/Tree/Tree.meta.d.ts +3 -0
- package/dist/components/Tree/Tree.meta.d.ts.map +1 -0
- package/dist/components/Tree/Tree.stories.d.ts +9 -0
- package/dist/components/Tree/Tree.stories.d.ts.map +1 -0
- package/dist/components/Tree/TreeContext.d.ts +18 -0
- package/dist/components/Tree/TreeContext.d.ts.map +1 -0
- package/dist/components/Tree/styles.css.d.ts +84 -0
- package/dist/components/Tree/styles.css.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2525 -2215
- package/dist/index.js.map +1 -1
- package/dist/table.js +1 -1
- package/package.json +2 -2
- package/src/components/Icon/Icon.tsx +20 -0
- package/src/components/InputGroup/InputGroup.stories.tsx +21 -0
- package/src/components/Tree/Tree.meta.ts +41 -0
- package/src/components/Tree/Tree.stories.tsx +151 -0
- package/src/components/Tree/Tree.tsx +304 -0
- package/src/components/Tree/TreeContext.ts +26 -0
- package/src/components/Tree/styles.css.ts +96 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import {css} from 'react-strict-dom'
|
|
2
|
+
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
3
|
+
import {spacing, radii} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
|
+
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
5
|
+
import {duration, easing} from '@duro-app/tokens/tokens/motion.css'
|
|
6
|
+
|
|
7
|
+
export const styles = css.create({
|
|
8
|
+
root: {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
margin: 0,
|
|
12
|
+
padding: 0,
|
|
13
|
+
listStyleType: 'none',
|
|
14
|
+
},
|
|
15
|
+
// The `role="group"` holding a branch's children: purely structural.
|
|
16
|
+
group: {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
margin: 0,
|
|
20
|
+
padding: 0,
|
|
21
|
+
listStyleType: 'none',
|
|
22
|
+
},
|
|
23
|
+
// The treeitem carries focus; its row draws the ring (the item also wraps
|
|
24
|
+
// its children, so a ring on it would circle the whole branch).
|
|
25
|
+
item: {
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
outlineWidth: 0,
|
|
29
|
+
outlineStyle: 'none',
|
|
30
|
+
},
|
|
31
|
+
row: {
|
|
32
|
+
display: 'flex',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
gap: spacing.xs,
|
|
35
|
+
paddingTop: '5px',
|
|
36
|
+
paddingBottom: '5px',
|
|
37
|
+
paddingRight: spacing.sm,
|
|
38
|
+
fontFamily: typography.fontFamily,
|
|
39
|
+
fontSize: typography.fontSizeSm,
|
|
40
|
+
color: colors.text,
|
|
41
|
+
borderRadius: radii.sm,
|
|
42
|
+
cursor: 'pointer',
|
|
43
|
+
backgroundColor: {
|
|
44
|
+
default: 'transparent',
|
|
45
|
+
':hover': colors.bgCardHover,
|
|
46
|
+
},
|
|
47
|
+
transitionProperty: 'background-color',
|
|
48
|
+
transitionDuration: duration.fast,
|
|
49
|
+
transitionTimingFunction: easing.standard,
|
|
50
|
+
},
|
|
51
|
+
// one indent step per level below the top
|
|
52
|
+
indent: (level: number) => ({
|
|
53
|
+
paddingLeft: `calc(${spacing.sm} + ${Math.max(0, level - 1)} * ${spacing.lg})`,
|
|
54
|
+
}),
|
|
55
|
+
rowFocused: {
|
|
56
|
+
outlineWidth: 2,
|
|
57
|
+
outlineStyle: 'solid',
|
|
58
|
+
outlineColor: colors.accent,
|
|
59
|
+
outlineOffset: -2,
|
|
60
|
+
},
|
|
61
|
+
rowSelected: {
|
|
62
|
+
color: colors.accent,
|
|
63
|
+
fontWeight: typography.fontWeightMedium,
|
|
64
|
+
backgroundColor: colors.bgCardHover,
|
|
65
|
+
},
|
|
66
|
+
chevron: {
|
|
67
|
+
display: 'inline-flex',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
justifyContent: 'center',
|
|
70
|
+
width: spacing.md,
|
|
71
|
+
flexShrink: 0,
|
|
72
|
+
color: colors.textMuted,
|
|
73
|
+
transitionProperty: 'transform',
|
|
74
|
+
transitionDuration: duration.fast,
|
|
75
|
+
transitionTimingFunction: easing.standard,
|
|
76
|
+
},
|
|
77
|
+
chevronOpen: {
|
|
78
|
+
transform: 'rotate(90deg)',
|
|
79
|
+
},
|
|
80
|
+
// a leaf keeps the chevron's width (labels align) but shows nothing
|
|
81
|
+
chevronLeaf: {
|
|
82
|
+
visibility: 'hidden',
|
|
83
|
+
},
|
|
84
|
+
label: {
|
|
85
|
+
flexGrow: 1,
|
|
86
|
+
minWidth: 0,
|
|
87
|
+
overflow: 'hidden',
|
|
88
|
+
textOverflow: 'ellipsis',
|
|
89
|
+
whiteSpace: 'nowrap',
|
|
90
|
+
},
|
|
91
|
+
meta: {
|
|
92
|
+
flexShrink: 0,
|
|
93
|
+
fontSize: typography.fontSizeXs,
|
|
94
|
+
color: colors.textMuted,
|
|
95
|
+
},
|
|
96
|
+
})
|
package/src/index.ts
CHANGED
|
@@ -74,6 +74,7 @@ export {TagGroup} from './components/TagGroup/TagGroup'
|
|
|
74
74
|
// from there gives the same object with those attached.
|
|
75
75
|
export {Table, type TableVariant, type TableSize} from './components/Table/Table'
|
|
76
76
|
export {Tabs} from './components/Tabs/Tabs'
|
|
77
|
+
export {Tree} from './components/Tree/Tree'
|
|
77
78
|
export {Textarea, type TextareaVariant} from './components/Textarea/Textarea'
|
|
78
79
|
export {
|
|
79
80
|
ThemeProvider,
|