@duro-app/ui 0.19.0 → 0.20.1

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 (49) hide show
  1. package/dist/components/DetailPanel/DetailPanel.d.ts +53 -0
  2. package/dist/components/DetailPanel/DetailPanel.d.ts.map +1 -0
  3. package/dist/components/DetailPanel/DetailPanel.meta.d.ts +3 -0
  4. package/dist/components/DetailPanel/DetailPanel.meta.d.ts.map +1 -0
  5. package/dist/components/DetailPanel/DetailPanel.stories.d.ts +9 -0
  6. package/dist/components/DetailPanel/DetailPanel.stories.d.ts.map +1 -0
  7. package/dist/components/DetailPanel/styles.css.d.ts +126 -0
  8. package/dist/components/DetailPanel/styles.css.d.ts.map +1 -0
  9. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  10. package/dist/components/Dialog/Dialog.meta.d.ts +3 -0
  11. package/dist/components/Dialog/Dialog.meta.d.ts.map +1 -0
  12. package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
  13. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  14. package/dist/components/Drawer/Drawer.meta.d.ts +3 -0
  15. package/dist/components/Drawer/Drawer.meta.d.ts.map +1 -0
  16. package/dist/components/Drawer/Drawer.stories.d.ts.map +1 -1
  17. package/dist/components/Drawer/useSwipeDismiss.d.ts.map +1 -1
  18. package/dist/components/Panel/Panel.d.ts +27 -0
  19. package/dist/components/Panel/Panel.d.ts.map +1 -0
  20. package/dist/components/Panel/Panel.meta.d.ts +3 -0
  21. package/dist/components/Panel/Panel.meta.d.ts.map +1 -0
  22. package/dist/components/Panel/Panel.stories.d.ts +10 -0
  23. package/dist/components/Panel/Panel.stories.d.ts.map +1 -0
  24. package/dist/components/Panel/styles.css.d.ts +50 -0
  25. package/dist/components/Panel/styles.css.d.ts.map +1 -0
  26. package/dist/components/Table/Table.stories.d.ts.map +1 -1
  27. package/dist/index.css +1 -1
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +2417 -2034
  31. package/dist/index.js.map +1 -1
  32. package/package.json +2 -2
  33. package/src/components/DetailPanel/DetailPanel.meta.ts +41 -0
  34. package/src/components/DetailPanel/DetailPanel.stories.tsx +270 -0
  35. package/src/components/DetailPanel/DetailPanel.tsx +312 -0
  36. package/src/components/DetailPanel/styles.css.ts +187 -0
  37. package/src/components/Dialog/Dialog.meta.ts +44 -0
  38. package/src/components/Dialog/Dialog.stories.tsx +5 -7
  39. package/src/components/Dialog/Dialog.tsx +1 -5
  40. package/src/components/Drawer/Drawer.meta.ts +45 -0
  41. package/src/components/Drawer/Drawer.stories.tsx +24 -21
  42. package/src/components/Drawer/Drawer.tsx +2 -9
  43. package/src/components/Drawer/useSwipeDismiss.ts +13 -6
  44. package/src/components/Panel/Panel.meta.ts +37 -0
  45. package/src/components/Panel/Panel.stories.tsx +124 -0
  46. package/src/components/Panel/Panel.tsx +56 -0
  47. package/src/components/Panel/styles.css.ts +55 -0
  48. package/src/components/Table/Table.stories.tsx +1 -4
  49. package/src/index.ts +2 -0
