@tulipfarm/sprout 0.4.0 → 0.5.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 +55 -53
- package/dist/components/agent-avatar.d.ts +27 -0
- package/dist/components/agent-avatar.js +67 -0
- package/dist/components/alert-dialog.d.ts +2 -2
- package/dist/components/alert-dialog.js +4 -4
- package/dist/components/attachment.d.ts +1 -1
- package/dist/components/attachment.js +2 -2
- package/dist/components/avatar.d.ts +2 -10
- package/dist/components/avatar.js +3 -40
- package/dist/components/board.js +4 -4
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +13 -29
- package/dist/components/card.d.ts +1 -1
- package/dist/components/card.js +2 -2
- package/dist/components/chat-input.js +3 -3
- package/dist/components/chat-sources.js +1 -1
- package/dist/components/combobox.d.ts +10 -4
- package/dist/components/combobox.js +6 -5
- package/dist/components/form.js +1 -1
- package/dist/components/gradient-banner.d.ts +2 -2
- package/dist/components/gradient-banner.js +1 -1
- package/dist/components/input-group.d.ts +7 -7
- package/dist/components/input-group.js +7 -7
- package/dist/components/input-otp.d.ts +6 -2
- package/dist/components/input-otp.js +5 -3
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +2 -2
- package/dist/components/page-header.js +1 -1
- package/dist/components/pagination.js +2 -2
- package/dist/components/questionnaire.js +1 -1
- package/dist/components/record-list.d.ts +2 -2
- package/dist/components/record-list.js +2 -2
- package/dist/components/result-card.js +1 -1
- package/dist/components/rich-text-editor.d.ts +3 -3
- package/dist/components/rich-text-editor.js +3 -3
- package/dist/components/scroll-area.d.ts +2 -2
- package/dist/components/scroll-area.js +2 -2
- package/dist/components/search-field.js +1 -1
- package/dist/components/select.d.ts +2 -6
- package/dist/components/select.js +2 -2
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +2 -2
- package/dist/components/state-panel-samples.js +13 -13
- package/dist/components/state-sample.d.ts +1 -1
- package/dist/components/state-sample.js +2 -2
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +2 -2
- package/dist/components/table.js +1 -1
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group.js +3 -3
- package/dist/components/toggle.d.ts +2 -2
- package/dist/components/toggle.js +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/agent-avatar-artwork.d.ts +4 -0
- package/dist/internal/agent-avatar-artwork.js +219 -0
- package/dist/internal/hash.d.ts +1 -0
- package/dist/internal/hash.js +9 -0
- package/dist/styles/alert-dialog.css +6 -6
- package/dist/styles/attachment.css +13 -13
- package/dist/styles/avatar.css +2 -14
- package/dist/styles/button-group.css +1 -1
- package/dist/styles/button.css +29 -154
- package/dist/styles/chat-sources.css +1 -0
- package/dist/styles/combobox.css +13 -2
- package/dist/styles/command.css +3 -1
- package/dist/styles/context-menu.css +2 -0
- package/dist/styles/dropdown-menu.css +2 -0
- package/dist/styles/gradient-banner.css +0 -5
- package/dist/styles/index.css +5 -4
- package/dist/styles/input-group.css +36 -28
- package/dist/styles/input-otp.css +13 -3
- package/dist/styles/input.css +14 -6
- package/dist/styles/menubar.css +4 -2
- package/dist/styles/navigation-menu.css +1 -1
- package/dist/styles/page-header.css +4 -0
- package/dist/styles/pagination.css +11 -2
- package/dist/styles/record-list.css +1 -1
- package/dist/styles/result-card.css +1 -1
- package/dist/styles/rich-text-editor.css +3 -3
- package/dist/styles/select.css +8 -12
- package/dist/styles/sidebar.css +15 -13
- package/dist/styles/state-sample.css +2 -2
- package/dist/styles/table.css +11 -4
- package/dist/styles/tabs.css +1 -3
- package/dist/styles/toggle-group.css +6 -6
- package/dist/styles/toggle.css +6 -6
- package/dist/styles/view-switcher.css +20 -2
- package/package.json +5 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
|
-
export declare const spinnerSizeNames: readonly ["sm", "
|
|
2
|
+
export declare const spinnerSizeNames: readonly ["sm", "md", "lg"];
|
|
3
3
|
export type SpinnerSize = (typeof spinnerSizeNames)[number];
|
|
4
4
|
export declare const thinkingSpinnerSizeNames: readonly ["lg", "xl"];
|
|
5
5
|
export type ThinkingSpinnerSize = (typeof thinkingSpinnerSizeNames)[number];
|
|
@@ -8,7 +8,7 @@ export type SpinnerActivity = (typeof spinnerActivityNames)[number];
|
|
|
8
8
|
export interface LoaderSpinnerProps extends Omit<ComponentProps<'svg'>, 'children' | 'color'> {
|
|
9
9
|
variant?: 'default' | undefined;
|
|
10
10
|
/**
|
|
11
|
-
* `"sm"` is 12px, `"
|
|
11
|
+
* `"sm"` is 12px, `"md"` 16px, and `"lg"` 20px. The size holds inside
|
|
12
12
|
* buttons; badges shrink it to their 12px icon size.
|
|
13
13
|
*/
|
|
14
14
|
size?: SpinnerSize | undefined;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { lazy, Suspense } from 'react';
|
|
3
3
|
import { Loader } from 'reicon-react/icons/Loader';
|
|
4
4
|
import { cn } from '../internal/classes.js';
|
|
5
|
-
export const spinnerSizeNames = ['sm', '
|
|
5
|
+
export const spinnerSizeNames = ['sm', 'md', 'lg'];
|
|
6
6
|
export const thinkingSpinnerSizeNames = ['lg', 'xl'];
|
|
7
7
|
export const spinnerActivityNames = [
|
|
8
8
|
'working',
|
|
@@ -29,7 +29,7 @@ const ThinkingOrb = lazy(() => import('thinking-orbs').then(({ ThinkingOrb }) =>
|
|
|
29
29
|
export function Spinner(props) {
|
|
30
30
|
if (props.variant === 'thinking')
|
|
31
31
|
return _jsx(ThinkingSpinner, { ...props });
|
|
32
|
-
const { variant: _variant, size = '
|
|
32
|
+
const { variant: _variant, size = 'md', className, role = 'status', 'aria-label': label = 'Loading', 'aria-hidden': hidden, ...rest } = props;
|
|
33
33
|
const decorative = hidden === true || hidden === 'true';
|
|
34
34
|
return (_jsx(Loader, { "data-slot": "spinner", "data-variant": "default", "data-size": size, ...(decorative ? { 'aria-hidden': 'true' } : { role, 'aria-label': label }), focusable: "false", className: cn('sprout-spinner', `sprout-spinner-size-${size}`, className), ...rest }));
|
|
35
35
|
}
|
|
@@ -14,7 +14,7 @@ import { ShieldUser } from 'reicon-react/icons/ShieldUser';
|
|
|
14
14
|
import { User } from 'reicon-react/icons/User';
|
|
15
15
|
import { Users } from 'reicon-react/icons/Users';
|
|
16
16
|
import { FileTypeIcon } from './attachment.js';
|
|
17
|
-
import { AgentAvatar } from './avatar.js';
|
|
17
|
+
import { AgentAvatar } from './agent-avatar.js';
|
|
18
18
|
import { Badge } from './badge.js';
|
|
19
19
|
import { BrandIcon } from './brand-icon.js';
|
|
20
20
|
import { SampleBar, SampleIconTile, SampleList, SampleMark, SampleTable, SampleText, SampleWindow, } from './state-sample.js';
|
|
@@ -210,7 +210,7 @@ export function SkillsSample(props) {
|
|
|
210
210
|
export function WorkflowsSample(props) {
|
|
211
211
|
const active = badge('success', 'Active');
|
|
212
212
|
const draft = badge('secondary', 'Draft');
|
|
213
|
-
return (_jsx(SampleWindow, { ...props, icon: BranchDown, trail: ['Workflows'], children: _jsx(SampleTable, { columns: [{ label: 'Workflow', size: '
|
|
213
|
+
return (_jsx(SampleWindow, { ...props, icon: BranchDown, trail: ['Workflows'], children: _jsx(SampleTable, { columns: [{ label: 'Workflow', size: 'lg' }, { label: 'Trigger' }, { label: 'Status', size: 'sm' }], rows: [
|
|
214
214
|
[named('green', 'Approve large discounts'), muted('New quote'), active],
|
|
215
215
|
[named('blue', 'Onboard a new customer'), muted('Deal won'), active],
|
|
216
216
|
[named('orange', 'Reorder low stock'), muted('Daily, 8:00'), draft],
|
|
@@ -228,9 +228,9 @@ export function TablesSample(props) {
|
|
|
228
228
|
['teal', 'Support tickets', '10', '2,031'],
|
|
229
229
|
];
|
|
230
230
|
return (_jsx(SampleWindow, { ...props, icon: Database, trail: ['Tables'], children: _jsx(SampleTable, { columns: [
|
|
231
|
-
{ label: 'Table', size: '
|
|
232
|
-
{ label: 'Fields', size: '
|
|
233
|
-
{ label: 'Rows', size: '
|
|
231
|
+
{ label: 'Table', size: 'lg' },
|
|
232
|
+
{ label: 'Fields', size: 'sm' },
|
|
233
|
+
{ label: 'Rows', size: 'sm' },
|
|
234
234
|
], rows: rows.map(([tone, name, fields, count]) => [
|
|
235
235
|
named(tone, name),
|
|
236
236
|
_jsx(SampleText, { children: fields }),
|
|
@@ -250,13 +250,13 @@ export function RecordsSample({ table, fields, ...props }) {
|
|
|
250
250
|
const columns = shown.length
|
|
251
251
|
? shown.map((label, index) => ({
|
|
252
252
|
label,
|
|
253
|
-
size: index === 0 ? '
|
|
253
|
+
size: index === 0 ? 'lg' : 'md',
|
|
254
254
|
}))
|
|
255
|
-
: [{ label: 'Row', size: '
|
|
255
|
+
: [{ label: 'Row', size: 'lg' }];
|
|
256
256
|
return (_jsx(SampleWindow, { ...props, icon: Database, trail: ['Tables', table], children: _jsx(SampleTable, { columns: columns, rows: recordRows.map(([tone, first, rest]) => columns.map((_, column) => column === 0 ? (_jsxs(_Fragment, { children: [_jsx(SampleMark, { tone: tone }), _jsx(SampleBar, { width: first })] })) : (_jsx(SampleBar, { width: column % 2 ? rest : first })))) }) }));
|
|
257
257
|
}
|
|
258
258
|
export function CreateInChatSample(props) {
|
|
259
|
-
return (_jsx(SampleWindow, { ...props, icon: ChatRound, trail: ['New chat'], children: _jsxs("div", { className: "sprout-state-panel-samples-chat", children: [_jsx("p", { className: "sprout-state-panel-samples-bubble", children: "Track our suppliers with a name, contact email, payment terms, and region." }), _jsxs("p", { className: "sprout-state-panel-samples-reply", children: ["I\u2019ll create a ", _jsx("strong", { children: "Suppliers" }), " table with these fields. Review the schema before approving."] }), _jsx("div", { className: "sprout-state-panel-samples-schema", children: _jsx(SampleTable, { columns: [{ label: 'Field', size: '
|
|
259
|
+
return (_jsx(SampleWindow, { ...props, icon: ChatRound, trail: ['New chat'], children: _jsxs("div", { className: "sprout-state-panel-samples-chat", children: [_jsx("p", { className: "sprout-state-panel-samples-bubble", children: "Track our suppliers with a name, contact email, payment terms, and region." }), _jsxs("p", { className: "sprout-state-panel-samples-reply", children: ["I\u2019ll create a ", _jsx("strong", { children: "Suppliers" }), " table with these fields. Review the schema before approving."] }), _jsx("div", { className: "sprout-state-panel-samples-schema", children: _jsx(SampleTable, { columns: [{ label: 'Field', size: 'lg' }, { label: 'Type' }], rows: [
|
|
260
260
|
[strong('Name'), muted('Text')],
|
|
261
261
|
[strong('Contact email'), muted('Email')],
|
|
262
262
|
[strong('Payment terms'), muted('Choice')],
|
|
@@ -329,7 +329,7 @@ export function ModelsSample(props) {
|
|
|
329
329
|
export function MembersSample(props) {
|
|
330
330
|
const admin = badge('info', 'Admin');
|
|
331
331
|
const member = badge('secondary', 'Member');
|
|
332
|
-
return (_jsx(SampleWindow, { ...props, icon: User, trail: ['Settings', 'Members'], children: _jsx(SampleTable, { columns: [{ label: 'Member', size: '
|
|
332
|
+
return (_jsx(SampleWindow, { ...props, icon: User, trail: ['Settings', 'Members'], children: _jsx(SampleTable, { columns: [{ label: 'Member', size: 'lg' }, { label: 'Role', size: 'sm' }, { label: 'Teams' }], rows: [
|
|
333
333
|
[named('violet', 'Maya Chen'), admin, muted('Operations')],
|
|
334
334
|
[named('orange', 'Leo Martins'), member, muted('Sales, Support')],
|
|
335
335
|
[named('green', 'Priya Nair'), member, muted('Finance')],
|
|
@@ -363,7 +363,7 @@ export function TeamsSample(props) {
|
|
|
363
363
|
}
|
|
364
364
|
export function InvitationsSample(props) {
|
|
365
365
|
const link = (email) => _jsx(SampleText, { tone: "link", children: email });
|
|
366
|
-
return (_jsx(SampleWindow, { ...props, icon: Envelope, trail: ['Settings', 'Members', 'Invitations'], children: _jsx(SampleTable, { columns: [{ label: 'Email', size: '
|
|
366
|
+
return (_jsx(SampleWindow, { ...props, icon: Envelope, trail: ['Settings', 'Members', 'Invitations'], children: _jsx(SampleTable, { columns: [{ label: 'Email', size: 'lg' }, { label: 'Status', size: 'sm' }, { label: 'Email delivery' }], rows: [
|
|
367
367
|
[link('maya@northwind.co'), badge('info', 'active'), muted('Delivered')],
|
|
368
368
|
[link('leo@northwind.co'), badge('secondary', 'Accepted'), muted('Delivered')],
|
|
369
369
|
[link('priya@northwind.co'), badge('info', 'active'), muted('Sent')],
|
|
@@ -374,9 +374,9 @@ export function GrantsSample(props) {
|
|
|
374
374
|
const granted = badge('success', 'Granted');
|
|
375
375
|
const none = muted('None');
|
|
376
376
|
return (_jsx(SampleWindow, { ...props, icon: ShieldUser, trail: ['Settings', 'Table access'], tabs: ['Sales', 'Finance', 'Support'], children: _jsx(SampleTable, { columns: [
|
|
377
|
-
{ label: 'Table', size: '
|
|
378
|
-
{ label: 'Read', size: '
|
|
379
|
-
{ label: 'Edit', size: '
|
|
377
|
+
{ label: 'Table', size: 'lg' },
|
|
378
|
+
{ label: 'Read', size: 'sm' },
|
|
379
|
+
{ label: 'Edit', size: 'sm' },
|
|
380
380
|
], rows: [
|
|
381
381
|
[named('blue', 'Customers'), granted, granted],
|
|
382
382
|
[named('green', 'Invoices'), granted, none],
|
|
@@ -14,7 +14,7 @@ export interface SampleWindowProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
14
14
|
children: ReactNode;
|
|
15
15
|
}
|
|
16
16
|
export declare function SampleWindow({ icon: Icon, trail, tabs, label, children, className, ...props }: SampleWindowProps): import("react").JSX.Element;
|
|
17
|
-
export declare const sampleColumnSizeNames: readonly ["
|
|
17
|
+
export declare const sampleColumnSizeNames: readonly ["lg", "md", "sm"];
|
|
18
18
|
export type SampleColumnSize = (typeof sampleColumnSizeNames)[number];
|
|
19
19
|
export type SampleColumn = {
|
|
20
20
|
label: string;
|
|
@@ -4,9 +4,9 @@ import { cn } from '../internal/classes.js';
|
|
|
4
4
|
export function SampleWindow({ icon: Icon, trail, tabs, label = 'Example', children, className, ...props }) {
|
|
5
5
|
return (_jsxs("div", { "data-slot": "state-sample", ...props, className: cn('sprout-state-sample', className), children: [_jsxs("div", { className: "sprout-state-sample-bar", children: [_jsx("span", { className: "sprout-state-sample-icon", "aria-hidden": "true", children: _jsx(Icon, { size: 14 }) }), trail.map((part, index) => (_jsxs(Fragment, { children: [index > 0 && (_jsx("span", { className: "sprout-state-sample-faint", "aria-hidden": "true", children: "/" })), _jsx("span", { className: "sprout-state-sample-crumb", "data-current": index === trail.length - 1 ? '' : undefined, children: part })] }, index))), _jsx("span", { className: "sprout-state-sample-faint", "aria-hidden": "true", children: "\u00B7\u00B7\u00B7" }), _jsx("span", { className: "sprout-state-sample-label", children: label })] }), tabs && tabs.length > 0 && (_jsx("div", { className: "sprout-state-sample-tabs", children: tabs.map((tab, index) => (_jsx("span", { className: "sprout-state-sample-tab", "data-selected": index === 0 ? '' : undefined, children: tab }, index))) })), children] }));
|
|
6
6
|
}
|
|
7
|
-
export const sampleColumnSizeNames = ['
|
|
7
|
+
export const sampleColumnSizeNames = ['lg', 'md', 'sm'];
|
|
8
8
|
export function SampleTable({ columns, rows, className, ...props }) {
|
|
9
|
-
return (_jsxs("div", { "data-slot": "state-sample-table", ...props, className: cn('sprout-state-sample-table', className), children: [_jsxs("div", { className: "sprout-state-sample-head", children: [_jsx("span", { className: "sprout-state-sample-check", "aria-hidden": "true" }), columns.map((column, index) => (_jsx("span", { className: "sprout-state-sample-cell", "data-size": column.size ?? '
|
|
9
|
+
return (_jsxs("div", { "data-slot": "state-sample-table", ...props, className: cn('sprout-state-sample-table', className), children: [_jsxs("div", { className: "sprout-state-sample-head", children: [_jsx("span", { className: "sprout-state-sample-check", "aria-hidden": "true" }), columns.map((column, index) => (_jsx("span", { className: "sprout-state-sample-cell", "data-size": column.size ?? 'md', children: column.label }, index)))] }), rows.map((row, rowIndex) => (_jsxs("div", { className: "sprout-state-sample-row", children: [_jsx("span", { className: "sprout-state-sample-check", "aria-hidden": "true" }), row.map((cell, cellIndex) => (_jsx("span", { className: "sprout-state-sample-cell", "data-size": columns[cellIndex]?.size ?? 'md', children: cell }, cellIndex)))] }, rowIndex)))] }));
|
|
10
10
|
}
|
|
11
11
|
export function SampleList({ items, className, ...props }) {
|
|
12
12
|
return (_jsx("div", { "data-slot": "state-sample-list", ...props, className: cn('sprout-state-sample-list', className), children: items.map((item, index) => (_jsxs("div", { className: "sprout-state-sample-item", children: [item.leading && _jsx("span", { className: "sprout-state-sample-leading", children: item.leading }), _jsxs("span", { className: "sprout-state-sample-copy", children: [_jsx("span", { className: "sprout-state-sample-title", children: item.title }), item.detail && _jsx("span", { className: "sprout-state-sample-detail", children: item.detail })] }), item.trailing && _jsx("span", { className: "sprout-state-sample-trailing", children: item.trailing })] }, index))) }));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Switch as BaseSwitch } from '@base-ui/react/switch';
|
|
2
|
-
export declare const switchSizeNames: readonly ["
|
|
2
|
+
export declare const switchSizeNames: readonly ["md", "sm"];
|
|
3
3
|
export type SwitchSize = (typeof switchSizeNames)[number];
|
|
4
4
|
export interface SwitchProps extends BaseSwitch.Root.Props {
|
|
5
|
-
/** `
|
|
5
|
+
/** `md` is a 32 × 18px track. `sm` is a 24 × 14px track. */
|
|
6
6
|
size?: SwitchSize | undefined;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -3,12 +3,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Switch as BaseSwitch } from '@base-ui/react/switch';
|
|
4
4
|
import { cn, stateClassName } from '../internal/classes.js';
|
|
5
5
|
import { useFieldsetDisabled } from '../internal/fieldset.js';
|
|
6
|
-
export const switchSizeNames = ['
|
|
6
|
+
export const switchSizeNames = ['md', 'sm'];
|
|
7
7
|
/**
|
|
8
8
|
* An on/off switch for a setting that applies right away. Name it with a
|
|
9
9
|
* wrapping `Label`, a `Label htmlFor` pointing at its `id`, or `aria-label`.
|
|
10
10
|
*/
|
|
11
|
-
export function Switch({ size = '
|
|
11
|
+
export function Switch({ size = 'md', className, disabled, ref, ...props }) {
|
|
12
12
|
const [fieldsetDisabled, fieldsetRef] = useFieldsetDisabled(ref);
|
|
13
13
|
return (_jsx(BaseSwitch.Root, { "data-slot": "switch", "data-size": size, ...props, ref: fieldsetRef, disabled: disabled || fieldsetDisabled, className: stateClassName(cn('sprout-switch', `sprout-switch-size-${size}`), className), children: _jsx(BaseSwitch.Thumb, { "data-slot": "switch-thumb", className: "sprout-switch-thumb" }) }));
|
|
14
14
|
}
|
package/dist/components/table.js
CHANGED
|
@@ -445,7 +445,7 @@ function HeadCell({ header, config, resizable, reorderable, sized, role, }) {
|
|
|
445
445
|
[column.id]: Math.max(48, column.getSize() + delta),
|
|
446
446
|
}));
|
|
447
447
|
};
|
|
448
|
-
return (_jsxs("th", { ref: reorderable ? sortable_.setNodeRef : undefined, "data-slot": "table-head", "data-align": align, "data-pinned": pinned || undefined, "data-column-id": column.id, "data-dragging": sortable_.isDragging || undefined, className: "sprout-table-head", "aria-sort": sorted === 'asc' ? 'ascending' : sorted === 'desc' ? 'descending' : undefined, role: role, style: style, children: [_jsxs("span", { className: "sprout-table-head-inner", children: [reorderable && (_jsx("button", { type: "button", className: "sprout-table-handle", "aria-label": `Move ${title} column`, ...sortable_.attributes, ...sortable_.listeners, children: _jsx(Reorder, { size: 14, "aria-hidden": "true" }) })), sortable ? (_jsxs(Button, { variant: sorted ? 'secondary' : 'ghost', size: align === 'right' ? '
|
|
448
|
+
return (_jsxs("th", { ref: reorderable ? sortable_.setNodeRef : undefined, "data-slot": "table-head", "data-align": align, "data-pinned": pinned || undefined, "data-column-id": column.id, "data-dragging": sortable_.isDragging || undefined, className: "sprout-table-head", "aria-sort": sorted === 'asc' ? 'ascending' : sorted === 'desc' ? 'descending' : undefined, role: role, style: style, children: [_jsxs("span", { className: "sprout-table-head-inner", children: [reorderable && (_jsx("button", { type: "button", className: "sprout-table-handle", "aria-label": `Move ${title} column`, ...sortable_.attributes, ...sortable_.listeners, children: _jsx(Reorder, { size: 14, "aria-hidden": "true" }) })), sortable ? (_jsxs(Button, { variant: sorted ? 'secondary' : 'ghost', size: "sm", className: align === 'right' ? 'sprout-table-sort sprout-table-sort-end' : 'sprout-table-sort', "aria-label": `Sort by ${title}${hint}`, title: sorted ? undefined : 'Sort ascending', onClick: column.getToggleSortingHandler(), children: [title, _jsx(Icon, { size: 14, "aria-hidden": "true" })] })) : (title), config?.hint && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: _jsx("button", { type: "button", "aria-label": `About ${title}`, className: "sprout-table-hint" }), children: _jsx(InfoCircle, { size: 14, "aria-hidden": "true" }) }), _jsx(TooltipContent, { children: config.hint })] }))] }), resizable && (_jsx("div", { role: "separator", "aria-orientation": "vertical", "aria-label": `Resize ${title} column`, "aria-valuenow": column.getSize(), "aria-valuemin": 48, tabIndex: 0, className: "sprout-table-resizer", "data-resizing": column.getIsResizing() || undefined, onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), onKeyDown: onResizeKey, onDoubleClick: () => column.resetSize() }))] }));
|
|
449
449
|
}
|
|
450
450
|
function GroupRow({ row, columns, byKey, selectable, reorder, hasActions, rowIndex, role, }) {
|
|
451
451
|
const groupColumn = byKey.get(row.groupingColumnId ?? '');
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Toggle as BaseToggle } from '@base-ui/react/toggle';
|
|
2
2
|
import { ToggleGroup as BaseToggleGroup } from '@base-ui/react/toggle-group';
|
|
3
3
|
export declare const toggleGroupVariantNames: readonly ["default", "outline"];
|
|
4
|
-
export declare const toggleGroupSizeNames: readonly ["
|
|
4
|
+
export declare const toggleGroupSizeNames: readonly ["md", "sm", "lg"];
|
|
5
5
|
export type ToggleGroupVariant = (typeof toggleGroupVariantNames)[number];
|
|
6
6
|
export type ToggleGroupSize = (typeof toggleGroupSizeNames)[number];
|
|
7
7
|
export interface ToggleGroupProps<Value extends string = string> extends BaseToggleGroup.Props<Value> {
|
|
8
8
|
/** `default` is borderless. `outline` draws a control border on each item. */
|
|
9
9
|
variant?: ToggleGroupVariant;
|
|
10
|
-
/** `sm` is 28px, `
|
|
10
|
+
/** `sm` is 28px, `md` 32px, and `lg` 36px tall. */
|
|
11
11
|
size?: ToggleGroupSize;
|
|
12
12
|
/**
|
|
13
13
|
* Gap between items in 4px steps. `0` joins the items into one
|
|
@@ -5,10 +5,10 @@ import { Toggle as BaseToggle } from '@base-ui/react/toggle';
|
|
|
5
5
|
import { ToggleGroup as BaseToggleGroup } from '@base-ui/react/toggle-group';
|
|
6
6
|
import { cn } from '../internal/classes.js';
|
|
7
7
|
export const toggleGroupVariantNames = ['default', 'outline'];
|
|
8
|
-
export const toggleGroupSizeNames = ['
|
|
8
|
+
export const toggleGroupSizeNames = ['md', 'sm', 'lg'];
|
|
9
9
|
const ToggleGroupContext = createContext({
|
|
10
10
|
variant: 'default',
|
|
11
|
-
size: '
|
|
11
|
+
size: 'md',
|
|
12
12
|
spacing: 2,
|
|
13
13
|
orientation: 'horizontal',
|
|
14
14
|
});
|
|
@@ -17,7 +17,7 @@ const ToggleGroupContext = createContext({
|
|
|
17
17
|
* `multiple` to let several items stay pressed. Arrow keys move focus
|
|
18
18
|
* between items; Space and Enter press the focused one.
|
|
19
19
|
*/
|
|
20
|
-
export function ToggleGroup({ className, style, variant = 'default', size = '
|
|
20
|
+
export function ToggleGroup({ className, style, variant = 'default', size = 'md', spacing = 2, orientation = 'horizontal', children, ...props }) {
|
|
21
21
|
const gap = { '--sprout-toggle-group-spacing': spacing };
|
|
22
22
|
return (_jsx(BaseToggleGroup, { "data-slot": "toggle-group", "data-variant": variant, "data-size": size, "data-spacing": spacing, orientation: orientation, ...props, style: typeof style === 'function'
|
|
23
23
|
? (state) => ({ ...gap, ...style(state) })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Toggle as BaseToggle } from '@base-ui/react/toggle';
|
|
2
2
|
export declare const toggleVariantNames: readonly ["default", "outline"];
|
|
3
|
-
export declare const toggleSizeNames: readonly ["
|
|
3
|
+
export declare const toggleSizeNames: readonly ["md", "sm", "lg"];
|
|
4
4
|
export type ToggleVariant = (typeof toggleVariantNames)[number];
|
|
5
5
|
export type ToggleSize = (typeof toggleSizeNames)[number];
|
|
6
6
|
export interface ToggleVariantOptions {
|
|
@@ -16,7 +16,7 @@ export declare function toggleVariants({ variant, size, className }?: ToggleVari
|
|
|
16
16
|
export interface ToggleProps<Value extends string = string> extends BaseToggle.Props<Value> {
|
|
17
17
|
/** `default` is borderless. `outline` draws a control border. */
|
|
18
18
|
variant?: ToggleVariant | null;
|
|
19
|
-
/** `sm` is 28px, `
|
|
19
|
+
/** `sm` is 28px, `md` 32px, and `lg` 36px tall. */
|
|
20
20
|
size?: ToggleSize | null;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -3,13 +3,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Toggle as BaseToggle } from '@base-ui/react/toggle';
|
|
4
4
|
import { cn, stateClassName } from '../internal/classes.js';
|
|
5
5
|
export const toggleVariantNames = ['default', 'outline'];
|
|
6
|
-
export const toggleSizeNames = ['
|
|
6
|
+
export const toggleSizeNames = ['md', 'sm', 'lg'];
|
|
7
7
|
/**
|
|
8
8
|
* Class names for a toggle look. Use it to give another pressable element,
|
|
9
9
|
* such as a Base UI `Toggle` inside your own group, the same style.
|
|
10
10
|
*/
|
|
11
11
|
export function toggleVariants({ variant, size, className } = {}) {
|
|
12
|
-
return cn('sprout-toggle', `sprout-toggle-variant-${variant ?? 'default'}`, `sprout-toggle-size-${size ?? '
|
|
12
|
+
return cn('sprout-toggle', `sprout-toggle-variant-${variant ?? 'default'}`, `sprout-toggle-size-${size ?? 'md'}`, className);
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* A two-state button. It sets `aria-pressed` and `data-pressed` while on.
|
|
@@ -17,5 +17,5 @@ export function toggleVariants({ variant, size, className } = {}) {
|
|
|
17
17
|
* An icon-only toggle needs an `aria-label`.
|
|
18
18
|
*/
|
|
19
19
|
export function Toggle({ variant, size, className, ...props }) {
|
|
20
|
-
return (_jsx(BaseToggle, { "data-slot": "toggle", "data-variant": variant ?? 'default', "data-size": size ?? '
|
|
20
|
+
return (_jsx(BaseToggle, { "data-slot": "toggle", "data-variant": variant ?? 'default', "data-size": size ?? 'md', ...props, className: stateClassName(toggleVariants({ variant, size }), className) }));
|
|
21
21
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const objects: readonly ["tulip", "tulip-bouquet", "cactus", "sunflower", "daisy", "sprout", "bonsai", "monstera", "fern", "lavender", "rose", "poppy", "daffodil", "lily", "bellflower", "eucalyptus", "ivy", "succulent", "acorn", "pinecone", "watering-can", "hand-trowel", "garden-fork", "pruning-shears", "gardening-gloves", "rain-boots", "wheelbarrow", "seed-packet", "flower-pot", "plant-mister", "spade", "rake", "hoe", "garden-hose", "seed-tray", "garden-apron", "plant-label", "twine-spool", "compost-bin", "pruning-saw", "mushroom", "strawberry", "carrot", "pumpkin", "apple", "pear", "lemon", "corn-cob", "honey-jar", "harvest-basket", "windmill", "barn", "tractor", "wheat", "pea-pod", "beetroot", "radish", "eggplant", "cherries", "hay-bale", "umbrella", "mug", "teapot", "moka-pot", "lantern", "candle", "picnic-basket", "straw-hat", "vase", "jam-jar", "birdhouse", "rocking-chair", "kettle", "bread-loaf", "croissant", "milk-bottle", "cookie", "oven-mitt", "thermos", "yarn-ball", "notebook", "pencil", "paintbrush", "paint-palette", "fountain-pen", "camera", "headphones", "desk-lamp", "book-stack", "alarm-clock", "scissors", "ruler", "stapler", "paperclip", "binder-clip", "tape-dispenser", "magnifying-glass", "envelope", "typewriter", "globe"];
|
|
2
|
+
export declare const colors: readonly ["pink", "coral", "orange", "yellow", "green", "teal", "blue", "purple"];
|
|
3
|
+
export declare const palettes: string[][];
|
|
4
|
+
export declare const artwork: string[];
|