@duro-app/ui 5.6.0 → 5.7.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 (60) hide show
  1. package/dist/{Table-B1sWL3GA.js → Table-Dj7PXqO_.js} +3 -2
  2. package/dist/Table-Dj7PXqO_.js.map +1 -0
  3. package/dist/components/DragDrop/DragDrop.d.ts +95 -14
  4. package/dist/components/DragDrop/DragDrop.d.ts.map +1 -1
  5. package/dist/components/DragDrop/DragDrop.meta.d.ts.map +1 -1
  6. package/dist/components/DragDrop/DragDropBoard.stories.d.ts +69 -0
  7. package/dist/components/DragDrop/DragDropBoard.stories.d.ts.map +1 -0
  8. package/dist/components/DragDrop/styles.css.d.ts +80 -3
  9. package/dist/components/DragDrop/styles.css.d.ts.map +1 -1
  10. package/dist/components/Meter/Meter.d.ts +17 -0
  11. package/dist/components/Meter/Meter.d.ts.map +1 -0
  12. package/dist/components/Meter/Meter.meta.d.ts +3 -0
  13. package/dist/components/Meter/Meter.meta.d.ts.map +1 -0
  14. package/dist/components/Meter/Meter.stories.d.ts +12 -0
  15. package/dist/components/Meter/Meter.stories.d.ts.map +1 -0
  16. package/dist/components/Meter/styles.css.d.ts +34 -0
  17. package/dist/components/Meter/styles.css.d.ts.map +1 -0
  18. package/dist/components/Timeline/Timeline.d.ts +71 -0
  19. package/dist/components/Timeline/Timeline.d.ts.map +1 -0
  20. package/dist/components/Timeline/Timeline.meta.d.ts +3 -0
  21. package/dist/components/Timeline/Timeline.meta.d.ts.map +1 -0
  22. package/dist/components/Timeline/Timeline.stories.d.ts +26 -0
  23. package/dist/components/Timeline/Timeline.stories.d.ts.map +1 -0
  24. package/dist/components/Timeline/styles.css.d.ts +158 -0
  25. package/dist/components/Timeline/styles.css.d.ts.map +1 -0
  26. package/dist/components/Toast/Toast.meta.d.ts.map +1 -1
  27. package/dist/components/Toast/Toast.stories.d.ts +9 -0
  28. package/dist/components/Toast/Toast.stories.d.ts.map +1 -1
  29. package/dist/components/Toast/ToastProvider.d.ts +11 -5
  30. package/dist/components/Toast/ToastProvider.d.ts.map +1 -1
  31. package/dist/components/Toast/index.d.ts +1 -1
  32. package/dist/components/Toast/index.d.ts.map +1 -1
  33. package/dist/components/Toast/styles.css.d.ts +6 -0
  34. package/dist/components/Toast/styles.css.d.ts.map +1 -1
  35. package/dist/index.css +1 -1
  36. package/dist/index.d.ts +4 -2
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +5029 -3927
  39. package/dist/index.js.map +1 -1
  40. package/dist/table.js +1 -1
  41. package/package.json +2 -2
  42. package/src/components/DragDrop/DragDrop.meta.ts +22 -21
  43. package/src/components/DragDrop/DragDrop.tsx +1147 -246
  44. package/src/components/DragDrop/DragDropBoard.stories.tsx +668 -0
  45. package/src/components/DragDrop/styles.css.ts +74 -4
  46. package/src/components/Meter/Meter.meta.ts +24 -0
  47. package/src/components/Meter/Meter.stories.tsx +64 -0
  48. package/src/components/Meter/Meter.tsx +55 -0
  49. package/src/components/Meter/styles.css.ts +30 -0
  50. package/src/components/Timeline/Timeline.meta.ts +46 -0
  51. package/src/components/Timeline/Timeline.stories.tsx +238 -0
  52. package/src/components/Timeline/Timeline.tsx +332 -0
  53. package/src/components/Timeline/styles.css.ts +162 -0
  54. package/src/components/Toast/Toast.meta.ts +2 -1
  55. package/src/components/Toast/Toast.stories.tsx +84 -0
  56. package/src/components/Toast/ToastProvider.tsx +49 -11
  57. package/src/components/Toast/index.ts +7 -1
  58. package/src/components/Toast/styles.css.ts +2 -0
  59. package/src/index.ts +16 -0
  60. package/dist/Table-B1sWL3GA.js.map +0 -1
package/dist/table.js CHANGED
@@ -1,4 +1,4 @@
1
- import { M as F, m as xt, R as rt, H as kt, n as pt, o as bt, p as ft, q as mt, k as ht, t as yt, r as St, v as Tt } from "./Table-B1sWL3GA.js";
1
+ import { M as F, m as xt, R as rt, H as kt, n as pt, o as bt, p as ft, q as mt, k as ht, t as yt, r as St, v as Tt } from "./Table-Dj7PXqO_.js";
2
2
  import { jsx as u, jsxs as q } from "react/jsx-runtime";
3
3
  import { c as H, m as p, d as b } from "./compiler-runtime-B2IcI8_O.js";
