@manakind/ui-core 0.34.1 → 0.35.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/README.md CHANGED
@@ -70,6 +70,7 @@ separately, so an app can load only what it renders.
70
70
  | `@manakind/ui-core/icon` | `Icon` |
71
71
  | `@manakind/ui-core/illustration` | `Illustration` + `illustrationPaint` |
72
72
  | `@manakind/ui-core/menu` | `Menu`, `MenuTrigger`, `ActionMenu`; `MenuItem.icon` adds a decorative glyph before its label |
73
+ | `@manakind/ui-core/nav-list` | `NavList` + `NavListItem`; links to a section's places with the current one marked, a count per item, and a sideways row below a viewport step |
73
74
  | `@manakind/ui-core/popover` | `Popover` |
74
75
  | `@manakind/ui-core/checkbox` | `Checkbox` |
75
76
  | `@manakind/ui-core/combobox` | `Combobox`; `ComboboxItem.group` collects options under named headings, with keyboard navigation in displayed order; `toolbar`, `status` and `facets` put filters, a status line and a pinnable facet column inside the open list |
@@ -92,6 +93,7 @@ separately, so an app can load only what it renders.
92
93
  | `@manakind/ui-core/spinner` | `Spinner` |
93
94
  | `@manakind/ui-core/radio-group` | `RadioGroup` |
94
95
  | `@manakind/ui-core/scroll-area` | `ScrollArea` |
96
+ | `@manakind/ui-core/status-dot` | `StatusDot`; a dot that marks something unread, live or new, with its meaning in words for assistive technology |
95
97
  | `@manakind/ui-core/sticky` | `Sticky` |
96
98
  | `@manakind/ui-core/empty-state` | `EmptyState` |
97
99
  | `@manakind/ui-core/page-layout` | `PageLayout`, `PageHeader`, `PageTitle`, `PageDescription`, `PageActions` |
@@ -115,6 +117,7 @@ separately, so an app can load only what it renders.
115
117
  | `@manakind/ui-core/css/icon` | Icon structural CSS |
116
118
  | `@manakind/ui-core/css/illustration` | Illustration structural CSS, including the paint roles |
117
119
  | `@manakind/ui-core/css/menu` | Menu and ActionMenu structural CSS; an ActionMenu's glyphs also need `css/icon` |
120
+ | `@manakind/ui-core/css/nav-list` | NavList structural CSS; a count's noun also needs `css/visually-hidden` |
118
121
  | `@manakind/ui-core/css/popover` | Popover structural CSS |
119
122
  | `@manakind/ui-core/css/checkbox` | Checkbox structural CSS |
120
123
  | `@manakind/ui-core/css/combobox` | Combobox structural CSS; its pin and chip-remove captions also need `css/tooltip` |
@@ -137,6 +140,7 @@ separately, so an app can load only what it renders.
137
140
  | `@manakind/ui-core/css/spinner` | Spinner structural CSS; its label also needs `css/visually-hidden` |
138
141
  | `@manakind/ui-core/css/radio-group` | RadioGroup structural CSS |
139
142
  | `@manakind/ui-core/css/scroll-area` | ScrollArea structural CSS |
143
+ | `@manakind/ui-core/css/status-dot` | StatusDot structural CSS; its label also needs `css/visually-hidden` |
140
144
  | `@manakind/ui-core/css/sticky` | Sticky structural CSS |
141
145
  | `@manakind/ui-core/css/empty-state` | EmptyState structural CSS; its glyph also needs `css/icon` |
142
146
  | `@manakind/ui-core/css/page-layout` | PageLayout structural CSS; its title and description also need `css/text` |
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ export * from './layout';
24
24
  export * from './link';
25
25
  export type { LinkComponentProps } from './link-component';
26
26
  export * from './menu';
27
+ export * from './nav-list';
27
28
  export * from './page-layout';
28
29
  export * from './popover';
29
30
  export * from './progress';
@@ -39,6 +40,7 @@ export * from './skeleton';
39
40
  export * from './slider';
40
41
  export * from './spinner';
41
42
  export * from './split-layout';
43
+ export * from './status-dot';
42
44
  export * from './sticky';
43
45
  export * from './switch';
44
46
  export * from './table';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B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;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ export * from './illustration';
23
23
  export * from './layout';
24
24
  export * from './link';
25
25
  export * from './menu';
26
+ export * from './nav-list';
26
27
  export * from './page-layout';
27
28
  export * from './popover';
28
29
  export * from './progress';
@@ -38,6 +39,7 @@ export * from './skeleton';
38
39
  export * from './slider';
39
40
  export * from './spinner';
40
41
  export * from './split-layout';
42
+ export * from './status-dot';
41
43
  export * from './sticky';
42
44
  export * from './switch';
