@duro-app/ui 0.21.0 → 0.22.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/components/ActionBar/ActionBar.stories.d.ts.map +1 -1
- package/dist/components/DetailPanel/DetailPanel.d.ts.map +1 -1
- package/dist/components/DetailPanel/DetailPanel.meta.d.ts.map +1 -1
- package/dist/components/DetailPanel/DetailPanel.stories.d.ts.map +1 -1
- package/dist/components/DetailPanel/styles.css.d.ts +4 -0
- package/dist/components/DetailPanel/styles.css.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.meta.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.meta.d.ts.map +1 -1
- package/dist/components/Field/Field.stories.d.ts.map +1 -1
- package/dist/components/List/List.d.ts +46 -0
- package/dist/components/List/List.d.ts.map +1 -0
- package/dist/components/List/List.meta.d.ts +3 -0
- package/dist/components/List/List.meta.d.ts.map +1 -0
- package/dist/components/List/List.stories.d.ts +9 -0
- package/dist/components/List/List.stories.d.ts.map +1 -0
- package/dist/components/List/styles.css.d.ts +77 -0
- package/dist/components/List/styles.css.d.ts.map +1 -0
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.meta.d.ts.map +1 -1
- package/dist/components/Panel/Panel.stories.d.ts.map +1 -1
- package/dist/components/Panel/styles.css.d.ts +4 -0
- package/dist/components/Panel/styles.css.d.ts.map +1 -1
- package/dist/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- 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 +1384 -1217
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/ActionBar/ActionBar.stories.tsx +10 -0
- package/src/components/DetailPanel/DetailPanel.meta.ts +4 -1
- package/src/components/DetailPanel/DetailPanel.stories.tsx +54 -27
- package/src/components/DetailPanel/DetailPanel.tsx +3 -16
- package/src/components/DetailPanel/styles.css.ts +5 -0
- package/src/components/Dialog/Dialog.meta.ts +8 -2
- package/src/components/Drawer/Drawer.meta.ts +4 -1
- package/src/components/Field/Field.stories.tsx +6 -0
- package/src/components/List/List.meta.ts +39 -0
- package/src/components/List/List.stories.tsx +200 -0
- package/src/components/List/List.tsx +118 -0
- package/src/components/List/styles.css.ts +99 -0
- package/src/components/Panel/Panel.meta.ts +12 -3
- package/src/components/Panel/Panel.stories.tsx +17 -10
- package/src/components/Panel/Panel.tsx +2 -10
- package/src/components/Panel/styles.css.ts +5 -0
- package/src/components/Table/Table.stories.tsx +16 -0
- package/src/components/Tabs/Tabs.stories.tsx +7 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +15 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {css} from 'react-strict-dom'
|
|
2
|
+
import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
3
|
+
import {spacing} from '@duro-app/tokens/tokens/spacing.css'
|
|
4
|
+
import {typography} from '@duro-app/tokens/tokens/typography.css'
|
|
5
|
+
|
|
6
|
+
export const styles = css.create({
|
|
7
|
+
// --- Root ---
|
|
8
|
+
root: {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
margin: 0,
|
|
12
|
+
padding: 0,
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
// --- Item ---
|
|
16
|
+
item: {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
gap: spacing.sm,
|
|
20
|
+
paddingTop: spacing.sm,
|
|
21
|
+
paddingBottom: spacing.sm,
|
|
22
|
+
paddingLeft: spacing.ms,
|
|
23
|
+
paddingRight: spacing.ms,
|
|
24
|
+
borderBottomWidth: 1,
|
|
25
|
+
borderBottomStyle: 'solid',
|
|
26
|
+
borderBottomColor: colors.border,
|
|
27
|
+
backgroundColor: {
|
|
28
|
+
default: 'transparent',
|
|
29
|
+
':hover': colors.bgCardHover,
|
|
30
|
+
},
|
|
31
|
+
transitionProperty: 'background-color',
|
|
32
|
+
transitionDuration: '120ms',
|
|
33
|
+
cursor: 'default',
|
|
34
|
+
},
|
|
35
|
+
itemSelected: {
|
|
36
|
+
backgroundColor: {
|
|
37
|
+
default: colors.bgCardHover,
|
|
38
|
+
':hover': colors.bgCardHover,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
itemDisabled: {
|
|
42
|
+
opacity: 0.5,
|
|
43
|
+
pointerEvents: 'none',
|
|
44
|
+
},
|
|
45
|
+
itemLast: {
|
|
46
|
+
borderBottomWidth: 0,
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
// --- Item content area (text + description) ---
|
|
50
|
+
content: {
|
|
51
|
+
flex: 1,
|
|
52
|
+
display: 'flex',
|
|
53
|
+
flexDirection: 'column',
|
|
54
|
+
gap: 2,
|
|
55
|
+
minWidth: 0,
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
// --- Primary text ---
|
|
59
|
+
text: {
|
|
60
|
+
fontSize: typography.fontSizeSm,
|
|
61
|
+
fontWeight: typography.fontWeightMedium,
|
|
62
|
+
lineHeight: typography.lineHeight,
|
|
63
|
+
color: colors.text,
|
|
64
|
+
margin: 0,
|
|
65
|
+
overflow: 'hidden',
|
|
66
|
+
textOverflow: 'ellipsis',
|
|
67
|
+
whiteSpace: 'nowrap',
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
// --- Description text ---
|
|
71
|
+
description: {
|
|
72
|
+
fontSize: typography.fontSizeXs,
|
|
73
|
+
lineHeight: typography.lineHeight,
|
|
74
|
+
color: colors.textMuted,
|
|
75
|
+
margin: 0,
|
|
76
|
+
overflow: 'hidden',
|
|
77
|
+
textOverflow: 'ellipsis',
|
|
78
|
+
whiteSpace: 'nowrap',
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
// --- Actions slot ---
|
|
82
|
+
actions: {
|
|
83
|
+
display: 'flex',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
gap: spacing.xs,
|
|
86
|
+
flexShrink: 0,
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
// --- Empty state ---
|
|
90
|
+
empty: {
|
|
91
|
+
display: 'flex',
|
|
92
|
+
alignItems: 'center',
|
|
93
|
+
justifyContent: 'center',
|
|
94
|
+
paddingTop: spacing.xl,
|
|
95
|
+
paddingBottom: spacing.xl,
|
|
96
|
+
color: colors.textMuted,
|
|
97
|
+
fontSize: typography.fontSizeSm,
|
|
98
|
+
},
|
|
99
|
+
})
|
|
@@ -18,9 +18,18 @@ export const meta: ComponentMeta = {
|
|
|
18
18
|
optional: ['Root', 'Header', 'Body', 'Footer'],
|
|
19
19
|
},
|
|
20
20
|
relatedTo: [
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
{
|
|
22
|
+
component: 'Card',
|
|
23
|
+
relationship: 'Card is for shallow, repeated items; Panel is for deep, organized content',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
component: 'DetailPanel',
|
|
27
|
+
relationship: 'DetailPanel uses Panel internally for its structural layout',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
component: 'PageShell',
|
|
31
|
+
relationship: 'PageShell is for page-level layout; Panel is for section-level',
|
|
32
|
+
},
|
|
24
33
|
],
|
|
25
34
|
example: `<Panel.Root bordered>
|
|
26
35
|
<Panel.Header>
|
|
@@ -10,6 +10,12 @@ import {Input} from '../Input/Input'
|
|
|
10
10
|
|
|
11
11
|
const meta: Meta = {
|
|
12
12
|
title: 'Components/Panel',
|
|
13
|
+
argTypes: {
|
|
14
|
+
bordered: {
|
|
15
|
+
control: 'boolean',
|
|
16
|
+
description: 'Whether the panel has an outer border for visual separation',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
export default meta
|
|
@@ -25,9 +31,8 @@ export const Default: Story = {
|
|
|
25
31
|
</Panel.Header>
|
|
26
32
|
<Panel.Body>
|
|
27
33
|
<Text>
|
|
28
|
-
Panel is a structural primitive for grouping content with
|
|
29
|
-
|
|
30
|
-
and page-level layout.
|
|
34
|
+
Panel is a structural primitive for grouping content with header, body, and footer slots.
|
|
35
|
+
It fills the gap between Card and page-level layout.
|
|
31
36
|
</Text>
|
|
32
37
|
</Panel.Body>
|
|
33
38
|
<Panel.Footer>
|
|
@@ -45,12 +50,14 @@ export const Bordered: Story = {
|
|
|
45
50
|
<Panel.Root bordered>
|
|
46
51
|
<Panel.Header>
|
|
47
52
|
<Heading level={3}>Bordered Panel</Heading>
|
|
48
|
-
<Button variant="secondary" size="small">
|
|
53
|
+
<Button variant="secondary" size="small">
|
|
54
|
+
Action
|
|
55
|
+
</Button>
|
|
49
56
|
</Panel.Header>
|
|
50
57
|
<Panel.Body>
|
|
51
58
|
<Text>
|
|
52
|
-
The bordered variant adds an outer border, useful when the panel
|
|
53
|
-
|
|
59
|
+
The bordered variant adds an outer border, useful when the panel needs visual separation
|
|
60
|
+
from its surroundings.
|
|
54
61
|
</Text>
|
|
55
62
|
</Panel.Body>
|
|
56
63
|
<Panel.Footer>
|
|
@@ -67,8 +74,8 @@ export const BodyOnly: Story = {
|
|
|
67
74
|
<Panel.Root bordered>
|
|
68
75
|
<Panel.Body>
|
|
69
76
|
<Text>
|
|
70
|
-
Panel sub-components can be used independently. This panel only
|
|
71
|
-
|
|
77
|
+
Panel sub-components can be used independently. This panel only has a Body — no Header or
|
|
78
|
+
Footer.
|
|
72
79
|
</Text>
|
|
73
80
|
</Panel.Body>
|
|
74
81
|
</Panel.Root>
|
|
@@ -85,8 +92,8 @@ export const UnpaddedBody: Story = {
|
|
|
85
92
|
</Panel.Header>
|
|
86
93
|
<Panel.Body padded={false}>
|
|
87
94
|
<Text>
|
|
88
|
-
Setting padded=false removes body padding, useful for content
|
|
89
|
-
|
|
95
|
+
Setting padded=false removes body padding, useful for content that needs to extend
|
|
96
|
+
edge-to-edge (tables, images, etc).
|
|
90
97
|
</Text>
|
|
91
98
|
</Panel.Body>
|
|
92
99
|
</Panel.Root>
|
|
@@ -11,11 +11,7 @@ interface RootProps {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
function Root({children, bordered = false}: RootProps) {
|
|
14
|
-
return
|
|
15
|
-
<html.div style={[styles.root, bordered && styles.bordered]}>
|
|
16
|
-
{children}
|
|
17
|
-
</html.div>
|
|
18
|
-
)
|
|
14
|
+
return <html.div style={[styles.root, bordered && styles.bordered]}>{children}</html.div>
|
|
19
15
|
}
|
|
20
16
|
|
|
21
17
|
// --- Header ---
|
|
@@ -33,11 +29,7 @@ interface BodyProps {
|
|
|
33
29
|
}
|
|
34
30
|
|
|
35
31
|
function Body({children, padded = true}: BodyProps) {
|
|
36
|
-
return
|
|
37
|
-
<html.div style={[styles.body, padded && styles.bodyPadded]}>
|
|
38
|
-
{children}
|
|
39
|
-
</html.div>
|
|
40
|
-
)
|
|
32
|
+
return <html.div style={[styles.body, padded && styles.bodyPadded]}>{children}</html.div>
|
|
41
33
|
}
|
|
42
34
|
|
|
43
35
|
// --- Footer ---
|
|
@@ -31,6 +31,11 @@ export const styles = css.create({
|
|
|
31
31
|
body: {
|
|
32
32
|
flex: 1,
|
|
33
33
|
overflowY: 'auto',
|
|
34
|
+
// Minimal inset prevents child borders from touching panel structural borders
|
|
35
|
+
paddingTop: spacing.sm,
|
|
36
|
+
paddingBottom: spacing.sm,
|
|
37
|
+
paddingLeft: spacing.sm,
|
|
38
|
+
paddingRight: spacing.sm,
|
|
34
39
|
},
|
|
35
40
|
bodyPadded: {
|
|
36
41
|
paddingTop: spacing.lg,
|
|
@@ -11,6 +11,22 @@ import {colors} from '@duro-app/tokens/tokens/colors.css'
|
|
|
11
11
|
|
|
12
12
|
const meta: Meta = {
|
|
13
13
|
title: 'Components/Table',
|
|
14
|
+
argTypes: {
|
|
15
|
+
columns: {
|
|
16
|
+
control: 'number',
|
|
17
|
+
description: 'Number of columns in the table grid',
|
|
18
|
+
},
|
|
19
|
+
variant: {
|
|
20
|
+
control: 'select',
|
|
21
|
+
options: ['default', 'striped', 'bordered'],
|
|
22
|
+
description: 'Visual style variant of the table',
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
control: 'select',
|
|
26
|
+
options: ['sm', 'md', 'lg'],
|
|
27
|
+
description: 'Density/size of table rows',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
14
30
|
}
|
|
15
31
|
|
|
16
32
|
export default meta
|
|
@@ -4,6 +4,13 @@ import {Tabs} from './Tabs'
|
|
|
4
4
|
|
|
5
5
|
const meta: Meta = {
|
|
6
6
|
title: 'Components/Tabs',
|
|
7
|
+
argTypes: {
|
|
8
|
+
orientation: {
|
|
9
|
+
control: 'select',
|
|
10
|
+
options: ['horizontal', 'vertical'],
|
|
11
|
+
description: 'Layout orientation of the tab list',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
7
14
|
}
|
|
8
15
|
|
|
9
16
|
export default meta
|
|
@@ -6,6 +6,21 @@ import {Badge} from '../Badge/Badge'
|
|
|
6
6
|
|
|
7
7
|
const meta: Meta = {
|
|
8
8
|
title: 'Components/Tooltip',
|
|
9
|
+
argTypes: {
|
|
10
|
+
content: {
|
|
11
|
+
control: 'text',
|
|
12
|
+
description: 'Text content displayed inside the tooltip',
|
|
13
|
+
},
|
|
14
|
+
placement: {
|
|
15
|
+
control: 'select',
|
|
16
|
+
options: ['top', 'bottom', 'left', 'right'],
|
|
17
|
+
description: 'Preferred placement of the tooltip relative to the trigger',
|
|
18
|
+
},
|
|
19
|
+
delay: {
|
|
20
|
+
control: 'number',
|
|
21
|
+
description: 'Delay in milliseconds before the tooltip appears on hover',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
9
24
|
}
|
|
10
25
|
|
|
11
26
|
export default meta
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export {DetailPanel, type DetailPanelSize} from './components/DetailPanel/Detail
|
|
|
16
16
|
export {Drawer, type DrawerAnchor, type DrawerSize} from './components/Drawer/Drawer'
|
|
17
17
|
export {EmptyState} from './components/EmptyState/EmptyState'
|
|
18
18
|
export {Heading, type HeadingVariant} from './components/Heading/Heading'
|
|
19
|
+
export {List, type ListSelectionMode} from './components/List/List'
|
|
19
20
|
export {Field} from './components/Field/Field'
|
|
20
21
|
export {Form, type FormProps} from './components/Form/Form'
|
|
21
22
|
export {Fieldset, type FieldsetGap} from './components/Fieldset/Fieldset'
|