@duro-app/ui 0.41.0 → 0.43.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 (29) hide show
  1. package/dist/components/Callout/Callout.d.ts +7 -1
  2. package/dist/components/Callout/Callout.d.ts.map +1 -1
  3. package/dist/components/Callout/Callout.stories.d.ts +1 -1
  4. package/dist/components/Callout/Callout.stories.d.ts.map +1 -1
  5. package/dist/components/Callout/styles.css.d.ts +14 -5
  6. package/dist/components/Callout/styles.css.d.ts.map +1 -1
  7. package/dist/components/VirtualTable/VirtualTable.d.ts +57 -0
  8. package/dist/components/VirtualTable/VirtualTable.d.ts.map +1 -0
  9. package/dist/components/VirtualTable/VirtualTable.meta.d.ts +3 -0
  10. package/dist/components/VirtualTable/VirtualTable.meta.d.ts.map +1 -0
  11. package/dist/components/VirtualTable/VirtualTable.stories.d.ts +14 -0
  12. package/dist/components/VirtualTable/VirtualTable.stories.d.ts.map +1 -0
  13. package/dist/components/VirtualTable/styles.css.d.ts +128 -0
  14. package/dist/components/VirtualTable/styles.css.d.ts.map +1 -0
  15. package/dist/index.css +1 -1
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +1914 -1658
  19. package/dist/index.js.map +1 -1
  20. package/package.json +3 -2
  21. package/src/components/Callout/Callout.meta.ts +1 -1
  22. package/src/components/Callout/Callout.stories.tsx +24 -11
  23. package/src/components/Callout/Callout.tsx +16 -3
  24. package/src/components/Callout/styles.css.ts +17 -5
  25. package/src/components/VirtualTable/VirtualTable.meta.ts +43 -0
  26. package/src/components/VirtualTable/VirtualTable.stories.tsx +89 -0
  27. package/src/components/VirtualTable/VirtualTable.tsx +275 -0
  28. package/src/components/VirtualTable/styles.css.ts +135 -0
  29. package/src/index.ts +3 -0
