@manakind/manuia-ui 0.17.0 → 0.18.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.
- package/dist/action-item/action-item.css +26 -0
- package/dist/action-item/action-item.d.ts +13 -4
- package/dist/action-item/action-item.d.ts.map +1 -1
- package/dist/action-item/action-item.js +8 -5
- package/dist/action-item/action-item.js.map +1 -1
- package/dist/focus-item/focus-item.css +26 -0
- package/dist/focus-item/focus-item.d.ts +13 -4
- package/dist/focus-item/focus-item.d.ts.map +1 -1
- package/dist/focus-item/focus-item.js +6 -3
- package/dist/focus-item/focus-item.js.map +1 -1
- package/package.json +3 -3
|
@@ -196,5 +196,31 @@
|
|
|
196
196
|
align-self: center;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
+
|
|
200
|
+
/*
|
|
201
|
+
* The product's placing controls stand before the card, centred against
|
|
202
|
+
* it, with a message passed as children kept under the card. The card
|
|
203
|
+
* becomes the container the narrow layout measures, so the row collapses
|
|
204
|
+
* by the width inside the card (its padding excluded) rather than by the
|
|
205
|
+
* whole row, controls included.
|
|
206
|
+
*/
|
|
207
|
+
&:has(> .mui-action-item__leading) {
|
|
208
|
+
container-type: normal;
|
|
209
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
210
|
+
column-gap: var(--semantic-space-gap);
|
|
211
|
+
|
|
212
|
+
& > :not(.mui-action-item__leading) {
|
|
213
|
+
grid-column: 2;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
& > .mui-action-item__card {
|
|
217
|
+
container: mui-action-item / inline-size;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
& > .mui-action-item__leading {
|
|
222
|
+
grid-row: 1;
|
|
223
|
+
align-self: center;
|
|
224
|
+
}
|
|
199
225
|
}
|
|
200
226
|
}
|
|
@@ -72,6 +72,12 @@ export interface ActionItemProps extends Omit<ComponentProps<'li'>, 'title' | 'c
|
|
|
72
72
|
* schedules the action, a delete button for a stale one. Rendered as given.
|
|
73
73
|
*/
|
|
74
74
|
secondary?: ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* The product's controls that place this row in its list, set before the
|
|
77
|
+
* card and outside it: a vertical `ReorderControl`, say. Kept out of the card, so a
|
|
78
|
+
* list that shows the same action unordered doesn't carry them.
|
|
79
|
+
*/
|
|
80
|
+
leading?: ReactNode;
|
|
75
81
|
/** Heading level for the title. Defaults to `h3`; match the surrounding outline. */
|
|
76
82
|
titleAs?: 'h2' | 'h3' | 'h4';
|
|
77
83
|
/** Extra class names on the `<li>`. */
|
|
@@ -98,9 +104,12 @@ export interface ActionItemProps extends Omit<ComponentProps<'li'>, 'title' | 'c
|
|
|
98
104
|
* Wide, the row reads left to right. Narrow, the toggle, the title and the
|
|
99
105
|
* checkbox share the first line; the details and categories follow, lined up
|
|
100
106
|
* under the title, and the second line and the controls share a footer
|
|
101
|
-
* across the full width.
|
|
102
|
-
*
|
|
103
|
-
*
|
|
107
|
+
* across the full width. With `leading`, the product's placing controls stand before the
|
|
108
|
+
* card, centred against it, and a message passed as children stays under
|
|
109
|
+
* the card. Attributes other than the props land on the `<li>`: a
|
|
110
|
+
* virtualised list gives each row `aria-setsize` and `aria-posinset`, so the
|
|
111
|
+
* count a screen reader hears is the whole list's, and a sortable list
|
|
112
|
+
* passes its drag library's ref and transform style.
|
|
104
113
|
*/
|
|
105
|
-
export declare function ActionItem({ title, completed, onCompletedChange, completeIcon, priority, details, categories, maxVisibleCategories, note, noteTone, selected, onSelectedChange, controls, secondary, titleAs, className, children, ...listItemProps }: ActionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
export declare function ActionItem({ title, completed, onCompletedChange, completeIcon, priority, details, categories, maxVisibleCategories, note, noteTone, selected, onSelectedChange, controls, secondary, leading, titleAs, className, children, ...listItemProps }: ActionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
106
115
|
//# sourceMappingURL=action-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|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AS,CAAC;IACpB,oFAAoF;IACpF,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7B,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,OAAY,EACZ,UAAe,EACf,oBAAwB,EACxB,IAAI,EACJ,QAAkB,EAClB,QAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,OAAO,EACP,OAAc,EACd,SAAS,EACT,QAAQ,EACR,GAAG,aAAa,EACjB,EAAE,eAAe,2CAyGjB"}
|
|
@@ -17,11 +17,14 @@ import './action-item.css';
|
|
|
17
17
|
* Wide, the row reads left to right. Narrow, the toggle, the title and the
|
|
18
18
|
* checkbox share the first line; the details and categories follow, lined up
|
|
19
19
|
* under the title, and the second line and the controls share a footer
|
|
20
|
-
* across the full width.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* across the full width. With `leading`, the product's placing controls stand before the
|
|
21
|
+
* card, centred against it, and a message passed as children stays under
|
|
22
|
+
* the card. Attributes other than the props land on the `<li>`: a
|
|
23
|
+
* virtualised list gives each row `aria-setsize` and `aria-posinset`, so the
|
|
24
|
+
* count a screen reader hears is the whole list's, and a sortable list
|
|
25
|
+
* passes its drag library's ref and transform style.
|
|
23
26
|
*/
|
|
24
|
-
export function ActionItem({ title, completed, onCompletedChange, completeIcon, priority, details = [], categories = [], maxVisibleCategories = 2, note, noteTone = 'muted', selected = false, onSelectedChange, controls, secondary, titleAs = 'h3', className, children, ...listItemProps }) {
|
|
27
|
+
export function ActionItem({ title, completed, onCompletedChange, completeIcon, priority, details = [], categories = [], maxVisibleCategories = 2, note, noteTone = 'muted', selected = false, onSelectedChange, controls, secondary, leading, titleAs = 'h3', className, children, ...listItemProps }) {
|
|
25
28
|
const selectable = onSelectedChange !== undefined;
|
|
26
29
|
const toggle = completeIcon && onCompletedChange ? (_jsx(IconButton, { className: "mui-action-item__complete", variant: completed ? 'primary' : 'secondary', size: "md", icon: completeIcon, "aria-pressed": completed, "aria-label": `Complete ${title}`, onClick: () => onCompletedChange(!completed) })) : null;
|
|
27
30
|
/*
|
|
@@ -37,6 +40,6 @@ export function ActionItem({ title, completed, onCompletedChange, completeIcon,
|
|
|
37
40
|
});
|
|
38
41
|
const priorityDetail = priority ? (_jsxs("span", { className: cx('mui-action-item__detail', 'mui-action-item__priority', `mui-action-item__priority--${priority.level}`), children: [priority.icon && (_jsx(Icon, { source: priority.icon, size: "sm", decorative: true, className: "mui-action-item__priority-icon" })), priority.label] })) : null;
|
|
39
42
|
const detailList = priority || details.length > 0 || note ? (_jsxs("p", { className: "mui-action-item__details", children: [priorityDetail, detailRows, note && (_jsx(Badge, { variant: noteTone, className: "mui-action-item__note", children: note }))] })) : null;
|
|
40
|
-
return (_jsxs("li", { ...listItemProps, className: cx('mui-action-item', completed && 'mui-action-item--completed', selectable && selected && 'mui-action-item--selected', className), children: [_jsx(Card, { className: "mui-action-item__card", children: _jsxs("div", { className: "mui-action-item__row", children: [toggle, _jsxs("div", { className: "mui-action-item__main", children: [_jsx(CardTitle, { as: titleAs, className: "mui-action-item__title", children: title }), detailList, _jsx(GoalCategories, { className: "mui-action-item__categories", categories: categories, maxVisible: maxVisibleCategories }), secondary && _jsx("div", { className: "mui-action-item__secondary", children: secondary })] }), controls && _jsx("div", { className: "mui-action-item__controls", children: controls }), selectable && (_jsx(Checkbox, { className: "mui-action-item__select", "aria-label": `Select ${title}`, checked: selected, onCheckedChange: onSelectedChange }))] }) }), children] }));
|
|
43
|
+
return (_jsxs("li", { ...listItemProps, className: cx('mui-action-item', completed && 'mui-action-item--completed', selectable && selected && 'mui-action-item--selected', className), children: [leading && _jsx("div", { className: "mui-action-item__leading", children: leading }), _jsx(Card, { className: "mui-action-item__card", children: _jsxs("div", { className: "mui-action-item__row", children: [toggle, _jsxs("div", { className: "mui-action-item__main", children: [_jsx(CardTitle, { as: titleAs, className: "mui-action-item__title", children: title }), detailList, _jsx(GoalCategories, { className: "mui-action-item__categories", categories: categories, maxVisible: maxVisibleCategories }), secondary && _jsx("div", { className: "mui-action-item__secondary", children: secondary })] }), controls && _jsx("div", { className: "mui-action-item__controls", children: controls }), selectable && (_jsx(Checkbox, { className: "mui-action-item__select", "aria-label": `Select ${title}`, checked: selected, onCheckedChange: onSelectedChange }))] }) }), children] }));
|
|
41
44
|
}
|
|
42
45
|
//# sourceMappingURL=action-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-item.js","sourceRoot":"","sources":["../../src/action-item/action-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,EAEL,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,EAAE,EACF,IAAI,EACJ,UAAU,GAEX,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AACvE,OAAO,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"action-item.js","sourceRoot":"","sources":["../../src/action-item/action-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,EAEL,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,EAAE,EACF,IAAI,EACJ,UAAU,GAEX,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AACvE,OAAO,mBAAmB,CAAC;AA+F3B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,OAAO,GAAG,EAAE,EACZ,UAAU,GAAG,EAAE,EACf,oBAAoB,GAAG,CAAC,EACxB,IAAI,EACJ,QAAQ,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AAS,EAAC,2BAA2B,YAAE,QAAQ,GAAO,EACvE,UAAU,IAAI,CACb,KAAC,QAAQ,IACP,SAAS,EAAC,yBAAyB,gBACvB,UAAU,KAAK,EAAE,EAC7B,OAAO,EAAE,QAAQ,EACjB,eAAe,EAAE,gBAAgB,GACjC,CACH,IACG,GACD,EACN,QAAQ,IACN,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -154,5 +154,31 @@
|
|
|
154
154
|
justify-self: end;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
+
|
|
158
|
+
/*
|
|
159
|
+
* The product's placing controls stand before the card, centred against
|
|
160
|
+
* it, with a message passed as children kept under the card. The card
|
|
161
|
+
* becomes the container the narrow layout measures, so the row collapses
|
|
162
|
+
* by the width inside the card (its padding excluded) rather than by the
|
|
163
|
+
* whole row, controls included.
|
|
164
|
+
*/
|
|
165
|
+
&:has(> .mui-focus-item__leading) {
|
|
166
|
+
container-type: normal;
|
|
167
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
168
|
+
column-gap: var(--semantic-space-gap);
|
|
169
|
+
|
|
170
|
+
& > :not(.mui-focus-item__leading) {
|
|
171
|
+
grid-column: 2;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
& > .mui-focus-item__card {
|
|
175
|
+
container: mui-focus-item / inline-size;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
& > .mui-focus-item__leading {
|
|
180
|
+
grid-row: 1;
|
|
181
|
+
align-self: center;
|
|
182
|
+
}
|
|
157
183
|
}
|
|
158
184
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IconSource } from '@manakind/ui-core';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
3
3
|
import { type GoalCategory } from '../goal-categories';
|
|
4
4
|
import './focus-item.css';
|
|
5
5
|
/** What a focus row holds: a single action, or an outcome that groups actions. */
|
|
@@ -11,7 +11,7 @@ export interface FocusItemAction {
|
|
|
11
11
|
/** The action's description. */
|
|
12
12
|
title: string;
|
|
13
13
|
}
|
|
14
|
-
export interface FocusItemProps {
|
|
14
|
+
export interface FocusItemProps extends Omit<ComponentProps<'li'>, 'title' | 'children' | 'className'> {
|
|
15
15
|
/** Whether the row is an action or an outcome. Shown as text beside `kindIcon`. */
|
|
16
16
|
kind: FocusItemKind;
|
|
17
17
|
/** The action's description or the outcome. Rendered as the row's heading. */
|
|
@@ -47,6 +47,12 @@ export interface FocusItemProps {
|
|
|
47
47
|
* toggle: an edit button. They render as given; the row only places them.
|
|
48
48
|
*/
|
|
49
49
|
controls?: ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* The product's controls that place this item in its list, set before the
|
|
52
|
+
* card and outside it: a vertical `ReorderControl`, say. Kept out of the card, so a
|
|
53
|
+
* list that shows the same item unordered doesn't carry them.
|
|
54
|
+
*/
|
|
55
|
+
leading?: ReactNode;
|
|
50
56
|
/** Heading level for the title. Defaults to `h3`; match the surrounding outline. */
|
|
51
57
|
titleAs?: 'h2' | 'h3' | 'h4';
|
|
52
58
|
/** Extra class names on the `<li>`. */
|
|
@@ -73,7 +79,10 @@ export interface FocusItemProps {
|
|
|
73
79
|
* then categories, then the toggle and the product's controls. Narrow, only
|
|
74
80
|
* the title shares a line with the toggle; the details, actions and
|
|
75
81
|
* categories take the full width below, and the controls close the row at
|
|
76
|
-
* its end.
|
|
82
|
+
* its end. With `leading`, the product's placing controls stand before the card, centred
|
|
83
|
+
* against it, and a message passed as children stays under the card.
|
|
84
|
+
* Attributes other than the props land on the `<li>`: a sortable list
|
|
85
|
+
* passes its drag library's ref and transform style there.
|
|
77
86
|
*/
|
|
78
|
-
export declare function FocusItem({ kind, title, kindIcon, details, categories, actions, focused, onFocusedChange, focusIcon, focusedIcon, controls, titleAs, className, children, }: FocusItemProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
export declare function FocusItem({ kind, title, kindIcon, details, categories, actions, focused, onFocusedChange, focusIcon, focusedIcon, controls, leading, titleAs, className, children, ...listItemProps }: FocusItemProps): import("react/jsx-runtime").JSX.Element;
|
|
79
88
|
//# sourceMappingURL=focus-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-item.d.ts","sourceRoot":"","sources":["../../src/focus-item/focus-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"focus-item.d.ts","sourceRoot":"","sources":["../../src/focus-item/focus-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,kBAAkB,CAAC;AAE1B,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEjD,+CAA+C;AAC/C,MAAM,WAAW,eAAe;IAC9B,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf;AAOD,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;IACtE,mFAAmF;IACnF,IAAI,EAAE,aAAa,CAAC;IACpB,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,sDAAsD;IACtD,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,sEAAsE;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,wFAAwF;IACxF,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,oFAAoF;IACpF,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7B,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,OAAY,EACZ,UAAe,EACf,OAAY,EACZ,OAAO,EACP,eAAe,EACf,SAAS,EACT,WAAuB,EACvB,QAAQ,EACR,OAAO,EACP,OAAc,EACd,SAAS,EACT,QAAQ,EACR,GAAG,aAAa,EACjB,EAAE,cAAc,2CAkEhB"}
|
|
@@ -22,15 +22,18 @@ const KIND_LABELS = {
|
|
|
22
22
|
* then categories, then the toggle and the product's controls. Narrow, only
|
|
23
23
|
* the title shares a line with the toggle; the details, actions and
|
|
24
24
|
* categories take the full width below, and the controls close the row at
|
|
25
|
-
* its end.
|
|
25
|
+
* its end. With `leading`, the product's placing controls stand before the card, centred
|
|
26
|
+
* against it, and a message passed as children stays under the card.
|
|
27
|
+
* Attributes other than the props land on the `<li>`: a sortable list
|
|
28
|
+
* passes its drag library's ref and transform style there.
|
|
26
29
|
*/
|
|
27
|
-
export function FocusItem({ kind, title, kindIcon, details = [], categories = [], actions = [], focused, onFocusedChange, focusIcon, focusedIcon = focusIcon, controls, titleAs = 'h3', className, children, }) {
|
|
30
|
+
export function FocusItem({ kind, title, kindIcon, details = [], categories = [], actions = [], focused, onFocusedChange, focusIcon, focusedIcon = focusIcon, controls, leading, titleAs = 'h3', className, children, ...listItemProps }) {
|
|
28
31
|
const isOutcome = kind === 'outcome';
|
|
29
32
|
const actionCount = `${actions.length} open ${actions.length === 1 ? 'action' : 'actions'}`;
|
|
30
33
|
const facts = [...new Set(isOutcome ? [actionCount, ...details] : details)];
|
|
31
34
|
const handleToggle = () => onFocusedChange?.(!focused);
|
|
32
35
|
const actionList = isOutcome && actions.length > 0 ? (_jsx("ul", { className: "mui-focus-item__actions", "aria-label": `Open actions for ${title}`, children: actions.map((action) => (_jsx("li", { className: "mui-focus-item__action", children: action.title }, action.id))) })) : null;
|
|
33
36
|
const toggle = onFocusedChange ? (_jsx(Button, { className: "mui-focus-item__toggle", variant: focused ? 'primary' : 'secondary', size: "sm", leadingIcon: focused ? focusedIcon : focusIcon, "aria-pressed": focused, "aria-label": `Focus ${title}`, onClick: handleToggle, children: "Focus" })) : null;
|
|
34
|
-
return (_jsxs("li", { className: cx('mui-focus-item', className), children: [_jsx(Card, { className: "mui-focus-item__card", children: _jsxs("div", { className: "mui-focus-item__row", children: [_jsxs("div", { className: "mui-focus-item__main", children: [_jsx(CardTitle, { as: titleAs, className: "mui-focus-item__title", children: title }), _jsxs("p", { className: "mui-focus-item__details", children: [_jsxs("span", { className: "mui-focus-item__kind", children: [kindIcon && _jsx(Icon, { source: kindIcon, size: "sm", decorative: true }), KIND_LABELS[kind]] }), facts.map((fact) => (_jsx("span", { className: "mui-focus-item__detail", children: fact }, fact)))] }), actionList] }), _jsx(GoalCategories, { className: "mui-focus-item__categories", categories: categories }), toggle, controls && _jsx("div", { className: "mui-focus-item__controls", children: controls })] }) }), children] }));
|
|
37
|
+
return (_jsxs("li", { ...listItemProps, className: cx('mui-focus-item', className), children: [leading && _jsx("div", { className: "mui-focus-item__leading", children: leading }), _jsx(Card, { className: "mui-focus-item__card", children: _jsxs("div", { className: "mui-focus-item__row", children: [_jsxs("div", { className: "mui-focus-item__main", children: [_jsx(CardTitle, { as: titleAs, className: "mui-focus-item__title", children: title }), _jsxs("p", { className: "mui-focus-item__details", children: [_jsxs("span", { className: "mui-focus-item__kind", children: [kindIcon && _jsx(Icon, { source: kindIcon, size: "sm", decorative: true }), KIND_LABELS[kind]] }), facts.map((fact) => (_jsx("span", { className: "mui-focus-item__detail", children: fact }, fact)))] }), actionList] }), _jsx(GoalCategories, { className: "mui-focus-item__categories", categories: categories }), toggle, controls && _jsx("div", { className: "mui-focus-item__controls", children: controls })] }) }), children] }));
|
|
35
38
|
}
|
|
36
39
|
//# sourceMappingURL=focus-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-item.js","sourceRoot":"","sources":["../../src/focus-item/focus-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAmB,MAAM,mBAAmB,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AACvE,OAAO,kBAAkB,CAAC;AAa1B,MAAM,WAAW,GAAkC;IACjD,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"focus-item.js","sourceRoot":"","sources":["../../src/focus-item/focus-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAmB,MAAM,mBAAmB,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AACvE,OAAO,kBAAkB,CAAC;AAa1B,MAAM,WAAW,GAAkC;IACjD,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACnB,CAAC;AAwDF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAA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
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"vr": "playwright test"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@manakind/manuia-tokens": "0.
|
|
41
|
-
"@manakind/ui-core": "0.
|
|
40
|
+
"@manakind/manuia-tokens": "0.17.0",
|
|
41
|
+
"@manakind/ui-core": "0.17.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": "^19.0.0",
|