@surflane/ui 0.9.0 → 0.10.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 +4 -4
- package/dist/accordion.d.ts +33 -17
- package/dist/accordion.js +10 -11
- package/dist/alert-dialog.d.ts +8 -4
- package/dist/alert-dialog.js +3 -4
- package/dist/app-shell.d.ts +81 -44
- package/dist/app-shell.js +67 -29
- package/dist/autocomplete.d.ts +117 -61
- package/dist/autocomplete.js +8 -8
- package/dist/avatar.d.ts +34 -17
- package/dist/avatar.js +8 -9
- package/dist/badge.d.ts +6 -10
- package/dist/badge.js +5 -6
- package/dist/bottom-navigation.d.ts +11 -41
- package/dist/bottom-navigation.js +9 -10
- package/dist/breadcrumbs.d.ts +21 -5
- package/dist/breadcrumbs.js +12 -14
- package/dist/button.d.ts +15 -8
- package/dist/button.js +8 -9
- package/dist/card.d.ts +610 -35
- package/dist/card.js +12 -12
- package/dist/chart.d.ts +9 -32
- package/dist/chart.js +65 -26
- package/dist/checkbox-group.d.ts +4 -1
- package/dist/checkbox-group.js +3 -4
- package/dist/checkbox.d.ts +13 -4
- package/dist/checkbox.js +6 -6
- package/dist/choice-label.d.ts +3 -11
- package/dist/choice-label.js +4 -4
- package/dist/class-names.d.ts +6 -0
- package/dist/class-names.js +18 -0
- package/dist/code.d.ts +13 -10
- package/dist/code.js +8 -5
- package/dist/collapsible.d.ts +25 -12
- package/dist/collapsible.js +7 -8
- package/dist/combobox.d.ts +145 -73
- package/dist/combobox.js +27 -27
- package/dist/context-menu.d.ts +106 -54
- package/dist/context-menu.js +4 -5
- package/dist/css/accordion.css +1 -1
- package/dist/css/alert-dialog.css +2 -2
- package/dist/css/all.css +7 -5
- package/dist/css/app-shell.css +1 -1
- package/dist/css/autocomplete.css +1 -1
- package/dist/css/avatar.css +2 -2
- package/dist/css/badge.css +2 -2
- package/dist/css/bottom-navigation.css +1 -1
- package/dist/css/breadcrumbs.css +3 -3
- package/dist/css/button.css +1 -1
- package/dist/css/card.css +3 -3
- package/dist/css/chart.css +2 -2
- package/dist/css/checkbox-group.css +1 -1
- package/dist/css/checkbox.css +1 -1
- package/dist/css/choice-label.css +1 -1
- package/dist/css/code.css +2 -2
- package/dist/css/collapsible.css +1 -1
- package/dist/css/combobox.css +1 -1
- package/dist/css/context-menu.css +1 -1
- package/dist/css/date-picker.css +1 -1
- package/dist/css/dialog.css +2 -2
- package/dist/css/drawer.css +2 -2
- package/dist/css/empty-state.css +2 -2
- package/dist/css/field.css +1 -1
- package/dist/css/fieldset.css +1 -1
- package/dist/css/file-upload.css +2 -2
- package/dist/css/filter-bar.css +1 -1
- package/dist/css/form.css +1 -1
- package/dist/css/icon.css +1 -1
- package/dist/css/inline-message.css +2 -2
- package/dist/css/input.css +1 -1
- package/dist/css/layout.css +2 -2
- package/dist/css/link.css +2 -2
- package/dist/css/list.css +2 -2
- package/dist/css/markdown.css +4 -4
- package/dist/css/menu.css +1 -1
- package/dist/css/menubar.css +1 -1
- package/dist/css/meter.css +1 -1
- package/dist/css/native-select.css +1 -1
- package/dist/css/navigation-menu.css +1 -1
- package/dist/css/number-field.css +1 -1
- package/dist/css/otp-field.css +1 -1
- package/dist/css/page-header.css +3 -3
- package/dist/css/pagination.css +2 -2
- package/dist/css/popover.css +1 -1
- package/dist/css/preview-card.css +2 -2
- package/dist/css/progress.css +1 -1
- package/dist/css/radio-group.css +1 -1
- package/dist/css/rules/accordion.css +5 -5
- package/dist/css/rules/alert-dialog.css +9 -9
- package/dist/css/rules/app-shell.css +274 -82
- package/dist/css/rules/avatar.css +7 -7
- package/dist/css/rules/badge.css +6 -6
- package/dist/css/rules/bar.css +11 -11
- package/dist/css/rules/base.css +30 -30
- package/dist/css/rules/bottom-navigation.css +57 -56
- package/dist/css/rules/breadcrumbs.css +2 -2
- package/dist/css/rules/button.css +66 -65
- package/dist/css/rules/card.css +3 -3
- package/dist/css/rules/chart.css +134 -124
- package/dist/css/rules/checkbox.css +5 -5
- package/dist/css/rules/choice-label.css +19 -18
- package/dist/css/rules/choice.css +65 -60
- package/dist/css/rules/code.css +2 -2
- package/dist/css/rules/collapsible.css +2 -2
- package/dist/css/rules/combobox.css +87 -83
- package/dist/css/rules/context-menu.css +1 -1
- package/dist/css/rules/date-picker.css +150 -144
- package/dist/css/rules/dialog.css +85 -79
- package/dist/css/rules/disclosure.css +49 -47
- package/dist/css/rules/drawer.css +6 -6
- package/dist/css/rules/empty-state.css +2 -2
- package/dist/css/rules/field-control.css +51 -42
- package/dist/css/rules/field.css +26 -24
- package/dist/css/rules/fieldset.css +8 -8
- package/dist/css/rules/file-upload.css +73 -72
- package/dist/css/rules/filter-bar.css +19 -18
- package/dist/css/rules/form.css +3 -3
- package/dist/css/rules/gauge.css +22 -22
- package/dist/css/rules/icon.css +16 -11
- package/dist/css/rules/inline-message.css +3 -3
- package/dist/css/rules/input-group.css +44 -43
- package/dist/css/rules/input.css +11 -11
- package/dist/css/rules/item.css +7 -7
- package/dist/css/rules/link.css +2 -2
- package/dist/css/rules/list.css +3 -3
- package/dist/css/rules/markdown.css +27 -27
- package/dist/css/rules/menu.css +45 -42
- package/dist/css/rules/menubar.css +6 -6
- package/dist/css/rules/navigation-menu.css +69 -66
- package/dist/css/rules/number-field.css +22 -21
- package/dist/css/rules/otp-field.css +28 -27
- package/dist/css/rules/panel.css +105 -100
- package/dist/css/rules/popover.css +23 -20
- package/dist/css/rules/popup.css +15 -14
- package/dist/css/rules/preview-card.css +20 -19
- package/dist/css/rules/progress.css +3 -3
- package/dist/css/rules/radio-group.css +8 -8
- package/dist/css/rules/scroll-area.css +50 -39
- package/dist/css/rules/select.css +39 -36
- package/dist/css/rules/sizing.css +119 -116
- package/dist/css/rules/skeleton.css +11 -11
- package/dist/css/rules/slider.css +43 -43
- package/dist/css/rules/sparkline.css +21 -21
- package/dist/css/rules/spinner.css +9 -9
- package/dist/css/rules/stat.css +32 -32
- package/dist/css/rules/switch.css +28 -21
- package/dist/css/rules/syntax-highlighter.css +37 -36
- package/dist/css/rules/table.css +10 -10
- package/dist/css/rules/tabs.css +53 -52
- package/dist/css/rules/textarea.css +9 -7
- package/dist/css/rules/toast.css +94 -90
- package/dist/css/rules/toggle.css +12 -12
- package/dist/css/rules/toolbar.css +27 -27
- package/dist/css/rules/tooltip.css +14 -14
- package/dist/css/rules/tree.css +38 -38
- package/dist/css/scroll-area.css +1 -1
- package/dist/css/select.css +1 -1
- package/dist/css/separator.css +2 -2
- package/dist/css/sheet.css +2 -2
- package/dist/css/sizing.css +1 -1
- package/dist/css/skeleton.css +1 -1
- package/dist/css/slider.css +1 -1
- package/dist/css/sparkline.css +1 -1
- package/dist/css/spinner.css +1 -1
- package/dist/css/stat.css +1 -1
- package/dist/css/styles.css +17 -17
- package/dist/css/switch.css +1 -1
- package/dist/css/syntax-highlighter.css +1 -1
- package/dist/css/table.css +2 -2
- package/dist/css/tabs.css +1 -1
- package/dist/css/textarea.css +1 -1
- package/dist/css/toast.css +1 -1
- package/dist/css/toggle-group.css +1 -1
- package/dist/css/toggle.css +1 -1
- package/dist/css/toolbar.css +1 -1
- package/dist/css/tooltip.css +1 -1
- package/dist/css/tree.css +1 -1
- package/dist/css/typography.css +2 -2
- package/dist/date-picker.js +28 -8
- package/dist/dialog.d.ts +20 -8
- package/dist/dialog.js +11 -12
- package/dist/drawer.d.ts +12 -4
- package/dist/drawer.js +5 -5
- package/dist/element-part.d.ts +8 -0
- package/dist/element-part.js +21 -0
- package/dist/empty-state.d.ts +602 -24
- package/dist/empty-state.js +9 -9
- package/dist/field.d.ts +60 -36
- package/dist/field.js +6 -6
- package/dist/fieldset.d.ts +19 -11
- package/dist/fieldset.js +2 -2
- package/dist/file-upload.d.ts +8 -23
- package/dist/file-upload.js +21 -16
- package/dist/filter-bar.d.ts +30 -10
- package/dist/filter-bar.js +16 -18
- package/dist/form.js +1 -1
- package/dist/icon.d.ts +9 -2
- package/dist/icon.js +6 -6
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -3
- package/dist/inline-message.d.ts +51 -27
- package/dist/inline-message.js +10 -11
- package/dist/input.d.ts +4 -2
- package/dist/input.js +3 -4
- package/dist/layout.d.ts +24 -12
- package/dist/layout.js +27 -27
- package/dist/link.d.ts +3 -1
- package/dist/link.js +3 -4
- package/dist/list.d.ts +43 -27
- package/dist/list.js +12 -13
- package/dist/markdown.d.ts +14 -6
- package/dist/markdown.js +28 -11
- package/dist/menu.d.ts +113 -57
- package/dist/menu.js +24 -25
- package/dist/menubar.d.ts +5 -3
- package/dist/menubar.js +1 -1
- package/dist/meter.d.ts +46 -26
- package/dist/meter.js +5 -5
- package/dist/native-select.d.ts +4 -2
- package/dist/native-select.js +2 -2
- package/dist/navigation-menu.d.ts +76 -40
- package/dist/navigation-menu.js +15 -16
- package/dist/number-field.d.ts +44 -19
- package/dist/number-field.js +12 -13
- package/dist/otp-field.d.ts +26 -9
- package/dist/otp-field.js +10 -11
- package/dist/page-header.js +3 -4
- package/dist/pagination.d.ts +11 -8
- package/dist/pagination.js +4 -5
- package/dist/panel.d.ts +3 -1
- package/dist/panel.js +5 -6
- package/dist/parts.d.ts +5 -7
- package/dist/parts.js +8 -16
- package/dist/popover.d.ts +20 -12
- package/dist/popover.js +3 -3
- package/dist/preview-card.d.ts +22 -10
- package/dist/preview-card.js +7 -8
- package/dist/progress.d.ts +46 -26
- package/dist/progress.js +5 -5
- package/dist/radio-group.d.ts +16 -8
- package/dist/radio-group.js +5 -5
- package/dist/scroll-area.d.ts +4 -2
- package/dist/scroll-area.js +6 -6
- package/dist/select.d.ts +3 -1
- package/dist/select.js +5 -5
- package/dist/separator.d.ts +5 -2
- package/dist/separator.js +3 -4
- package/dist/sheet.d.ts +12 -4
- package/dist/sheet.js +5 -5
- package/dist/size.d.ts +7 -0
- package/dist/size.js +9 -0
- package/dist/sizing.d.ts +8 -3
- package/dist/sizing.js +8 -10
- package/dist/skeleton.d.ts +3 -3
- package/dist/skeleton.js +4 -6
- package/dist/slider.d.ts +55 -31
- package/dist/slider.js +7 -7
- package/dist/sparkline.d.ts +5 -20
- package/dist/sparkline.js +5 -7
- package/dist/spinner.d.ts +4 -6
- package/dist/spinner.js +7 -8
- package/dist/stat.d.ts +34 -42
- package/dist/stat.js +9 -10
- package/dist/status.js +0 -1
- package/dist/switch.d.ts +17 -8
- package/dist/switch.js +4 -5
- package/dist/syntax-engine.js +9 -1
- package/dist/syntax-highlighter.d.ts +3 -7
- package/dist/syntax-highlighter.js +4 -4
- package/dist/syntax-highlighting.js +2 -2
- package/dist/table.d.ts +111 -75
- package/dist/table.js +32 -33
- package/dist/tabs.d.ts +46 -26
- package/dist/tabs.js +5 -5
- package/dist/textarea.d.ts +4 -2
- package/dist/textarea.js +3 -4
- package/dist/toast.d.ts +76 -42
- package/dist/toast.js +28 -28
- package/dist/toggle-group.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tone-transition.d.ts +1 -1
- package/dist/tone-transition.js +9 -8
- package/dist/toolbar.d.ts +55 -31
- package/dist/toolbar.js +6 -6
- package/dist/tooltip.d.ts +4 -1
- package/dist/tooltip.js +2 -2
- package/dist/tree.d.ts +12 -1
- package/dist/tree.js +13 -9
- package/dist/typography.d.ts +3 -1
- package/dist/typography.js +6 -8
- package/package.json +6 -5
package/dist/inline-message.d.ts
CHANGED
|
@@ -1,35 +1,59 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type StatusTone } from './status.js';
|
|
3
3
|
export declare const InlineMessage: {
|
|
4
|
-
Root: React.
|
|
4
|
+
Root: ({ tone, className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
|
|
5
5
|
tone?: StatusTone;
|
|
6
|
-
} &
|
|
7
|
-
|
|
6
|
+
} & {
|
|
7
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
Icon: ({ tone, children, className, ref, ...props }: React.ComponentPropsWithoutRef<"span"> & {
|
|
8
10
|
tone?: StatusTone;
|
|
9
|
-
} &
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
11
|
+
} & {
|
|
12
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
13
|
+
}) => React.JSX.Element;
|
|
14
|
+
Content: ({ ref, ...props }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
|
|
15
|
+
size?: import("./size.js").ComponentSize;
|
|
16
|
+
} & {
|
|
17
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
18
|
+
}) => React.JSX.Element;
|
|
19
|
+
Title: ({ ref, ...props }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "size"> & {
|
|
20
|
+
size?: import("./size.js").ComponentSize;
|
|
21
|
+
} & {
|
|
22
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
23
|
+
}) => React.JSX.Element;
|
|
24
|
+
Description: ({ ref, ...props }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">, "size"> & {
|
|
25
|
+
size?: import("./size.js").ComponentSize;
|
|
26
|
+
} & {
|
|
27
|
+
ref?: React.Ref<HTMLParagraphElement> | undefined;
|
|
28
|
+
}) => React.JSX.Element;
|
|
29
|
+
Actions: ({ ref, ...props }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
|
|
30
|
+
size?: import("./size.js").ComponentSize;
|
|
31
|
+
} & {
|
|
32
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
33
|
+
}) => React.JSX.Element;
|
|
22
34
|
};
|
|
23
|
-
export declare const InlineMessageRoot: React.
|
|
35
|
+
export declare const InlineMessageRoot: ({ tone, className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
|
|
24
36
|
tone?: StatusTone;
|
|
25
|
-
} &
|
|
37
|
+
} & {
|
|
38
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
39
|
+
}) => React.JSX.Element, InlineMessageIcon: ({ tone, children, className, ref, ...props }: React.ComponentPropsWithoutRef<"span"> & {
|
|
26
40
|
tone?: StatusTone;
|
|
27
|
-
} &
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
size?: import("./
|
|
31
|
-
} &
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
size?: import("./
|
|
35
|
-
} &
|
|
41
|
+
} & {
|
|
42
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
43
|
+
}) => React.JSX.Element, InlineMessageContent: ({ ref, ...props }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
|
|
44
|
+
size?: import("./size.js").ComponentSize;
|
|
45
|
+
} & {
|
|
46
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
47
|
+
}) => React.JSX.Element, InlineMessageTitle: ({ ref, ...props }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "size"> & {
|
|
48
|
+
size?: import("./size.js").ComponentSize;
|
|
49
|
+
} & {
|
|
50
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
51
|
+
}) => React.JSX.Element, InlineMessageDescription: ({ ref, ...props }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">, "size"> & {
|
|
52
|
+
size?: import("./size.js").ComponentSize;
|
|
53
|
+
} & {
|
|
54
|
+
ref?: React.Ref<HTMLParagraphElement> | undefined;
|
|
55
|
+
}) => React.JSX.Element, InlineMessageActions: ({ ref, ...props }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
|
|
56
|
+
size?: import("./size.js").ComponentSize;
|
|
57
|
+
} & {
|
|
58
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
59
|
+
}) => React.JSX.Element;
|
package/dist/inline-message.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import { useToneTransition } from './tone-transition.js';
|
|
5
4
|
import { part, cx } from './parts.js';
|
|
6
5
|
import { StatusIcon } from './status.js';
|
|
7
|
-
const MessageRoot =
|
|
6
|
+
const MessageRoot = function MessageRoot({ tone = 'neutral', className, ref, ...props }) {
|
|
8
7
|
const elementRef = useToneTransition(tone, ref);
|
|
9
|
-
return (_jsx("div", { ...props, ref: elementRef, "data-tone": tone, className: cx('
|
|
10
|
-
}
|
|
11
|
-
const MessageIcon =
|
|
12
|
-
return (_jsx("span", { ...props, ref: ref, "aria-hidden": 'true', className: cx('
|
|
13
|
-
}
|
|
8
|
+
return (_jsx("div", { ...props, ref: elementRef, "data-tone": tone, className: cx('surf-message', className) }));
|
|
9
|
+
};
|
|
10
|
+
const MessageIcon = function MessageIcon({ tone = 'neutral', children, className, ref, ...props }) {
|
|
11
|
+
return (_jsx("span", { ...props, ref: ref, "aria-hidden": 'true', className: cx('surf-message-icon', className), children: children ?? _jsx(StatusIcon, { tone: tone }) }));
|
|
12
|
+
};
|
|
14
13
|
export const InlineMessage = {
|
|
15
14
|
Root: MessageRoot,
|
|
16
15
|
Icon: MessageIcon,
|
|
17
|
-
Content: /* @__PURE__ */ part('div', '
|
|
18
|
-
Title: /* @__PURE__ */ part('strong', '
|
|
19
|
-
Description: /* @__PURE__ */ part('p', '
|
|
20
|
-
Actions: /* @__PURE__ */ part('div', '
|
|
16
|
+
Content: /* @__PURE__ */ part('div', 'surf-message-content'),
|
|
17
|
+
Title: /* @__PURE__ */ part('strong', 'surf-message-title'),
|
|
18
|
+
Description: /* @__PURE__ */ part('p', 'surf-message-description'),
|
|
19
|
+
Actions: /* @__PURE__ */ part('div', 'surf-message-actions'),
|
|
21
20
|
};
|
|
22
21
|
// Flat names for React Server Components, which cannot dot into client exports.
|
|
23
22
|
export const { Root: InlineMessageRoot, Icon: InlineMessageIcon, Content: InlineMessageContent, Title: InlineMessageTitle, Description: InlineMessageDescription, Actions: InlineMessageActions, } = InlineMessage;
|
package/dist/input.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type ComponentSizeAlias } from './sizing.js';
|
|
3
|
-
export declare const Input:
|
|
3
|
+
export declare const Input: ({ className, leadingIcon, wrapperClassName, size, ref, ...props }: Omit<React.ComponentPropsWithoutRef<"input">, "size"> & {
|
|
4
4
|
size?: number | ComponentSizeAlias;
|
|
5
5
|
leadingIcon?: React.ReactNode;
|
|
6
6
|
wrapperClassName?: string;
|
|
7
|
-
} &
|
|
7
|
+
} & {
|
|
8
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
9
|
+
}) => React.JSX.Element;
|
package/dist/input.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import { cx } from './parts.js';
|
|
5
4
|
import { useComponentSize } from './sizing.js';
|
|
6
5
|
import { Input as BaseInput } from '@base-ui/react/input';
|
|
7
|
-
export const Input =
|
|
6
|
+
export const Input = function Input({ className, leadingIcon, wrapperClassName, size, ref, ...props }) {
|
|
8
7
|
const scheme = useComponentSize(typeof size === 'string' ? size : undefined);
|
|
9
|
-
return (_jsxs("span", { "data-ui-size": scheme, className: cx('
|
|
10
|
-
}
|
|
8
|
+
return (_jsxs("span", { "data-ui-size": scheme, className: cx('surf-control', wrapperClassName), "data-leading-icon": leadingIcon ? '' : undefined, "data-disabled": props.disabled || undefined, children: [leadingIcon && (_jsx("span", { className: 'surf-control-icon', "aria-hidden": 'true', children: leadingIcon })), _jsx(BaseInput, { ...props, size: typeof size === 'number' ? size : undefined, ref: ref, className: cx('surf-input', className) })] }));
|
|
9
|
+
};
|
package/dist/layout.d.ts
CHANGED
|
@@ -1,33 +1,45 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export type Space = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20;
|
|
3
|
-
export declare const Container:
|
|
3
|
+
export declare const Container: ({ width, className, ref, ...props }: React.ComponentProps<"div"> & {
|
|
4
4
|
width?: "workspace" | "reading" | "wide" | "full";
|
|
5
|
-
}
|
|
6
|
-
|
|
5
|
+
} & {
|
|
6
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export declare const Stack: ({ gap, className, style, ref, ...props }: React.ComponentProps<"div"> & {
|
|
7
9
|
gap?: Space;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
+
} & {
|
|
11
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
12
|
+
}) => React.JSX.Element;
|
|
13
|
+
export declare const Inline: ({ gap, justify, className, style, ref, ...props }: React.ComponentProps<"div"> & {
|
|
10
14
|
gap?: Space;
|
|
11
15
|
justify?: "start" | "between" | "end";
|
|
12
|
-
}
|
|
13
|
-
|
|
16
|
+
} & {
|
|
17
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
18
|
+
}) => React.JSX.Element;
|
|
19
|
+
export declare const Grid: ({ gap, bleed, columns, className, style, ref, ...props }: React.ComponentProps<"div"> & {
|
|
14
20
|
gap?: Space;
|
|
15
21
|
/** Extend inline edges by the matching child content inset (card padding or table cell inset). The parent
|
|
16
22
|
* must reserve this space for the card surface and focus outline. */
|
|
17
23
|
bleed?: Space;
|
|
18
24
|
columns?: 1 | 2 | 3 | 4 | "layout";
|
|
19
|
-
}
|
|
25
|
+
} & {
|
|
26
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
27
|
+
}) => React.JSX.Element;
|
|
20
28
|
/** Spans are explicit at each viewport breakpoint; placement follows DOM order. */
|
|
21
|
-
export declare const GridItem:
|
|
29
|
+
export declare const GridItem: ({ span, mediumSpan, smallSpan, className, style, ref, ...props }: React.ComponentProps<"div"> & {
|
|
22
30
|
span?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
23
31
|
mediumSpan?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
24
32
|
smallSpan?: 1 | 2 | 3 | 4;
|
|
25
|
-
}
|
|
33
|
+
} & {
|
|
34
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
35
|
+
}) => React.JSX.Element;
|
|
26
36
|
export type SurfaceKind = 'canvas' | 'subtle';
|
|
27
|
-
export declare const Surface:
|
|
37
|
+
export declare const Surface: ({ surface, tone, padding, className, style, ref, ...props }: React.ComponentProps<"div"> & {
|
|
28
38
|
/** The background: subtle sits on the sheet, canvas matches it. */
|
|
29
39
|
surface?: SurfaceKind;
|
|
30
40
|
/** @deprecated Use surface; tone names a status color elsewhere. */
|
|
31
41
|
tone?: SurfaceKind;
|
|
32
42
|
padding?: Space;
|
|
33
|
-
}
|
|
43
|
+
} & {
|
|
44
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
45
|
+
}) => React.JSX.Element;
|
package/dist/layout.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { cx } from './parts.js';
|
|
2
|
+
import { cx } from './class-names.js';
|
|
5
3
|
const gapStyle = (gap, style) => ({
|
|
6
|
-
...(gap === undefined
|
|
4
|
+
...(gap === undefined
|
|
5
|
+
? {}
|
|
6
|
+
: { '--surf-layout-gap': `var(--surf-space-${gap})` }),
|
|
7
7
|
...style,
|
|
8
8
|
});
|
|
9
|
-
export const Container =
|
|
10
|
-
return (_jsx("div", { ...props, ref: ref, className: cx('
|
|
11
|
-
}
|
|
12
|
-
export const Stack =
|
|
13
|
-
return (_jsx("div", { ...props, ref: ref, className: cx('
|
|
14
|
-
}
|
|
15
|
-
export const Inline =
|
|
16
|
-
return (_jsx("div", { ...props, ref: ref, className: cx('
|
|
17
|
-
}
|
|
18
|
-
export const Grid =
|
|
19
|
-
return (_jsx("div", { ...props, ref: ref, className: cx('
|
|
20
|
-
'--grid-inline-bleed': `var(--space-${bleed})`,
|
|
9
|
+
export const Container = function Container({ width = 'workspace', className, ref, ...props }) {
|
|
10
|
+
return (_jsx("div", { ...props, ref: ref, className: cx('surf-container', className), "data-width": width }));
|
|
11
|
+
};
|
|
12
|
+
export const Stack = function Stack({ gap, className, style, ref, ...props }) {
|
|
13
|
+
return (_jsx("div", { ...props, ref: ref, className: cx('surf-stack', className), style: gapStyle(gap, style) }));
|
|
14
|
+
};
|
|
15
|
+
export const Inline = function Inline({ gap, justify = 'start', className, style, ref, ...props }) {
|
|
16
|
+
return (_jsx("div", { ...props, ref: ref, className: cx('surf-inline', className), "data-justify": justify, style: gapStyle(gap, style) }));
|
|
17
|
+
};
|
|
18
|
+
export const Grid = function Grid({ gap, bleed = 0, columns = 3, className, style, ref, ...props }) {
|
|
19
|
+
return (_jsx("div", { ...props, ref: ref, className: cx('surf-grid', className), "data-columns": columns, style: gapStyle(gap, {
|
|
20
|
+
'--surf-grid-inline-bleed': `var(--surf-space-${bleed})`,
|
|
21
21
|
...style,
|
|
22
22
|
}) }));
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
/** Spans are explicit at each viewport breakpoint; placement follows DOM order. */
|
|
25
|
-
export const GridItem =
|
|
26
|
-
return (_jsx("div", { ...props, ref: ref, className: cx('
|
|
27
|
-
'--grid-item-span': span,
|
|
28
|
-
'--grid-item-span-medium': mediumSpan,
|
|
29
|
-
'--grid-item-span-small': smallSpan,
|
|
25
|
+
export const GridItem = function GridItem({ span, mediumSpan, smallSpan, className, style, ref, ...props }) {
|
|
26
|
+
return (_jsx("div", { ...props, ref: ref, className: cx('surf-grid-item', className), style: {
|
|
27
|
+
'--surf-grid-item-span': span,
|
|
28
|
+
'--surf-grid-item-span-medium': mediumSpan,
|
|
29
|
+
'--surf-grid-item-span-small': smallSpan,
|
|
30
30
|
...style,
|
|
31
31
|
} }));
|
|
32
|
-
}
|
|
33
|
-
export const Surface =
|
|
34
|
-
return (_jsx("div", { ...props, ref: ref, className: cx('
|
|
32
|
+
};
|
|
33
|
+
export const Surface = function Surface({ surface, tone, padding, className, style, ref, ...props }) {
|
|
34
|
+
return (_jsx("div", { ...props, ref: ref, className: cx('surf-surface', className), "data-surface": surface ?? tone ?? 'subtle', style: {
|
|
35
35
|
...(padding === undefined
|
|
36
36
|
? {}
|
|
37
|
-
: { '--surface-padding': `var(--space-${padding})` }),
|
|
37
|
+
: { '--surf-surface-padding': `var(--surf-space-${padding})` }),
|
|
38
38
|
...style,
|
|
39
39
|
} }));
|
|
40
|
-
}
|
|
40
|
+
};
|
package/dist/link.d.ts
CHANGED
|
@@ -3,4 +3,6 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
3
3
|
export type LinkProps = Omit<useRender.ComponentProps<'a'>, 'ref'>;
|
|
4
4
|
/** A text link. Pass a router's link element as `render`, such as
|
|
5
5
|
* `<Link render={<NextLink href='/docs' />}>Docs</Link>`, to keep client navigation. */
|
|
6
|
-
export declare const Link:
|
|
6
|
+
export declare const Link: ({ render, className, ref, ...props }: LinkProps & {
|
|
7
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
8
|
+
}) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
package/dist/link.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as React from 'react';
|
|
3
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
4
3
|
import { cx } from './parts.js';
|
|
5
4
|
/** A text link. Pass a router's link element as `render`, such as
|
|
6
5
|
* `<Link render={<NextLink href='/docs' />}>Docs</Link>`, to keep client navigation. */
|
|
7
|
-
export const Link =
|
|
6
|
+
export const Link = function Link({ render, className, ref, ...props }) {
|
|
8
7
|
return useRender({
|
|
9
8
|
defaultTagName: 'a',
|
|
10
9
|
render,
|
|
11
10
|
ref,
|
|
12
11
|
props: {
|
|
13
12
|
...props,
|
|
14
|
-
className: cx('
|
|
13
|
+
className: cx('surf-link', className),
|
|
15
14
|
},
|
|
16
15
|
});
|
|
17
|
-
}
|
|
16
|
+
};
|
package/dist/list.d.ts
CHANGED
|
@@ -1,33 +1,49 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const ListRoot: React.
|
|
3
|
-
|
|
2
|
+
declare const ListRoot: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"ul"> & {
|
|
3
|
+
ref?: React.Ref<HTMLUListElement>;
|
|
4
|
+
}) => React.JSX.Element;
|
|
5
|
+
declare const ListItem: ({ selected, className, ref, ...props }: React.ComponentPropsWithoutRef<"li"> & {
|
|
4
6
|
selected?: boolean;
|
|
5
|
-
} &
|
|
7
|
+
} & {
|
|
8
|
+
ref?: React.Ref<HTMLLIElement>;
|
|
9
|
+
}) => React.JSX.Element;
|
|
6
10
|
export declare const List: {
|
|
7
|
-
Root: React.
|
|
8
|
-
|
|
11
|
+
Root: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"ul"> & {
|
|
12
|
+
ref?: React.Ref<HTMLUListElement>;
|
|
13
|
+
}) => React.JSX.Element;
|
|
14
|
+
Item: ({ selected, className, ref, ...props }: React.ComponentPropsWithoutRef<"li"> & {
|
|
9
15
|
selected?: boolean;
|
|
10
|
-
} &
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
size?: import("./
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
} & {
|
|
17
|
+
ref?: React.Ref<HTMLLIElement>;
|
|
18
|
+
}) => React.JSX.Element;
|
|
19
|
+
Content: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
|
|
20
|
+
size?: import("./size.js").ComponentSize;
|
|
21
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
22
|
+
}) => React.JSX.Element;
|
|
23
|
+
Title: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
|
|
24
|
+
size?: import("./size.js").ComponentSize;
|
|
25
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
26
|
+
}) => React.JSX.Element;
|
|
27
|
+
Description: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">, "size"> & {
|
|
28
|
+
size?: import("./size.js").ComponentSize;
|
|
29
|
+
ref?: React.Ref<HTMLParagraphElement> | undefined;
|
|
30
|
+
}) => React.JSX.Element;
|
|
31
|
+
Actions: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
|
|
32
|
+
size?: import("./size.js").ComponentSize;
|
|
33
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
34
|
+
}) => React.JSX.Element;
|
|
23
35
|
};
|
|
24
36
|
export { ListRoot, ListItem };
|
|
25
|
-
export declare const ListContent:
|
|
26
|
-
size?: import("./
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
size?: import("./
|
|
33
|
-
|
|
37
|
+
export declare const ListContent: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
|
|
38
|
+
size?: import("./size.js").ComponentSize;
|
|
39
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
40
|
+
}) => React.JSX.Element, ListTitle: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
|
|
41
|
+
size?: import("./size.js").ComponentSize;
|
|
42
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
43
|
+
}) => React.JSX.Element, ListDescription: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">, "size"> & {
|
|
44
|
+
size?: import("./size.js").ComponentSize;
|
|
45
|
+
ref?: React.Ref<HTMLParagraphElement> | undefined;
|
|
46
|
+
}) => React.JSX.Element, ListActions: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
|
|
47
|
+
size?: import("./size.js").ComponentSize;
|
|
48
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
49
|
+
}) => React.JSX.Element;
|
package/dist/list.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
const ListRoot =
|
|
6
|
-
return (_jsx("ul", { role: 'list', ...props, ref: ref, className: cx('
|
|
7
|
-
}
|
|
8
|
-
const ListItem =
|
|
9
|
-
return (_jsx("li", { ...props, ref: ref, "data-selected": selected || undefined, className: cx('
|
|
10
|
-
}
|
|
2
|
+
import { cx } from './class-names.js';
|
|
3
|
+
import { elementPart } from './element-part.js';
|
|
4
|
+
const ListRoot = function ListRoot({ className, ref, ...props }) {
|
|
5
|
+
return (_jsx("ul", { role: 'list', ...props, ref: ref, className: cx('surf-list', className) }));
|
|
6
|
+
};
|
|
7
|
+
const ListItem = function ListItem({ selected, className, ref, ...props }) {
|
|
8
|
+
return (_jsx("li", { ...props, ref: ref, "data-selected": selected || undefined, className: cx('surf-list-item', className) }));
|
|
9
|
+
};
|
|
11
10
|
export const List = {
|
|
12
11
|
Root: ListRoot,
|
|
13
12
|
Item: ListItem,
|
|
14
|
-
Content: /* @__PURE__ */
|
|
15
|
-
Title: /* @__PURE__ */
|
|
16
|
-
Description: /* @__PURE__ */
|
|
17
|
-
Actions: /* @__PURE__ */
|
|
13
|
+
Content: /* @__PURE__ */ elementPart('div', 'surf-list-content'),
|
|
14
|
+
Title: /* @__PURE__ */ elementPart('div', 'surf-list-title'),
|
|
15
|
+
Description: /* @__PURE__ */ elementPart('p', 'surf-list-description'),
|
|
16
|
+
Actions: /* @__PURE__ */ elementPart('div', 'surf-list-actions'),
|
|
18
17
|
};
|
|
19
18
|
// Flat names for React Server Components, which cannot dot into client exports.
|
|
20
19
|
export { ListRoot, ListItem };
|
package/dist/markdown.d.ts
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { type CodeBlockLabels } from './code.js';
|
|
2
3
|
export type MarkdownProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> & {
|
|
3
4
|
source: string;
|
|
4
5
|
label?: string;
|
|
5
6
|
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
7
|
codeWrap?: boolean;
|
|
8
|
+
/** Names the document gives its parts; pass translations here. */
|
|
9
|
+
labels?: Partial<MarkdownLabels>;
|
|
7
10
|
};
|
|
11
|
+
export type MarkdownLabels = {
|
|
12
|
+
/** A code block's name, given the document's label and the block's first line. */
|
|
13
|
+
code: (label: string, line: number) => string;
|
|
14
|
+
/** A table's name, given the document's label and the table's first line. */
|
|
15
|
+
table: (label: string, line: number) => string;
|
|
16
|
+
/** A task list checkbox whose item has no text. */
|
|
17
|
+
task: string;
|
|
18
|
+
} & CodeBlockLabels;
|
|
8
19
|
/** CommonMark + GFM. HTML stays disabled, URLs use react-markdown's safe default.
|
|
9
20
|
* Fetching, permissions, frontmatter, MDX and script execution are caller concerns. */
|
|
10
|
-
export declare const Markdown:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
14
|
-
codeWrap?: boolean;
|
|
15
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export declare const Markdown: ({ source, label, headingLevel, codeWrap, labels, className, ref, ...props }: MarkdownProps & {
|
|
22
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
23
|
+
}) => React.JSX.Element;
|
package/dist/markdown.js
CHANGED
|
@@ -6,6 +6,22 @@ import remarkGfm from 'remark-gfm';
|
|
|
6
6
|
import { CodeBlock } from './code.js';
|
|
7
7
|
import { Table } from './table.js';
|
|
8
8
|
import { cx } from './parts.js';
|
|
9
|
+
const markdownLabels = {
|
|
10
|
+
code: (label, line) => `${label}: code at line ${line}`,
|
|
11
|
+
table: (label, line) => `${label}: table at line ${line}`,
|
|
12
|
+
task: 'Task list item',
|
|
13
|
+
};
|
|
14
|
+
// Code blocks and tables read the labels here, so passing new labels never remounts
|
|
15
|
+
// the parts react-markdown renders.
|
|
16
|
+
const LabelsContext = /* @__PURE__ */ React.createContext({});
|
|
17
|
+
function MarkdownCodeBlock({ label, line, ...props }) {
|
|
18
|
+
const { code, table: _table, task: _task, ...copy } = React.useContext(LabelsContext);
|
|
19
|
+
return (_jsx(CodeBlock, { ...props, label: (code ?? markdownLabels.code)(label, line), labels: copy }));
|
|
20
|
+
}
|
|
21
|
+
function MarkdownTable({ label, line, children, }) {
|
|
22
|
+
const { table } = React.useContext(LabelsContext);
|
|
23
|
+
return (_jsx(Table.Container, { label: (table ?? markdownLabels.table)(label, line), orientation: 'horizontal', children: children }));
|
|
24
|
+
}
|
|
9
25
|
function text(node) {
|
|
10
26
|
return 'value' in node
|
|
11
27
|
? node.value
|
|
@@ -21,7 +37,8 @@ function visit(node, callback) {
|
|
|
21
37
|
}
|
|
22
38
|
/** CommonMark + GFM. HTML stays disabled, URLs use react-markdown's safe default.
|
|
23
39
|
* Fetching, permissions, frontmatter, MDX and script execution are caller concerns. */
|
|
24
|
-
export const Markdown =
|
|
40
|
+
export const Markdown = function Markdown({ source, label = 'Markdown content', headingLevel = 2, codeWrap = false, labels, className, ref, ...props }) {
|
|
41
|
+
const taskLabel = labels?.task ?? markdownLabels.task;
|
|
25
42
|
const prefix = `md-${React.useId().replace(/[^a-zA-Z0-9_-]/g, '')}`;
|
|
26
43
|
const headings = React.useMemo(() => () => (tree) => {
|
|
27
44
|
const counts = new Map();
|
|
@@ -48,11 +65,11 @@ export const Markdown = /* @__PURE__ */ React.forwardRef(function Markdown({ sou
|
|
|
48
65
|
visit(tree, (node) => {
|
|
49
66
|
if (node.tagName === 'li' &&
|
|
50
67
|
String(node.properties.className ?? '').includes('task-list-item')) {
|
|
51
|
-
const
|
|
68
|
+
const name = text(node).trim() || taskLabel;
|
|
52
69
|
visit(node, (child) => {
|
|
53
70
|
if (child.tagName === 'input' &&
|
|
54
71
|
child.properties.type === 'checkbox')
|
|
55
|
-
child.properties.ariaLabel =
|
|
72
|
+
child.properties.ariaLabel = name;
|
|
56
73
|
});
|
|
57
74
|
}
|
|
58
75
|
for (const property of ['ariaDescribedBy', 'ariaLabelledBy']) {
|
|
@@ -78,7 +95,7 @@ export const Markdown = /* @__PURE__ */ React.forwardRef(function Markdown({ sou
|
|
|
78
95
|
/* A malformed fragment remains inert navigation text. */
|
|
79
96
|
}
|
|
80
97
|
});
|
|
81
|
-
}, [prefix]);
|
|
98
|
+
}, [prefix, taskLabel]);
|
|
82
99
|
const components = React.useMemo(() => {
|
|
83
100
|
const heading = (level) => ({ node: _node, ...headingProps }) => React.createElement(`h${Math.min(6, Math.max(1, headingLevel) + level - 1)}`, headingProps);
|
|
84
101
|
return {
|
|
@@ -95,19 +112,19 @@ export const Markdown = /* @__PURE__ */ React.forwardRef(function Markdown({ sou
|
|
|
95
112
|
const language = /(?:^|\s)language-([^\s]+)/.exec(child.props.className ?? '')?.[1] ??
|
|
96
113
|
'text';
|
|
97
114
|
const code = String(child.props.children ?? '').replace(/\n$/, '');
|
|
98
|
-
return (_jsx(
|
|
115
|
+
return (_jsx(MarkdownCodeBlock, { code: code, language: language, wrap: codeWrap, label: label, line: node?.position?.start.line ?? 1 }));
|
|
99
116
|
},
|
|
100
117
|
code({ node: _node, ...codeProps }) {
|
|
101
|
-
return _jsx("code", { ...codeProps, className: '
|
|
118
|
+
return _jsx("code", { ...codeProps, className: 'surf-markdown-inline-code' });
|
|
102
119
|
},
|
|
103
120
|
table({ node, children, ...tableProps }) {
|
|
104
|
-
return (_jsx(
|
|
121
|
+
return (_jsx(MarkdownTable, { label: label, line: node?.position?.start.line ?? 1, children: _jsx("table", { ...tableProps, className: 'surf-table', children: children }) }));
|
|
105
122
|
},
|
|
106
123
|
th({ node: _node, ...cellProps }) {
|
|
107
|
-
return (_jsx("th", { ...cellProps, scope: 'col', className: '
|
|
124
|
+
return (_jsx("th", { ...cellProps, scope: 'col', className: 'surf-table-cell surf-table-header' }));
|
|
108
125
|
},
|
|
109
126
|
td({ node: _node, ...cellProps }) {
|
|
110
|
-
return _jsx("td", { ...cellProps, className: '
|
|
127
|
+
return _jsx("td", { ...cellProps, className: 'surf-table-cell' });
|
|
111
128
|
},
|
|
112
129
|
a({ node: _node, href, children, ...linkProps }) {
|
|
113
130
|
return href ? (_jsx("a", { ...linkProps, href: href, children: children })) : (_jsx("span", { children: children }));
|
|
@@ -117,5 +134,5 @@ export const Markdown = /* @__PURE__ */ React.forwardRef(function Markdown({ sou
|
|
|
117
134
|
},
|
|
118
135
|
};
|
|
119
136
|
}, [headingLevel, label, codeWrap]);
|
|
120
|
-
return (_jsx("div", { ...props, ref: ref, role: 'article', className: cx('
|
|
121
|
-
}
|
|
137
|
+
return (_jsx("div", { ...props, ref: ref, role: 'article', className: cx('surf-prose surf-markdown', className), "aria-label": label, children: _jsx(LabelsContext.Provider, { value: labels ?? {}, children: _jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], rehypePlugins: [headings], remarkRehypeOptions: { clobberPrefix: `${prefix}-` }, skipHtml: true, components: components, children: source }) }) }));
|
|
138
|
+
};
|