@mastra/playground-ui 70.0.0-alpha.7 → 70.0.1-alpha.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/dist/{Section-Dk_Vcsi7.cjs → Section-BdO9TFjY.cjs} +2 -2
- package/dist/{Section-Dk_Vcsi7.cjs.map → Section-BdO9TFjY.cjs.map} +1 -1
- package/dist/{Section-D6JJ926q.js → Section-DV2aLnkc.js} +2 -2
- package/dist/{Section-D6JJ926q.js.map → Section-DV2aLnkc.js.map} +1 -1
- package/dist/components/Section.cjs.js +1 -1
- package/dist/components/Section.es.js +1 -1
- package/dist/components/SideDialog.cjs.js +1 -1
- package/dist/components/SideDialog.es.js +1 -1
- package/dist/domains/datasets/components/add-dataset-item-dialog/add-dataset-item-dialog.cjs.js +1 -1
- package/dist/domains/datasets/components/add-dataset-item-dialog/add-dataset-item-dialog.es.js +1 -1
- package/dist/domains/datasets/components/add-dataset-item-dialog/collapsible-settings-row.cjs.js +1 -1
- package/dist/domains/datasets/components/add-dataset-item-dialog/collapsible-settings-row.es.js +1 -1
- package/dist/domains/knowledge/components/KnowledgePageDetail.cjs.js +99 -58
- package/dist/domains/knowledge/components/KnowledgePageDetail.cjs.js.map +1 -1
- package/dist/domains/knowledge/components/KnowledgePageDetail.es.js +99 -58
- package/dist/domains/knowledge/components/KnowledgePageDetail.es.js.map +1 -1
- package/dist/domains/knowledge/components/KnowledgePageExplorer.cjs.js +21 -0
- package/dist/domains/knowledge/components/KnowledgePageExplorer.cjs.js.map +1 -1
- package/dist/domains/knowledge/components/KnowledgePageExplorer.es.js +21 -0
- package/dist/domains/knowledge/components/KnowledgePageExplorer.es.js.map +1 -1
- package/dist/domains/knowledge/components/KnowledgePageTree.cjs.js +1 -1
- package/dist/domains/knowledge/components/KnowledgePageTree.cjs.js.map +1 -1
- package/dist/domains/knowledge/components/KnowledgePageTree.es.js +2 -2
- package/dist/domains/knowledge/components/KnowledgePageTree.es.js.map +1 -1
- package/dist/domains/knowledge/lib/pageAddress.cjs.js +21 -6
- package/dist/domains/knowledge/lib/pageAddress.cjs.js.map +1 -1
- package/dist/domains/knowledge/lib/pageAddress.es.js +21 -6
- package/dist/domains/knowledge/lib/pageAddress.es.js.map +1 -1
- package/dist/domains/mcps/components/mcp-app-viewer.cjs.js +1 -1
- package/dist/domains/mcps/components/mcp-app-viewer.es.js +1 -1
- package/dist/domains/mcps/hooks/use-mcp-app-tool-call.cjs.js +1 -1
- package/dist/domains/mcps/hooks/use-mcp-app-tool-call.es.js +1 -1
- package/dist/new/settings.cjs.js +2 -2
- package/dist/new/settings.es.js +2 -2
- package/dist/{settings-DIrzLcgE.js → settings-B7RMGKgf.js} +31 -15
- package/dist/settings-B7RMGKgf.js.map +1 -0
- package/dist/{settings-5PdsNlhV.cjs → settings-CYKWxfrJ.cjs} +31 -15
- package/dist/settings-CYKWxfrJ.cjs.map +1 -0
- package/dist/{settings-row-C2HTuwjN.js → settings-row-BnlFZSQL.js} +27 -5
- package/dist/settings-row-BnlFZSQL.js.map +1 -0
- package/dist/{settings-row-Dfi4pLnl.cjs → settings-row-Da1HHyBg.cjs} +27 -5
- package/dist/settings-row-Da1HHyBg.cjs.map +1 -0
- package/dist/src/domains/knowledge/components/KnowledgePageDetail.d.ts +11 -1
- package/dist/src/domains/knowledge/lib/pageAddress.d.ts +4 -2
- package/dist/src/ds/new/settings/settings-list.d.ts +16 -2
- package/dist/src/ds/new/settings/settings-row.d.ts +22 -2
- package/dist/style.css +32 -0
- package/dist/{types-DT1pgDom.cjs → types-CVS7iNs8.cjs} +2 -2
- package/dist/{types-DT1pgDom.cjs.map → types-CVS7iNs8.cjs.map} +1 -1
- package/dist/{types-Dl74jixe.js → types-D64dArGX.js} +2 -2
- package/dist/{types-Dl74jixe.js.map → types-D64dArGX.js.map} +1 -1
- package/package.json +9 -9
- package/dist/settings-5PdsNlhV.cjs.map +0 -1
- package/dist/settings-DIrzLcgE.js.map +0 -1
- package/dist/settings-row-C2HTuwjN.js.map +0 -1
- package/dist/settings-row-Dfi4pLnl.cjs.map +0 -1
|
@@ -2,7 +2,7 @@ const require_primitives_raised_surface = require("./primitives/raised-surface.c
|
|
|
2
2
|
const require_utils = require("./utils-uDc1ofX1.cjs");
|
|
3
3
|
const require_tooltip = require("./tooltip-BsExuMO8.cjs");
|
|
4
4
|
const require_Txt = require("./Txt-_00wWxTd.cjs");
|
|
5
|
-
const require_settings_row = require("./settings-row-
|
|
5
|
+
const require_settings_row = require("./settings-row-Da1HHyBg.cjs");
|
|
6
6
|
const require_skeleton_text = require("./skeleton-text-Bi4d2-D8.cjs");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -23,6 +23,7 @@ function SettingsContainer({ className, ...props }) {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
// src/ds/new/settings/settings-header.tsx
|
|
26
|
+
var settingsInset = "[--settings-inset:0px] in-data-[slot=settings-layout]:[--settings-inset:--spacing(2.5)] ps-(--settings-inset)";
|
|
26
27
|
var SettingsTitleIdContext = (0, react.createContext)(void 0);
|
|
27
28
|
/** One section of a settings page: a `SettingsTitle` (or `SettingsHeader`) above its `SettingsContainer`. */
|
|
28
29
|
function SettingsGroup({ className, ...props }) {
|
|
@@ -53,12 +54,12 @@ function SettingsHeader({ action, children, className, ...props }) {
|
|
|
53
54
|
function SettingsTitle({ accessory, info, className, children, ...props }) {
|
|
54
55
|
const titleId = (0, react.useContext)(SettingsTitleIdContext);
|
|
55
56
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
56
|
-
className: "flex min-w-0 flex-wrap items-center gap-2
|
|
57
|
+
className: require_utils.cn("flex min-w-0 flex-wrap items-center gap-2", settingsInset),
|
|
57
58
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Txt.Txt, {
|
|
58
59
|
as: "h2",
|
|
59
60
|
id: titleId,
|
|
60
61
|
variant: "subheading",
|
|
61
|
-
tone: "
|
|
62
|
+
tone: "ink",
|
|
62
63
|
className,
|
|
63
64
|
...props,
|
|
64
65
|
children: info == null ? children : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsTitleInfo, {
|
|
@@ -90,18 +91,21 @@ function SettingsDescription({ className, ...props }) {
|
|
|
90
91
|
as: "p",
|
|
91
92
|
variant: "caption",
|
|
92
93
|
tone: "muted",
|
|
93
|
-
className: require_utils.cn(
|
|
94
|
+
className: require_utils.cn(settingsInset, className),
|
|
94
95
|
...props
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
98
|
// src/ds/new/settings/settings-list.tsx
|
|
98
|
-
/**
|
|
99
|
-
|
|
99
|
+
/**
|
|
100
|
+
* A list's first row: its count, caption or empty text on the left and its one action ("Add account", "Invite
|
|
101
|
+
* member") on the right. A full list and an empty one share this exact look, so the card reads the same either way.
|
|
102
|
+
*/
|
|
103
|
+
function SettingsListBar({ action, className, children, ...props }) {
|
|
100
104
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
101
|
-
className: require_utils.cn("flex min-h-8 items-center justify-between gap-3", className),
|
|
105
|
+
className: require_utils.cn("flex min-h-8 items-center justify-between gap-3 sm:min-h-[calc(var(--text-label)*1.5+1px+var(--text-caption)*1.5+--spacing(6.5))]", className),
|
|
102
106
|
...props,
|
|
103
107
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
104
|
-
className:
|
|
108
|
+
className: "min-w-0 truncate text-label text-foreground",
|
|
105
109
|
children
|
|
106
110
|
}), action != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
107
111
|
className: "flex shrink-0 items-center gap-2",
|
|
@@ -113,15 +117,16 @@ function SettingsListBar({ tone, action, className, children, ...props }) {
|
|
|
113
117
|
function SettingsListHeader(props) {
|
|
114
118
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsListBar, {
|
|
115
119
|
"data-slot": "settings-list-header",
|
|
116
|
-
tone: "title",
|
|
117
120
|
...props
|
|
118
121
|
});
|
|
119
122
|
}
|
|
120
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* An empty list's only row: what's missing on the left ("No join links"), the list's action on the right. Looks
|
|
125
|
+
* exactly like `SettingsListHeader`, so empty and full lists match; use it for every empty list in a card.
|
|
126
|
+
*/
|
|
121
127
|
function SettingsEmptyRow(props) {
|
|
122
128
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsListBar, {
|
|
123
129
|
"data-slot": "settings-empty-row",
|
|
124
|
-
tone: "muted",
|
|
125
130
|
...props
|
|
126
131
|
});
|
|
127
132
|
}
|
|
@@ -143,11 +148,22 @@ function SettingsItemIcon({ className, ...props }) {
|
|
|
143
148
|
...props
|
|
144
149
|
});
|
|
145
150
|
}
|
|
146
|
-
/**
|
|
151
|
+
/**
|
|
152
|
+
* One thing in a settings list (an account, a member, a session, a source, a package version). Its right side holds
|
|
153
|
+
* the item's status or its own actions (Remove, Revoke, Copy), not a control that changes a setting. Goes in a
|
|
154
|
+
* `SettingsContainer`, usually under a `SettingsListHeader`.
|
|
155
|
+
*
|
|
156
|
+
* For a setting the person changes (an input, select or switch with a label), use `SettingsRow` instead.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* <SettingsItem media={<Avatar size="md" … />} title="Ada Lovelace" description="ada@example.com">
|
|
160
|
+
* <Button size="sm" variant="ghost">Remove</Button>
|
|
161
|
+
* </SettingsItem>
|
|
162
|
+
*/
|
|
147
163
|
function SettingsItem({ media, title, description, children, className, ...props }) {
|
|
148
164
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
149
165
|
"data-slot": "settings-item",
|
|
150
|
-
className: require_utils.cn("flex min-w-0 items-center gap-3", className),
|
|
166
|
+
className: require_utils.cn("flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 sm:flex-nowrap", className),
|
|
151
167
|
...props,
|
|
152
168
|
children: [
|
|
153
169
|
media,
|
|
@@ -163,7 +179,7 @@ function SettingsItem({ media, title, description, children, className, ...props
|
|
|
163
179
|
})]
|
|
164
180
|
}),
|
|
165
181
|
children != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
166
|
-
className: "flex
|
|
182
|
+
className: "flex min-w-0 basis-full items-center gap-2 sm:shrink-0 sm:basis-auto",
|
|
167
183
|
children
|
|
168
184
|
})
|
|
169
185
|
]
|
|
@@ -286,4 +302,4 @@ Object.defineProperty(exports, "SettingsTitle", {
|
|
|
286
302
|
}
|
|
287
303
|
});
|
|
288
304
|
|
|
289
|
-
//# sourceMappingURL=settings-
|
|
305
|
+
//# sourceMappingURL=settings-CYKWxfrJ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-CYKWxfrJ.cjs","names":["cn","fieldsOnSurface","createContext","useId","cn","useContext","Txt","Tooltip","TooltipTrigger","TooltipContent","cn","cn","Skeleton","SkeletonText","SettingsRow"],"sources":["../src/ds/new/settings/settings-container.tsx","../src/ds/new/settings/settings-header.tsx","../src/ds/new/settings/settings-list.tsx","../src/ds/new/settings/settings-skeleton.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { fieldsOnSurface } from '@/ds/primitives/raised-surface';\nimport { cn } from '@/lib/utils';\n\n/**\n * A settings card: the card fill with no rim, 14px from its edge to the content, and hairlines between rows that\n * stop at that inset. The card owns its rows' spacing: each direct child gets 13px above and below, and the card\n * adds the last 1px at its edges. Children with nothing in them (an empty `SettingsNoticeRow`) take no space and\n * draw no hairline, so a list can always render its notice row.\n */\nconst settingsCardStyle = cn(\n // `!`: the card owns row spacing, so a row's own reset (`Fieldset`'s `p-0`) can't remove it.\n 'flex min-w-0 flex-col rounded-xl bg-card px-3.5 py-px *:py-3.25! *:empty:hidden',\n '[&>:not(:empty)~:not(:empty)]:border-t [&>:not(:empty)~:not(:empty)]:border-border',\n fieldsOnSurface,\n);\n\nexport type SettingsContainerProps = ComponentProps<'div'>;\n\n/** One settings card. Holds `SettingsRow`s, `SettingsItem`s, a `SettingsListHeader` or a `SettingsEmptyRow`. */\nexport function SettingsContainer({ className, ...props }: SettingsContainerProps) {\n return <div data-slot=\"settings-container\" className={cn(settingsCardStyle, className)} {...props} />;\n}\n","import { createContext, useContext, useId } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@/ds/components/Tooltip';\nimport { Txt } from '@/ds/components/Txt';\nimport { cn } from '@/lib/utils';\n\n// On a settings page (`SettingsLayout`), section titles and descriptions sit 10px inside the card's edge, in line with\n// the inset page title. Anywhere else (forms, other pages) they line up with the page's left edge and field labels.\n// The inset is a custom property, so a caller's `ps-*` class still wins. Written out in full so Tailwind finds it.\nconst settingsInset =\n '[--settings-inset:0px] in-data-[slot=settings-layout]:[--settings-inset:--spacing(2.5)] ps-(--settings-inset)';\n\nconst SettingsTitleIdContext = createContext<string | undefined>(undefined);\n\n/** One section of a settings page: a `SettingsTitle` (or `SettingsHeader`) above its `SettingsContainer`. */\nexport function SettingsGroup({ className, ...props }: ComponentProps<'section'>) {\n const titleId = useId();\n\n return (\n <SettingsTitleIdContext.Provider value={titleId}>\n <section\n aria-labelledby={titleId}\n className={cn('flex min-w-0 scroll-mt-4 flex-col gap-2', className)}\n {...props}\n />\n </SettingsTitleIdContext.Provider>\n );\n}\n\n/** A section title with something beside it. A list's actions go in its card (`SettingsListHeader`), not here. */\nexport function SettingsHeader({\n action,\n children,\n className,\n ...props\n}: ComponentProps<'header'> & { action?: ReactNode }) {\n return (\n <header\n className={cn('flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4', className)}\n {...props}\n >\n <div className=\"flex min-w-0 flex-col gap-1\">{children}</div>\n {action != null && <div className=\"shrink-0\">{action}</div>}\n </header>\n );\n}\n\nexport function SettingsTitle({\n accessory,\n info,\n className,\n children,\n ...props\n}: Omit<ComponentProps<'h2'>, 'id'> & {\n accessory?: ReactNode;\n /** What the section is for, shown in a tooltip on the title. For sections whose name isn't self-explanatory. */\n info?: ReactNode;\n}) {\n const titleId = useContext(SettingsTitleIdContext);\n\n return (\n <div className={cn('flex min-w-0 flex-wrap items-center gap-2', settingsInset)}>\n <Txt as=\"h2\" id={titleId} variant=\"subheading\" tone=\"ink\" className={className} {...props}>\n {info == null ? children : <SettingsTitleInfo info={info}>{children}</SettingsTitleInfo>}\n </Txt>\n {accessory}\n </div>\n );\n}\n\n/** The title's text as a tooltip trigger, described by `info`. */\nfunction SettingsTitleInfo({ info, children }: { info: ReactNode; children: ReactNode }) {\n const infoId = useId();\n\n return (\n <Tooltip>\n <TooltipTrigger\n render={\n <span\n tabIndex={0}\n aria-describedby={infoId}\n className=\"cursor-help underline decoration-transparent decoration-dotted underline-offset-4 hover:decoration-current focus-visible:decoration-current focus-visible:outline-none\"\n />\n }\n >\n {children}\n </TooltipTrigger>\n <TooltipContent id={infoId} keepMounted className=\"max-w-64\">\n {info}\n </TooltipContent>\n </Tooltip>\n );\n}\n\nexport function SettingsDescription({ className, ...props }: ComponentProps<'p'>) {\n return <Txt as=\"p\" variant=\"caption\" tone=\"muted\" className={cn(settingsInset, className)} {...props} />;\n}\n","import type { ComponentProps, ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\n\n/**\n * A list's first row: its count, caption or empty text on the left and its one action (\"Add account\", \"Invite\n * member\") on the right. A full list and an empty one share this exact look, so the card reads the same either way.\n */\nfunction SettingsListBar({ action, className, children, ...props }: ComponentProps<'div'> & { action?: ReactNode }) {\n return (\n <div\n className={cn(\n // As tall as a `SettingsRow` (label + one-line description) plus the 13px the card puts above and below each\n // row, since this row's own box includes that padding. Keeps a list's first row level with the settings above it.\n 'flex min-h-8 items-center justify-between gap-3 sm:min-h-[calc(var(--text-label)*1.5+1px+var(--text-caption)*1.5+--spacing(6.5))]',\n className,\n )}\n {...props}\n >\n <div className=\"min-w-0 truncate text-label text-foreground\">{children}</div>\n {action != null && <div className=\"flex shrink-0 items-center gap-2\">{action}</div>}\n </div>\n );\n}\n\nexport type SettingsListHeaderProps = ComponentProps<'div'> & {\n /** The list's action, on the right. Refresh and other list controls can sit beside it. */\n action?: ReactNode;\n};\n\n/** The first row of a list's `SettingsContainer`: a count (\"2 accounts\") and the list's action. */\nexport function SettingsListHeader(props: SettingsListHeaderProps) {\n return <SettingsListBar data-slot=\"settings-list-header\" {...props} />;\n}\n\nexport type SettingsEmptyRowProps = ComponentProps<'div'> & {\n /** The same action the list's header would hold, so an empty list still offers it. */\n action?: ReactNode;\n};\n\n/**\n * An empty list's only row: what's missing on the left (\"No join links\"), the list's action on the right. Looks\n * exactly like `SettingsListHeader`, so empty and full lists match; use it for every empty list in a card.\n */\nexport function SettingsEmptyRow(props: SettingsEmptyRowProps) {\n return <SettingsListBar data-slot=\"settings-empty-row\" {...props} />;\n}\n\n/** A list's notices and errors, as a row of its `SettingsContainer`. Takes no space while it has nothing in it. */\nexport function SettingsNoticeRow({ className, ...props }: ComponentProps<'div'>) {\n return <div data-slot=\"settings-notice-row\" className={cn('flex flex-col gap-2', className)} {...props} />;\n}\n\n/** The square on the left of a `SettingsItem` holding an icon or logo. Avatars use `Avatar size=\"md\"`, the\n * same size, so every list's text starts at the same place. */\nexport function SettingsItemIcon({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"settings-item-icon\"\n aria-hidden\n className={cn(\n 'flex size-avatar-md shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground [&>svg]:size-icon-md',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport type SettingsItemProps = Omit<ComponentProps<'div'>, 'title'> & {\n /** A `SettingsItemIcon` or an `Avatar size=\"md\"`. */\n media?: ReactNode;\n title: ReactNode;\n /** One line under the title: \"GitHub · Connected 3 weeks ago\". */\n description?: ReactNode;\n /** The item's status or actions, on the right. */\n children?: ReactNode;\n};\n\n/**\n * One thing in a settings list (an account, a member, a session, a source, a package version). Its right side holds\n * the item's status or its own actions (Remove, Revoke, Copy), not a control that changes a setting. Goes in a\n * `SettingsContainer`, usually under a `SettingsListHeader`.\n *\n * For a setting the person changes (an input, select or switch with a label), use `SettingsRow` instead.\n *\n * @example\n * <SettingsItem media={<Avatar size=\"md\" … />} title=\"Ada Lovelace\" description=\"ada@example.com\">\n * <Button size=\"sm\" variant=\"ghost\">Remove</Button>\n * </SettingsItem>\n */\nexport function SettingsItem({ media, title, description, children, className, ...props }: SettingsItemProps) {\n return (\n <div\n data-slot=\"settings-item\"\n // Below `sm` the item's value or actions wrap onto their own full-width line under the title, as a\n // `SettingsRow`'s control does, so a long value (an email, a type) never squeezes the title out.\n className={cn('flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 sm:flex-nowrap', className)}\n {...props}\n >\n {media}\n <div className=\"flex min-w-0 flex-1 flex-col gap-px\">\n {/* A string title truncates, so it also goes in the hover title to stay readable in full. */}\n <div className=\"truncate text-label text-foreground\" title={typeof title === 'string' ? title : undefined}>\n {title}\n </div>\n {description != null && <div className=\"truncate text-caption text-muted-foreground\">{description}</div>}\n </div>\n {children != null && (\n <div className=\"flex min-w-0 basis-full items-center gap-2 sm:shrink-0 sm:basis-auto\">{children}</div>\n )}\n </div>\n );\n}\n","import { SettingsItem } from './settings-list';\nimport { SettingsRow } from './settings-row';\nimport { Skeleton } from '@/ds/components/Skeleton/skeleton';\nimport { SkeletonText } from '@/ds/components/Skeleton/skeleton-text';\nimport { cn } from '@/lib/utils';\n\nconst bar = 'motion-reduce:before:animate-none';\n\nexport type SettingsSkeletonProps = {\n /** Announced while loading, e.g. \"Loading members\". */\n label: string;\n /** Placeholder rows, matching how many the loaded list usually has. */\n rows?: number;\n /** `row` stands in for `SettingsRow`s (label left, control right); `item` for `SettingsItem`s (icon, title, description). */\n variant?: 'row' | 'item';\n className?: string;\n};\n\n/**\n * The loading state for anything inside a `SettingsContainer`. Placeholders are built from the real `SettingsRow` and\n * `SettingsItem`, so they sit exactly where the loaded rows will.\n *\n * ```tsx\n * <SettingsContainer>\n * {isLoading ? <SettingsSkeleton label=\"Loading members\" variant=\"item\" rows={3} /> : members.map(...)}\n * </SettingsContainer>\n * ```\n */\nexport function SettingsSkeleton({ label, rows = 2, variant = 'row', className }: SettingsSkeletonProps) {\n const Placeholder = variant === 'item' ? ItemPlaceholder : RowPlaceholder;\n\n return (\n // One child of the card, so it takes the card's row padding; inside, rows repeat that rhythm with hairlines.\n <div\n role=\"status\"\n aria-label={label}\n data-slot=\"settings-skeleton\"\n className={cn('grid divide-y divide-border *:py-3.25 *:first:pt-0 *:last:pb-0', className)}\n >\n {Array.from({ length: rows }, (_, index) => (\n <Placeholder key={index} />\n ))}\n </div>\n );\n}\n\nfunction ItemPlaceholder() {\n return (\n <SettingsItem\n aria-hidden\n media={<Skeleton className={cn('size-avatar-md shrink-0 rounded-lg', bar)} />}\n title={<SkeletonText line=\"text-label\" className={cn('w-32', bar)} />}\n description={<SkeletonText line=\"text-caption\" className={cn('w-48 max-w-full', bar)} />}\n />\n );\n}\n\nfunction RowPlaceholder() {\n return (\n <SettingsRow\n aria-hidden\n label={<SkeletonText line=\"text-label\" className={cn('w-28', bar)} />}\n description={<SkeletonText line=\"text-caption\" className={cn('w-48 max-w-full', bar)} />}\n >\n <Skeleton className={cn('h-control-sm w-28 max-w-full rounded-full', bar)} />\n </SettingsRow>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAUA,IAAM,oBAAoBA,cAAAA,GAExB,mFACA,sFACAC,kCAAAA,eACF;;AAKA,SAAgB,kBAAkB,EAAE,WAAW,GAAG,SAAiC;CACjF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,aAAU;EAAqB,WAAWD,cAAAA,GAAG,mBAAmB,SAAS;EAAG,GAAI;CAAQ,CAAA;AACtG;;ACbA,IAAM,gBACJ;AAEF,IAAM,0BAAA,GAAyBE,MAAAA,cAAAA,CAAkC,KAAA,CAAS;;AAG1E,SAAgB,cAAc,EAAE,WAAW,GAAG,SAAoC;CAChF,MAAM,WAAA,GAAU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B,GAAR,KAAQ,CAC3B;CACE,CAAA;AAET;AAEA,SAAS,kBAAkB;CACzB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD;EACE,eAAA;EACA,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,UAAD,EAAU,WAAWD,cAAAA,GAAG,sCAAsC,GAAG,EAAI,CAAA;EAC5E,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACE,sBAAAA,cAAD;GAAc,MAAK;GAAa,WAAWF,cAAAA,GAAG,QAAQ,GAAG;EAAI,CAAA;EACpE,aAAa,iBAAA,GAAA,kBAAA,IAAA,CAACE,sBAAAA,cAAD;GAAc,MAAK;GAAe,WAAWF,cAAAA,GAAG,mBAAmB,GAAG;EAAI,CAAA;CACxF,CAAA;AAEL;AAEA,SAAS,iBAAiB;CACxB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,qBAAAA,aAAD;EACE,eAAA;EACA,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,cAAD;GAAc,MAAK;GAAa,WAAWF,cAAAA,GAAG,QAAQ,GAAG;EAAI,CAAA;EACpE,aAAa,iBAAA,GAAA,kBAAA,IAAA,CAACE,sBAAAA,cAAD;GAAc,MAAK;GAAe,WAAWF,cAAAA,GAAG,mBAAmB,GAAG;EAAI,CAAA;EAEvF,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,UAAD,EAAU,WAAWD,cAAAA,GAAG,6CAA6C,GAAG,EAAI,CAAA;CACjE,CAAA;AAEjB"}
|
|
@@ -9,6 +9,8 @@ var rowClassName = "min-w-0 gap-3";
|
|
|
9
9
|
/** Side by side: label left, control pushed right. A control below its label fills the row instead. */
|
|
10
10
|
var sideRowClassName = "sm:justify-between sm:gap-6";
|
|
11
11
|
var headingClassName = "flex min-w-0 flex-col gap-px";
|
|
12
|
+
/** Beside its control, the label column is as tall as a label with a one-line description, so rows with and without one match. */
|
|
13
|
+
var sideHeadingClassName = "sm:min-h-[calc(var(--text-label)*1.5+1px+var(--text-caption)*1.5)] sm:justify-center";
|
|
12
14
|
/**
|
|
13
15
|
* The control column on the right. Inputs fill it (at least 13.75rem); selects and other field triggers hug
|
|
14
16
|
* their value (`--field-width: auto`, see `fieldTriggerWidthStyle`) up to that same width.
|
|
@@ -28,7 +30,19 @@ function SettingsRowControl({ viewOnly = false, children }) {
|
|
|
28
30
|
children
|
|
29
31
|
] });
|
|
30
32
|
}
|
|
31
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* One setting the person changes: a label, an optional one-line description, and the control that changes it. The
|
|
35
|
+
* row is a form field, so its label names the control. Goes in a `SettingsContainer`.
|
|
36
|
+
*
|
|
37
|
+
* For one thing in a list (an account, a member, an API key, a package version), use `SettingsItem` instead: a row
|
|
38
|
+
* with no control, or one per record in a `.map`, is a list item. A setting someone may not change stays a
|
|
39
|
+
* `SettingsRow` with `viewOnly`.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* <SettingsRow label="Theme" description="Color scheme for the interface.">
|
|
43
|
+
* <ThemeToggle />
|
|
44
|
+
* </SettingsRow>
|
|
45
|
+
*/
|
|
32
46
|
function SettingsRow({ label, description, htmlFor, children, className, tone = "default", viewOnly = false, required = false, errorMsg, disabled, controlPlacement = "side", ...props }) {
|
|
33
47
|
const controlBelow = controlPlacement === "below";
|
|
34
48
|
return /* @__PURE__ */ jsxs(Field, {
|
|
@@ -39,7 +53,7 @@ function SettingsRow({ label, description, htmlFor, children, className, tone =
|
|
|
39
53
|
className: cn(rowClassName, !controlBelow && sideRowClassName, className),
|
|
40
54
|
...props,
|
|
41
55
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
42
|
-
className: headingClassName,
|
|
56
|
+
className: cn(headingClassName, !controlBelow && sideHeadingClassName),
|
|
43
57
|
children: [
|
|
44
58
|
/* @__PURE__ */ jsx(FieldLabel, {
|
|
45
59
|
...htmlFor ? { htmlFor } : {},
|
|
@@ -67,7 +81,15 @@ function SettingsRow({ label, description, htmlFor, children, className, tone =
|
|
|
67
81
|
})]
|
|
68
82
|
});
|
|
69
83
|
}
|
|
70
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* A `SettingsRow` for one setting made of several controls (radios, several switches), labelled by a legend. Same
|
|
86
|
+
* rule as `SettingsRow`: a setting the person changes, never a list entry.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* <SettingsFieldsetRow label="Notify me about" controlPlacement="below">
|
|
90
|
+
* <Checkbox … />
|
|
91
|
+
* </SettingsFieldsetRow>
|
|
92
|
+
*/
|
|
71
93
|
function SettingsFieldsetRow({ label, description, children, className, controlPlacement = "side", ...props }) {
|
|
72
94
|
const descriptionId = useId();
|
|
73
95
|
const controlBelow = controlPlacement === "below";
|
|
@@ -77,7 +99,7 @@ function SettingsFieldsetRow({ label, description, children, className, controlP
|
|
|
77
99
|
className: cn("flex flex-col", rowClassName, !controlBelow && ["sm:flex-row sm:items-center", sideRowClassName], className),
|
|
78
100
|
...props,
|
|
79
101
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
80
|
-
className: headingClassName,
|
|
102
|
+
className: cn(headingClassName, !controlBelow && sideHeadingClassName),
|
|
81
103
|
children: [/* @__PURE__ */ jsx(FieldsetLegend, { children: label }), description != null && /* @__PURE__ */ jsx("div", {
|
|
82
104
|
id: descriptionId,
|
|
83
105
|
className: "flex flex-col gap-0.5 text-caption text-pretty text-muted-foreground",
|
|
@@ -92,4 +114,4 @@ function SettingsFieldsetRow({ label, description, children, className, controlP
|
|
|
92
114
|
}
|
|
93
115
|
export { SettingsRow as n, SettingsRowControl as r, SettingsFieldsetRow as t };
|
|
94
116
|
|
|
95
|
-
//# sourceMappingURL=settings-row-
|
|
117
|
+
//# sourceMappingURL=settings-row-BnlFZSQL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-row-BnlFZSQL.js","names":["_Fragment"],"sources":["../src/ds/new/settings/settings-row.tsx"],"sourcesContent":["import { useId } from 'react';\nimport type { ReactNode } from 'react';\nimport { Field, FieldDescription, FieldError, FieldLabel, Fieldset, FieldsetLegend } from '@/ds/components/Field';\nimport type { FieldProps, FieldsetProps } from '@/ds/components/Field';\nimport { IconLock } from '@/ds/icons/central/IconLock';\nimport { cn } from '@/lib/utils';\n\nexport type SettingsRowProps = Omit<FieldProps, 'children' | 'invalid' | 'orientation'> & {\n label: ReactNode;\n description?: ReactNode;\n /** @deprecated The row's `Field` names the control it holds; drop `htmlFor` and the control's `id`. */\n htmlFor?: string;\n children?: ReactNode;\n tone?: 'default' | 'destructive';\n viewOnly?: boolean;\n required?: boolean;\n errorMsg?: ReactNode;\n /**\n * `side` (default): the control sits on the right. Text fields take one shared width (13.75rem), selects hug\n * their value up to that width, and switches and buttons keep their own size; all end at the right edge.\n * `below`: the control goes under the label at full width, for forms with several controls.\n */\n controlPlacement?: 'side' | 'below';\n};\n\n/** Label left, control right; stacked below `sm`. The card around the row gives it its spacing. */\nconst rowClassName = 'min-w-0 gap-3';\n/** Side by side: label left, control pushed right. A control below its label fills the row instead. */\nconst sideRowClassName = 'sm:justify-between sm:gap-6';\nconst headingClassName = 'flex min-w-0 flex-col gap-px';\n/** Beside its control, the label column is as tall as a label with a one-line description, so rows with and without one match. */\nconst sideHeadingClassName = 'sm:min-h-[calc(var(--text-label)*1.5+1px+var(--text-caption)*1.5)] sm:justify-center';\n/**\n * The control column on the right. Inputs fill it (at least 13.75rem); selects and other field triggers hug\n * their value (`--field-width: auto`, see `fieldTriggerWidthStyle`) up to that same width.\n */\nconst sideControlClassName =\n 'flex min-w-0 items-center justify-end gap-2 [--field-max-width:13.75rem] [--field-width:auto] sm:min-w-55 sm:shrink-0';\n\nexport function SettingsRowControl({ viewOnly = false, children }: { viewOnly?: boolean; children: ReactNode }) {\n if (!viewOnly) return children;\n return (\n <>\n <IconLock className=\"size-icon-md shrink-0\" aria-hidden />\n <span className=\"sr-only\">View only: </span>\n {children}\n </>\n );\n}\n\n/**\n * One setting the person changes: a label, an optional one-line description, and the control that changes it. The\n * row is a form field, so its label names the control. Goes in a `SettingsContainer`.\n *\n * For one thing in a list (an account, a member, an API key, a package version), use `SettingsItem` instead: a row\n * with no control, or one per record in a `.map`, is a list item. A setting someone may not change stays a\n * `SettingsRow` with `viewOnly`.\n *\n * @example\n * <SettingsRow label=\"Theme\" description=\"Color scheme for the interface.\">\n * <ThemeToggle />\n * </SettingsRow>\n */\nexport function SettingsRow({\n label,\n description,\n htmlFor,\n children,\n className,\n tone = 'default',\n viewOnly = false,\n required = false,\n errorMsg,\n disabled,\n controlPlacement = 'side',\n ...props\n}: SettingsRowProps) {\n const controlBelow = controlPlacement === 'below';\n\n return (\n <Field\n orientation={controlBelow ? 'vertical' : 'responsive'}\n invalid={Boolean(errorMsg)}\n disabled={disabled || viewOnly}\n data-slot=\"settings-row\"\n className={cn(rowClassName, !controlBelow && sideRowClassName, className)}\n {...props}\n >\n <div className={cn(headingClassName, !controlBelow && sideHeadingClassName)}>\n <FieldLabel\n {...(htmlFor ? { htmlFor } : {})}\n required={required}\n className={cn(tone === 'destructive' && 'text-destructive-foreground')}\n >\n {label}\n </FieldLabel>\n {description != null && (\n <FieldDescription render={<div />} className=\"mt-0 flex flex-col gap-0.5 text-pretty\">\n {description}\n </FieldDescription>\n )}\n <FieldError className=\"mt-0\">{errorMsg}</FieldError>\n </div>\n {children != null && (\n <div\n data-slot=\"settings-row-control\"\n className={cn(\n 'min-w-0',\n !controlBelow && sideControlClassName,\n viewOnly && 'flex items-center gap-2 text-body-sm text-muted-foreground',\n )}\n >\n <SettingsRowControl viewOnly={viewOnly}>{children}</SettingsRowControl>\n </div>\n )}\n </Field>\n );\n}\n\nexport type SettingsFieldsetRowProps = Omit<FieldsetProps, 'children'> & {\n label: ReactNode;\n description?: ReactNode;\n children?: ReactNode;\n /** Same as `SettingsRow`'s: `below` puts the controls under the label at full width. */\n controlPlacement?: 'side' | 'below';\n};\n\n/**\n * A `SettingsRow` for one setting made of several controls (radios, several switches), labelled by a legend. Same\n * rule as `SettingsRow`: a setting the person changes, never a list entry.\n *\n * @example\n * <SettingsFieldsetRow label=\"Notify me about\" controlPlacement=\"below\">\n * <Checkbox … />\n * </SettingsFieldsetRow>\n */\nexport function SettingsFieldsetRow({\n label,\n description,\n children,\n className,\n controlPlacement = 'side',\n ...props\n}: SettingsFieldsetRowProps) {\n const descriptionId = useId();\n const controlBelow = controlPlacement === 'below';\n\n return (\n <Fieldset\n data-slot=\"settings-row\"\n aria-describedby={description == null ? undefined : descriptionId}\n className={cn(\n 'flex flex-col',\n rowClassName,\n !controlBelow && ['sm:flex-row sm:items-center', sideRowClassName],\n className,\n )}\n {...props}\n >\n <div className={cn(headingClassName, !controlBelow && sideHeadingClassName)}>\n <FieldsetLegend>{label}</FieldsetLegend>\n {description != null && (\n <div id={descriptionId} className=\"flex flex-col gap-0.5 text-caption text-pretty text-muted-foreground\">\n {description}\n </div>\n )}\n </div>\n {children != null && (\n <div data-slot=\"settings-row-control\" className={cn('min-w-0', !controlBelow && sideControlClassName)}>\n {children}\n </div>\n )}\n </Fieldset>\n );\n}\n"],"mappings":";;;;;;;AA0BA,IAAM,eAAe;;AAErB,IAAM,mBAAmB;AACzB,IAAM,mBAAmB;;AAEzB,IAAM,uBAAuB;;;;;AAK7B,IAAM,uBACJ;AAEF,SAAgB,mBAAmB,EAAE,WAAW,OAAO,YAAyD;CAC9G,IAAI,CAAC,UAAU,OAAO;CACtB,OACE,qBAAAA,YAAA,EAAA,UAAA;EACE,oBAAC,UAAD;GAAU,WAAU;GAAwB,eAAA;EAAa,CAAA;EACzD,oBAAC,QAAD;GAAM,WAAU;GAAU,UAAA;EAAiB,CAAA;EAC1C;CACD,EAAA,CAAA;AAEN;;;;;;;;;;;;;;AAeA,SAAgB,YAAY,EAC1B,OACA,aACA,SACA,UACA,WACA,OAAO,WACP,WAAW,OACX,WAAW,OACX,UACA,UACA,mBAAmB,QACnB,GAAG,SACgB;CACnB,MAAM,eAAe,qBA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;IAAe,WAAU;IAC/B,UAAA;GACE,CAAA,CAEJ;EACJ,CAAA,GAAA,YAAY,QACX,oBAAC,OAAD;GAAK,aAAU;GAAuB,WAAW,GAAG,WAAW,CAAC,gBAAgB,oBAAoB;GACjG;EACE,CAAA,CAEC;;AAEd"}
|
|
@@ -9,6 +9,8 @@ var rowClassName = "min-w-0 gap-3";
|
|
|
9
9
|
/** Side by side: label left, control pushed right. A control below its label fills the row instead. */
|
|
10
10
|
var sideRowClassName = "sm:justify-between sm:gap-6";
|
|
11
11
|
var headingClassName = "flex min-w-0 flex-col gap-px";
|
|
12
|
+
/** Beside its control, the label column is as tall as a label with a one-line description, so rows with and without one match. */
|
|
13
|
+
var sideHeadingClassName = "sm:min-h-[calc(var(--text-label)*1.5+1px+var(--text-caption)*1.5)] sm:justify-center";
|
|
12
14
|
/**
|
|
13
15
|
* The control column on the right. Inputs fill it (at least 13.75rem); selects and other field triggers hug
|
|
14
16
|
* their value (`--field-width: auto`, see `fieldTriggerWidthStyle`) up to that same width.
|
|
@@ -28,7 +30,19 @@ function SettingsRowControl({ viewOnly = false, children }) {
|
|
|
28
30
|
children
|
|
29
31
|
] });
|
|
30
32
|
}
|
|
31
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* One setting the person changes: a label, an optional one-line description, and the control that changes it. The
|
|
35
|
+
* row is a form field, so its label names the control. Goes in a `SettingsContainer`.
|
|
36
|
+
*
|
|
37
|
+
* For one thing in a list (an account, a member, an API key, a package version), use `SettingsItem` instead: a row
|
|
38
|
+
* with no control, or one per record in a `.map`, is a list item. A setting someone may not change stays a
|
|
39
|
+
* `SettingsRow` with `viewOnly`.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* <SettingsRow label="Theme" description="Color scheme for the interface.">
|
|
43
|
+
* <ThemeToggle />
|
|
44
|
+
* </SettingsRow>
|
|
45
|
+
*/
|
|
32
46
|
function SettingsRow({ label, description, htmlFor, children, className, tone = "default", viewOnly = false, required = false, errorMsg, disabled, controlPlacement = "side", ...props }) {
|
|
33
47
|
const controlBelow = controlPlacement === "below";
|
|
34
48
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Field.Field, {
|
|
@@ -39,7 +53,7 @@ function SettingsRow({ label, description, htmlFor, children, className, tone =
|
|
|
39
53
|
className: require_utils.cn(rowClassName, !controlBelow && sideRowClassName, className),
|
|
40
54
|
...props,
|
|
41
55
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
42
|
-
className: headingClassName,
|
|
56
|
+
className: require_utils.cn(headingClassName, !controlBelow && sideHeadingClassName),
|
|
43
57
|
children: [
|
|
44
58
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Field.FieldLabel, {
|
|
45
59
|
...htmlFor ? { htmlFor } : {},
|
|
@@ -67,7 +81,15 @@ function SettingsRow({ label, description, htmlFor, children, className, tone =
|
|
|
67
81
|
})]
|
|
68
82
|
});
|
|
69
83
|
}
|
|
70
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* A `SettingsRow` for one setting made of several controls (radios, several switches), labelled by a legend. Same
|
|
86
|
+
* rule as `SettingsRow`: a setting the person changes, never a list entry.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* <SettingsFieldsetRow label="Notify me about" controlPlacement="below">
|
|
90
|
+
* <Checkbox … />
|
|
91
|
+
* </SettingsFieldsetRow>
|
|
92
|
+
*/
|
|
71
93
|
function SettingsFieldsetRow({ label, description, children, className, controlPlacement = "side", ...props }) {
|
|
72
94
|
const descriptionId = (0, react.useId)();
|
|
73
95
|
const controlBelow = controlPlacement === "below";
|
|
@@ -77,7 +99,7 @@ function SettingsFieldsetRow({ label, description, children, className, controlP
|
|
|
77
99
|
className: require_utils.cn("flex flex-col", rowClassName, !controlBelow && ["sm:flex-row sm:items-center", sideRowClassName], className),
|
|
78
100
|
...props,
|
|
79
101
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
80
|
-
className: headingClassName,
|
|
102
|
+
className: require_utils.cn(headingClassName, !controlBelow && sideHeadingClassName),
|
|
81
103
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Field.FieldsetLegend, { children: label }), description != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
82
104
|
id: descriptionId,
|
|
83
105
|
className: "flex flex-col gap-0.5 text-caption text-pretty text-muted-foreground",
|
|
@@ -109,4 +131,4 @@ Object.defineProperty(exports, "SettingsRowControl", {
|
|
|
109
131
|
}
|
|
110
132
|
});
|
|
111
133
|
|
|
112
|
-
//# sourceMappingURL=settings-row-
|
|
134
|
+
//# sourceMappingURL=settings-row-Da1HHyBg.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-row-Da1HHyBg.cjs","names":["_Fragment","IconLock","Field","cn","FieldLabel","FieldDescription","FieldError","useId","Fieldset","FieldsetLegend"],"sources":["../src/ds/new/settings/settings-row.tsx"],"sourcesContent":["import { useId } from 'react';\nimport type { ReactNode } from 'react';\nimport { Field, FieldDescription, FieldError, FieldLabel, Fieldset, FieldsetLegend } from '@/ds/components/Field';\nimport type { FieldProps, FieldsetProps } from '@/ds/components/Field';\nimport { IconLock } from '@/ds/icons/central/IconLock';\nimport { cn } from '@/lib/utils';\n\nexport type SettingsRowProps = Omit<FieldProps, 'children' | 'invalid' | 'orientation'> & {\n label: ReactNode;\n description?: ReactNode;\n /** @deprecated The row's `Field` names the control it holds; drop `htmlFor` and the control's `id`. */\n htmlFor?: string;\n children?: ReactNode;\n tone?: 'default' | 'destructive';\n viewOnly?: boolean;\n required?: boolean;\n errorMsg?: ReactNode;\n /**\n * `side` (default): the control sits on the right. Text fields take one shared width (13.75rem), selects hug\n * their value up to that width, and switches and buttons keep their own size; all end at the right edge.\n * `below`: the control goes under the label at full width, for forms with several controls.\n */\n controlPlacement?: 'side' | 'below';\n};\n\n/** Label left, control right; stacked below `sm`. The card around the row gives it its spacing. */\nconst rowClassName = 'min-w-0 gap-3';\n/** Side by side: label left, control pushed right. A control below its label fills the row instead. */\nconst sideRowClassName = 'sm:justify-between sm:gap-6';\nconst headingClassName = 'flex min-w-0 flex-col gap-px';\n/** Beside its control, the label column is as tall as a label with a one-line description, so rows with and without one match. */\nconst sideHeadingClassName = 'sm:min-h-[calc(var(--text-label)*1.5+1px+var(--text-caption)*1.5)] sm:justify-center';\n/**\n * The control column on the right. Inputs fill it (at least 13.75rem); selects and other field triggers hug\n * their value (`--field-width: auto`, see `fieldTriggerWidthStyle`) up to that same width.\n */\nconst sideControlClassName =\n 'flex min-w-0 items-center justify-end gap-2 [--field-max-width:13.75rem] [--field-width:auto] sm:min-w-55 sm:shrink-0';\n\nexport function SettingsRowControl({ viewOnly = false, children }: { viewOnly?: boolean; children: ReactNode }) {\n if (!viewOnly) return children;\n return (\n <>\n <IconLock className=\"size-icon-md shrink-0\" aria-hidden />\n <span className=\"sr-only\">View only: </span>\n {children}\n </>\n );\n}\n\n/**\n * One setting the person changes: a label, an optional one-line description, and the control that changes it. The\n * row is a form field, so its label names the control. Goes in a `SettingsContainer`.\n *\n * For one thing in a list (an account, a member, an API key, a package version), use `SettingsItem` instead: a row\n * with no control, or one per record in a `.map`, is a list item. A setting someone may not change stays a\n * `SettingsRow` with `viewOnly`.\n *\n * @example\n * <SettingsRow label=\"Theme\" description=\"Color scheme for the interface.\">\n * <ThemeToggle />\n * </SettingsRow>\n */\nexport function SettingsRow({\n label,\n description,\n htmlFor,\n children,\n className,\n tone = 'default',\n viewOnly = false,\n required = false,\n errorMsg,\n disabled,\n controlPlacement = 'side',\n ...props\n}: SettingsRowProps) {\n const controlBelow = controlPlacement === 'below';\n\n return (\n <Field\n orientation={controlBelow ? 'vertical' : 'responsive'}\n invalid={Boolean(errorMsg)}\n disabled={disabled || viewOnly}\n data-slot=\"settings-row\"\n className={cn(rowClassName, !controlBelow && sideRowClassName, className)}\n {...props}\n >\n <div className={cn(headingClassName, !controlBelow && sideHeadingClassName)}>\n <FieldLabel\n {...(htmlFor ? { htmlFor } : {})}\n required={required}\n className={cn(tone === 'destructive' && 'text-destructive-foreground')}\n >\n {label}\n </FieldLabel>\n {description != null && (\n <FieldDescription render={<div />} className=\"mt-0 flex flex-col gap-0.5 text-pretty\">\n {description}\n </FieldDescription>\n )}\n <FieldError className=\"mt-0\">{errorMsg}</FieldError>\n </div>\n {children != null && (\n <div\n data-slot=\"settings-row-control\"\n className={cn(\n 'min-w-0',\n !controlBelow && sideControlClassName,\n viewOnly && 'flex items-center gap-2 text-body-sm text-muted-foreground',\n )}\n >\n <SettingsRowControl viewOnly={viewOnly}>{children}</SettingsRowControl>\n </div>\n )}\n </Field>\n );\n}\n\nexport type SettingsFieldsetRowProps = Omit<FieldsetProps, 'children'> & {\n label: ReactNode;\n description?: ReactNode;\n children?: ReactNode;\n /** Same as `SettingsRow`'s: `below` puts the controls under the label at full width. */\n controlPlacement?: 'side' | 'below';\n};\n\n/**\n * A `SettingsRow` for one setting made of several controls (radios, several switches), labelled by a legend. Same\n * rule as `SettingsRow`: a setting the person changes, never a list entry.\n *\n * @example\n * <SettingsFieldsetRow label=\"Notify me about\" controlPlacement=\"below\">\n * <Checkbox … />\n * </SettingsFieldsetRow>\n */\nexport function SettingsFieldsetRow({\n label,\n description,\n children,\n className,\n controlPlacement = 'side',\n ...props\n}: SettingsFieldsetRowProps) {\n const descriptionId = useId();\n const controlBelow = controlPlacement === 'below';\n\n return (\n <Fieldset\n data-slot=\"settings-row\"\n aria-describedby={description == null ? undefined : descriptionId}\n className={cn(\n 'flex flex-col',\n rowClassName,\n !controlBelow && ['sm:flex-row sm:items-center', sideRowClassName],\n className,\n )}\n {...props}\n >\n <div className={cn(headingClassName, !controlBelow && sideHeadingClassName)}>\n <FieldsetLegend>{label}</FieldsetLegend>\n {description != null && (\n <div id={descriptionId} className=\"flex flex-col gap-0.5 text-caption text-pretty text-muted-foreground\">\n {description}\n </div>\n )}\n </div>\n {children != null && (\n <div data-slot=\"settings-row-control\" className={cn('min-w-0', !controlBelow && sideControlClassName)}>\n {children}\n </div>\n )}\n </Fieldset>\n );\n}\n"],"mappings":";;;;;;;AA0BA,IAAM,eAAe;;AAErB,IAAM,mBAAmB;AACzB,IAAM,mBAAmB;;AAEzB,IAAM,uBAAuB;;;;;AAK7B,IAAM,uBACJ;AAEF,SAAgB,mBAAmB,EAAE,WAAW,OAAO,YAAyD;CAC9G,IAAI,CAAC,UAAU,OAAO;CACtB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAAA,kBAAAA,UAAA,EAAA,UAAA;EACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,+BAAAA,UAAD;GAAU,WAAU;GAAwB,eAAA;EAAa,CAAA;EACzD,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAU;GAAU,UAAA;EAAiB,CAAA;EAC1C;CACD,EAAA,CAAA;AAEN;;;;;;;;;;;;;;AAeA,SAAgB,YAAY,EAC1B,OACA,aACA,SACA,UACA,WACA,OAAO,WACP,WAAW,OACX,WAAW,OACX,UACA,UACA,mBAAmB,QACnB,GAAG,SACgB;CACnB,MAAM,eAAe,qBAAqB;CAE1C,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,yBAAAA,OAAD;EACE,aAAa,eAAe,aAAa;EACzC,SAAS,QAAQ,QAAQ;EACzB,UAAU,YAAY;EACtB,aAAU;EACV,WAAWC,cAAAA,GAAG,cAAc,CAAC,gBAAgB,kBAAkB,SAAS;EACxE,GAAI;EANN,UAAA,CAQE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,WAAWA,cAAAA,GAAG,kBAAkB,CAAC,gBAAgB,oBAAoB;GAA1E,UAAA;IACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,yBAAAA,YAAD;KACE,GAAK,UAAU,EAAE,QAAQ,IAAI,CAAC;KACpB;KACV,WAAWD,cAAAA,GAAG,SAAS,iBAAiB,6BAA6B;KAEpE,UAAA;IACS,CAAA;IACX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A,IAAA,CAAC,OAAD;GAAK,aAAU;GAAuB,WAAWN,cAAAA,GAAG,WAAW,CAAC,gBAAgB,oBAAoB;GACjG;EACE,CAAA,CAEC;;AAEd"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { KnowledgePageActivityPayload, KnowledgeNotePayload, KnowledgePagePayload, KnowledgePinPayload } from '../pageTypes';
|
|
3
|
+
type LinkedPage = {
|
|
4
|
+
page: KnowledgePagePayload;
|
|
5
|
+
count: number;
|
|
6
|
+
};
|
|
7
|
+
export type PageLinkLists = {
|
|
8
|
+
in: LinkedPage[];
|
|
9
|
+
out: LinkedPage[];
|
|
10
|
+
};
|
|
3
11
|
export declare function KnowledgeDetailSection({ label, count, children, }: {
|
|
4
12
|
label: string;
|
|
5
13
|
count?: number;
|
|
@@ -26,9 +34,10 @@ export declare function KnowledgeNoteItem({ note, pagesById, onPageClick, highli
|
|
|
26
34
|
*
|
|
27
35
|
* Paged lists take a `…More` slot the host fills with the next page's loader.
|
|
28
36
|
*/
|
|
29
|
-
export declare function KnowledgePageDetail({ page, notes, pin, pagesById, onPageClick, highlightMentionOf, ancestors, mentionedBy, notesMore, childPages, activity, onOpenPage, compact, }: {
|
|
37
|
+
export declare function KnowledgePageDetail({ page, notes, pin, pagesById, onPageClick, highlightMentionOf, ancestors, mentionedBy, notesMore, childPages, activity, links, onOpenPage, compact, }: {
|
|
30
38
|
compact?: boolean;
|
|
31
39
|
onOpenPage?: () => void;
|
|
40
|
+
links?: PageLinkLists;
|
|
32
41
|
page: KnowledgePagePayload;
|
|
33
42
|
notes: KnowledgeNotePayload[];
|
|
34
43
|
pin?: KnowledgePinPayload;
|
|
@@ -47,3 +56,4 @@ export declare function KnowledgePageDetail({ page, notes, pin, pagesById, onPag
|
|
|
47
56
|
childPages?: ReactNode;
|
|
48
57
|
activity?: KnowledgePageActivityPayload[];
|
|
49
58
|
}): import("react").JSX.Element;
|
|
59
|
+
export {};
|
|
@@ -4,9 +4,11 @@ type KnowledgeSource = {
|
|
|
4
4
|
label: string;
|
|
5
5
|
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* The source imported pages came from: an importer's own scope (`linear:…`), or the page an importer
|
|
9
|
+
* writes its pages under, directly inside the organization scope and keyed by its source (`notion`).
|
|
10
|
+
*/
|
|
8
11
|
export declare function scopeSource(page: KnowledgePagePayload): KnowledgeSource | undefined;
|
|
9
|
-
/** A scope's readable name: an imported scope named only by its address reads as its source, e.g. "Linear". */
|
|
10
12
|
export declare function scopeTitle(page: KnowledgePagePayload): string;
|
|
11
13
|
/** The page's place from its root scope down, through the pages the graph holds. */
|
|
12
14
|
export declare function pagePath(page: KnowledgePagePayload, byId: ReadonlyMap<string, KnowledgePagePayload>): string;
|
|
@@ -9,7 +9,10 @@ export type SettingsEmptyRowProps = ComponentProps<'div'> & {
|
|
|
9
9
|
/** The same action the list's header would hold, so an empty list still offers it. */
|
|
10
10
|
action?: ReactNode;
|
|
11
11
|
};
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* An empty list's only row: what's missing on the left ("No join links"), the list's action on the right. Looks
|
|
14
|
+
* exactly like `SettingsListHeader`, so empty and full lists match; use it for every empty list in a card.
|
|
15
|
+
*/
|
|
13
16
|
export declare function SettingsEmptyRow(props: SettingsEmptyRowProps): import("react").JSX.Element;
|
|
14
17
|
/** A list's notices and errors, as a row of its `SettingsContainer`. Takes no space while it has nothing in it. */
|
|
15
18
|
export declare function SettingsNoticeRow({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
@@ -25,5 +28,16 @@ export type SettingsItemProps = Omit<ComponentProps<'div'>, 'title'> & {
|
|
|
25
28
|
/** The item's status or actions, on the right. */
|
|
26
29
|
children?: ReactNode;
|
|
27
30
|
};
|
|
28
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* One thing in a settings list (an account, a member, a session, a source, a package version). Its right side holds
|
|
33
|
+
* the item's status or its own actions (Remove, Revoke, Copy), not a control that changes a setting. Goes in a
|
|
34
|
+
* `SettingsContainer`, usually under a `SettingsListHeader`.
|
|
35
|
+
*
|
|
36
|
+
* For a setting the person changes (an input, select or switch with a label), use `SettingsRow` instead.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* <SettingsItem media={<Avatar size="md" … />} title="Ada Lovelace" description="ada@example.com">
|
|
40
|
+
* <Button size="sm" variant="ghost">Remove</Button>
|
|
41
|
+
* </SettingsItem>
|
|
42
|
+
*/
|
|
29
43
|
export declare function SettingsItem({ media, title, description, children, className, ...props }: SettingsItemProps): import("react").JSX.Element;
|
|
@@ -21,7 +21,19 @@ export declare function SettingsRowControl({ viewOnly, children }: {
|
|
|
21
21
|
viewOnly?: boolean;
|
|
22
22
|
children: ReactNode;
|
|
23
23
|
}): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* One setting the person changes: a label, an optional one-line description, and the control that changes it. The
|
|
26
|
+
* row is a form field, so its label names the control. Goes in a `SettingsContainer`.
|
|
27
|
+
*
|
|
28
|
+
* For one thing in a list (an account, a member, an API key, a package version), use `SettingsItem` instead: a row
|
|
29
|
+
* with no control, or one per record in a `.map`, is a list item. A setting someone may not change stays a
|
|
30
|
+
* `SettingsRow` with `viewOnly`.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* <SettingsRow label="Theme" description="Color scheme for the interface.">
|
|
34
|
+
* <ThemeToggle />
|
|
35
|
+
* </SettingsRow>
|
|
36
|
+
*/
|
|
25
37
|
export declare function SettingsRow({ label, description, htmlFor, children, className, tone, viewOnly, required, errorMsg, disabled, controlPlacement, ...props }: SettingsRowProps): import("react").JSX.Element;
|
|
26
38
|
export type SettingsFieldsetRowProps = Omit<FieldsetProps, 'children'> & {
|
|
27
39
|
label: ReactNode;
|
|
@@ -30,5 +42,13 @@ export type SettingsFieldsetRowProps = Omit<FieldsetProps, 'children'> & {
|
|
|
30
42
|
/** Same as `SettingsRow`'s: `below` puts the controls under the label at full width. */
|
|
31
43
|
controlPlacement?: 'side' | 'below';
|
|
32
44
|
};
|
|
33
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* A `SettingsRow` for one setting made of several controls (radios, several switches), labelled by a legend. Same
|
|
47
|
+
* rule as `SettingsRow`: a setting the person changes, never a list entry.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* <SettingsFieldsetRow label="Notify me about" controlPlacement="below">
|
|
51
|
+
* <Checkbox … />
|
|
52
|
+
* </SettingsFieldsetRow>
|
|
53
|
+
*/
|
|
34
54
|
export declare function SettingsFieldsetRow({ label, description, children, className, controlPlacement, ...props }: SettingsFieldsetRowProps): import("react").JSX.Element;
|
package/dist/style.css
CHANGED
|
@@ -3990,6 +3990,10 @@
|
|
|
3990
3990
|
flex-basis: auto;
|
|
3991
3991
|
}
|
|
3992
3992
|
|
|
3993
|
+
.basis-full {
|
|
3994
|
+
flex-basis: 100%;
|
|
3995
|
+
}
|
|
3996
|
+
|
|
3993
3997
|
.table-fixed {
|
|
3994
3998
|
table-layout: fixed;
|
|
3995
3999
|
}
|
|
@@ -6638,6 +6642,10 @@
|
|
|
6638
6642
|
padding-inline-start: var(--chat-edge);
|
|
6639
6643
|
}
|
|
6640
6644
|
|
|
6645
|
+
.ps-\(--settings-inset\) {
|
|
6646
|
+
padding-inline-start: var(--settings-inset);
|
|
6647
|
+
}
|
|
6648
|
+
|
|
6641
6649
|
.ps-2\.5 {
|
|
6642
6650
|
padding-inline-start: calc(var(--spacing) * 2.5);
|
|
6643
6651
|
}
|
|
@@ -8641,6 +8649,10 @@
|
|
|
8641
8649
|
--scroll-area-scrollbar-inset: .5rem;
|
|
8642
8650
|
}
|
|
8643
8651
|
|
|
8652
|
+
.\[--settings-inset\:0px\] {
|
|
8653
|
+
--settings-inset: 0px;
|
|
8654
|
+
}
|
|
8655
|
+
|
|
8644
8656
|
.\[--sidebar-hold-opacity\:0\] {
|
|
8645
8657
|
--sidebar-hold-opacity: 0;
|
|
8646
8658
|
}
|
|
@@ -10932,6 +10944,10 @@
|
|
|
10932
10944
|
background-color: #0000;
|
|
10933
10945
|
}
|
|
10934
10946
|
|
|
10947
|
+
:where([data-slot="settings-layout"]) .in-data-\[slot\=settings-layout\]\:\[--settings-inset\:--spacing\(2\.5\)\] {
|
|
10948
|
+
--settings-inset: calc(var(--spacing) * 2.5);
|
|
10949
|
+
}
|
|
10950
|
+
|
|
10935
10951
|
.has-focus-visible\:bg-surface-panel:has(:focus-visible) {
|
|
10936
10952
|
background-color: var(--surface-panel);
|
|
10937
10953
|
}
|
|
@@ -12648,6 +12664,14 @@
|
|
|
12648
12664
|
max-height: calc(85dvh - 2rem);
|
|
12649
12665
|
}
|
|
12650
12666
|
|
|
12667
|
+
.sm\:min-h-\[calc\(var\(--text-label\)\*1\.5\+1px\+var\(--text-caption\)\*1\.5\)\] {
|
|
12668
|
+
min-height: calc(var(--text-label) * 1.5 + 1px + var(--text-caption) * 1.5);
|
|
12669
|
+
}
|
|
12670
|
+
|
|
12671
|
+
.sm\:min-h-\[calc\(var\(--text-label\)\*1\.5\+1px\+var\(--text-caption\)\*1\.5\+--spacing\(6\.5\)\)\] {
|
|
12672
|
+
min-height: calc(var(--text-label) * 1.5 + 1px + var(--text-caption) * 1.5 + calc(var(--spacing) * 6.5));
|
|
12673
|
+
}
|
|
12674
|
+
|
|
12651
12675
|
.sm\:w-36 {
|
|
12652
12676
|
width: calc(var(--spacing) * 36);
|
|
12653
12677
|
}
|
|
@@ -12696,6 +12720,10 @@
|
|
|
12696
12720
|
flex-shrink: 0;
|
|
12697
12721
|
}
|
|
12698
12722
|
|
|
12723
|
+
.sm\:basis-auto {
|
|
12724
|
+
flex-basis: auto;
|
|
12725
|
+
}
|
|
12726
|
+
|
|
12699
12727
|
.sm\:translate-y-0 {
|
|
12700
12728
|
--tw-translate-y: 0px;
|
|
12701
12729
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
@@ -12757,6 +12785,10 @@
|
|
|
12757
12785
|
justify-content: space-between;
|
|
12758
12786
|
}
|
|
12759
12787
|
|
|
12788
|
+
.sm\:justify-center {
|
|
12789
|
+
justify-content: center;
|
|
12790
|
+
}
|
|
12791
|
+
|
|
12760
12792
|
.sm\:justify-end {
|
|
12761
12793
|
justify-content: flex-end;
|
|
12762
12794
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-CmQyd0Gu.cjs");
|
|
2
2
|
let zod_v4 = require("zod/v4");
|
|
3
3
|
zod_v4 = require_rolldown_runtime.__toESM(zod_v4, 1);
|
|
4
|
-
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@modelcontextprotocol/sdk/1.32.2/
|
|
4
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@modelcontextprotocol/sdk/1.32.2/8326c6471d0594e8eae7130a68d16f1984de0a48ea06e84f6aa0accf5b542e41/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
5
5
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
6
6
|
/**
|
|
7
7
|
* Assert 'object' type schema.
|
|
@@ -1919,4 +1919,4 @@ Object.defineProperty(exports, "McpError", {
|
|
|
1919
1919
|
}
|
|
1920
1920
|
});
|
|
1921
1921
|
|
|
1922
|
-
//# sourceMappingURL=types-
|
|
1922
|
+
//# sourceMappingURL=types-CVS7iNs8.cjs.map
|