@@ -0,0 +1,135 @@
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
+
6
+ export const styles = css.create({
7
+ wrap: {
8
+ position: 'relative',
9
+ width: '100%',
10
+ },
11
+ scroll: {
12
+ position: 'relative',
13
+ width: '100%',
14
+ borderWidth: 1,
15
+ borderStyle: 'solid',
16
+ borderColor: colors.border,
17
+ borderRadius: radii.md,
18
+ backgroundColor: colors.bgCard,
19
+ },
20
+ // Dynamic: only virtualized lists get a capped, scrollable viewport.
21
+ scrollMax: (maxHeight: number | string) => ({
22
+ maxHeight,
23
+ overflowY: 'auto',
24
+ overscrollBehavior: 'contain',
25
+ }),
26
+ head: {
27
+ position: 'sticky',
28
+ top: 0,
29
+ zIndex: 1,
30
+ backgroundColor: colors.bgCard,
31
+ },
32
+ headRow: {
33
+ display: 'flex',
34
+ flexDirection: 'row',
35
+ borderBottomWidth: 1,
36
+ borderBottomStyle: 'solid',
37
+ borderBottomColor: colors.border,
38
+ },
39
+ headCell: {
40
+ display: 'flex',
41
+ flexDirection: 'row',
42
+ alignItems: 'center',
43
+ gap: spacing.xs,
44
+ paddingTop: spacing.sm,
45
+ paddingBottom: spacing.sm,
46
+ paddingLeft: spacing.md,
47
+ paddingRight: spacing.md,
48
+ fontFamily: typography.fontFamily,
49
+ fontSize: typography.fontSizeXs,
50
+ fontWeight: typography.fontWeightSemibold,
51
+ textTransform: 'uppercase' as const,
52
+ letterSpacing: '0.03em',
53
+ color: colors.textMuted,
54
+ },
55
+ headCellSortable: {
56
+ cursor: 'pointer',
57
+ userSelect: 'none',
58
+ color: {default: colors.textMuted, ':hover': colors.text},
59
+ },
60
+ sortMark: {
61
+ fontSize: typography.fontSizeXs,
62
+ color: colors.accent,
63
+ },
64
+ bodyTotal: (height: number) => ({
65
+ position: 'relative',
66
+ width: '100%',
67
+ height,
68
+ }),
69
+ row: {
70
+ display: 'flex',
71
+ flexDirection: 'row',
72
+ alignItems: 'center',
73
+ width: '100%',
74
+ borderBottomWidth: 1,
75
+ borderBottomStyle: 'solid',
76
+ borderBottomColor: colors.border,
77
+ },
78
+ rowClickable: {
79
+ cursor: 'pointer',
80
+ backgroundColor: {default: 'transparent', ':hover': colors.bgCardHover},
81
+ },
82
+ // Dynamic: absolute placement of a windowed row.
83
+ rowAbsolute: (y: number) => ({
84
+ position: 'absolute',
85
+ top: 0,
86
+ left: 0,
87
+ transform: `translateY(${y}px)`,
88
+ }),
89
+ cell: {
90
+ paddingTop: spacing.sm,
91
+ paddingBottom: spacing.sm,
92
+ paddingLeft: spacing.md,
93
+ paddingRight: spacing.md,
94
+ fontFamily: typography.fontFamily,
95
+ fontSize: typography.fontSizeSm,
96
+ color: colors.text,
97
+ overflow: 'hidden',
98
+ textOverflow: 'ellipsis',
99
+ whiteSpace: 'nowrap',
100
+ },
101
+ // Dynamic: proportional column width from the TanStack column size (fr-like).
102
+ cellFlex: (size: number) => ({
103
+ flexGrow: size,
104
+ flexShrink: 1,
105
+ flexBasis: 0,
106
+ minWidth: 0,
107
+ }),
108
+ empty: {
109
+ paddingTop: spacing.xl,
110
+ paddingBottom: spacing.xl,
111
+ textAlign: 'center' as const,
112
+ color: colors.textMuted,
113
+ fontFamily: typography.fontFamily,
114
+ fontSize: typography.fontSizeSm,
115
+ },
116
+ // Floating position indicator, pinned bottom-right of the viewport.
117
+ pos: {
118
+ position: 'absolute',
119
+ right: spacing.sm,
120
+ bottom: spacing.sm,
121
+ paddingTop: 3,
122
+ paddingBottom: 3,
123
+ paddingLeft: spacing.sm,
124
+ paddingRight: spacing.sm,
125
+ borderRadius: radii.full,
126
+ backgroundColor: colors.bgCardHover,
127
+ borderWidth: 1,
128
+ borderStyle: 'solid',
129
+ borderColor: colors.border,
130
+ color: colors.textMuted,
131
+ fontFamily: typography.fontFamily,
132
+ fontSize: typography.fontSizeXs,
133
+ pointerEvents: 'none',
134
+ },
135
+ })
package/src/index.ts CHANGED
@@ -56,6 +56,9 @@ export {
56
56
  export {Tag, type TagVariant, type TagSize} from './components/Tag/Tag'
57
57
  export {TagGroup} from './components/TagGroup/TagGroup'
58
58
  export {Table, type TableVariant, type TableSize} from './components/Table/Table'
59
+ // Web-only (DOM scroll measurement + @tanstack/react-virtual); intentionally
60
+ // absent from index.native.ts.
61
+ export {VirtualTable, type VirtualTableRange} from './components/VirtualTable/VirtualTable'
59
62
  // Side-effect import registers our augmentation of TanStack's ColumnMeta
60
63
  // (stackLabel / isActions). Standalone module so the augmentation lands
61
64
  // whenever this package is in a consumer's TS program, even if FromTanstack