@estiva-app/ui 0.12.10 → 0.13.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 (43) hide show
  1. package/dist/AttachmentCard.d.ts +52 -0
  2. package/dist/AttachmentCard.d.ts.map +1 -0
  3. package/dist/Card.d.ts +48 -0
  4. package/dist/Card.d.ts.map +1 -0
  5. package/dist/InlineChip.d.ts +59 -0
  6. package/dist/InlineChip.d.ts.map +1 -0
  7. package/dist/Link.d.ts +37 -0
  8. package/dist/Link.d.ts.map +1 -0
  9. package/dist/ProgressBar.d.ts +32 -0
  10. package/dist/ProgressBar.d.ts.map +1 -0
  11. package/dist/index.d.ts +5 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +694 -355
  14. package/dist/index.js.map +4 -4
  15. package/package.json +1 -1
  16. package/src/AttachmentCard.mdx +62 -0
  17. package/src/AttachmentCard.stories.tsx +92 -0
  18. package/src/AttachmentCard.test.tsx +172 -0
  19. package/src/AttachmentCard.tsx +324 -0
  20. package/src/Card.mdx +68 -0
  21. package/src/Card.stories.tsx +109 -0
  22. package/src/Card.test.tsx +106 -0
  23. package/src/Card.tsx +115 -0
  24. package/src/EmptyState.mdx +14 -0
  25. package/src/EmptyState.stories.tsx +28 -7
  26. package/src/EmptyState.test.tsx +8 -0
  27. package/src/InlineChip.mdx +56 -0
  28. package/src/InlineChip.stories.tsx +59 -0
  29. package/src/InlineChip.test.tsx +81 -0
  30. package/src/InlineChip.tsx +90 -0
  31. package/src/Link.mdx +59 -0
  32. package/src/Link.stories.tsx +102 -0
  33. package/src/Link.test.tsx +100 -0
  34. package/src/Link.tsx +58 -0
  35. package/src/Person.stories.tsx +1 -1
  36. package/src/PersonTrigger.stories.tsx +1 -1
  37. package/src/ProgressBar.mdx +47 -0
  38. package/src/ProgressBar.stories.tsx +48 -0
  39. package/src/ProgressBar.test.tsx +62 -0
  40. package/src/ProgressBar.tsx +56 -0
  41. package/src/ReactionPicker.stories.tsx +1 -1
  42. package/src/index.ts +12 -0
  43. package/stories/Choosing.mdx +5 -0
@@ -0,0 +1,56 @@
1
+ import { Progress } from '@base-ui/react/progress'
2
+ import { cn } from './cn'
3
+
4
+ /**
5
+ * How much of something is done: a thin rounded track with a success-coloured
6
+ * fill. On Base UI's `Progress`, which owns the `progressbar` role and its
7
+ * numbers; this component writes the look.
8
+ *
9
+ * Both apps hand-built one, each with its own `role="progressbar"` (UIG-27).
10
+ * Their two looks are both kept, because each does a different job:
11
+ *
12
+ * - `default` is Ship's (`ui/ProgressBar.tsx`): 6px, the success colour — a
13
+ * bar someone reads, with the words printed beside it.
14
+ * - `quiet` is Peek's (`ui/ProjectTickets.tsx`): 4px, the muted success colour
15
+ * — a glance on the same line as a count, "not a chart".
16
+ *
17
+ * The props are Ship's, unchanged. The bar alone says nothing a screen reader
18
+ * can use beyond its numbers, so `label` is required; Base UI reads the value
19
+ * out as a percentage.
20
+ */
21
+ export type ProgressBarVariant = 'default' | 'quiet'
22
+
23
+ const TRACK_CLASSES: Record<ProgressBarVariant, string> = {
24
+ default: 'h-1.5 w-full overflow-hidden rounded-full bg-bg-inset',
25
+ // 4px, Katerina's ruling of 14 September; Peek's own bar is 3px until it takes this one.
26
+ quiet: 'h-1 w-full overflow-hidden rounded-full bg-bg-inset',
27
+ }
28
+
29
+ const INDICATOR_CLASSES: Record<ProgressBarVariant, string> = {
30
+ default: 'h-full rounded-full bg-success-default transition-[width]',
31
+ quiet: 'h-full rounded-full bg-success-muted transition-[width] duration-300',
32
+ }
33
+
34
+ export interface ProgressBarProps {
35
+ /** How many are done. */
36
+ value: number
37
+ /** How many there are. At `0` the bar is empty. */
38
+ max: number
39
+ /** The accessible name — "Items done". */
40
+ label: string
41
+ /** Default `default`. */
42
+ variant?: ProgressBarVariant
43
+ /** Placement only: a width, a margin, `flex-1` in a row. */
44
+ className?: string
45
+ }
46
+
47
+ export function ProgressBar({ value, max, label, variant = 'default', className }: ProgressBarProps) {
48
+ return (
49
+ // `max={0}` needs no guard: Base UI reads the 0/0 share as an empty bar.
50
+ <Progress.Root value={value} max={max} aria-label={label} className={className}>
51
+ <Progress.Track className={TRACK_CLASSES[variant]}>
52
+ <Progress.Indicator className={INDICATOR_CLASSES[variant]} />
53
+ </Progress.Track>
54
+ </Progress.Root>
55
+ )
56
+ }
@@ -25,7 +25,7 @@ const OPTIONS: ReactionOption[] = [
25
25
  ]