@@ -0,0 +1,56 @@
1
+ import type {ReactNode} from 'react'
2
+ import {html} from 'react-strict-dom'
3
+ import {styles} from './styles.css'
4
+
5
+ // --- Root ---
6
+
7
+ interface RootProps {
8
+ children: ReactNode
9
+ /** Adds an outer border. Default: false */
10
+ bordered?: boolean
11
+ }
12
+
13
+ function Root({children, bordered = false}: RootProps) {
14
+ return (
15
+ <html.div style={[styles.root, bordered && styles.bordered]}>
16
+ {children}
17
+ </html.div>
18
+ )
19
+ }
20
+
21
+ // --- Header ---
22
+
23
+ function Header({children}: {children: ReactNode}) {
24
+ return <html.div style={styles.header}>{children}</html.div>
25
+ }
26
+
27
+ // --- Body ---
28
+
29
+ interface BodyProps {
30
+ children: ReactNode
31
+ /** Adds inner padding. Default: true */
32
+ padded?: boolean
33
+ }
34
+
35
+ function Body({children, padded = true}: BodyProps) {
36
+ return (
37
+ <html.div style={[styles.body, padded && styles.bodyPadded]}>
38
+ {children}
39
+ </html.div>
40
+ )
41
+ }
42
+
43
+ // --- Footer ---
44
+
45
+ function Footer({children}: {children: ReactNode}) {
46
+ return <html.div style={styles.footer}>{children}</html.div>
47
+ }
48
+
49
+ // --- Export ---
50
+
51
+ export const Panel = {
52
+ Root,
53
+ Header,
54
+ Body,
55
+ Footer,
56
+ }
@@ -0,0 +1,55 @@
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
+
5
+ export const styles = css.create({
6
+ root: {
7
+ display: 'flex',
8
+ flexDirection: 'column',
9
+ backgroundColor: colors.bgCard,
10
+ },
11
+ bordered: {
12
+ borderWidth: 1,
13
+ borderStyle: 'solid',
14
+ borderColor: colors.border,
15
+ },
16
+
17
+ header: {
18
+ display: 'flex',
19
+ alignItems: 'center',
20
+ justifyContent: 'space-between',
21
+ paddingTop: spacing.lg,
22
+ paddingLeft: spacing.lg,
23
+ paddingRight: spacing.lg,
24
+ paddingBottom: spacing.lg,
25
+ gap: spacing.md,
26
+ borderBottomWidth: 1,
27
+ borderBottomStyle: 'solid',
28
+ borderBottomColor: colors.border,
29
+ },
30
+
31
+ body: {
32
+ flex: 1,
33
+ overflowY: 'auto',
34
+ },
35
+ bodyPadded: {
36
+ paddingTop: spacing.lg,
37
+ paddingLeft: spacing.lg,
38
+ paddingRight: spacing.lg,
39
+ paddingBottom: spacing.lg,
40
+ },
41
+
42
+ footer: {
43
+ display: 'flex',
44
+ alignItems: 'center',
45
+ justifyContent: 'flex-end',
46
+ gap: spacing.sm,
47
+ paddingTop: spacing.md,
48
+ paddingBottom: spacing.md,
49
+ paddingLeft: spacing.lg,
50
+ paddingRight: spacing.lg,
51
+ borderTopWidth: 1,
52
+ borderTopStyle: 'solid',
53
+ borderTopColor: colors.border,
54
+ },
55
+ })
@@ -271,10 +271,7 @@ function CheckboxTableDemo() {
271
271
  </Table.Body>
272
272
  </Table.Root>
273
273
 
274
- <ActionBar
275
- selectedItemCount={selected.size}
276
- onClearSelection={() => setSelected(new Set())}
277
- >
274
+ <ActionBar selectedItemCount={selected.size} onClearSelection={() => setSelected(new Set())}>
278
275
  <Button variant="danger" size="small">
279
276
  Delete
280
277
  </Button>
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@ export {Callout, type CalloutVariant} from './components/Callout/Callout'
12
12
  export {Card, type CardVariant, type CardSize} from './components/Card/Card'
13
13
  export {Checkbox} from './components/Checkbox/Checkbox'
14
14
  export {Dialog, type DialogSize} from './components/Dialog/Dialog'
15
+ export {DetailPanel, type DetailPanelSize} from './components/DetailPanel/DetailPanel'
15
16
  export {Drawer, type DrawerAnchor, type DrawerSize} from './components/Drawer/Drawer'
16
17
  export {EmptyState} from './components/EmptyState/EmptyState'
17
18
  export {Heading, type HeadingVariant} from './components/Heading/Heading'
@@ -26,6 +27,7 @@ export {
26
27
  type LinkButtonSize,
27
28
  } from './components/LinkButton/LinkButton'
28
29
  export {Menu} from './components/Menu/Menu'
30
+ export {Panel} from './components/Panel/Panel'
29
31
  export {ScrollArea} from './components/ScrollArea/ScrollArea'
30
32
  export {Select} from './components/Select/Select'
31
33
  export {SideNav} from './components/SideNav/SideNav'