@stll/ui 0.71.0 → 0.73.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/calendar/primitives.d.ts +7 -7
- package/dist/components/alert-dialog.d.ts +15 -15
- package/dist/components/animated-preview.d.ts +9 -9
- package/dist/components/animated-preview.js +3 -3
- package/dist/components/application-rail.d.ts +8 -8
- package/dist/components/bidi-text.d.ts +7 -7
- package/dist/components/brand-icons.d.ts +5 -5
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/button.d.ts +4 -2
- package/dist/components/button.js +8 -1
- package/dist/components/button.native-classes.js +15 -0
- package/dist/components/button.shared.d.ts +5 -1
- package/dist/components/button.shared.js +6 -0
- package/dist/components/checkbox.d.ts +15 -1
- package/dist/components/checkbox.js +74 -30
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/collapsible.js +3 -3
- package/dist/components/color-picker.d.ts +4 -4
- package/dist/components/combobox.d.ts +23 -23
- package/dist/components/combobox.js +6 -6
- package/dist/components/command.d.ts +19 -19
- package/dist/components/composer.js +1 -1
- package/dist/components/destructive-action-confirmation.d.ts +5 -5
- package/dist/components/destructive-action-confirmation.js +2 -2
- package/dist/components/destructive-confirm-dialog.d.ts +7 -7
- package/dist/components/details-grid.d.ts +6 -6
- package/dist/components/dialog.d.ts +19 -19
- package/dist/components/frame.d.ts +7 -7
- package/dist/components/hex-color-picker.d.ts +16 -2
- package/dist/components/highlighted-textarea.d.ts +13 -0
- package/dist/components/highlighted-textarea.js +47 -0
- package/dist/components/input-group.d.ts +6 -6
- package/dist/components/input-otp.d.ts +7 -7
- package/dist/components/input-otp.js +2 -2
- package/dist/components/input.d.ts +5 -5
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/list.d.ts +20 -20
- package/dist/components/menu.d.ts +22 -21
- package/dist/components/menu.js +4 -1
- package/dist/components/outcome-screen-view.d.ts +88 -0
- package/dist/components/outcome-screen-view.js +170 -0
- package/dist/components/outcome-screen.d.ts +16 -0
- package/dist/components/outcome-screen.js +47 -0
- package/dist/components/outline-rail.d.ts +12 -0
- package/dist/components/pagination.d.ts +9 -9
- package/dist/components/popover.d.ts +10 -9
- package/dist/components/popover.js +4 -1
- package/dist/components/preview-pane.d.ts +6 -6
- package/dist/components/prose.d.ts +2 -2
- package/dist/components/scroll-to-top.d.ts +5 -0
- package/dist/components/search-field.d.ts +3 -3
- package/dist/components/select.d.ts +9 -9
- package/dist/components/select.js +11 -11
- package/dist/components/sheet.d.ts +16 -16
- package/dist/components/steps.d.ts +6 -6
- package/dist/components/switch.d.ts +5 -5
- package/dist/components/switch.native.d.ts +3 -3
- package/dist/components/table-layout.d.ts +14 -0
- package/dist/components/table-layout.js +15 -0
- package/dist/components/table.d.ts +18 -17
- package/dist/components/table.js +2 -1
- package/dist/components/textarea.d.ts +5 -3
- package/dist/components/textarea.js +27 -15
- package/dist/components/time-field.d.ts +3 -3
- package/dist/components/toast.d.ts +20 -20
- package/dist/components/toast.js +3 -3
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/tooltip-trigger-helper.d.ts +4 -4
- package/dist/components/truncated-text.d.ts +4 -4
- package/dist/components/truncated-text.js +3 -3
- package/dist/data-table/index.d.ts +7 -0
- package/dist/hooks/use-contained-handler.d.ts +2 -2
- package/dist/hooks/use-mobile.js +2 -2
- package/dist/hooks/use-viewport-width.js +2 -2
- package/dist/icons.d.ts +29 -1
- package/dist/icons.js +55 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +3 -1
- package/dist/inspector/chrome.d.ts +22 -22
- package/dist/inspector/index.d.ts +9 -0
- package/dist/kanban/grouping.d.ts +10 -0
- package/dist/kanban/index.d.ts +9 -0
- package/dist/kanban/sortable-interactions.d.ts +8 -8
- package/dist/kanban/sortable-interactions.js +11 -11
- package/dist/lib/button-disposition.d.ts +2 -2
- package/dist/lib/tooltip-content.d.ts +2 -2
- package/dist/lib/utils.d.ts +2 -2
- package/dist/styles/collapsible.css +26 -0
- package/dist/styles/theme.css +35 -0
- package/package.json +17 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Side-pane preview pattern: a list of options (menu items, rows) with a
|
|
4
4
|
* fixed-width pane beside it that previews the highlighted option. The pane
|
|
@@ -6,8 +6,8 @@ import * as React$1 from "react";
|
|
|
6
6
|
* from `onMouseEnter`/`onFocus` on the options and render `PreviewPane`
|
|
7
7
|
* empty (no children) while nothing is highlighted.
|
|
8
8
|
*/
|
|
9
|
-
type MenuPreviewLayoutProps = React
|
|
10
|
-
preview: React
|
|
9
|
+
type MenuPreviewLayoutProps = React.PropsWithChildren<{
|
|
10
|
+
preview: React.ReactNode;
|
|
11
11
|
className?: string;
|
|
12
12
|
/**
|
|
13
13
|
* `fixed` sizes the menu around a fixed-width pane. `remaining` is for a
|
|
@@ -17,7 +17,7 @@ type MenuPreviewLayoutProps = React$1.PropsWithChildren<{
|
|
|
17
17
|
*/
|
|
18
18
|
previewWidth?: "fixed" | "remaining";
|
|
19
19
|
}>;
|
|
20
|
-
declare const MenuPreviewLayout: ({ children, preview, className, previewWidth }: MenuPreviewLayoutProps) => React
|
|
20
|
+
declare const MenuPreviewLayout: ({ children, preview, className, previewWidth }: MenuPreviewLayoutProps) => React.JSX.Element;
|
|
21
21
|
/**
|
|
22
22
|
* What the pane does with content taller than its box. `clip` is for a
|
|
23
23
|
* depiction (a sketch, a scaled glimpse of a page) that only has to show its
|
|
@@ -29,7 +29,7 @@ declare const MenuPreviewLayout: ({ children, preview, className, previewWidth }
|
|
|
29
29
|
* assistive technology.
|
|
30
30
|
*/
|
|
31
31
|
type PreviewPaneOverflow = "clip" | "scroll";
|
|
32
|
-
type PreviewPaneProps = React
|
|
32
|
+
type PreviewPaneProps = React.ComponentProps<"div"> & {
|
|
33
33
|
overflow?: PreviewPaneOverflow;
|
|
34
34
|
/**
|
|
35
35
|
* `default` is the side pane described above. `thumbnail` is the same pane
|
|
@@ -37,5 +37,5 @@ type PreviewPaneProps = React$1.ComponentProps<"div"> & {
|
|
|
37
37
|
*/
|
|
38
38
|
size?: "default" | "thumbnail";
|
|
39
39
|
};
|
|
40
|
-
declare const PreviewPane: ({ children, className, overflow, size, ...props }: PreviewPaneProps) => React
|
|
40
|
+
declare const PreviewPane: ({ children, className, overflow, size, ...props }: PreviewPaneProps) => React.JSX.Element;
|
|
41
41
|
export { MenuPreviewLayout, PreviewPane };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
/** Preserve source word breaks while allowing oversized tokens to fit narrow panes. */
|
|
4
4
|
export declare const LEGAL_TEXT_CLASS_NAME = "hyphens-manual wrap-anywhere";
|
|
@@ -7,5 +7,5 @@ declare const proseVariants: (props?: ({
|
|
|
7
7
|
tone?: "default" | "muted" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
/** A readable measure for narrative copy; task-shaped text should not use it. */
|
|
10
|
-
export declare const Prose: ({ className, size, tone, ...props }: React
|
|
10
|
+
export declare const Prose: ({ className, size, tone, ...props }: React.ComponentProps<"p"> & VariantProps<typeof proseVariants>) => React.JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll-to-top affordance — a subtle floating button that fades in once a
|
|
3
|
+
* scroll container is scrolled past a threshold and jumps back to the top
|
|
4
|
+
* (instant, not animated, so it stays snappy on very long documents).
|
|
5
|
+
*/
|
|
1
6
|
import { RefObject } from "react";
|
|
2
7
|
export type ScrollToTopProps = {
|
|
3
8
|
scrollContainerRef: RefObject<HTMLElement | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { InputGroupInput } from "./input-group.js";
|
|
3
|
-
type SearchFieldProps = Omit<React
|
|
3
|
+
type SearchFieldProps = Omit<React.ComponentProps<typeof InputGroupInput>, "onChange" | "type" | "value"> & {
|
|
4
4
|
value: string;
|
|
5
5
|
onValueChange: (value: string) => void;
|
|
6
6
|
/** Accessible name of the clear button; the package ships no copy. */
|
|
@@ -14,5 +14,5 @@ type SearchFieldProps = Omit<React$1.ComponentProps<typeof InputGroupInput>, "on
|
|
|
14
14
|
* and the matching; keep matching local and instant for lists under a few
|
|
15
15
|
* hundred rows.
|
|
16
16
|
*/
|
|
17
|
-
declare const SearchField: ({ value, onValueChange, clearLabel, groupClassName, className, onKeyDown, ...props }: SearchFieldProps) => React
|
|
17
|
+
declare const SearchField: ({ value, onValueChange, clearLabel, groupClassName, className, onKeyDown, ...props }: SearchFieldProps) => React.JSX.Element;
|
|
18
18
|
export { SearchField, type SearchFieldProps };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { ControlSize } from "../lib/control-size.js";
|
|
3
3
|
import { Select as Select$1 } from "@base-ui/react/select";
|
|
4
4
|
type SelectItemProps = Select$1.Item.Props & {
|
|
5
5
|
label?: string;
|
|
6
6
|
};
|
|
7
|
-
declare const Select: <Value, Multiple extends boolean | undefined = false>({ children, isItemEqualToValue, itemToStringLabel, itemToStringValue, ...props }: Select$1.Root.Props<Value, Multiple>) => React
|
|
7
|
+
declare const Select: <Value, Multiple extends boolean | undefined = false>({ children, isItemEqualToValue, itemToStringLabel, itemToStringValue, ...props }: Select$1.Root.Props<Value, Multiple>) => React.JSX.Element;
|
|
8
8
|
declare const SelectTrigger: ({ className, align, size, children, ...props }: Select$1.Trigger.Props & {
|
|
9
9
|
size?: ControlSize;
|
|
10
10
|
align?: "start" | "center";
|
|
11
|
-
}) => React
|
|
12
|
-
declare const SelectValue: ({ className, children, placeholder, ...props }: Select$1.Value.Props) => React
|
|
11
|
+
}) => React.JSX.Element;
|
|
12
|
+
declare const SelectValue: ({ className, children, placeholder, ...props }: Select$1.Value.Props) => React.JSX.Element;
|
|
13
13
|
declare const SelectPopup: ({ className, children, side, sideOffset, align, alignOffset, alignItemWithTrigger, ...props }: Select$1.Popup.Props & {
|
|
14
14
|
side?: Select$1.Positioner.Props["side"];
|
|
15
15
|
sideOffset?: Select$1.Positioner.Props["sideOffset"];
|
|
16
16
|
align?: Select$1.Positioner.Props["align"];
|
|
17
17
|
alignOffset?: Select$1.Positioner.Props["alignOffset"];
|
|
18
18
|
alignItemWithTrigger?: Select$1.Positioner.Props["alignItemWithTrigger"];
|
|
19
|
-
}) => React
|
|
20
|
-
declare const SelectItem: ({ className, children, label: _label, ...props }: SelectItemProps) => React
|
|
21
|
-
declare const SelectSeparator: ({ className, ...props }: Select$1.Separator.Props) => React
|
|
22
|
-
declare const SelectGroup: (props: Select$1.Group.Props) => React
|
|
23
|
-
declare const SelectGroupLabel: (props: Select$1.GroupLabel.Props) => React
|
|
19
|
+
}) => React.JSX.Element;
|
|
20
|
+
declare const SelectItem: ({ className, children, label: _label, ...props }: SelectItemProps) => React.JSX.Element;
|
|
21
|
+
declare const SelectSeparator: ({ className, ...props }: Select$1.Separator.Props) => React.JSX.Element;
|
|
22
|
+
declare const SelectGroup: (props: Select$1.Group.Props) => React.JSX.Element;
|
|
23
|
+
declare const SelectGroupLabel: (props: Select$1.GroupLabel.Props) => React.JSX.Element;
|
|
24
24
|
export { Select, SelectPopup as SelectContent, SelectPopup, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -6,10 +6,10 @@ import { FIELD_TRIGGER_CLASS_NAME } from "../lib/field-trigger.js";
|
|
|
6
6
|
import { OVERLAY_LAYER_CLASS_NAMES } from "../lib/overlay-layer.js";
|
|
7
7
|
import { cn } from "../lib/utils.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import * as React
|
|
9
|
+
import * as React from "react";
|
|
10
10
|
import { Select as Select$1 } from "@base-ui/react/select";
|
|
11
11
|
// src/components/select.tsx
|
|
12
|
-
const SelectItemDisplaysContext = React
|
|
12
|
+
const SelectItemDisplaysContext = React.createContext(/* @__PURE__ */ new Map());
|
|
13
13
|
const renderSelectedDisplay = (displays, placeholder) => (value) => {
|
|
14
14
|
if (!displays.has(value)) return placeholder ?? null;
|
|
15
15
|
return displays.get(value) ?? null;
|
|
@@ -18,7 +18,7 @@ const Select = ({ children, isItemEqualToValue, itemToStringLabel, itemToStringV
|
|
|
18
18
|
const itemLabels = collectSelectItemLabels(children);
|
|
19
19
|
const itemDisplays = collectSelectItemDisplays(children);
|
|
20
20
|
const itemLabelsRef = useLatest(itemLabels);
|
|
21
|
-
const resolveItemLabel = React
|
|
21
|
+
const resolveItemLabel = React.useCallback((value) => itemLabelsRef.current.get(value) ?? String(value), [itemLabelsRef]);
|
|
22
22
|
const root = /* @__PURE__ */ jsx(Select$1.Root, {
|
|
23
23
|
...props,
|
|
24
24
|
isItemEqualToValue,
|
|
@@ -46,7 +46,7 @@ const SELECT_TRIGGER_SIZE_CLASS_NAMES = {
|
|
|
46
46
|
[CONTROL_SIZE.lg]: "min-h-10 sm:min-h-9"
|
|
47
47
|
};
|
|
48
48
|
const SelectValue = ({ className, children, placeholder, ...props }) => {
|
|
49
|
-
const displays = React
|
|
49
|
+
const displays = React.use(SelectItemDisplaysContext);
|
|
50
50
|
if (children !== void 0 || displays.size === 0) return /* @__PURE__ */ jsx(Select$1.Value, {
|
|
51
51
|
className: cn("data-placeholder:text-muted-foreground flex-1 truncate", className),
|
|
52
52
|
"data-slot": "select-value",
|
|
@@ -121,14 +121,14 @@ const SelectItem = ({ className, children, label: _label, ...props }) => /* @__P
|
|
|
121
121
|
});
|
|
122
122
|
function collectSelectItemLabels(children) {
|
|
123
123
|
const labels = /* @__PURE__ */ new Map();
|
|
124
|
-
React
|
|
124
|
+
React.Children.forEach(children, (child) => {
|
|
125
125
|
collectSelectItemLabel(child, labels);
|
|
126
126
|
});
|
|
127
127
|
return labels;
|
|
128
128
|
}
|
|
129
129
|
function collectSelectItemDisplays(children) {
|
|
130
130
|
const displays = /* @__PURE__ */ new Map();
|
|
131
|
-
React
|
|
131
|
+
React.Children.forEach(children, (child) => {
|
|
132
132
|
collectSelectItemDisplay(child, displays);
|
|
133
133
|
});
|
|
134
134
|
return displays;
|
|
@@ -140,7 +140,7 @@ function collectSelectItemDisplay(child, displays) {
|
|
|
140
140
|
displays.set(value, child.props.children);
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
-
React
|
|
143
|
+
React.Children.forEach(child.props.children, (nestedChild) => {
|
|
144
144
|
collectSelectItemDisplay(nestedChild, displays);
|
|
145
145
|
});
|
|
146
146
|
}
|
|
@@ -151,15 +151,15 @@ function collectSelectItemLabel(child, labels) {
|
|
|
151
151
|
const label = child.props.label ?? getTextLabel(child.props.children);
|
|
152
152
|
if (label) labels.set(value, label);
|
|
153
153
|
}
|
|
154
|
-
React
|
|
154
|
+
React.Children.forEach(child.props.children, (nestedChild) => {
|
|
155
155
|
collectSelectItemLabel(nestedChild, labels);
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
function isElementWithChildren(node) {
|
|
159
|
-
return React
|
|
159
|
+
return React.isValidElement(node);
|
|
160
160
|
}
|
|
161
161
|
function isSelectItemElement(node) {
|
|
162
|
-
return React
|
|
162
|
+
return React.isValidElement(node) && node.type === SelectItem;
|
|
163
163
|
}
|
|
164
164
|
function isReactNodeArray(node) {
|
|
165
165
|
return Array.isArray(node);
|
|
@@ -168,7 +168,7 @@ function getTextLabel(node) {
|
|
|
168
168
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
169
169
|
if (isReactNodeArray(node)) {
|
|
170
170
|
const parts = [];
|
|
171
|
-
React
|
|
171
|
+
React.Children.forEach(node, (child) => {
|
|
172
172
|
const text = getTextLabel(child);
|
|
173
173
|
if (text) parts.push(text);
|
|
174
174
|
});
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { Dialog } from "@base-ui/react/dialog";
|
|
3
|
-
declare const Sheet: <Payload>(props: Dialog.Root.Props<Payload>) => React
|
|
4
|
-
declare const SheetPortal: React
|
|
3
|
+
declare const Sheet: <Payload>(props: Dialog.Root.Props<Payload>) => React.JSX.Element;
|
|
4
|
+
declare const SheetPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
type SheetSide = "inline-start" | "inline-end" | "block-start" | "block-end";
|
|
6
6
|
declare function SheetTrigger({ tooltip, ...props }: Dialog.Trigger.Props & {
|
|
7
|
-
tooltip?: React
|
|
8
|
-
}): React
|
|
7
|
+
tooltip?: React.ReactNode;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
9
|
declare function SheetClose({ tooltip, ...props }: Dialog.Close.Props & {
|
|
10
|
-
tooltip?: React
|
|
11
|
-
}): React
|
|
12
|
-
declare const SheetBackdrop: ({ className, ...props }: Dialog.Backdrop.Props) => React
|
|
10
|
+
tooltip?: React.ReactNode;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare const SheetBackdrop: ({ className, ...props }: Dialog.Backdrop.Props) => React.JSX.Element;
|
|
13
13
|
declare const SheetPopup: ({ className, children, showCloseButton, side, variant, ...props }: Dialog.Popup.Props & {
|
|
14
14
|
showCloseButton?: boolean;
|
|
15
15
|
side?: SheetSide;
|
|
16
16
|
variant?: "default" | "inset";
|
|
17
|
-
}) => React
|
|
18
|
-
declare const SheetHeader: ({ className, ...props }: React
|
|
19
|
-
declare const SheetFooter: ({ className, variant, ...props }: React
|
|
17
|
+
}) => React.JSX.Element;
|
|
18
|
+
declare const SheetHeader: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
19
|
+
declare const SheetFooter: ({ className, variant, ...props }: React.ComponentProps<"div"> & {
|
|
20
20
|
variant?: "default" | "bare";
|
|
21
|
-
}) => React
|
|
22
|
-
declare const SheetTitle: ({ className, ...props }: Dialog.Title.Props) => React
|
|
23
|
-
declare const SheetDescription: ({ className, ...props }: Dialog.Description.Props) => React
|
|
24
|
-
declare const SheetPanel: ({ className, scrollFade, ...props }: React
|
|
21
|
+
}) => React.JSX.Element;
|
|
22
|
+
declare const SheetTitle: ({ className, ...props }: Dialog.Title.Props) => React.JSX.Element;
|
|
23
|
+
declare const SheetDescription: ({ className, ...props }: Dialog.Description.Props) => React.JSX.Element;
|
|
24
|
+
declare const SheetPanel: ({ className, scrollFade, ...props }: React.ComponentProps<"div"> & {
|
|
25
25
|
scrollFade?: boolean;
|
|
26
|
-
}) => React
|
|
26
|
+
}) => React.JSX.Element;
|
|
27
27
|
export { Sheet, SheetBackdrop, SheetBackdrop as SheetOverlay, SheetClose, SheetPopup as SheetContent, SheetPopup, SheetDescription, SheetFooter, SheetHeader, SheetPanel, SheetPortal, type SheetSide, SheetTitle, SheetTrigger };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const stepsVariants: (props?: ({
|
|
4
4
|
variant?: "compact" | "default" | "progress" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
type StepsProps = React
|
|
7
|
-
markerStyle: NonNullable<React
|
|
6
|
+
type StepsProps = React.ComponentProps<"ol"> & VariantProps<typeof stepsVariants> & {
|
|
7
|
+
markerStyle: NonNullable<React.CSSProperties["listStyleType"]>;
|
|
8
8
|
};
|
|
9
9
|
/** A meaningful procedure, timeline, or ranking. The list owns its numbers. */
|
|
10
|
-
declare const Steps: ({ className, variant, markerStyle, style, ...props }: StepsProps) => React
|
|
10
|
+
declare const Steps: ({ className, variant, markerStyle, style, ...props }: StepsProps) => React.JSX.Element;
|
|
11
11
|
declare const stepVariants: (props?: ({
|
|
12
12
|
status?: "completed" | "current" | "upcoming" | null | undefined;
|
|
13
13
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
-
type StepProps = React
|
|
15
|
-
declare const Step: ({ className, status, ...props }: StepProps) => React
|
|
14
|
+
type StepProps = React.ComponentProps<"li"> & VariantProps<typeof stepVariants>;
|
|
15
|
+
declare const Step: ({ className, status, ...props }: StepProps) => React.JSX.Element;
|
|
16
16
|
export { Step, Steps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { Switch as Switch$1 } from "@base-ui/react/switch";
|
|
3
3
|
/**
|
|
4
4
|
* `default` is a setting's own control; `sm` sits in a dense row or a menu
|
|
@@ -8,7 +8,7 @@ type SwitchSize = "sm" | "default";
|
|
|
8
8
|
type SwitchProps = Switch$1.Root.Props & {
|
|
9
9
|
size?: SwitchSize | undefined;
|
|
10
10
|
};
|
|
11
|
-
declare const Switch: ({ className, size, ...props }: SwitchProps) => React
|
|
11
|
+
declare const Switch: ({ className, size, ...props }: SwitchProps) => React.JSX.Element;
|
|
12
12
|
/**
|
|
13
13
|
* A setting row: its label and an optional description at the start, the
|
|
14
14
|
* switch at the end. The whole row is the label, so a click anywhere on it
|
|
@@ -16,7 +16,7 @@ declare const Switch: ({ className, size, ...props }: SwitchProps) => React$1.JS
|
|
|
16
16
|
* description is linked to the switch, so it is read after the name.
|
|
17
17
|
*/
|
|
18
18
|
declare const SwitchField: ({ className, description, label, size, ...props }: SwitchProps & {
|
|
19
|
-
label: React
|
|
20
|
-
description?: React
|
|
21
|
-
}) => React
|
|
19
|
+
label: React.ReactNode;
|
|
20
|
+
description?: React.ReactNode;
|
|
21
|
+
}) => React.JSX.Element;
|
|
22
22
|
export { Switch, SwitchField, type SwitchProps, type SwitchSize };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SwitchContract } from "./switch.shared.js";
|
|
2
|
-
import { SwitchProps } from "react-native";
|
|
3
|
-
type SwitchProps
|
|
2
|
+
import { SwitchProps as SwitchProps$1 } from "react-native";
|
|
3
|
+
type SwitchProps = Omit<SwitchProps$1, "value" | "onValueChange" | "disabled" | keyof SwitchContract> & SwitchContract;
|
|
4
4
|
/**
|
|
5
5
|
* The web's `Switch` (./switch.tsx) on a phone: the platform's own switch, in
|
|
6
6
|
* the web's colours (the primary fill when on, the input fill when off).
|
|
7
7
|
* Controlled through `checked`, or holding its own state from
|
|
8
8
|
* `defaultChecked`.
|
|
9
9
|
*/
|
|
10
|
-
export declare const Switch: ({ checked, defaultChecked, disabled, onCheckedChange, ...props }: SwitchProps
|
|
10
|
+
export declare const Switch: ({ checked, defaultChecked, disabled, onCheckedChange, ...props }: SwitchProps) => import("react").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** First-line boxes shared by table cells, row labels, and selection controls. */
|
|
2
|
+
export declare const TABLE_FIRST_LINE: {
|
|
3
|
+
/** Plain text at the table's body line height. */
|
|
4
|
+
readonly text: {
|
|
5
|
+
readonly slot: "h-5";
|
|
6
|
+
readonly content: "min-h-5";
|
|
7
|
+
};
|
|
8
|
+
/** A body line inside an editable field. */
|
|
9
|
+
readonly control: {
|
|
10
|
+
readonly slot: "h-7";
|
|
11
|
+
readonly content: "min-h-7";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type TableFirstLine = keyof typeof TABLE_FIRST_LINE;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/components/table-layout.ts
|
|
2
|
+
/** First-line boxes shared by table cells, row labels, and selection controls. */
|
|
3
|
+
const TABLE_FIRST_LINE = {
|
|
4
|
+
/** Plain text at the table's body line height. */
|
|
5
|
+
text: {
|
|
6
|
+
slot: "h-5",
|
|
7
|
+
content: "min-h-5"
|
|
8
|
+
},
|
|
9
|
+
/** A body line inside an editable field. */
|
|
10
|
+
control: {
|
|
11
|
+
slot: "h-7",
|
|
12
|
+
content: "min-h-7"
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export { TABLE_FIRST_LINE };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TABLE_FIRST_LINE, TableFirstLine } from "./table-layout.js";
|
|
2
3
|
/**
|
|
3
4
|
* How far cells pad their content from the column edges.
|
|
4
5
|
*
|
|
@@ -26,13 +27,13 @@ type TableScroll = "self" | "parent";
|
|
|
26
27
|
* first cell rather than as a column heading.
|
|
27
28
|
*/
|
|
28
29
|
type TableDensity = "default" | "compact";
|
|
29
|
-
type TableProps = React
|
|
30
|
+
type TableProps = React.ComponentProps<"table"> & {
|
|
30
31
|
density?: TableDensity;
|
|
31
32
|
inset?: TableInset;
|
|
32
33
|
scroll?: TableScroll;
|
|
33
34
|
};
|
|
34
|
-
declare const Table: ({ className, density, inset, scroll, ...props }: TableProps) => React
|
|
35
|
-
type TableHeaderProps = React
|
|
35
|
+
declare const Table: ({ className, density, inset, scroll, ...props }: TableProps) => React.JSX.Element;
|
|
36
|
+
type TableHeaderProps = React.ComponentProps<"thead"> & {
|
|
36
37
|
/**
|
|
37
38
|
* `muted` lays the header row on a muted band, separating it from the rows
|
|
38
39
|
* of a long list.
|
|
@@ -44,24 +45,24 @@ type TableHeaderProps = React$1.ComponentProps<"thead"> & {
|
|
|
44
45
|
*/
|
|
45
46
|
sticky?: boolean;
|
|
46
47
|
};
|
|
47
|
-
declare const TableHeader: ({ className, surface, sticky, ...props }: TableHeaderProps) => React
|
|
48
|
-
declare const TableBody: ({ className, ...props }: React
|
|
49
|
-
declare const TableFooter: ({ className, ...props }: React
|
|
48
|
+
declare const TableHeader: ({ className, surface, sticky, ...props }: TableHeaderProps) => React.JSX.Element;
|
|
49
|
+
declare const TableBody: ({ className, ...props }: React.ComponentProps<"tbody">) => React.JSX.Element;
|
|
50
|
+
declare const TableFooter: ({ className, ...props }: React.ComponentProps<"tfoot">) => React.JSX.Element;
|
|
50
51
|
/**
|
|
51
52
|
* `muted` greys out a row or a cell whose value no longer counts (a voided
|
|
52
53
|
* payment) or that only supports its neighbours (a secondary column).
|
|
53
54
|
*/
|
|
54
55
|
type TableTone = "default" | "muted";
|
|
55
|
-
declare const TableRow: ({ className, tone, ...props }: React
|
|
56
|
+
declare const TableRow: ({ className, tone, ...props }: React.ComponentProps<"tr"> & {
|
|
56
57
|
tone?: TableTone | undefined;
|
|
57
|
-
}) => React
|
|
58
|
+
}) => React.JSX.Element;
|
|
58
59
|
/**
|
|
59
60
|
* Where a column sets its content. `end` lines up figures and amounts;
|
|
60
61
|
* `start` is the default reading edge. A `numeric` head or cell sets to the
|
|
61
62
|
* end unless it names an alignment, so a figures column needs one prop.
|
|
62
63
|
*/
|
|
63
64
|
type TableAlign = "start" | "center" | "end";
|
|
64
|
-
type TableHeadProps = Omit<React
|
|
65
|
+
type TableHeadProps = Omit<React.ComponentProps<"th">, "align"> & {
|
|
65
66
|
align?: TableAlign | undefined;
|
|
66
67
|
/**
|
|
67
68
|
* Heads a column of figures: tabular numerals, like its cells, set to the
|
|
@@ -69,8 +70,8 @@ type TableHeadProps = Omit<React$1.ComponentProps<"th">, "align"> & {
|
|
|
69
70
|
*/
|
|
70
71
|
numeric?: boolean | undefined;
|
|
71
72
|
};
|
|
72
|
-
declare const TableHead: ({ className, align, numeric, ...props }: TableHeadProps) => React
|
|
73
|
-
type TableCellProps = Omit<React
|
|
73
|
+
declare const TableHead: ({ className, align, numeric, ...props }: TableHeadProps) => React.JSX.Element;
|
|
74
|
+
type TableCellProps = Omit<React.ComponentProps<"td">, "align"> & {
|
|
74
75
|
align?: TableAlign | undefined;
|
|
75
76
|
tone?: TableTone | undefined;
|
|
76
77
|
/**
|
|
@@ -90,13 +91,13 @@ type TableCellProps = Omit<React$1.ComponentProps<"td">, "align"> & {
|
|
|
90
91
|
*/
|
|
91
92
|
flush?: boolean;
|
|
92
93
|
};
|
|
93
|
-
declare const TableCell: ({ className, align, tone, numeric, truncate, flush, children, ...props }: TableCellProps) => React
|
|
94
|
+
declare const TableCell: ({ className, align, tone, numeric, truncate, flush, children, ...props }: TableCellProps) => React.JSX.Element;
|
|
94
95
|
type SortDirection = "asc" | "desc" | null;
|
|
95
96
|
type SortableHeadProps = Omit<TableHeadProps, "onClick"> & {
|
|
96
97
|
sortDirection?: SortDirection;
|
|
97
98
|
onSort: () => void;
|
|
98
99
|
/** Rendered next to the sort button inside the same cell (e.g. filter icon). */
|
|
99
|
-
trailing?: React
|
|
100
|
+
trailing?: React.ReactNode;
|
|
100
101
|
};
|
|
101
102
|
/**
|
|
102
103
|
* A column head the reader sorts by. The label is a quiet `Button`, so it
|
|
@@ -105,6 +106,6 @@ type SortableHeadProps = Omit<TableHeadProps, "onClick"> & {
|
|
|
105
106
|
* In an end-aligned (numeric) column the arrow sits before the label, keeping
|
|
106
107
|
* the label flush with the figures.
|
|
107
108
|
*/
|
|
108
|
-
declare const SortableHead: ({ children, sortDirection, onSort, trailing, className, align, numeric, ...props }: SortableHeadProps) => React
|
|
109
|
-
declare const TableCaption: ({ className, ...props }: React
|
|
110
|
-
export { type SortDirection, SortableHead, Table, type TableAlign, TableBody, TableCaption, TableCell, type TableCellProps, type TableDensity, TableFooter, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableInset, type TableProps, TableRow, type TableScroll, type TableTone };
|
|
109
|
+
declare const SortableHead: ({ children, sortDirection, onSort, trailing, className, align, numeric, ...props }: SortableHeadProps) => React.JSX.Element;
|
|
110
|
+
declare const TableCaption: ({ className, ...props }: React.ComponentProps<"caption">) => React.JSX.Element;
|
|
111
|
+
export { type SortDirection, SortableHead, TABLE_FIRST_LINE, Table, type TableAlign, TableBody, TableCaption, TableCell, type TableCellProps, type TableDensity, type TableFirstLine, TableFooter, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableInset, type TableProps, TableRow, type TableScroll, type TableTone };
|
package/dist/components/table.js
CHANGED
|
@@ -2,6 +2,7 @@ import { ArrowDownIcon, ArrowUpIcon } from "../icons.js";
|
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { Button } from "./button.js";
|
|
4
4
|
import { TruncatedText } from "./truncated-text.js";
|
|
5
|
+
import { TABLE_FIRST_LINE } from "./table-layout.js";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
// src/components/table.tsx
|
|
7
8
|
const Table = ({ className, density = "default", inset = "default", scroll = "self", ...props }) => {
|
|
@@ -109,4 +110,4 @@ const TableCaption = ({ className, ...props }) => /* @__PURE__ */ jsx("caption",
|
|
|
109
110
|
"data-slot": "table-caption",
|
|
110
111
|
...props
|
|
111
112
|
});
|
|
112
|
-
export { SortableHead, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
113
|
+
export { SortableHead, TABLE_FIRST_LINE, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { ControlSize } from "../lib/control-size.js";
|
|
3
|
-
type TextareaProps = React
|
|
3
|
+
type TextareaProps = React.ComponentProps<"textarea"> & {
|
|
4
4
|
size?: ControlSize | number;
|
|
5
|
+
/** A borderless editor inside the shared large composer text well. */
|
|
6
|
+
appearance?: "default" | "composer";
|
|
5
7
|
unstyled?: boolean;
|
|
6
8
|
/**
|
|
7
9
|
* A borderless field in a line of text: it edits text where it is read
|
|
@@ -27,5 +29,5 @@ type TextareaProps = React$1.ComponentProps<"textarea"> & {
|
|
|
27
29
|
*/
|
|
28
30
|
showCount?: boolean | undefined;
|
|
29
31
|
};
|
|
30
|
-
declare const Textarea: ({ className, size, unstyled, inline, fieldSizing, maxRows, showCount, dir, onChange, style, ...props }: TextareaProps) => React
|
|
32
|
+
declare const Textarea: ({ className, id, name, disabled, value, defaultValue, size, appearance, unstyled, inline, fieldSizing, maxRows, showCount, dir, onChange, style, ...props }: TextareaProps) => React.JSX.Element;
|
|
31
33
|
export { Textarea, type TextareaProps };
|
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
import { useContentDir } from "../hooks/use-content-dir.js";
|
|
3
3
|
import { CONTROL_SIZE } from "../lib/control-size.js";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { COMPOSER_LARGE_EDITOR_CLASS, COMPOSER_TEXT_CLASS } from "./composer-tokens.js";
|
|
5
6
|
import { INLINE_FIELD_CLASS_NAME } from "./input-control.js";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { useState } from "react";
|
|
8
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
9
9
|
import { Field } from "@base-ui/react/field";
|
|
10
10
|
// src/components/textarea.tsx
|
|
11
|
-
const Textarea = ({ className, size = CONTROL_SIZE.default, unstyled = false, inline = false, fieldSizing = "content", maxRows, showCount = false, dir, onChange, style, ...props }) => {
|
|
11
|
+
const Textarea = ({ className, id, name, disabled, value, defaultValue, size = CONTROL_SIZE.default, appearance = "default", unstyled = false, inline = false, fieldSizing = "content", maxRows, showCount = false, dir, onChange, style, ...props }) => {
|
|
12
12
|
const controlSize = typeof size === "number" ? CONTROL_SIZE.default : size;
|
|
13
|
+
const composer = appearance === "composer";
|
|
14
|
+
const fieldEditorClass = inline ? cn(INLINE_FIELD_CLASS_NAME, "resize-none [--textarea-pb:0px] [--textarea-pt:0px]") : cn("w-full rounded-[inherit] px-[calc(--spacing(3)-1px)] outline-none", TEXTAREA_SIZE_CLASS_NAMES[controlSize], fieldSizing === "content" && TEXTAREA_FLOOR_CLASS_NAMES[controlSize]);
|
|
15
|
+
const editorClass = composer ? cn("placeholder:text-foreground-placeholder block w-full resize-none bg-transparent outline-none [--textarea-pb:0px] [--textarea-pt:0px]", COMPOSER_TEXT_CLASS, COMPOSER_LARGE_EDITOR_CLASS) : fieldEditorClass;
|
|
13
16
|
const contentDir = useContentDir({
|
|
14
17
|
dir,
|
|
15
|
-
value
|
|
16
|
-
defaultValue
|
|
18
|
+
value,
|
|
19
|
+
defaultValue
|
|
17
20
|
});
|
|
18
|
-
const [typedLength, setTypedLength] = useState(() => textLength(
|
|
19
|
-
const length =
|
|
21
|
+
const [typedLength, setTypedLength] = useState(() => textLength(defaultValue));
|
|
22
|
+
const length = value === void 0 ? typedLength : textLength(value);
|
|
20
23
|
const counted = showCount && props.maxLength !== void 0;
|
|
21
24
|
const handleChange = (event) => {
|
|
22
25
|
contentDir.trackValue(event.currentTarget.value);
|
|
@@ -26,7 +29,7 @@ const Textarea = ({ className, size = CONTROL_SIZE.default, unstyled = false, in
|
|
|
26
29
|
const syncCountOnFormReset = (control) => {
|
|
27
30
|
const textarea = control?.querySelector("textarea");
|
|
28
31
|
const form = textarea?.form;
|
|
29
|
-
if (!counted ||
|
|
32
|
+
if (!counted || value !== void 0 || !textarea || !form) return;
|
|
30
33
|
const handleReset = () => {
|
|
31
34
|
setTimeout(() => {
|
|
32
35
|
contentDir.trackValue(textarea.value);
|
|
@@ -43,17 +46,26 @@ const Textarea = ({ className, size = CONTROL_SIZE.default, unstyled = false, in
|
|
|
43
46
|
"--textarea-max-rows": maxRows
|
|
44
47
|
};
|
|
45
48
|
return /* @__PURE__ */ jsxs("span", {
|
|
46
|
-
className: cn(inline && "relative inline-flex w-full", counted && "relative", !unstyled && !inline && "border-input bg-background text-foreground ring-ring/24 has-focus-visible:border-ring has-aria-invalid:border-destructive/36 has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 dark:bg-input/32 dark:has-aria-invalid:ring-destructive/24 relative inline-flex w-full rounded-lg border text-base shadow-xs/5 not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:ring-[3px] has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none sm:text-sm dark:not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", className) || void 0,
|
|
49
|
+
className: cn(composer && "block w-full", !composer && inline && "relative inline-flex w-full", counted && "relative", !composer && !unstyled && !inline && "border-input bg-background text-foreground ring-ring/24 has-focus-visible:border-ring has-aria-invalid:border-destructive/36 has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 dark:bg-input/32 dark:has-aria-invalid:ring-destructive/24 relative inline-flex w-full rounded-lg border text-base shadow-xs/5 not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:ring-[3px] has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none sm:text-sm dark:not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", className) || void 0,
|
|
50
|
+
"data-appearance": appearance,
|
|
47
51
|
"data-size": size,
|
|
48
52
|
"data-slot": "textarea-control",
|
|
49
53
|
ref: syncCountOnFormReset,
|
|
50
|
-
children: [/* @__PURE__ */ jsx(Field.Control, {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
children: [/* @__PURE__ */ jsx(Field.Control, {
|
|
55
|
+
id,
|
|
56
|
+
name,
|
|
57
|
+
disabled,
|
|
58
|
+
value,
|
|
59
|
+
defaultValue,
|
|
60
|
+
render: /* @__PURE__ */ jsx("textarea", {
|
|
61
|
+
className: cn(editorClass, fieldSizing === "content" ? "field-sizing-content" : "field-sizing-fixed resize-none", "pt-(--textarea-pt) pb-(--textarea-pb)", counted && "[--textarea-pb:--spacing(6)]", maxRows !== void 0 && "max-h-[calc(var(--textarea-max-rows)*1lh+var(--textarea-pt)+var(--textarea-pb))] min-h-0 max-sm:min-h-0"),
|
|
62
|
+
"data-slot": "textarea",
|
|
63
|
+
...props,
|
|
64
|
+
onChange: handleChange,
|
|
65
|
+
dir: contentDir.dir,
|
|
66
|
+
style: textareaStyle
|
|
67
|
+
})
|
|
68
|
+
}), counted ? /* @__PURE__ */ jsxs("span", {
|
|
57
69
|
className: "text-muted-foreground pointer-events-none absolute end-3 bottom-1.5 text-xs tabular-nums",
|
|
58
70
|
"data-slot": "textarea-count",
|
|
59
71
|
children: [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { PickerClock } from "./date-picker-popover.logic.js";
|
|
3
3
|
/**
|
|
4
4
|
* Stacks time fields on one grid, so their labels, hours and minutes line up
|
|
5
5
|
* whatever each label's length. A lone TimeField makes its own group.
|
|
6
6
|
*/
|
|
7
|
-
declare const TimeFieldGroup: ({ children, className, ...props }: React
|
|
7
|
+
declare const TimeFieldGroup: ({ children, className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
8
8
|
type TimeFieldProps = {
|
|
9
9
|
className?: string | undefined;
|
|
10
10
|
disabled: boolean;
|
|
@@ -21,5 +21,5 @@ type TimeFieldProps = {
|
|
|
21
21
|
* A wall-clock time to the minute: hour and minute selects in the locale's
|
|
22
22
|
* own clock and numerals, so `2 PM` and `14` read as each locale writes them.
|
|
23
23
|
*/
|
|
24
|
-
declare const TimeField: ({ className, ...props }: TimeFieldProps) => React
|
|
24
|
+
declare const TimeField: ({ className, ...props }: TimeFieldProps) => React.JSX.Element;
|
|
25
25
|
export { TimeField, TimeFieldGroup, type TimeFieldProps };
|