43
45
  export * from './table';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,EACtB,GAAG,IAAI,WAAW,GACnB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAEvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './accordion';\nexport * from './alert';\nexport * from './avatar';\nexport * from './badge';\nexport * from './breadcrumb';\nexport * from './button';\nexport * from './calendar';\nexport * from './card';\nexport * from './centered-layout';\nexport * from './checkbox';\nexport * from './combobox';\nexport { cx } from './cx';\nexport * from './date-input';\nexport * from './dialog';\nexport * from './divider';\nexport * from './empty-state';\nexport {\n Check as FallbackCheck,\n ChevronLeft as FallbackChevronLeft,\n ChevronRight as FallbackChevronRight,\n Cross as FallbackCross,\n Pin as FallbackPin,\n} from './fallback-glyphs';\nexport * from './field';\nexport * from './form-layout';\nexport * from './icon';\nexport * from './icon-defaults';\nexport * from './illustration';\nexport * from './layout';\nexport * from './link';\nexport type { LinkComponentProps } from './link-component';\nexport * from './menu';\nexport * from './page-layout';\nexport * from './popover';\nexport * from './progress';\nexport * from './radio-group';\nexport * from './reorder-control';\nexport * from './scroll-area';\nexport * from './section';\nexport * from './segment-group';\nexport * from './select';\nexport * from './show';\nexport * from './side-panel-layout';\nexport * from './skeleton';\nexport * from './slider';\nexport * from './spinner';\nexport * from './split-layout';\nexport * from './sticky';\nexport * from './switch';\nexport * from './table';\nexport * from './tabs';\nexport * from './text';\nexport * from './tooltip';\nexport * from './visually-hidden';\nexport * from './wizard-layout';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,EACtB,GAAG,IAAI,WAAW,GACnB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAEvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './accordion';\nexport * from './alert';\nexport * from './avatar';\nexport * from './badge';\nexport * from './breadcrumb';\nexport * from './button';\nexport * from './calendar';\nexport * from './card';\nexport * from './centered-layout';\nexport * from './checkbox';\nexport * from './combobox';\nexport { cx } from './cx';\nexport * from './date-input';\nexport * from './dialog';\nexport * from './divider';\nexport * from './empty-state';\nexport {\n Check as FallbackCheck,\n ChevronLeft as FallbackChevronLeft,\n ChevronRight as FallbackChevronRight,\n Cross as FallbackCross,\n Pin as FallbackPin,\n} from './fallback-glyphs';\nexport * from './field';\nexport * from './form-layout';\nexport * from './icon';\nexport * from './icon-defaults';\nexport * from './illustration';\nexport * from './layout';\nexport * from './link';\nexport type { LinkComponentProps } from './link-component';\nexport * from './menu';\nexport * from './nav-list';\nexport * from './page-layout';\nexport * from './popover';\nexport * from './progress';\nexport * from './radio-group';\nexport * from './reorder-control';\nexport * from './scroll-area';\nexport * from './section';\nexport * from './segment-group';\nexport * from './select';\nexport * from './show';\nexport * from './side-panel-layout';\nexport * from './skeleton';\nexport * from './slider';\nexport * from './spinner';\nexport * from './split-layout';\nexport * from './status-dot';\nexport * from './sticky';\nexport * from './switch';\nexport * from './table';\nexport * from './tabs';\nexport * from './text';\nexport * from './tooltip';\nexport * from './visually-hidden';\nexport * from './wizard-layout';\n"]}
