@alexgorbatchev/shadcn 0.0.85 → 0.0.87
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/{chunk-cjbbeph9.js → chunk-h2xvhydx.js} +409 -224
- package/dist/{chunk-5jtbr6q4.js → chunk-nj2shejq.js} +1 -1
- package/dist/{chunk-xhq6s4z7.js → chunk-qn4a3gg4.js} +4 -2
- package/dist/{chunk-tmt6rwg1.js → chunk-wnkxd9km.js} +1 -1
- package/dist/{chunk-ya14cv0r.js → chunk-z6kyewpg.js} +1 -1
- package/dist/components/ReviewList.d.ts +13 -2
- package/dist/components/StarRating.d.ts +14 -2
- package/dist/components/Table.d.ts +8 -2
- package/dist/components/ToolbarToggleChip.d.ts +39 -0
- package/dist/components/assistant-ui/elements/DataTable.js +2 -2
- package/dist/components/assistant-ui/index.js +2 -2
- package/dist/components/data-grid/index.js +2 -2
- package/dist/components/gantt/index.js +1 -1
- package/dist/components/json-render/index.js +2 -2
- package/dist/components/resizable/SplitView.d.ts +4 -2
- package/dist/components/resizable/index.js +26 -1
- package/dist/components/virtual-data-grid/index.js +3 -3
- package/dist/components/virtual-table/index.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -2
- package/dist/prototype.js +1 -1
- package/llms/components/actions/ToolbarToggleChip.md +105 -0
- package/llms/components/data-display/ReviewList.md +8 -0
- package/llms/components/data-display/Table.md +23 -0
- package/llms/components/forms/StarRating.md +26 -0
- package/llms/components/layout/SplitView.md +16 -0
- package/llms.txt +1 -0
- package/package.json +1 -1
|
@@ -49,11 +49,13 @@ function TableFooter2({ density, className, ...props }) {
|
|
|
49
49
|
...props
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
function TableRow2({ density, className, ...props }) {
|
|
52
|
+
function TableRow2({ density, className, stripe, style, ...props }) {
|
|
53
53
|
return /* @__PURE__ */ jsx("tr", {
|
|
54
54
|
"data-density": density,
|
|
55
55
|
"data-slot": "table-row",
|
|
56
|
-
|
|
56
|
+
"data-stripe": stripe ? "" : undefined,
|
|
57
|
+
style: stripe ? { ...style, ["--row-stripe"]: stripe } : style,
|
|
58
|
+
className: cn2("border-b transition-colors outline-none hover:bg-muted/50 has-aria-expanded:bg-muted/50 focus:outline-2 focus:-outline-offset-2 focus:outline-ring data-[state=selected]:bg-muted aria-selected:bg-primary/10 aria-selected:shadow-[inset_3px_0_0_var(--primary)] aria-selected:hover:bg-primary/15", "data-stripe:[&>td:first-child]:shadow-[inset_4px_0_0_var(--row-stripe)] data-stripe:aria-selected:[&>td:first-child]:shadow-[inset_3px_0_0_var(--primary),inset_7px_0_0_var(--row-stripe)]", className),
|
|
57
59
|
...props
|
|
58
60
|
});
|
|
59
61
|
}
|
|
@@ -9,18 +9,29 @@ export interface IReviewListRow {
|
|
|
9
9
|
content: ReactNode;
|
|
10
10
|
/** Further cells with their own controls, which ← and → reach; give those controls `tabIndex={-1}`. */
|
|
11
11
|
cells?: readonly ReactNode[];
|
|
12
|
+
/** The row's depth in a tree review, from 1; any row with a level makes the list a tree grid. */
|
|
13
|
+
level?: number;
|
|
14
|
+
/** Whether a row with children shows them; leave unset on rows without children. Enter toggles it. */
|
|
15
|
+
isExpanded?: boolean;
|
|
16
|
+
/** Some but not all of the row's children are included; the checkbox shows the mixed state. */
|
|
17
|
+
isIndeterminate?: boolean;
|
|
12
18
|
}
|
|
13
19
|
interface IReviewListProps {
|
|
14
20
|
label: string;
|
|
15
21
|
rows: readonly IReviewListRow[];
|
|
16
22
|
/** Sets the inclusion of these rows; a range or Mod+A changes several at once. */
|
|
17
23
|
onIncludedChange: (ids: readonly string[], isIncluded: boolean) => void;
|
|
24
|
+
/** Shows or hides a row's children: Enter on the row or its disclosure. The consumer drops hidden rows. */
|
|
25
|
+
onExpandedChange?: (id: string, isExpanded: boolean) => void;
|
|
18
26
|
}
|
|
19
27
|
/**
|
|
20
28
|
* A plan's review rows, where a tick means "include this change". It is one tab stop with a cursor: ↑/↓, Home and End
|
|
21
29
|
* move between rows and ← and → between a row's cells. A click only moves the cursor, so a stray click never changes
|
|
22
30
|
* what the plan includes; the checkbox, Mod+click, X and Shift+Space toggle a row, Shift+click sets the range from the
|
|
23
|
-
* anchor row to the anchor's state, and Mod+A includes every row.
|
|
31
|
+
* anchor row to the anchor's state, and Mod+A includes every row. Shift+↑ and Shift+↓ move the cursor and set the range
|
|
32
|
+
* from the anchor to it the same way. Space is left to the page, such as a player. Rows with a `level` form a tree:
|
|
33
|
+
* Enter or the disclosure shows or hides a row's children, and a row whose children are partly included shows a mixed
|
|
34
|
+
* checkbox.
|
|
24
35
|
*/
|
|
25
|
-
export declare function ReviewList({ label, rows, onIncludedChange }: IReviewListProps): ReactElement;
|
|
36
|
+
export declare function ReviewList({ label, rows, onIncludedChange, onExpandedChange }: IReviewListProps): ReactElement;
|
|
26
37
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
2
|
import type { IAnalyticsProps } from "../analytics/types.js";
|
|
3
3
|
import type { IDensityProps } from "../density/types.js";
|
|
4
4
|
interface IStarRatingProps extends IDensityProps, IAnalyticsProps {
|
|
@@ -10,8 +10,20 @@ interface IStarRatingProps extends IDensityProps, IAnalyticsProps {
|
|
|
10
10
|
* target, such as a data-grid row that rates its track with its own keys.
|
|
11
11
|
*/
|
|
12
12
|
focusable?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* When a rating is written. `change` (the default) reports every move, including arrow keys. `confirm` lets arrow
|
|
15
|
+
* keys move a draft and reports it once, on Enter, Space, a click or leaving the stars, so a rating that saves on
|
|
16
|
+
* change is never written by the first arrow press.
|
|
17
|
+
*/
|
|
18
|
+
commit?: "change" | "confirm";
|
|
19
|
+
/** Whether Unrated is offered; turn it off where clearing a rating is a separate, confirmed action. */
|
|
20
|
+
clearable?: boolean;
|
|
21
|
+
/** A confirmed rating is saving; the stars stay enabled and keep focus, and announce that they are busy. */
|
|
22
|
+
busy?: boolean;
|
|
23
|
+
/** In `confirm` mode, called when the current rating is chosen again, such as a click on the lit last star. */
|
|
24
|
+
onReselect?: (value: number) => void;
|
|
13
25
|
onValueChange: (value: number) => void;
|
|
14
26
|
}
|
|
15
27
|
/** Five stars and Unrated as one radio group; compact density draws it to fit a single-line row. */
|
|
16
|
-
export declare function StarRating({ analytics, label, value, disabled, density: densityProp, focusable, onValueChange, }: IStarRatingProps): ReactElement;
|
|
28
|
+
export declare function StarRating({ analytics, label, value, disabled, density: densityProp, focusable, commit, clearable, busy, onReselect, onValueChange, }: IStarRatingProps): ReactElement;
|
|
17
29
|
export {};
|
|
@@ -14,8 +14,14 @@ type TableBodyProps = ComponentProps<"tbody"> & IDensityProps;
|
|
|
14
14
|
declare function TableBody({ density, className, ...props }: TableBodyProps): ReactElement;
|
|
15
15
|
type TableFooterProps = ComponentProps<"tfoot"> & IDensityProps;
|
|
16
16
|
declare function TableFooter({ density, className, ...props }: TableFooterProps): ReactElement;
|
|
17
|
-
type TableRowProps = ComponentProps<"tr"> & IDensityProps
|
|
18
|
-
|
|
17
|
+
type TableRowProps = ComponentProps<"tr"> & IDensityProps & {
|
|
18
|
+
/**
|
|
19
|
+
* A CSS color drawn as a 4 px stripe at the row's leading edge, such as a track's label color. A selected row
|
|
20
|
+
* keeps its selection edge and draws the stripe just inside it.
|
|
21
|
+
*/
|
|
22
|
+
stripe?: string;
|
|
23
|
+
};
|
|
24
|
+
declare function TableRow({ density, className, stripe, style, ...props }: TableRowProps): ReactElement;
|
|
19
25
|
type TableTextAlign = TextAlign;
|
|
20
26
|
/** Viewport breakpoints, or table-container breakpoints at 400, 480, and 640 pixels. */
|
|
21
27
|
type TableVisibility = "sm" | "lg" | "container-sm" | "container-md" | "container-lg";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { IAnalyticsProps } from "../analytics/types.js";
|
|
2
|
+
import type { IDensityProps } from "../density/types.js";
|
|
3
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
4
|
+
/** `"mixed"` is a value that only some of the chip's targets hold, such as a tag on 2 of 3 selected tracks. */
|
|
5
|
+
export type ToggleChipPressed = boolean | "mixed";
|
|
6
|
+
export interface IToolbarToggleChipProps extends IDensityProps, IAnalyticsProps {
|
|
7
|
+
/** The chip's name, which is also its accessible name. */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
pressed: ToggleChipPressed;
|
|
10
|
+
/** Called with `true` when an unpressed or mixed chip is activated, `false` when a pressed one is. */
|
|
11
|
+
onPressedChange: (pressed: boolean) => void;
|
|
12
|
+
/** A key that toggles the chip elsewhere, shown after the name and exposed as `aria-keyshortcuts`. */
|
|
13
|
+
shortcut?: string;
|
|
14
|
+
/** Extra text after the name, such as "2 of 3"; it becomes part of the accessible name. */
|
|
15
|
+
detail?: ReactNode;
|
|
16
|
+
/** A CSS color drawn as a swatch before the name, for color choices. */
|
|
17
|
+
swatch?: string;
|
|
18
|
+
/** Hides the name visually and keeps it as the accessible name, for compact swatches. */
|
|
19
|
+
hideLabel?: boolean;
|
|
20
|
+
/** Disables activation while keeping the chip focusable and explaining why on focus or hover. */
|
|
21
|
+
disabledReason?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Whether a pointer press moves focus to the chip. Turn it off where the chip acts on something another region owns,
|
|
24
|
+
* such as a list whose keys should keep working after a click.
|
|
25
|
+
*/
|
|
26
|
+
focusOnPointer?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether Space activates the chip. Turn it off where Space belongs to the surrounding application, such as a player
|
|
29
|
+
* whose transport key is Space; Enter still activates the chip, and Space reaches the application's listeners with its
|
|
30
|
+
* default intact. The chip then carries `data-space-activates="false"` for key handlers that defer to native controls.
|
|
31
|
+
*/
|
|
32
|
+
spaceActivates?: boolean;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A tri-state toggle button for a `Toolbar`: pressed, unpressed or mixed (`aria-pressed="mixed"`), with an optional
|
|
37
|
+
* shortcut key, detail text and color swatch. Activating a mixed chip presses it, so every target gains the value.
|
|
38
|
+
*/
|
|
39
|
+
export declare function ToolbarToggleChip({ analytics, density, children, pressed, onPressedChange, shortcut, detail, swatch, hideLabel, disabledReason, focusOnPointer, spaceActivates, className, }: IToolbarToggleChipProps): ReactElement;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataTable2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-z6kyewpg.js";
|
|
4
4
|
import"../../../chunk-1wz92wgg.js";
|
|
5
|
-
import"../../../chunk-
|
|
5
|
+
import"../../../chunk-qn4a3gg4.js";
|
|
6
6
|
import"../../../chunk-k1f35j55.js";
|
|
7
7
|
import"../../../chunk-m4geb1s5.js";
|
|
8
8
|
import"../../../chunk-9t530p75.js";
|
|
@@ -203,8 +203,8 @@ import"../../chunk-1wz92wgg.js";
|
|
|
203
203
|
import"../../chunk-9t530p75.js";
|
|
204
204
|
import {
|
|
205
205
|
DataTable2
|
|
206
|
-
} from "../../chunk-
|
|
207
|
-
import"../../chunk-
|
|
206
|
+
} from "../../chunk-z6kyewpg.js";
|
|
207
|
+
import"../../chunk-qn4a3gg4.js";
|
|
208
208
|
import {
|
|
209
209
|
DaySeparator2
|
|
210
210
|
} from "../../chunk-3j9enr2q.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
DataGridColumnHeader2,
|
|
8
8
|
DataGridFilter2,
|
|
9
9
|
DataGridPagination2
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-nj2shejq.js";
|
|
11
11
|
import"../../chunk-7ny0vyek.js";
|
|
12
12
|
import"../../chunk-8ssktt4b.js";
|
|
13
13
|
import"../../chunk-en44w1pn.js";
|
|
@@ -17,7 +17,7 @@ import"../../chunk-jpvw9xqy.js";
|
|
|
17
17
|
import {
|
|
18
18
|
Button2
|
|
19
19
|
} from "../../chunk-32t5kc0y.js";
|
|
20
|
-
import"../../chunk-
|
|
20
|
+
import"../../chunk-qn4a3gg4.js";
|
|
21
21
|
import"../../chunk-p6z2m3zp.js";
|
|
22
22
|
import"../../chunk-7jpsybag.js";
|
|
23
23
|
import"../../chunk-7vg045gd.js";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
DrawerHeader2,
|
|
32
32
|
DrawerTitle2,
|
|
33
33
|
DrawerDescription2
|
|
34
|
-
} from "../../chunk-
|
|
34
|
+
} from "../../chunk-h2xvhydx.js";
|
|
35
35
|
import {
|
|
36
36
|
MenuPopup,
|
|
37
37
|
MenuItem2,
|
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
TableHead2,
|
|
146
146
|
TableCell2,
|
|
147
147
|
TableCaption2
|
|
148
|
-
} from "../../chunk-
|
|
148
|
+
} from "../../chunk-qn4a3gg4.js";
|
|
149
149
|
import"../../chunk-7vnpp3ya.js";
|
|
150
150
|
import"../../chunk-m4geb1s5.js";
|
|
151
151
|
import"../../chunk-9ecf92s6.js";
|
|
@@ -24,9 +24,11 @@ interface ISplitViewProps {
|
|
|
24
24
|
wideQuery?: string;
|
|
25
25
|
/**
|
|
26
26
|
* Below `wideQuery`: "stack" places the panes one above the other; "takeover" shows an open sidebar in the content's
|
|
27
|
-
* place, with the content hidden but still mounted, as a narrow window's inspector or review does
|
|
27
|
+
* place, with the content hidden but still mounted, as a narrow window's inspector or review does; "strip" places an
|
|
28
|
+
* open sidebar above the content as a strip whose height the divider resizes, so both stay in view and usable, as a
|
|
29
|
+
* persistent tool panel under a player does.
|
|
28
30
|
*/
|
|
29
|
-
narrowLayout?: "stack" | "takeover";
|
|
31
|
+
narrowLayout?: "stack" | "takeover" | "strip";
|
|
30
32
|
/** Widens the sidebar to `maxSidebarSize`; turning it off restores the width it had before. */
|
|
31
33
|
sidebarExpanded?: boolean;
|
|
32
34
|
}
|
|
@@ -87,7 +87,9 @@ function SplitView({
|
|
|
87
87
|
const isFill = layoutMode === "fill";
|
|
88
88
|
const isWide = useMediaQuery(wideQuery);
|
|
89
89
|
const isTakeover = !isWide && narrowLayout === "takeover" && sidebarOpen;
|
|
90
|
+
const isStrip = !isWide && narrowLayout === "strip" && sidebarOpen;
|
|
90
91
|
const layout = useDefaultLayout({ id: storageKey, storage, onlySaveAfterUserInteractions: true });
|
|
92
|
+
const stripLayout = useDefaultLayout({ id: `${storageKey}:strip`, storage, onlySaveAfterUserInteractions: true });
|
|
91
93
|
const sidebarRef = usePanelRef();
|
|
92
94
|
const isHydrated = useSyncExternalStore(subscribeToHydration, () => true, () => false);
|
|
93
95
|
const [slots] = useState(createSlots);
|
|
@@ -129,7 +131,7 @@ function SplitView({
|
|
|
129
131
|
const sidebarContent = /* @__PURE__ */ jsx("aside", {
|
|
130
132
|
hidden: !sidebarOpen,
|
|
131
133
|
"aria-label": sidebarLabel,
|
|
132
|
-
className: cn2("min-w-0 bg-card", isWide && "h-full", sidebarPadding === "panel" && "p-4", isFill && "min-h-0 overflow-y-auto", !isWide && isFill && !isTakeover && "max-h-[35%] shrink-0", isTakeover && isFill && "flex-1"),
|
|
134
|
+
className: cn2("min-w-0 bg-card", isWide && "h-full", sidebarPadding === "panel" && "p-4", isFill && "min-h-0 overflow-y-auto", !isWide && isFill && !isTakeover && !isStrip && "max-h-[35%] shrink-0", isStrip && "h-full", isTakeover && isFill && "flex-1"),
|
|
133
135
|
children: sidebar
|
|
134
136
|
});
|
|
135
137
|
const content = /* @__PURE__ */ jsx("section", {
|
|
@@ -183,6 +185,29 @@ function SplitView({
|
|
|
183
185
|
}),
|
|
184
186
|
sidebarPosition === "start" ? contentPanel : sidebarPanel
|
|
185
187
|
]
|
|
188
|
+
}) : isStrip ? /* @__PURE__ */ jsxs(Resizable2, {
|
|
189
|
+
orientation: "vertical",
|
|
190
|
+
className: cn2(isFill && "h-full min-h-0"),
|
|
191
|
+
defaultLayout: stripLayout.defaultLayout,
|
|
192
|
+
onLayoutChanged: stripLayout.onLayoutChanged,
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ jsx(ResizablePanel2, {
|
|
195
|
+
id: "strip",
|
|
196
|
+
defaultSize: "40%",
|
|
197
|
+
minSize: "15%",
|
|
198
|
+
maxSize: "70%",
|
|
199
|
+
children: sidebarSlot
|
|
200
|
+
}),
|
|
201
|
+
/* @__PURE__ */ jsx(ResizableHandle2, {
|
|
202
|
+
thickness: "strong",
|
|
203
|
+
"aria-label": resizeLabel
|
|
204
|
+
}),
|
|
205
|
+
/* @__PURE__ */ jsx(ResizablePanel2, {
|
|
206
|
+
id: "content",
|
|
207
|
+
minSize: "25%",
|
|
208
|
+
children: contentSlot
|
|
209
|
+
})
|
|
210
|
+
]
|
|
186
211
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
187
212
|
className: cn2("flex min-w-0 flex-col bg-card", isFill && "h-full min-h-0 overflow-hidden"),
|
|
188
213
|
children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import"../../chunk-en44w1pn.js";
|
|
2
2
|
import {
|
|
3
3
|
TableRow2
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-qn4a3gg4.js";
|
|
5
5
|
import {
|
|
6
6
|
DataGridColumnFitContext,
|
|
7
7
|
getDataGridColumnFit,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
DataGridHeaderRows,
|
|
11
11
|
DataGridCells2,
|
|
12
12
|
DataGridColumns
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-nj2shejq.js";
|
|
14
14
|
import"../../chunk-7ny0vyek.js";
|
|
15
15
|
import"../../chunk-8ssktt4b.js";
|
|
16
16
|
import"../../chunk-e6hk39ev.js";
|
|
@@ -22,7 +22,7 @@ import"../../chunk-7jpsybag.js";
|
|
|
22
22
|
import"../../chunk-7vg045gd.js";
|
|
23
23
|
import {
|
|
24
24
|
VirtualTable2
|
|
25
|
-
} from "../../chunk-
|
|
25
|
+
} from "../../chunk-wnkxd9km.js";
|
|
26
26
|
import"../../chunk-5mydsjp3.js";
|
|
27
27
|
|
|
28
28
|
// src/components/virtual-data-grid/VirtualDataGrid.tsx
|
package/dist/index.d.ts
CHANGED
|
@@ -103,6 +103,8 @@ export type { PortalContainer } from "./portal/types.js";
|
|
|
103
103
|
export { NumberField, NumberFieldGroup, NumberFieldInput, NumberFieldDecrement, NumberFieldIncrement, NumberFieldScrubArea, NumberFieldScrubAreaCursor, } from "./components/NumberField.js";
|
|
104
104
|
export { Meter, MeterLabel, MeterValue, MeterTrack, MeterIndicator } from "./components/Meter.js";
|
|
105
105
|
export { Toolbar, ToolbarButton, ToolbarLink, ToolbarInput, ToolbarGroup, ToolbarSeparator, } from "./components/Toolbar.js";
|
|
106
|
+
export { ToolbarToggleChip } from "./components/ToolbarToggleChip.js";
|
|
107
|
+
export type { IToolbarToggleChipProps, ToggleChipPressed } from "./components/ToolbarToggleChip.js";
|
|
106
108
|
export { Stepper, StepperList, StepperTrigger, StepperIndicator, StepperContent } from "./components/Stepper.js";
|
|
107
109
|
export { AppShell } from "./components/AppShell.js";
|
|
108
110
|
export type { AppShellContent, AppShellProps, AppShellNavigationItem } from "./components/AppShell.js";
|
package/dist/index.js
CHANGED
|
@@ -147,6 +147,7 @@ import {
|
|
|
147
147
|
MeterValue2,
|
|
148
148
|
MeterTrack2,
|
|
149
149
|
MeterIndicator2,
|
|
150
|
+
ToolbarToggleChip2,
|
|
150
151
|
Stepper2,
|
|
151
152
|
StepperList2,
|
|
152
153
|
StepperTrigger2,
|
|
@@ -174,7 +175,7 @@ import {
|
|
|
174
175
|
StatusTracker2,
|
|
175
176
|
DashboardLayout2,
|
|
176
177
|
BillingUsage2
|
|
177
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-h2xvhydx.js";
|
|
178
179
|
import {
|
|
179
180
|
Combobox2,
|
|
180
181
|
ComboboxValue2,
|
|
@@ -267,7 +268,7 @@ import {
|
|
|
267
268
|
TableColumnGroup2,
|
|
268
269
|
TableColumn2,
|
|
269
270
|
TableCaption2
|
|
270
|
-
} from "./chunk-
|
|
271
|
+
} from "./chunk-qn4a3gg4.js";
|
|
271
272
|
import {
|
|
272
273
|
ScrollArea2,
|
|
273
274
|
ScrollBar2
|
|
@@ -856,6 +857,7 @@ export {
|
|
|
856
857
|
ToolbarInput2 as ToolbarInput,
|
|
857
858
|
ToolbarLink2 as ToolbarLink,
|
|
858
859
|
ToolbarSeparator2 as ToolbarSeparator,
|
|
860
|
+
ToolbarToggleChip2 as ToolbarToggleChip,
|
|
859
861
|
Tooltip2 as Tooltip,
|
|
860
862
|
TooltipContent2 as TooltipContent,
|
|
861
863
|
TooltipProvider2 as TooltipProvider,
|
package/dist/prototype.js
CHANGED
|
@@ -2051,7 +2051,7 @@ var program = new Command;
|
|
|
2051
2051
|
// package.json
|
|
2052
2052
|
var package_default = {
|
|
2053
2053
|
name: "@alexgorbatchev/shadcn",
|
|
2054
|
-
version: "0.0.
|
|
2054
|
+
version: "0.0.87",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# ToolbarToggleChip
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/actions/ToolbarToggleChip
|
|
4
|
+
Source: src/components/stories/actions/ToolbarToggleChip.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/actions/ToolbarToggleChip.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { Toolbar, ToolbarToggleChip, type ToggleChipPressed } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Supporting imports
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { useState, type ReactElement } from "react";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default component
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
ToolbarToggleChip
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Default args
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
{ children: "Dark", pressed: "mixed", detail: "2 of 3", shortcut: "k", onPressedChange: fn() }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Default render
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
function Example(args): ReactElement {
|
|
36
|
+
const [pressed, setPressed] = useState<ToggleChipPressed>(args.pressed);
|
|
37
|
+
return (<Toolbar aria-label="Tags">
|
|
38
|
+
<ToolbarToggleChip {...args} pressed={pressed} onPressedChange={(next) => {
|
|
39
|
+
setPressed(next);
|
|
40
|
+
args.onPressedChange(next);
|
|
41
|
+
}}/>
|
|
42
|
+
<ToolbarToggleChip pressed={false} onPressedChange={fn()} shortcut="b">
|
|
43
|
+
Bright
|
|
44
|
+
</ToolbarToggleChip>
|
|
45
|
+
</Toolbar>);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Examples
|
|
50
|
+
|
|
51
|
+
Storybook CSF excerpts. Default args and render apply unless overridden. Local helpers, fixtures, decorators, and providers may be required; these are reference excerpts, not standalone consumer modules. Interaction tests are omitted.
|
|
52
|
+
|
|
53
|
+
### Mixed
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
{}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### KeepsFocusAndSpace
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
{
|
|
63
|
+
args: { pressed: false, detail: undefined, focusOnPointer: false, spaceActivates: false },
|
|
64
|
+
render: function Example(args): ReactElement {
|
|
65
|
+
const onSpace = args.onPressedChange;
|
|
66
|
+
return (<div onKeyDown={(event) => {
|
|
67
|
+
// The application's own Space, which the chip leaves unprevented.
|
|
68
|
+
if (event.key === " " && !event.defaultPrevented)
|
|
69
|
+
onSpace(false);
|
|
70
|
+
}}>
|
|
71
|
+
<button type="button">Outside</button>
|
|
72
|
+
<Toolbar aria-label="Tags">
|
|
73
|
+
<ToolbarToggleChip {...args} onPressedChange={args.onPressedChange}/>
|
|
74
|
+
</Toolbar>
|
|
75
|
+
</div>);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Swatches
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
{
|
|
84
|
+
render: function Example(): ReactElement {
|
|
85
|
+
const [color, setColor] = useState<string | null>(null);
|
|
86
|
+
const choices = [
|
|
87
|
+
{ name: "Red", swatch: "#e5484d", key: "1" },
|
|
88
|
+
{ name: "Orange", swatch: "#f76b15", key: "2" },
|
|
89
|
+
];
|
|
90
|
+
return (<Toolbar aria-label="Color">
|
|
91
|
+
{choices.map((choice) => (<ToolbarToggleChip key={choice.name} swatch={choice.swatch} shortcut={choice.key} hideLabel pressed={color === choice.name} onPressedChange={(next) => setColor(next ? choice.name : null)}>
|
|
92
|
+
{choice.name}
|
|
93
|
+
</ToolbarToggleChip>))}
|
|
94
|
+
</Toolbar>);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### DisabledWithReason
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
{
|
|
103
|
+
args: { pressed: false, detail: undefined, disabledReason: "One track at a time for now" }
|
|
104
|
+
}
|
|
105
|
+
```
|
|
@@ -292,3 +292,26 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
```
|
|
295
|
+
|
|
296
|
+
### RowStripes
|
|
297
|
+
|
|
298
|
+
```tsx
|
|
299
|
+
{
|
|
300
|
+
render: (): ReactElement => (<Table>
|
|
301
|
+
<TableBody>
|
|
302
|
+
<TableRow stripe="rgb(229, 72, 77)">
|
|
303
|
+
<TableCell>Red track</TableCell>
|
|
304
|
+
<TableCell>Artist</TableCell>
|
|
305
|
+
</TableRow>
|
|
306
|
+
<TableRow stripe="rgb(0, 144, 255)" aria-selected>
|
|
307
|
+
<TableCell>Selected blue track</TableCell>
|
|
308
|
+
<TableCell>Artist</TableCell>
|
|
309
|
+
</TableRow>
|
|
310
|
+
<TableRow>
|
|
311
|
+
<TableCell>Uncolored track</TableCell>
|
|
312
|
+
<TableCell>Artist</TableCell>
|
|
313
|
+
</TableRow>
|
|
314
|
+
</TableBody>
|
|
315
|
+
</Table>)
|
|
316
|
+
}
|
|
317
|
+
```
|
|
@@ -82,3 +82,29 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
82
82
|
args: { disabled: true }
|
|
83
83
|
}
|
|
84
84
|
```
|
|
85
|
+
|
|
86
|
+
### ConfirmOnCommit
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
{
|
|
90
|
+
args: { commit: "confirm", clearable: false, onReselect: fn() }
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### ConfirmOnLeave
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
{
|
|
98
|
+
args: { commit: "confirm", busy: true },
|
|
99
|
+
render: function Example(args): ReactElement {
|
|
100
|
+
const [value, setValue] = useState(args.value);
|
|
101
|
+
return (<div className="flex items-center gap-2">
|
|
102
|
+
<StarRating {...args} value={value} onValueChange={(next) => {
|
|
103
|
+
setValue(next);
|
|
104
|
+
args.onValueChange(next);
|
|
105
|
+
}}/>
|
|
106
|
+
<button type="button">After</button>
|
|
107
|
+
</div>);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
@@ -198,6 +198,22 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
198
198
|
}
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
+
### NarrowStrip
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
{
|
|
205
|
+
render: function Example(args) {
|
|
206
|
+
const [open, setOpen] = useState(false);
|
|
207
|
+
return (<div className="flex h-96 w-[600px] flex-col gap-2">
|
|
208
|
+
<Button onClick={() => setOpen(!open)}>{open ? "Close tags" : "Open tags"}</Button>
|
|
209
|
+
<SplitView {...args} sidebarLabel="Tags" resizeLabel="Resize tags" sidebarPosition="end" sidebarOpen={open} wideQuery="(min-width: 100000px)" narrowLayout="strip" layout="fill" sidebar={<button type="button">Dark</button>}>
|
|
210
|
+
<input aria-label="Draft answer" defaultValue=""/>
|
|
211
|
+
</SplitView>
|
|
212
|
+
</div>);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
201
217
|
### DockOpensAtDefaultWidth
|
|
202
218
|
|
|
203
219
|
```tsx
|
package/llms.txt
CHANGED
|
@@ -16,6 +16,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
16
16
|
- [Toggle](./llms/components/actions/Toggle.md)
|
|
17
17
|
- [ToggleGroup](./llms/components/actions/ToggleGroup.md)
|
|
18
18
|
- [Toolbar](./llms/components/actions/Toolbar.md)
|
|
19
|
+
- [ToolbarToggleChip](./llms/components/actions/ToolbarToggleChip.md)
|
|
19
20
|
|
|
20
21
|
## assistant-ui/elements/agents-tasks
|
|
21
22
|
|