26
26
 
27
27
  const meta = {
28
- title: 'Primitives/ReactionPicker',
28
+ title: 'Components/ReactionPicker',
29
29
  component: ReactionPicker,
30
30
  args: { options: OPTIONS, onSelect: () => {} },
31
31
  argTypes: { options: { control: false }, onSelect: { control: false } },
package/src/index.ts CHANGED
@@ -10,13 +10,24 @@
10
10
  * TypeScript that produced it.
11
11
  */
12
12
  export { AppShell, type AppShellProps } from './AppShell'
13
+ export { AttachmentCard, type AttachmentCardProps, type AttachmentCardState } from './AttachmentCard'
13
14
  export { Avatar, hueFor, initialsFor, type AvatarProps } from './Avatar'
14
15
  export { AvatarGroup, type AvatarGroupMember, type AvatarGroupProps } from './AvatarGroup'
15
16
  export { Banner, type BannerProps, type BannerTone } from './Banner'
16
17
  export { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from './Button'
18
+ export { Card, type CardAttention, type CardFill, type CardHover, type CardProps } from './Card'
17
19
  export { Checkbox, type CheckboxProps } from './Checkbox'
18
20
  export { Chip, type ChipProps, type ChipType } from './Chip'
19
21
  export { ChipInput, InputChip, type ChipInputOption, type ChipInputProps, type InputChipProps } from './ChipInput'
22
+ export {
23
+ INLINE_CHIP_CLASSES,
24
+ INLINE_CHIP_TONE_CLASSES,
25
+ InlineChip,
26
+ inlineChipClassName,
27
+ type InlineChipProps,
28
+ type InlineChipTone,
29
+ } from './InlineChip'
30
+ export { Link, type LinkProps, type LinkVariant } from './Link'
20
31
  export { IconButton, type IconButtonProps, type IconButtonVariant } from './IconButton'
21
32
  export { Kbd, type KbdProps } from './Kbd'
22
33
  export { IdentityMenu, IdentityPanel, type Identity, type IdentityMenuProps, type IdentityPanelProps } from './IdentityMenu'
@@ -30,6 +41,7 @@ export { DialogShell, type DialogShellProps } from './DialogShell'
30
41
  export { Divider, type DividerProps } from './Divider'
31
42
  export { EditableText, type EditableTextProps } from './EditableText'
32
43
  export { EmptyState, type EmptyStateProps } from './EmptyState'
44
+ export { ProgressBar, type ProgressBarProps, type ProgressBarVariant } from './ProgressBar'
33
45
  export { SkeletonBar, SkeletonList, SkeletonRow } from './Skeleton'
34
46
  export { Breadcrumb, type BreadcrumbProps, type Crumb } from './Breadcrumb'
35
47
  export { EnterHint, Menu, MenuItem, MenuPanel, MenuRow, MenuSection, MenuSub, type MenuItemProps, type MenuPanelProps, type MenuProps, type MenuSubProps } from './Menu'
@@ -69,11 +69,15 @@ fork freely, owe nothing back, mention it on the package's ticket.
69
69
  | You need | Reach for |
70
70
  |---|---|
71
71
  | Label–value rows (a details rail) | **Property** — `row` and `stacked` |
72
+ | One thing — a conversation, a project, an object — as a box you can pick | **Card** — the fill by what it sits on; `href` for a link, `hover="fill"` in a feed |
72
73
  | A section heading, chevron, hover actions | **SectionHeader** |
73
74
  | A group of rows that opens and closes, and stays how you left it | **CollapsibleSection** — `storageKey` remembers |
74
75
  | The uppercase micro-label | **SectionLabel** |
75
76
  | A hairline | **Divider** |
76
77
  | Where am I, and the way back up | **Breadcrumb** |
78
+ | A link — in text, on a title, beside a note, or a whole box | **Link** — `text`, `quiet`, `underlined`, `plain`; `external` for a new tab |
79
+ | A document or an image attached to something, posted or waiting to be sent | **AttachmentCard** — the file decides the shape; `pending` in a composer |
80
+ | A person or a thing named inside a sentence | **InlineChip** — one line high, level with the words; `href` makes it a link |
77
81
  | The key that does this too | **Kbd** — or the `shortcut` prop on **MenuItem**, **Tooltip** and **SearchInput** |
78
82
 
79
83
  ## Feedback
@@ -81,6 +85,7 @@ fork freely, owe nothing back, mention it on the package's ticket.
81
85
  | You need | Reach for |
82
86
  |---|---|
83
87
  | Data is on its way | **Skeleton** — shaped like what will arrive |
88
+ | How much of something is done | **ProgressBar** — `default` to be read, with the words beside it; `quiet` for a glance beside a count |
84
89
  | Nothing to show | **EmptyState** — says what would fill it; `page` when the whole page is empty (icon, centred), `section` when one part of it is (the line alone, left) |
85
90
  | It happened, briefly | **Toast**, via `useToast` inside a `ToastProvider` |
86
91
  | It happened, and must not be missed | **Toast** with `durationMs: 0` and an action — it floats and stays until dismissed (D21) |