@@ -0,0 +1,3 @@
1
+ export type { NavListItemProps, NavListProps } from './nav-list';
2
+ export { NavList, NavListItem } from './nav-list';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nav-list/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { NavList, NavListItem } from './nav-list';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nav-list/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export type { NavListItemProps, NavListProps } from './nav-list';\nexport { NavList, NavListItem } from './nav-list';\n"]}
@@ -0,0 +1,148 @@
1
+ @layer components {
2
+ .ds-nav-list {
3
+ font-size: var(--ds-nav-list-font-size);
4
+ overflow-wrap: anywhere;
5
+ }
6
+
7
+ .ds-nav-list__list {
8
+ display: flex;
9
+ flex-direction: column;
10
+ margin: 0;
11
+ padding: 0;
12
+ list-style: none;
13
+ }
14
+
15
+ /*
16
+ * The edge is drawn at rest too, transparent, so marking an item current
17
+ * moves no text. The ring is inset: a list in a scrolling sidebar, or in its
18
+ * sideways row, would crop a ring drawn outside the link.
19
+ */
20
+ .ds-nav-list__link {
21
+ display: flex;
22
+ align-items: baseline;
23
+ justify-content: space-between;
24
+ gap: var(--ds-nav-list-item-gap);
25
+ padding-block: var(--ds-nav-list-item-padding-block);
26
+ padding-inline: calc(
27
+ var(--ds-nav-list-item-padding-inline) +
28
+ var(--_nav-list-depth, 0) *
29
+ var(--ds-nav-list-item-indent)
30
+ )
31
+ var(--ds-nav-list-item-padding-inline);
32
+ border-inline-start: 2px solid var(--ds-nav-list-item-border);
33
+ color: var(--ds-nav-list-item-text);
34
+ font: inherit;
35
+ text-decoration: none;
36
+ cursor: pointer;
37
+ transition:
38
+ color 150ms cubic-bezier(0, 0, 0.2, 1),
39
+ background-color 150ms cubic-bezier(0, 0, 0.2, 1);
40
+
41
+ &:hover {
42
+ color: var(--ds-nav-list-item-text-hover);
43
+ background-color: var(--ds-nav-list-item-bg-hover);
44
+ }
45
+
46
+ &[aria-current="page"] {
47
+ color: var(--ds-nav-list-item-text-current);
48
+ border-inline-start-color: var(--ds-nav-list-item-border-current);
49
+ }
50
+
51
+ &:focus-visible {
52
+ outline: 2px solid var(--ds-nav-list-focus-ring);
53
+ outline-offset: -2px;
54
+ }
55
+ }
56
+
57
+ .ds-nav-list__label {
58
+ min-width: 0;
59
+ }
60
+
61
+ .ds-nav-list__count {
62
+ flex-shrink: 0;
63
+ color: var(--ds-nav-list-count-text);
64
+ font-variant-numeric: tabular-nums;
65
+ }
66
+
67
+ /*
68
+ * Below the step, one row that scrolls sideways: the labels keep to one
69
+ * line, as a sideways scroller may, and depth no longer indents. The
70
+ * breakpoints are the viewport tokens, written as literals because
71
+ * `@media` cannot read a custom property (`check:breakpoints`).
72
+ */
73
+ @media (width < 40rem) {
74
+ .ds-nav-list--inline-below-sm {
75
+ .ds-nav-list__list {
76
+ flex-direction: row;
77
+ overflow-x: auto;
78
+ overflow-y: hidden;
79
+ }
80
+
81
+ .ds-nav-list__item {
82
+ flex-shrink: 0;
83
+ }
84
+
85
+ .ds-nav-list__link {
86
+ padding-inline: var(--ds-nav-list-item-padding-inline);
87
+ white-space: nowrap;
88
+ }
89
+ }
90
+ }
91
+
92
+ @media (width < 48rem) {
93
+ .ds-nav-list--inline-below-md {
94
+ .ds-nav-list__list {
95
+ flex-direction: row;
96
+ overflow-x: auto;
97
+ overflow-y: hidden;
98
+ }
99
+
100
+ .ds-nav-list__item {
101
+ flex-shrink: 0;
102
+ }
103
+
104
+ .ds-nav-list__link {
105
+ padding-inline: var(--ds-nav-list-item-padding-inline);
106
+ white-space: nowrap;
107
+ }
108
+ }
109
+ }
110
+
111
+ @media (width < 64rem) {
112
+ .ds-nav-list--inline-below-lg {
113
+ .ds-nav-list__list {
114
+ flex-direction: row;
115
+ overflow-x: auto;
116
+ overflow-y: hidden;
117
+ }
118
+
119
+ .ds-nav-list__item {
120
+ flex-shrink: 0;
121
+ }
122
+
123
+ .ds-nav-list__link {
124
+ padding-inline: var(--ds-nav-list-item-padding-inline);
125
+ white-space: nowrap;
126
+ }
127
+ }
128
+ }
129
+
130
+ @media (width < 80rem) {
131
+ .ds-nav-list--inline-below-xl {
132
+ .ds-nav-list__list {
133
+ flex-direction: row;
134
+ overflow-x: auto;
135
+ overflow-y: hidden;
136
+ }
137
+
138
+ .ds-nav-list__item {
139
+ flex-shrink: 0;
140
+ }
141
+
142
+ .ds-nav-list__link {
143
+ padding-inline: var(--ds-nav-list-item-padding-inline);
144
+ white-space: nowrap;
145
+ }
146
+ }
147
+ }
148
+ }
@@ -0,0 +1,2 @@
1
+ /* AUTOGENERATED: types for the stylesheet beside it. */
2
+ export {};
@@ -0,0 +1,83 @@
1
+ import { type ComponentProps, type CSSProperties, type ReactElement, type ReactNode } from 'react';
2
+ import './nav-list.css';
3
+ import type { Breakpoint } from '../layout/layout';
4
+ export interface NavListProps extends Omit<ComponentProps<'nav'>, 'aria-label' | 'aria-labelledby'> {
5
+ /** Names the navigation landmark ("Mail folders"). Required: a page can hold several. */
6
+ label: string;
7
+ /**
8
+ * Below this viewport step the items sit in one row that scrolls sideways,
9
+ * for a list that runs down a sidebar on a wide screen and across the top
10
+ * on a narrow one. Depth indents only in the column.
11
+ */
12
+ inlineBelow?: Breakpoint;
13
+ /** `NavListItem`s. */
14
+ children: ReactNode;
15
+ }
16
+ /**
17
+ * A list of links to the places a section of an app holds, with the current
18
+ * one marked: the folders of a mailbox, the pages of a settings area.
19
+ *
20
+ * Renders a `nav` landmark around a list. Each `NavListItem` is a link; the
21
+ * current one carries `aria-current="page"`, an edge and text in the
22
+ * product's accent. For links that switch a panel in place rather than
23
+ * navigate, use `Tabs`.
24
+ */
25
+ export declare function NavList({ label, inlineBelow, className, children, ...props }: NavListProps): import("react/jsx-runtime").JSX.Element;
26
+ /**
27
+ * A count at the end of the item and the noun it counts, which is said after
28
+ * the number but not shown ("3 unread"). Together, so a bare number is never
29
+ * announced.
30
+ */
31
+ type NavListItemCount = {
32
+ /** How many things wait at this destination. Nothing shows for zero. */
33
+ count: number;
34
+ /** The noun the count counts ("unread"), said after the number. */
35
+ countLabel: string;
36
+ } | {
37
+ count?: undefined;
38
+ countLabel?: undefined;
39
+ };
40
+ type NavListItemOwnProps = NavListItemCount & {
41
+ /** The page the reader is on: `aria-current="page"`, the accent edge and text. */
42
+ current?: boolean;
43
+ /** How many steps the item is indented under its parent, from 0. Defaults to 0. */
44
+ depth?: number;
45
+ };
46
+ type NavListItemAsLinkProps = NavListItemOwnProps & Omit<ComponentProps<'a'>, 'aria-current'> & {
47
+ asChild?: false;
48
+ };
49
+ /**
50
+ * With `asChild` the child is the link, so its `href` or `to`, handlers, `ref`
51
+ * and ARIA go on the child; the item adds its look, state and count and
52
+ * nothing else, as `Button asChild` does.
53
+ */
54
+ type NavListItemAsChildProps = NavListItemOwnProps & {
55
+ /** Render the single child element, a router's link, as the item's link. */
56
+ asChild: true;
57
+ /**
58
+ * The one link element. Its own children become the label. A component
59
+ * works if it passes `className`, `style` and `children` on to the element
60
+ * it renders, as a router's link does.
61
+ */
62
+ children: ReactElement<{
63
+ className?: string;
64
+ style?: CSSProperties;
65
+ children?: ReactNode;
66
+ }>;
67
+ /** Extra class names appended to the link's. */
68
+ className?: string;
69
+ };
70
+ export type NavListItemProps = NavListItemAsLinkProps | NavListItemAsChildProps;
71
+ /**
72
+ * One destination in a `NavList`: a list item holding a link.
73
+ *
74
+ * Renders an `a`; for a router's link, pass `asChild` and the link as the
75
+ * only child, which keeps its own `to` and behaviour while taking the item's
76
+ * class, state and count
77
+ * (`<NavListItem asChild current><Link to="/mail">Inbox</Link></NavListItem>`).
78
+ * A link that marks itself `aria-current="page"` is drawn current too, since
79
+ * the look follows the attribute.
80
+ */
81
+ export declare function NavListItem(props: NavListItemProps): import("react/jsx-runtime").JSX.Element;
82
+ export {};
83
+ //# sourceMappingURL=nav-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nav-list.d.ts","sourceRoot":"","sources":["../../src/nav-list/nav-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAIlB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC;IACrE,yFAAyF;IACzF,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,sBAAsB;IACtB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,2CAc1F;AAED;;;;GAIG;AACH,KAAK,gBAAgB,GACjB;IACE,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;CACpB,GACD;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,UAAU,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAElD,KAAK,mBAAmB,GAAG,gBAAgB,GAAG;IAC5C,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,sBAAsB,GAAG,mBAAmB,GAC/C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAElE;;;;GAIG;AACH,KAAK,uBAAuB,GAAG,mBAAmB,GAAG;IACnD,4EAA4E;IAC5E,OAAO,EAAE,IAAI,CAAC;IACd;;;;OAIG;IACH,QAAQ,EAAE,YAAY,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,aAAa,CAAC;QAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAC5F,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GAAG,uBAAuB,CAAC;AAkFhF;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAMlD"}
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { cloneElement, Fragment, isValidElement, } from 'react';
3
+ import './nav-list.css';
4
+ import { cx } from '../cx';
5
+ import { VisuallyHidden } from '../visually-hidden/visually-hidden';
6
+ /**
7
+ * A list of links to the places a section of an app holds, with the current
8
+ * one marked: the folders of a mailbox, the pages of a settings area.
9
+ *
10
+ * Renders a `nav` landmark around a list. Each `NavListItem` is a link; the
11
+ * current one carries `aria-current="page"`, an edge and text in the
12
+ * product's accent. For links that switch a panel in place rather than
13
+ * navigate, use `Tabs`.
14
+ */
15
+ export function NavList({ label, inlineBelow, className, children, ...props }) {
16
+ return (_jsx("nav", { "aria-label": label, className: cx('ds-nav-list', inlineBelow && `ds-nav-list--inline-below-${inlineBelow}`, className), ...props, children: _jsx("ul", { className: "ds-nav-list__list", children: children }) }));
17
+ }
18
+ function NavListItemContent({ count, countLabel, children, }) {
19
+ return (_jsxs(_Fragment, { children: [_jsx("span", { className: "ds-nav-list__label", children: children }), count !== undefined && count > 0 ? (_jsxs(_Fragment, { children: [' ', _jsxs("span", { className: "ds-nav-list__count", children: [count, " ", _jsx(VisuallyHidden, { children: countLabel })] })] })) : null] }));
20
+ }
21
+ const indentFor = (depth) => depth > 0 ? { '--_nav-list-depth': depth } : undefined;
22
+ function NavListItemAsChild({ current = false, depth = 0, count, countLabel, className, children, }) {
23
+ if (!isValidElement(children) || children.type === Fragment) {
24
+ throw new Error('NavListItem asChild needs exactly one element as its child, such as <a> or a router link.');
25
+ }
26
+ const indent = indentFor(depth);
27
+ return cloneElement(children, {
28
+ className: cx('ds-nav-list__link', className, children.props.className),
29
+ style: indent ? { ...indent, ...children.props.style } : children.props.style,
30
+ ...(current ? { 'aria-current': 'page' } : {}),
31
+ }, _jsx(NavListItemContent, { count: count, countLabel: countLabel, children: children.props.children }));
32
+ }
33
+ function NavListItemAsLink({ current = false, depth = 0, count, countLabel, className, style, children, asChild: _asChild, ...props }) {
34
+ const indent = indentFor(depth);
35
+ return (_jsx("a", { "aria-current": current ? 'page' : undefined, className: cx('ds-nav-list__link', className), style: indent ? { ...indent, ...style } : style, ...props, children: _jsx(NavListItemContent, { count: count, countLabel: countLabel, children: children }) }));
36
+ }
37
+ /**
38
+ * One destination in a `NavList`: a list item holding a link.
39
+ *
40
+ * Renders an `a`; for a router's link, pass `asChild` and the link as the
41
+ * only child, which keeps its own `to` and behaviour while taking the item's
42
+ * class, state and count
43
+ * (`<NavListItem asChild current><Link to="/mail">Inbox</Link></NavListItem>`).
44
+ * A link that marks itself `aria-current="page"` is drawn current too, since
45
+ * the look follows the attribute.
46
+ */
47
+ export function NavListItem(props) {
48
+ return (_jsx("li", { className: "ds-nav-list__item", children: props.asChild ? _jsx(NavListItemAsChild, { ...props }) : _jsx(NavListItemAsLink, { ...props }) }));
49
+ }
50
+ //# sourceMappingURL=nav-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nav-list.js","sourceRoot":"","sources":["../../src/nav-list/nav-list.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,YAAY,EACZ,QAAQ,EACR,cAAc,GAGf,MAAM,OAAO,CAAC;AACf,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAgBpE;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAgB;IACzF,OAAO,CACL,4BACc,KAAK,EACjB,SAAS,EAAE,EAAE,CACX,aAAa,EACb,WAAW,IAAI,6BAA6B,WAAW,EAAE,EACzD,SAAS,CACV,KACG,KAAK,YAET,aAAI,SAAS,EAAC,mBAAmB,YAAE,QAAQ,GAAM,GAC7C,CACP,CAAC;AACJ,CAAC;AA8CD,SAAS,kBAAkB,CAAC,EAC1B,KAAK,EACL,UAAU,EACV,QAAQ,GAKT;IACC,OAAO,CACL,8BACE,eAAM,SAAS,EAAC,oBAAoB,YAAE,QAAQ,GAAQ,EACrD,KAAK,KAAK,SAAS,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAClC,8BACG,GAAG,EACJ,gBAAM,SAAS,EAAC,oBAAoB,aACjC,KAAK,OAAE,KAAC,cAAc,cAAE,UAAU,GAAkB,IAChD,IACN,CACJ,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAClC,KAAK,G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,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC1C,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,EAC7C,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,KAC3C,KAAK,YAET,KAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,YACrD,QAAQ,GACU,GACnB,CACL,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,OAAO,CACL,aAAI,SAAS,EAAC,mBAAmB,YAC9B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAC,kBAAkB,OAAK,KAAK,GAAI,CAAC,CAAC,CAAC,KAAC,iBAAiB,OAAK,KAAK,GAAI,GAClF,CACN,CAAC;AACJ,CAAC","sourcesContent":["import {\n type ComponentProps,\n type CSSProperties,\n cloneElement,\n Fragment,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport './nav-list.css';\nimport { cx } from '../cx';\nimport type { Breakpoint } from '../layout/layout';\nimport { VisuallyHidden } from '../visually-hidden/visually-hidden';\n\nexport interface NavListProps\n extends Omit<ComponentProps<'nav'>, 'aria-label' | 'aria-labelledby'> {\n /** Names the navigation landmark (\"Mail folders\"). Required: a page can hold several. */\n label: string;\n /**\n * Below this viewport step the items sit in one row that scrolls sideways,\n * for a list that runs down a sidebar on a wide screen and across the top\n * on a narrow one. Depth indents only in the column.\n */\n inlineBelow?: Breakpoint;\n /** `NavListItem`s. */\n children: ReactNode;\n}\n\n/**\n * A list of links to the places a section of an app holds, with the current\n * one marked: the folders of a mailbox, the pages of a settings area.\n *\n * Renders a `nav` landmark around a list. Each `NavListItem` is a link; the\n * current one carries `aria-current=\"page\"`, an edge and text in the\n * product's accent. For links that switch a panel in place rather than\n * navigate, use `Tabs`.\n */\nexport function NavList({ label, inlineBelow, className, children, ...props }: NavListProps) {\n return (\n <nav\n aria-label={label}\n className={cx(\n 'ds-nav-list',\n inlineBelow && `ds-nav-list--inline-below-${inlineBelow}`,\n className,\n )}\n {...props}\n >\n <ul className=\"ds-nav-list__list\">{children}</ul>\n </nav>\n );\n}\n\n/**\n * A count at the end of the item and the noun it counts, which is said after\n * the number but not shown (\"3 unread\"). Together, so a bare number is never\n * announced.\n */\ntype NavListItemCount =\n | {\n /** How many things wait at this destination. Nothing shows for zero. */\n count: number;\n /** The noun the count counts (\"unread\"), said after the number. */\n countLabel: string;\n }\n | { count?: undefined; countLabel?: undefined };\n\ntype NavListItemOwnProps = NavListItemCount & {\n /** The page the reader is on: `aria-current=\"page\"`, the accent edge and text. */\n current?: boolean;\n /** How many steps the item is indented under its parent, from 0. Defaults to 0. */\n depth?: number;\n};\n\ntype NavListItemAsLinkProps = NavListItemOwnProps &\n Omit<ComponentProps<'a'>, 'aria-current'> & { asChild?: false };\n\n/**\n * With `asChild` the child is the link, so its `href` or `to`, handlers, `ref`\n * and ARIA go on the child; the item adds its look, state and count and\n * nothing else, as `Button asChild` does.\n */\ntype NavListItemAsChildProps = NavListItemOwnProps & {\n /** Render the single child element, a router's link, as the item's link. */\n asChild: true;\n /**\n * The one link element. Its own children become the label. A component\n * works if it passes `className`, `style` and `children` on to the element\n * it renders, as a router's link does.\n */\n children: ReactElement<{ className?: string; style?: CSSProperties; children?: ReactNode }>;\n /** Extra class names appended to the link's. */\n className?: string;\n};\n\nexport type NavListItemProps = NavListItemAsLinkProps | NavListItemAsChildProps;\n\nfunction NavListItemContent({\n count,\n countLabel,\n children,\n}: {\n count?: number;\n countLabel?: string;\n children: ReactNode;\n}) {\n return (\n <>\n <span className=\"ds-nav-list__label\">{children}</span>\n {count !== undefined && count > 0 ? (\n <>\n {' '}\n <span className=\"ds-nav-list__count\">\n {count} <VisuallyHidden>{countLabel}</VisuallyHidden>\n </span>\n </>\n ) : null}\n </>\n );\n}\n\nconst indentFor = (depth: number) =>\n depth > 0 ? ({ '--_nav-list-depth': depth } as CSSProperties) : undefined;\n\nfunction NavListItemAsChild({\n current = false,\n depth = 0,\n count,\n countLabel,\n className,\n children,\n}: NavListItemAsChildProps) {\n if (!isValidElement(children) || children.type === Fragment) {\n throw new Error(\n 'NavListItem asChild needs exactly one element as its child, such as <a> or a router link.',\n );\n }\n const indent = indentFor(depth);\n return cloneElement(\n children,\n {\n className: cx('ds-nav-list__link', className, children.props.className),\n style: indent ? { ...indent, ...children.props.style } : children.props.style,\n ...(current ? { 'aria-current': 'page' } : {}),\n },\n <NavListItemContent count={count} countLabel={countLabel}>\n {children.props.children}\n </NavListItemContent>,\n );\n}\n\nfunction NavListItemAsLink({\n current = false,\n depth = 0,\n count,\n countLabel,\n className,\n style,\n children,\n asChild: _asChild,\n ...props\n}: NavListItemAsLinkProps) {\n const indent = indentFor(depth);\n return (\n <a\n aria-current={current ? 'page' : undefined}\n className={cx('ds-nav-list__link', className)}\n style={indent ? { ...indent, ...style } : style}\n {...props}\n >\n <NavListItemContent count={count} countLabel={countLabel}>\n {children}\n </NavListItemContent>\n </a>\n );\n}\n\n/**\n * One destination in a `NavList`: a list item holding a link.\n *\n * Renders an `a`; for a router's link, pass `asChild` and the link as the\n * only child, which keeps its own `to` and behaviour while taking the item's\n * class, state and count\n * (`<NavListItem asChild current><Link to=\"/mail\">Inbox</Link></NavListItem>`).\n * A link that marks itself `aria-current=\"page\"` is drawn current too, since\n * the look follows the attribute.\n */\nexport function NavListItem(props: NavListItemProps) {\n return (\n <li className=\"ds-nav-list__item\">\n {props.asChild ? <NavListItemAsChild {...props} /> : <NavListItemAsLink {...props} />}\n </li>\n );\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export type { StatusDotProps, StatusDotTone } from './status-dot';
2
+ export { StatusDot } from './status-dot';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/status-dot/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { StatusDot } from './status-dot';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/status-dot/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export type { StatusDotProps, StatusDotTone } from './status-dot';\nexport { StatusDot } from './status-dot';\n"]}
@@ -0,0 +1,70 @@
1
+ @layer components {
2
+ /*
3
+ * The tone sets the colour once, as `color`, so the fill and the glow both
4
+ * read `currentColor`. The glow is the tone at 80% under a blur the theme
5
+ * sets; a theme that sets it to zero draws a flat dot.
6
+ */
7
+ .ds-status-dot {
8
+ --_status-dot-glow: 0 0 var(--ds-status-dot-glow-size)
9
+ color-mix(in srgb, currentColor 80%, transparent);
10
+
11
+ position: relative;
12
+ display: inline-block;
13
+ flex-shrink: 0;
14
+ vertical-align: middle;
15
+ width: var(--ds-status-dot-size);
16
+ height: var(--ds-status-dot-size);
17
+ border-radius: 50%;
18
+ background-color: currentColor;
19
+ box-shadow: var(--_status-dot-glow);
20
+
21
+ &.ds-status-dot--success {
22
+ color: var(--ds-status-dot-success-bg);
23
+ }
24
+
25
+ &.ds-status-dot--warning {
26
+ color: var(--ds-status-dot-warning-bg);
27
+ }
28
+
29
+ &.ds-status-dot--danger {
30
+ color: var(--ds-status-dot-danger-bg);
31
+ }
32
+
33
+ &.ds-status-dot--info {
34
+ color: var(--ds-status-dot-info-bg);
35
+ }
36
+
37
+ /* Nothing waiting: a glow would light what is settled. */
38
+ &.ds-status-dot--neutral {
39
+ color: var(--ds-status-dot-neutral-bg);
40
+ box-shadow: none;
41
+ }
42
+
43
+ &.ds-status-dot--pulse {
44
+ animation: ds-status-dot-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
45
+ }
46
+ }
47
+
48
+ @keyframes ds-status-dot-pulse {
49
+ 50% {
50
+ opacity: 50%;
51
+ }
52
+ }
53
+
54
+ @media (prefers-reduced-motion: reduce) {
55
+ .ds-status-dot.ds-status-dot--pulse {
56
+ animation: none;
57
+ }
58
+ }
59
+
60
+ /*
61
+ * Forced colours paint backgrounds as the page, which would erase the dot,
62
+ * but draw borders in the text colour: the dot becomes a border that fills it.
63
+ */
64
+ @media (forced-colors: active) {
65
+ .ds-status-dot {
66
+ box-sizing: border-box;
67
+ border: calc(var(--ds-status-dot-size) / 2) solid currentColor;
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,2 @@
1
+ /* AUTOGENERATED: types for the stylesheet beside it. */
2
+ export {};
@@ -0,0 +1,36 @@
1
+ import type { ComponentProps } from 'react';
2
+ import './status-dot.css';
3
+ /** The status a dot reports, drawn in that status's colour. */
4
+ export type StatusDotTone = 'success' | 'warning' | 'danger' | 'info' | 'neutral';
5
+ export interface StatusDotProps extends Omit<ComponentProps<'span'>, 'children'> {
6
+ /**
7
+ * The status the dot reports. Required: the colour is the dot's whole
8
+ * message, so it is chosen at the call site rather than defaulted.
9
+ */
10
+ tone: StatusDotTone;
11
+ /**
12
+ * What the dot means, in words ("Unread", "Live"). Rendered visually
13
+ * hidden inside the dot, so it joins the name of a link or row the dot
14
+ * sits in; a dot never stands alone.
15
+ */
16
+ label: string;
17
+ /**
18
+ * Breathes slowly, for something live right now (a pipeline that is
19
+ * running). Still under `prefers-reduced-motion: reduce`, where the colour
20
+ * alone carries the state.
21
+ */
22
+ pulse?: boolean;
23
+ }
24
+ /**
25
+ * A small round dot that marks something unread, live or new, beside the
26
+ * text it belongs to.
27
+ *
28
+ * It renders inline, so it sits in a line of text or a row of a list. The
29
+ * colour comes from the status tokens through the `--ds-status-dot-*`
30
+ * contract, and so does a glow in the same colour where a product's theme
31
+ * gives it one; a `neutral` dot never glows. Its `label` is spoken in place of the colour; when the words
32
+ * beside it already say the same thing ("pipeline nominal"), the label still
33
+ * names the dot's own state ("Live").
34
+ */
35
+ export declare function StatusDot({ tone, label, pulse, className, ...props }: StatusDotProps): import("react/jsx-runtime").JSX.Element;
36
+ //# sourceMappingURL=status-dot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-dot.d.ts","sourceRoot":"","sources":["../../src/status-dot/status-dot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,kBAAkB,CAAC;AAI1B,+DAA+D;AAC/D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAElF,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC9E;;;OAGG;IACH,IAAI,EAAE,aAAa,CAAC;IACpB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAa,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,2CAc5F"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import './status-dot.css';
3
+ import { cx } from '../cx';
4
+ import { VisuallyHidden } from '../visually-hidden/visually-hidden';
5
+ /**
6
+ * A small round dot that marks something unread, live or new, beside the
7
+ * text it belongs to.
8
+ *
9
+ * It renders inline, so it sits in a line of text or a row of a list. The
10
+ * colour comes from the status tokens through the `--ds-status-dot-*`
11
+ * contract, and so does a glow in the same colour where a product's theme
12
+ * gives it one; a `neutral` dot never glows. Its `label` is spoken in place of the colour; when the words
13
+ * beside it already say the same thing ("pipeline nominal"), the label still
14
+ * names the dot's own state ("Live").
15
+ */
16
+ export function StatusDot({ tone, label, pulse = false, className, ...props }) {
17
+ return (_jsx("span", { className: cx('ds-status-dot', `ds-status-dot--${tone}`, pulse && 'ds-status-dot--pulse', className), ...props, children: _jsx(VisuallyHidden, { children: label }) }));
18
+ }
19
+ //# sourceMappingURL=status-dot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-dot.js","sourceRoot":"","sources":["../../src/status-dot/status-dot.tsx"],"names":[],"mappings":";AACA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAyBpE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAkB;IAC3F,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,eAAe,EACf,kBAAkB,IAAI,EAAE,EACxB,KAAK,IAAI,sBAAsB,EAC/B,SAAS,CACV,KACG,KAAK,YAET,KAAC,cAAc,cAAE,KAAK,GAAkB,GACnC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import type { ComponentProps } from 'react';\nimport './status-dot.css';\nimport { cx } from '../cx';\nimport { VisuallyHidden } from '../visually-hidden/visually-hidden';\n\n/** The status a dot reports, drawn in that status's colour. */\nexport type StatusDotTone = 'success' | 'warning' | 'danger' | 'info' | 'neutral';\n\nexport interface StatusDotProps extends Omit<ComponentProps<'span'>, 'children'> {\n /**\n * The status the dot reports. Required: the colour is the dot's whole\n * message, so it is chosen at the call site rather than defaulted.\n */\n tone: StatusDotTone;\n /**\n * What the dot means, in words (\"Unread\", \"Live\"). Rendered visually\n * hidden inside the dot, so it joins the name of a link or row the dot\n * sits in; a dot never stands alone.\n */\n label: string;\n /**\n * Breathes slowly, for something live right now (a pipeline that is\n * running). Still under `prefers-reduced-motion: reduce`, where the colour\n * alone carries the state.\n */\n pulse?: boolean;\n}\n\n/**\n * A small round dot that marks something unread, live or new, beside the\n * text it belongs to.\n *\n * It renders inline, so it sits in a line of text or a row of a list. The\n * colour comes from the status tokens through the `--ds-status-dot-*`\n * contract, and so does a glow in the same colour where a product's theme\n * gives it one; a `neutral` dot never glows. Its `label` is spoken in place of the colour; when the words\n * beside it already say the same thing (\"pipeline nominal\"), the label still\n * names the dot's own state (\"Live\").\n */\nexport function StatusDot({ tone, label, pulse = false, className, ...props }: StatusDotProps) {\n return (\n <span\n className={cx(\n 'ds-status-dot',\n `ds-status-dot--${tone}`,\n pulse && 'ds-status-dot--pulse',\n className,\n )}\n {...props}\n >\n <VisuallyHidden>{label}</VisuallyHidden>\n </span>\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manakind/ui-core",
3
- "version": "0.34.1",
3
+ "version": "0.35.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -112,6 +112,10 @@
112
112
  "types": "./dist/menu/index.d.ts",
113
113
  "import": "./dist/menu/index.js"
114
114
  },
115
+ "./nav-list": {
116
+ "types": "./dist/nav-list/index.d.ts",
117
+ "import": "./dist/nav-list/index.js"
118
+ },
115
119
  "./page-layout": {
116
120
  "types": "./dist/page-layout/index.d.ts",
117
121
  "import": "./dist/page-layout/index.js"
@@ -168,6 +172,10 @@
168
172
  "types": "./dist/split-layout/index.d.ts",
169
173
  "import": "./dist/split-layout/index.js"
170
174
  },
175
+ "./status-dot": {
176
+ "types": "./dist/status-dot/index.d.ts",
177
+ "import": "./dist/status-dot/index.js"
178
+ },
171
179
  "./sticky": {
172
180
  "types": "./dist/sticky/index.d.ts",
173
181
  "import": "./dist/sticky/index.js"
@@ -284,6 +292,10 @@
284
292
  "types": "./dist/menu/menu.css.d.ts",
285
293
  "default": "./dist/menu/menu.css"
286
294
  },
295
+ "./css/nav-list": {
296
+ "types": "./dist/nav-list/nav-list.css.d.ts",
297
+ "default": "./dist/nav-list/nav-list.css"
298
+ },
287
299
  "./css/page-layout": {
288
300
  "types": "./dist/page-layout/page-layout.css.d.ts",
289
301
  "default": "./dist/page-layout/page-layout.css"
@@ -340,6 +352,10 @@
340
352
  "types": "./dist/split-layout/split-layout.css.d.ts",
341
353
  "default": "./dist/split-layout/split-layout.css"
342
354
  },
355
+ "./css/status-dot": {
356
+ "types": "./dist/status-dot/status-dot.css.d.ts",
357
+ "default": "./dist/status-dot/status-dot.css"
358
+ },
343
359
  "./css/sticky": {
344
360
  "types": "./dist/sticky/sticky.css.d.ts",
345
361
  "default": "./dist/sticky/sticky.css"
@@ -396,7 +412,7 @@
396
412
  },
397
413
  "devDependencies": {
398
414
  "@manakind/ds-config": "*",
399
- "@manakind/manuia-tokens": "0.32.0",
415
+ "@manakind/manuia-tokens": "0.33.0",
400
416
  "@testing-library/jest-dom": "^6.9.1",
401
417
  "@testing-library/react": "^16.3.2",
402
418
  "@testing-library/user-event": "^14.6.1",