4
4
  import { flexRender as E, useReactTable as it, getPaginationRowModel as Ct, getFilteredRowModel as vt, getSortedRowModel as at, getCoreRowModel as st } from "@tanstack/react-table";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duro-app/ui",
3
- "version": "5.6.0",
3
+ "version": "5.7.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@tanstack/react-virtual": "^3.14.6",
69
- "@duro-app/tokens": "^5.6.0"
69
+ "@duro-app/tokens": "^5.7.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@babel/preset-typescript": "^7.28.0",
@@ -2,15 +2,15 @@ import type {ComponentMeta} from '../component-meta'
2
2
 
3
3
  export const meta: ComponentMeta = {
4
4
  description:
5
- 'Move items between zones with one pointer — mouse, pen and touch through the same pointer-event path (touch holds briefly, then drags; a moving touch stays a scroll). A ghost follows the pointer, the zone under it lights up, and the Root announces picks and drops to screen readers. Dragging is pointer-only by design: keep a button or remove affordance that does the same thing.',
6
- anatomy: {required: ['Root', 'Zone', 'Item']},
5
+ 'Move items between zones by pointer (mouse, pen and touch through one pointer-event path; touch holds briefly, then drags) or by keyboard (a Handle per item: Space picks up, arrows move, Space drops, Escape cancels). The innermost accepting zone wins, so a zone nested in an Item (a card in a column) takes its own drops; a zone can refuse with a reason that is shown and announced. Placeholders, edge auto-scroll and list-style announcements (through `announce`, for catalog strings) come with it.',
6
+ anatomy: {required: ['Root', 'Zone', 'Item'], optional: ['Handle']},
7
7
  whenToUse: [
8
8
  'Slotting things into places — people into approval gates, cards into columns, files into folders',
9
9
  'Reordering a short row or list when the order is visible and meaningful',
10
+ 'A board: columns as labelled lists (`list`), cards with a Handle, an attach zone nested in each card',
10
11
  ],
11
12
  whenNotToUse: [
12
- 'As the ONLY way to do something — every drag needs a tap/click equivalent (WCAG 2.5.7); this component does not provide one',
13
- 'Long lists that scroll while dragging — the ghost follows the pointer but zones do not auto-scroll',
13
+ 'As the ONLY way to do something — WCAG 2.5.7 asks for a single-pointer alternative to dragging (a button or menu that moves the item); a Handle adds the keyboard path, not a click one',
14
14
  'Sorting tabular data — sort the Table instead',
15
15
  'React Native — Item renders its children without drag behaviour there',
16
16
  ],
@@ -26,24 +26,25 @@ export const meta: ComponentMeta = {
26
26
  relationship: 'ScrollArea drags a thumb along one axis; DragDrop moves items between zones',
27
27
  },
28
28
  ],
29
- example: `<DragDrop.Root onDrop={({item, target}) => move(item.id, target.zone, target.index)}>
30
- <DragDrop.Zone id="roster" label="Roster">
31
- <Cluster gap="sm">
32
- {people.map((p) => (
33
- <DragDrop.Item key={p.id} id={p.id} zone="roster" label={p.name} data={p}>
34
- <Button variant="secondary" size="small" onClick={() => slot(p)}>{p.name}</Button>
29
+ example: `<DragDrop.Root
30
+ onDrop={({item, target}) => move(item.id, target.zone, target.index)}
31
+ renderPlaceholder={({label}) => <Text variant="caption">→ {label}</Text>}
32
+ announce={(e) => t(\`board.drag.\${e.kind}\`, e)}
33
+ >
34
+ {columns.map((col) => (
35
+ <DragDrop.Zone key={col.id} id={col.id} label={col.name} orientation="vertical" list
36
+ accepts={(item) => item.data.kind === 'task' || {ok: false, reason: t('board.attachOnCard')}}>
37
+ {col.cards.map((card) => (
38
+ <DragDrop.Item key={card.id} id={card.id} zone={col.id} label={card.title} data={card}>
39
+ <DragDrop.Handle>
40
+ <DragDrop.Zone id={\`attach:\${card.id}\`} label={card.title}
41
+ accepts={(item) => item.data.kind === 'activity'}>
42
+ <Card>{card.title}</Card>
43
+ </DragDrop.Zone>
44
+ </DragDrop.Handle>
35
45
  </DragDrop.Item>
36
46
  ))}
37
- </Cluster>
38
- </DragDrop.Zone>
39
- <DragDrop.Zone id="gates" label="Gates" orientation="horizontal">
40
- <Inline gap="sm">
41
- {gates.map((g) => (
42
- <DragDrop.Item key={g.id} id={g.id} zone="gates" label={g.name} data={g}>
43
- <Tag removable onRemove={() => unslot(g)}>{g.name}</Tag>
44
- </DragDrop.Item>
45
- ))}
46
- </Inline>
47
- </DragDrop.Zone>
47
+ </DragDrop.Zone>
48
+ ))}
48
49
  </DragDrop.Root>`,
49
50
  }