@godxjp/ui 28.1.0 → 28.2.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/components/feedback/alert.d.ts +3 -3
- package/dist/components/feedback/alert.js +5 -1
- package/dist/components/feedback/callout.d.ts +23 -0
- package/dist/components/feedback/callout.js +42 -0
- package/dist/components/feedback/index.d.ts +2 -0
- package/dist/components/feedback/index.js +2 -0
- package/dist/contracts/measurement.json +1 -1
- package/dist/props/components/feedback.prop.d.ts +12 -1
- package/dist/props/registry.d.ts +11 -1
- package/dist/props/registry.js +11 -1
- package/dist/props/vocabulary/index.d.ts +1 -1
- package/dist/props/vocabulary/interaction.prop.d.ts +12 -2
- package/dist/styles/alert-layout.css +28 -0
- package/dist/styles/navigation-layout.css +20 -9
- package/dist/tokens/base.css +1 -0
- package/dist/tokens/components/callout.css +13 -0
- package/docs/FRAME-COVERAGE-REPORT.md +3 -2
- package/docs/data-entry/toggle-count.tsx +5 -1
- package/docs/feedback/callout.tsx +220 -0
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { ToneProp } from "../../props/vocabulary/index.js";
|
|
2
|
+
import type { AlertVariantProp, ToneProp } from "../../props/vocabulary/index.js";
|
|
3
3
|
import type { AlertQueryErrorProp } from "../../props/components/feedback.prop.js";
|
|
4
4
|
export type { AlertProp, AlertProp as AlertProps, AlertTitleProp, AlertTitleProp as AlertTitleProps, AlertContentProp, AlertContentProp as AlertContentProps, AlertDescriptionProp, AlertDescriptionProp as AlertDescriptionProps, AlertActionsProp, AlertActionsProp as AlertActionsProps, AlertQueryErrorProp, AlertQueryErrorProp as AlertQueryErrorProps, } from "../../props/components/feedback.prop.js";
|
|
5
5
|
declare const AlertBase: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
-
variant?:
|
|
6
|
+
variant?: AlertVariantProp;
|
|
7
7
|
tone?: ToneProp;
|
|
8
8
|
icon?: import("../../props/index.js").IconProp | false;
|
|
9
9
|
onDismiss?: import("../../props/index.js").HandlerProp;
|
|
@@ -38,7 +38,7 @@ export declare const AlertActions: React.ForwardRefExoticComponent<React.HTMLAtt
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function AlertQueryError({ error, category, onRetry, onAuthAction, className, }: AlertQueryErrorProp): React.JSX.Element;
|
|
40
40
|
export declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
41
|
-
variant?:
|
|
41
|
+
variant?: AlertVariantProp;
|
|
42
42
|
tone?: ToneProp;
|
|
43
43
|
icon?: import("../../props/index.js").IconProp | false;
|
|
44
44
|
onDismiss?: import("../../props/index.js").HandlerProp;
|
|
@@ -16,6 +16,10 @@ import { Flex } from "../layout/flex.js";
|
|
|
16
16
|
import { Button } from "../general/button.js";
|
|
17
17
|
const AlertContext = React.createContext("default");
|
|
18
18
|
const ASSERTIVE_TONES = /* @__PURE__ */ new Set(["destructive", "warning"]);
|
|
19
|
+
const roleFor = (variant, tone) => {
|
|
20
|
+
if (variant === "callout") return "note";
|
|
21
|
+
return ASSERTIVE_TONES.has(tone) ? "alert" : "status";
|
|
22
|
+
};
|
|
19
23
|
const DEFAULT_ICONS = {
|
|
20
24
|
default: Info,
|
|
21
25
|
destructive: AlertCircle,
|
|
@@ -33,7 +37,7 @@ const AlertBase = React.forwardRef(
|
|
|
33
37
|
"div",
|
|
34
38
|
{
|
|
35
39
|
ref,
|
|
36
|
-
role:
|
|
40
|
+
role: roleFor(variant, tone),
|
|
37
41
|
"data-slot": "alert",
|
|
38
42
|
"data-variant": variant,
|
|
39
43
|
"data-tone": tone,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CalloutKindProp } from "../../props/vocabulary/index.js";
|
|
3
|
+
export type { CalloutProp, CalloutProp as CalloutProps, } from "../../props/components/feedback.prop.js";
|
|
4
|
+
export declare const Callout: React.ForwardRefExoticComponent<Omit<import("./alert.js").AlertProp, "onDismiss" | "variant"> & {
|
|
5
|
+
kind?: CalloutKindProp;
|
|
6
|
+
} & React.RefAttributes<HTMLDivElement>> & {
|
|
7
|
+
Title: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & {
|
|
8
|
+
className?: import("../../props/index.js").ClassNameProp;
|
|
9
|
+
children?: import("../../props/index.js").ChildrenProp;
|
|
10
|
+
} & React.RefAttributes<HTMLParagraphElement>>;
|
|
11
|
+
Content: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
12
|
+
className?: import("../../props/index.js").ClassNameProp;
|
|
13
|
+
children?: import("../../props/index.js").ChildrenProp;
|
|
14
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
Description: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & {
|
|
16
|
+
className?: import("../../props/index.js").ClassNameProp;
|
|
17
|
+
children?: import("../../props/index.js").ChildrenProp;
|
|
18
|
+
} & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
Actions: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
20
|
+
className?: import("../../props/index.js").ClassNameProp;
|
|
21
|
+
children?: import("../../props/index.js").ChildrenProp;
|
|
22
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Info, Lightbulb, MessageSquareWarning, OctagonAlert, TriangleAlert } from "lucide-react";
|
|
5
|
+
import { AlertActions, AlertBase, AlertContent, AlertDescription, AlertTitle } from "./alert.js";
|
|
6
|
+
const KINDS = {
|
|
7
|
+
note: { tone: "info", icon: Info },
|
|
8
|
+
tip: { tone: "success", icon: Lightbulb },
|
|
9
|
+
important: { tone: "neutral", icon: MessageSquareWarning },
|
|
10
|
+
warning: { tone: "warning", icon: TriangleAlert },
|
|
11
|
+
caution: { tone: "destructive", icon: OctagonAlert }
|
|
12
|
+
};
|
|
13
|
+
const CalloutBase = React.forwardRef(
|
|
14
|
+
({ kind = "note", tone, icon, ...props }, ref) => {
|
|
15
|
+
const preset = KINDS[kind];
|
|
16
|
+
return (
|
|
17
|
+
// `variant` sits AFTER the spread, as on Banner: the type already excludes it, and the
|
|
18
|
+
// runtime half of the same guarantee means a spread of leftover Alert props can never
|
|
19
|
+
// silently turn this aside back into a live region.
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
AlertBase,
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
tone: tone ?? preset.tone,
|
|
25
|
+
icon: icon ?? preset.icon,
|
|
26
|
+
...props,
|
|
27
|
+
variant: "callout"
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
CalloutBase.displayName = "Callout";
|
|
34
|
+
const Callout = Object.assign(CalloutBase, {
|
|
35
|
+
Title: AlertTitle,
|
|
36
|
+
Content: AlertContent,
|
|
37
|
+
Description: AlertDescription,
|
|
38
|
+
Actions: AlertActions
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
Callout
|
|
42
|
+
};
|
|
@@ -10,6 +10,8 @@ export { Skeleton, SkeletonForm, SkeletonRows, SkeletonTable, SkeletonDetail, Sk
|
|
|
10
10
|
export type { SkeletonProp, SkeletonProps, SkeletonWidth, SkeletonArticleProp, SkeletonArticleProps, SkeletonAvatarProp, SkeletonAvatarProps, SkeletonButtonProp, SkeletonButtonProps, SkeletonFormProp, SkeletonFormProps, SkeletonInputProp, SkeletonInputProps, SkeletonNodeProp, SkeletonNodeProps, SkeletonImageProp, SkeletonImageProps, } from "./skeleton.js";
|
|
11
11
|
export { Banner } from "./banner.js";
|
|
12
12
|
export type { BannerProp, BannerProps } from "./banner.js";
|
|
13
|
+
export { Callout } from "./callout.js";
|
|
14
|
+
export type { CalloutProp, CalloutProps } from "./callout.js";
|
|
13
15
|
export { Alert, AlertTitle, AlertContent, AlertDescription, AlertActions, AlertQueryError, } from "./alert.js";
|
|
14
16
|
export type { AlertProp, AlertProps, AlertTitleProp, AlertTitleProps, AlertContentProp, AlertContentProps, AlertDescriptionProp, AlertDescriptionProps, AlertActionsProp, AlertActionsProps, AlertQueryErrorProp, AlertQueryErrorProps, } from "./alert.js";
|
|
15
17
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "./tooltip.js";
|
|
@@ -57,6 +57,7 @@ import {
|
|
|
57
57
|
SkeletonImage
|
|
58
58
|
} from "./skeleton.js";
|
|
59
59
|
import { Banner } from "./banner.js";
|
|
60
|
+
import { Callout } from "./callout.js";
|
|
60
61
|
import {
|
|
61
62
|
Alert,
|
|
62
63
|
AlertTitle,
|
|
@@ -86,6 +87,7 @@ export {
|
|
|
86
87
|
AlertQueryError,
|
|
87
88
|
AlertTitle,
|
|
88
89
|
Banner,
|
|
90
|
+
Callout,
|
|
89
91
|
Dialog,
|
|
90
92
|
DialogAction,
|
|
91
93
|
DialogBody,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "AUTO-GENERATED by scripts/gen-measurement-contract.mjs — do not edit. Read this instead of guessing: docs/MEASUREMENT-CONTRACT.md.",
|
|
3
|
-
"version": "28.
|
|
3
|
+
"version": "28.2.0",
|
|
4
4
|
"targetSize": {
|
|
5
5
|
"standard": "WCAG 2.2 SC 2.5.8 Target Size (Minimum), level AA — 24×24 CSS px",
|
|
6
6
|
"min": 24,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Feedback component prop types — @see docs/COMPONENTS.md#feedback */
|
|
2
2
|
import type * as React from "react";
|
|
3
3
|
import type { QueryErrorCategory } from "../../lib/query-error.js";
|
|
4
|
-
import type { AlertVariantProp, AvatarShapeProp, CancelLabelProp, ChildrenProp, ClassNameProp, ConfirmLabelProp, ConfirmVariantProp, DefaultOpenProp, DescriptionProp, HandlerProp, IconProp, OpenProp, OnOpenChangeProp, PendingProp, ShapeProp, SizeProp, ToneProp, TitleProp } from "../vocabulary/index.js";
|
|
4
|
+
import type { AlertVariantProp, AvatarShapeProp, CalloutKindProp, CancelLabelProp, ChildrenProp, ClassNameProp, ConfirmLabelProp, ConfirmVariantProp, DefaultOpenProp, DescriptionProp, HandlerProp, IconProp, OpenProp, OnOpenChangeProp, PendingProp, ShapeProp, SizeProp, ToneProp, TitleProp } from "../vocabulary/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* @see Dialog — the compound modal ROOT.
|
|
7
7
|
*
|
|
@@ -87,6 +87,17 @@ export type AlertProp = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
87
87
|
* `icon`/`icon={false}` owns the leading glyph, `onDismiss` renders the built-in dismiss button.
|
|
88
88
|
*/
|
|
89
89
|
export type BannerProp = Omit<AlertProp, "variant">;
|
|
90
|
+
/**
|
|
91
|
+
* @see Callout — the in-prose aside (`<Alert variant="callout">` with the variant fixed).
|
|
92
|
+
*
|
|
93
|
+
* Same contract as {@link AlertProp} minus `variant` and `onDismiss`: a callout is part of the
|
|
94
|
+
* document the reader is reading, so it is never a live region and never dismissible. `kind` is
|
|
95
|
+
* the GitHub/Obsidian admonition preset and resolves `tone` + the leading glyph; pass `tone` or
|
|
96
|
+
* `icon` to override either per instance (gh#765).
|
|
97
|
+
*/
|
|
98
|
+
export type CalloutProp = Omit<AlertProp, "variant" | "onDismiss"> & {
|
|
99
|
+
kind?: CalloutKindProp;
|
|
100
|
+
};
|
|
90
101
|
/** @see AlertTitle */
|
|
91
102
|
export type AlertTitleProp = React.HTMLAttributes<HTMLParagraphElement> & {
|
|
92
103
|
className?: ClassNameProp;
|
package/dist/props/registry.d.ts
CHANGED
|
@@ -537,7 +537,12 @@ export declare const VOCABULARY_REGISTRY: {
|
|
|
537
537
|
readonly AlertVariantProp: {
|
|
538
538
|
readonly file: "vocabulary/interaction.prop.ts";
|
|
539
539
|
readonly category: "interaction";
|
|
540
|
-
readonly description: "Alert structural axis: default inline card | banner full-bleed strip";
|
|
540
|
+
readonly description: "Alert structural axis: default inline card | banner full-bleed strip | callout in-prose aside";
|
|
541
|
+
};
|
|
542
|
+
readonly CalloutKindProp: {
|
|
543
|
+
readonly file: "vocabulary/interaction.prop.ts";
|
|
544
|
+
readonly category: "interaction";
|
|
545
|
+
readonly description: "Callout admonition preset: note | tip | important | warning | caution";
|
|
541
546
|
};
|
|
542
547
|
readonly SortDirectionProp: {
|
|
543
548
|
readonly file: "vocabulary/interaction.prop.ts";
|
|
@@ -2168,6 +2173,11 @@ export declare const COMPONENT_PROP_REGISTRY: {
|
|
|
2168
2173
|
readonly file: "components/feedback.prop.ts";
|
|
2169
2174
|
readonly vocabulary: readonly ["ToneProp", "IconProp", "OnValueChangeProp", "ClassNameProp", "ChildrenProp"];
|
|
2170
2175
|
};
|
|
2176
|
+
readonly CalloutProp: {
|
|
2177
|
+
readonly group: "feedback";
|
|
2178
|
+
readonly file: "components/feedback.prop.ts";
|
|
2179
|
+
readonly vocabulary: readonly ["CalloutKindProp", "ToneProp", "IconProp", "ClassNameProp", "ChildrenProp"];
|
|
2180
|
+
};
|
|
2171
2181
|
readonly AlertTitleProp: {
|
|
2172
2182
|
readonly group: "feedback";
|
|
2173
2183
|
readonly file: "components/feedback.prop.ts";
|
package/dist/props/registry.js
CHANGED
|
@@ -536,7 +536,12 @@ const VOCABULARY_REGISTRY = {
|
|
|
536
536
|
AlertVariantProp: {
|
|
537
537
|
file: "vocabulary/interaction.prop.ts",
|
|
538
538
|
category: "interaction",
|
|
539
|
-
description: "Alert structural axis: default inline card | banner full-bleed strip"
|
|
539
|
+
description: "Alert structural axis: default inline card | banner full-bleed strip | callout in-prose aside"
|
|
540
|
+
},
|
|
541
|
+
CalloutKindProp: {
|
|
542
|
+
file: "vocabulary/interaction.prop.ts",
|
|
543
|
+
category: "interaction",
|
|
544
|
+
description: "Callout admonition preset: note | tip | important | warning | caution"
|
|
540
545
|
},
|
|
541
546
|
SortDirectionProp: {
|
|
542
547
|
file: "vocabulary/interaction.prop.ts",
|
|
@@ -2545,6 +2550,11 @@ const COMPONENT_PROP_REGISTRY = {
|
|
|
2545
2550
|
file: "components/feedback.prop.ts",
|
|
2546
2551
|
vocabulary: ["ToneProp", "IconProp", "OnValueChangeProp", "ClassNameProp", "ChildrenProp"]
|
|
2547
2552
|
},
|
|
2553
|
+
CalloutProp: {
|
|
2554
|
+
group: "feedback",
|
|
2555
|
+
file: "components/feedback.prop.ts",
|
|
2556
|
+
vocabulary: ["CalloutKindProp", "ToneProp", "IconProp", "ClassNameProp", "ChildrenProp"]
|
|
2557
|
+
},
|
|
2548
2558
|
AlertTitleProp: {
|
|
2549
2559
|
group: "feedback",
|
|
2550
2560
|
file: "components/feedback.prop.ts",
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
export type { ClassNameProp, ChildrenProp, IdProp, OpenProp, DefaultOpenProp, OnOpenChangeProp, HandlerProp, PendingProp, RequiredProp, DisabledProp, LabelProp, HelperProp, ErrorProp, ErrorBagProp, PlaceholderProp, NameProp, ValueProp, DefaultValueProp, OnValueChangeProp, OnChangeProp, OnClickProp, AsChildProp, FlushProp, WidthProp, ControlWidthProp, AllowClearProp, MaxTagCountProp, MaxTagPlaceholderProp, NotFoundContentProp, PopupMatchWidthProp, } from "./shared.prop.js";
|
|
3
3
|
export type { TitleProp, SubtitleProp, StatusProp, DescriptionProp, ExtraProp, FooterProp, ActionProp, IconProp, ConfirmLabelProp, CancelLabelProp, ActionsProp, EmptyMessageProp, } from "./content.prop.js";
|
|
4
4
|
export type { PageDensityProp, PageContainerVariantProp, CenteredShellWidthProp, CenteredShellAlignProp, CenteredShellPresetProp, ErrorSurfaceModeProp, ErrorSurfaceStatusProp, AuthShellPresetProp, MobileShellHeightProp, MobileShellWidthProp, OrientationProp, TableDensityProp, DensityProp, GapNameProp, PadProp, PadRawProp, PadSides, GapProp, GapStepProp, } from "./layout.prop.js";
|
|
5
|
-
export type { ButtonVariantProp, ButtonSizeProp, BadgeVariantProp, AppSettingPickerAppearanceProp, AppSettingToggleAppearanceProp, ShapeProp, AvatarShapeProp, TextSizeProp, TextToneProp, FontWeightProp, HeadingLevelProp, TextAlignProp, TextWhitespaceProp, TypographyTypeProp, TitleLevelProp, TypographyCopyConfigProp, TypographyEditConfigProp, TypographyEllipsisConfigProp, TypographyActionsConfigProp, SizeProp, ControlStatusProp, ControlVariantProp, FormLayoutProp, DescriptionsLayoutProp, BreakpointProp, ConfirmVariantProp, ToneProp, AlertVariantProp, SortDirectionProp, ColumnAlignProp, SortStateProp, RevealDelayProp, ActivityVariantProp, ActivityAnnounceProp, IconSizeProp, } from "./interaction.prop.js";
|
|
5
|
+
export type { ButtonVariantProp, ButtonSizeProp, BadgeVariantProp, AppSettingPickerAppearanceProp, AppSettingToggleAppearanceProp, ShapeProp, AvatarShapeProp, TextSizeProp, TextToneProp, FontWeightProp, HeadingLevelProp, TextAlignProp, TextWhitespaceProp, TypographyTypeProp, TitleLevelProp, TypographyCopyConfigProp, TypographyEditConfigProp, TypographyEllipsisConfigProp, TypographyActionsConfigProp, SizeProp, ControlStatusProp, ControlVariantProp, FormLayoutProp, DescriptionsLayoutProp, BreakpointProp, ConfirmVariantProp, ToneProp, AlertVariantProp, CalloutKindProp, SortDirectionProp, ColumnAlignProp, SortStateProp, RevealDelayProp, ActivityVariantProp, ActivityAnnounceProp, IconSizeProp, } from "./interaction.prop.js";
|
|
6
6
|
export type { BreadcrumbItemProp, BreadcrumbProp, BreadcrumbItemMenuProp, BreadcrumbItemMenuEntryProp, BreadcrumbSeparatorProp, BreadcrumbItemRenderProp, } from "./navigation.prop.js";
|
|
7
7
|
export type { GetRowIdProp, GetRowLabelProp, OnRowClickProp, ColumnDefProp, TablePresetProp, TableColumnPriorityProp, TableCellIndentProp, SelectedIdsProp, OnSelectChangeProp, OnTableDensityChangeProp, TableRowToneProp, RowToneProp, OnSortChangeProp, OnSearchChangeProp, OnClearFiltersProp, HasActiveFiltersProp, StickyProp, ColumnFixedProp, ColumnFilterValueProp, ColumnFilterItemProp, ColumnFilterStateProp, OnColumnFilterChangeProp, ColumnCompareProp, ColumnSorterProp, TableSelectionItemProp, TableRowSelectionProp, TableExpandableProp, TableSummaryProp, TableScrollProp, TableStickyProp, OnRowProp, TablePaginationProp, TablePaginationPositionProp, DescriptionsColumnProp, DescriptionsSpanProp, DescriptionsItemsProp, } from "./data.prop.js";
|
|
@@ -258,9 +258,19 @@ export type ToneProp = "default" | "success" | "warning" | "destructive" | "info
|
|
|
258
258
|
* Alert STRUCTURAL axis (orthogonal to `tone`, which owns colour/semantics):
|
|
259
259
|
* `default` — the inline card (rounded, framed on all sides);
|
|
260
260
|
* `banner` — the full-bleed page/shell attention strip the `Banner` export renders
|
|
261
|
-
* (square corners, hairline block-end rule only, `--banner-*` token geometry)
|
|
261
|
+
* (square corners, hairline block-end rule only, `--banner-*` token geometry);
|
|
262
|
+
* `callout` — the in-prose aside the `Callout` export renders (leading rail, `--callout-*`
|
|
263
|
+
* geometry) and, uniquely, the one value that is NOT a live region: it carries `role="note"`
|
|
264
|
+
* because it is part of the document being read, not an update to it (gh#765).
|
|
262
265
|
*/
|
|
263
|
-
export type AlertVariantProp = "default" | "banner";
|
|
266
|
+
export type AlertVariantProp = "default" | "banner" | "callout";
|
|
267
|
+
/**
|
|
268
|
+
* Callout kind — the five admonitions GitHub documents (`> [!NOTE]`, `[!TIP]`, `[!IMPORTANT]`,
|
|
269
|
+
* `[!WARNING]`, `[!CAUTION]`), which Obsidian's lower-case spelling maps onto one-for-one. It is a
|
|
270
|
+
* PRESET, not a second colour axis: each kind resolves to a `tone` and a leading glyph that
|
|
271
|
+
* `tone`/`icon` still override per instance.
|
|
272
|
+
*/
|
|
273
|
+
export type CalloutKindProp = "note" | "tip" | "important" | "warning" | "caution";
|
|
264
274
|
/** Sort direction for table columns. */
|
|
265
275
|
export type SortDirectionProp = "asc" | "desc";
|
|
266
276
|
/** Table column text alignment. */
|
|
@@ -62,6 +62,34 @@
|
|
|
62
62
|
padding-inline-end: calc(var(--banner-space-inset-inline) + var(--space-8));
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
[data-slot="alert"][data-variant="callout"] {
|
|
66
|
+
border-radius: var(--callout-radius);
|
|
67
|
+
border-block-width: 0;
|
|
68
|
+
border-inline-end-width: 0;
|
|
69
|
+
border-inline-start-width: var(--callout-rail-width);
|
|
70
|
+
border-start-start-radius: 0;
|
|
71
|
+
border-end-start-radius: 0;
|
|
72
|
+
padding-block: var(--callout-space-inset-block);
|
|
73
|
+
padding-inline: var(--callout-space-inset-inline);
|
|
74
|
+
margin-block: var(--callout-space-stack);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[data-slot="alert"][data-variant="callout"][data-tone="destructive"] {
|
|
78
|
+
border-color: hsl(var(--destructive));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[data-slot="alert"][data-variant="callout"][data-tone="warning"] {
|
|
82
|
+
border-color: hsl(var(--warning));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
[data-slot="alert"][data-variant="callout"][data-tone="success"] {
|
|
86
|
+
border-color: hsl(var(--success));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[data-slot="alert"][data-variant="callout"][data-tone="info"] {
|
|
90
|
+
border-color: hsl(var(--info));
|
|
91
|
+
}
|
|
92
|
+
|
|
65
93
|
[data-slot="alert-icon"] {
|
|
66
94
|
width: var(--alert-icon-size);
|
|
67
95
|
height: var(--alert-icon-size);
|
|
@@ -220,27 +220,27 @@
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
[data-slot="tabs"][data-variant="card"][data-placement="start"] [data-slot="tabs-list"],
|
|
223
|
-
[data-slot="tabs"][data-variant="editable-card"][data-placement="start"]
|
|
224
|
-
[data-slot="tabs-list"] {
|
|
223
|
+
[data-slot="tabs"][data-variant="editable-card"][data-placement="start"] [data-slot="tabs-list"] {
|
|
225
224
|
box-shadow: inset calc(-1 * var(--tabs-card-rail-border-width)) 0 0 hsl(var(--border));
|
|
226
225
|
}
|
|
227
226
|
|
|
228
227
|
[data-slot="tabs"][data-variant="card"][data-placement="end"] [data-slot="tabs-list"],
|
|
229
|
-
[data-slot="tabs"][data-variant="editable-card"][data-placement="end"]
|
|
230
|
-
[data-slot="tabs-list"] {
|
|
228
|
+
[data-slot="tabs"][data-variant="editable-card"][data-placement="end"] [data-slot="tabs-list"] {
|
|
231
229
|
box-shadow: inset var(--tabs-card-rail-border-width) 0 0 hsl(var(--border));
|
|
232
230
|
}
|
|
233
231
|
|
|
234
|
-
[dir="rtl"]
|
|
232
|
+
[dir="rtl"]
|
|
233
|
+
[data-slot="tabs"][data-variant="card"][data-placement="start"]
|
|
235
234
|
[data-slot="tabs-list"],
|
|
236
|
-
[dir="rtl"]
|
|
235
|
+
[dir="rtl"]
|
|
236
|
+
[data-slot="tabs"][data-variant="editable-card"][data-placement="start"]
|
|
237
237
|
[data-slot="tabs-list"] {
|
|
238
238
|
box-shadow: inset var(--tabs-card-rail-border-width) 0 0 hsl(var(--border));
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
[dir="rtl"] [data-slot="tabs"][data-variant="card"][data-placement="end"]
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
[dir="rtl"] [data-slot="tabs"][data-variant="card"][data-placement="end"] [data-slot="tabs-list"],
|
|
242
|
+
[dir="rtl"]
|
|
243
|
+
[data-slot="tabs"][data-variant="editable-card"][data-placement="end"]
|
|
244
244
|
[data-slot="tabs-list"] {
|
|
245
245
|
box-shadow: inset calc(-1 * var(--tabs-card-rail-border-width)) 0 0 hsl(var(--border));
|
|
246
246
|
}
|
|
@@ -266,6 +266,17 @@
|
|
|
266
266
|
align-items: flex-start;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
+
[data-slot="tabs"][data-bodied="true"][data-placement="top"] .ui-tabs-extra[data-side="end"],
|
|
270
|
+
[data-slot="tabs"][data-bodied="true"][data-placement="bottom"] .ui-tabs-extra[data-side="end"] {
|
|
271
|
+
margin-inline-end: calc(var(--tabs-panel-space-inset) + var(--tabs-panel-border-width));
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
[data-slot="tabs"][data-bodied="true"][data-placement="top"] .ui-tabs-extra[data-side="start"],
|
|
275
|
+
[data-slot="tabs"][data-bodied="true"][data-placement="bottom"]
|
|
276
|
+
.ui-tabs-extra[data-side="start"] {
|
|
277
|
+
margin-inline-start: calc(var(--tabs-panel-space-inset) + var(--tabs-panel-border-width));
|
|
278
|
+
}
|
|
279
|
+
|
|
269
280
|
[data-slot="tabs"][data-bodied="true"] > [data-slot="tabs-panel"],
|
|
270
281
|
[data-slot="tabs"][data-bodied="true"] > [data-slot="tabs-content"] {
|
|
271
282
|
border: var(--tabs-panel-border-width) solid hsl(var(--border));
|
package/dist/tokens/base.css
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
@import "./components/table.css";
|
|
17
17
|
@import "./components/feedback.css";
|
|
18
18
|
@import "./components/banner.css";
|
|
19
|
+
@import "./components/callout.css";
|
|
19
20
|
@import "./components/sheet.css";
|
|
20
21
|
@import "./components/badge.css";
|
|
21
22
|
@import "./components/navigation.css";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
> Generated by `scripts/frame-coverage.mjs` (issue #163). Do not edit by hand — run `pnpm check:frame-coverage`.
|
|
4
4
|
> Standard: [FRAME-COVERAGE-STANDARD.md](./FRAME-COVERAGE-STANDARD.md). A missing dimension is **UNTESTED**, never a pass.
|
|
5
5
|
|
|
6
|
-
- Public components: **
|
|
7
|
-
- With ≥1 frame: **
|
|
6
|
+
- Public components: **165**
|
|
7
|
+
- With ≥1 frame: **144** · zero-frame: **21**
|
|
8
8
|
- Fully covered (every contract axis declared): **0**
|
|
9
9
|
|
|
10
10
|
## UNTESTED — no `/frame/**` route
|
|
@@ -118,6 +118,7 @@ Legend: ✓ covered · N/A reasoned skip · · UNTESTED (blank cell = UNTESTED).
|
|
|
118
118
|
| Sheet | ✓ | N/A | N/A | · | · | · | · | · | · | · |
|
|
119
119
|
| Alert | ✓ | ✓ | N/A | N/A | · | · | · | · | · | · |
|
|
120
120
|
| Banner | ✓ | ✓ | N/A | N/A | · | · | · | · | · | · |
|
|
121
|
+
| Callout | ✓ | · | N/A | N/A | · | · | · | · | · | · |
|
|
121
122
|
| SkeletonTable | ✓ | N/A | N/A | N/A | · | · | · | · | · | · |
|
|
122
123
|
| SkeletonRows | **✗** | N/A | N/A | N/A | · | · | · | · | · | · |
|
|
123
124
|
| Toaster | ✓ | N/A | N/A | N/A | · | · | · | · | · | · |
|
|
@@ -130,7 +130,10 @@ export default function Demo() {
|
|
|
130
130
|
Badge variant="secondary" と同じ塗り)、shape="pill" が角、count
|
|
131
131
|
が件数、押下が選択。variant / size / shape はグループに一度だけ書けば context
|
|
132
132
|
で全アイテムに届く。default や outline
|
|
133
|
-
|
|
133
|
+
だとチップは押されるまで透明に見えるので、チップ列にはこの組み合わせを使う。タグ列は
|
|
134
|
+
件数ぶん伸びて桁を越えるので wrap を付ける(320px
|
|
135
|
+
の桁で計測:無しだと最後のチップが枠の外に 21.41px はみ出し、各ラベルが min-content
|
|
136
|
+
まで潰れて 129.13px · 有りで 3 行 80.00px、scrollWidth 267→212)。
|
|
134
137
|
</CardDescription>
|
|
135
138
|
</CardHeader>
|
|
136
139
|
<CardContent>
|
|
@@ -140,6 +143,7 @@ export default function Demo() {
|
|
|
140
143
|
variant="soft"
|
|
141
144
|
shape="pill"
|
|
142
145
|
size="xs"
|
|
146
|
+
wrap
|
|
143
147
|
value={tags}
|
|
144
148
|
onValueChange={setTags}
|
|
145
149
|
aria-label="タグで絞り込み"
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { Callout } from "@godxjp/ui/feedback";
|
|
2
|
+
import {
|
|
3
|
+
Card,
|
|
4
|
+
CardContent,
|
|
5
|
+
CardDescription,
|
|
6
|
+
CardHeader,
|
|
7
|
+
CardTitle,
|
|
8
|
+
Prose,
|
|
9
|
+
} from "@godxjp/ui/data-display";
|
|
10
|
+
import { Flex, PageContainer } from "@godxjp/ui/layout";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Callout · the aside INSIDE a document body — the Alert primitive with the
|
|
14
|
+
* structural axis fixed to variant="callout". It is the one variant that is NOT a
|
|
15
|
+
* live region: role="note", so a page carrying three of them stays silent on load.
|
|
16
|
+
* kind is the GitHub/Obsidian admonition preset (note/tip/important/warning/caution)
|
|
17
|
+
* and resolves tone + glyph; tone and icon still override per instance. Geometry —
|
|
18
|
+
* the leading rail, the prose insets, the block margin — is owned by the --callout-*
|
|
19
|
+
* tokens, never consumer CSS.
|
|
20
|
+
*/
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<PageContainer
|
|
24
|
+
title="Callout"
|
|
25
|
+
subtitle="kind × tone × icon · the static aside in prose (the announcing presentations are Alert and Banner)"
|
|
26
|
+
>
|
|
27
|
+
<Flex direction="col" gap="lg">
|
|
28
|
+
<Card>
|
|
29
|
+
<CardHeader>
|
|
30
|
+
<CardTitle level={2}>The five admonitions · every kind</CardTitle>
|
|
31
|
+
<CardDescription>
|
|
32
|
+
GitHub's documented set, which Obsidian's lower-case spelling maps onto
|
|
33
|
+
one-for-one. Each kind resolves a tone and its OWN glyph, so the five are told apart
|
|
34
|
+
without colour (WCAG 1.4.1). important takes the neutral tone on purpose. This system
|
|
35
|
+
has no purple role, and borrowing info would make it indistinguishable from note.
|
|
36
|
+
</CardDescription>
|
|
37
|
+
</CardHeader>
|
|
38
|
+
<CardContent>
|
|
39
|
+
<Flex direction="col" gap="md">
|
|
40
|
+
<Callout kind="note">
|
|
41
|
+
<Callout.Title>補足</Callout.Title>
|
|
42
|
+
<Callout.Description>
|
|
43
|
+
この設定は次回のログインから有効になります。
|
|
44
|
+
</Callout.Description>
|
|
45
|
+
</Callout>
|
|
46
|
+
<Callout kind="tip">
|
|
47
|
+
<Callout.Title>ヒント</Callout.Title>
|
|
48
|
+
<Callout.Description>
|
|
49
|
+
⌘K でどの画面からでもコマンドパレットを開けます。
|
|
50
|
+
</Callout.Description>
|
|
51
|
+
</Callout>
|
|
52
|
+
<Callout kind="important">
|
|
53
|
+
<Callout.Title>重要</Callout.Title>
|
|
54
|
+
<Callout.Description>
|
|
55
|
+
組織の所有者だけが請求情報を変更できます。
|
|
56
|
+
</Callout.Description>
|
|
57
|
+
</Callout>
|
|
58
|
+
<Callout kind="warning">
|
|
59
|
+
<Callout.Title>注意</Callout.Title>
|
|
60
|
+
<Callout.Description>
|
|
61
|
+
APIキーを再発行すると、既存のキーは直ちに無効になります。
|
|
62
|
+
</Callout.Description>
|
|
63
|
+
</Callout>
|
|
64
|
+
<Callout kind="caution">
|
|
65
|
+
<Callout.Title>警告</Callout.Title>
|
|
66
|
+
<Callout.Description>
|
|
67
|
+
リポジトリを削除すると、Issue と Pull Request
|
|
68
|
+
も一緒に削除されます。この操作は取り消せません。
|
|
69
|
+
</Callout.Description>
|
|
70
|
+
</Callout>
|
|
71
|
+
</Flex>
|
|
72
|
+
</CardContent>
|
|
73
|
+
</Card>
|
|
74
|
+
|
|
75
|
+
<Card>
|
|
76
|
+
<CardHeader>
|
|
77
|
+
<CardTitle level={2}>In prose · what it is actually for</CardTitle>
|
|
78
|
+
<CardDescription>
|
|
79
|
+
A callout is part of the document being read, not an update to it, which is why it
|
|
80
|
+
carries role="note" and never announces. Read this card with a screen
|
|
81
|
+
reader: the three callouts are reached in document order, and none of them interrupts.
|
|
82
|
+
An Alert in the same place would announce all three the moment the page loaded.
|
|
83
|
+
</CardDescription>
|
|
84
|
+
</CardHeader>
|
|
85
|
+
<CardContent>
|
|
86
|
+
<Prose>
|
|
87
|
+
<h3>APIキーの再発行</h3>
|
|
88
|
+
<p>
|
|
89
|
+
APIキーは組織ごとに発行され、すべての連携サービスで共有されます。ローテーションは四半期ごとを推奨しています。
|
|
90
|
+
</p>
|
|
91
|
+
<Callout kind="tip">
|
|
92
|
+
<Callout.Description>
|
|
93
|
+
再発行の前に、連携中のサービス一覧を書き出しておくと復旧が早くなります。
|
|
94
|
+
</Callout.Description>
|
|
95
|
+
</Callout>
|
|
96
|
+
<p>
|
|
97
|
+
再発行すると新しいキーが即座に有効になり、古いキーは同じ瞬間に失効します。猶予期間はありません。
|
|
98
|
+
</p>
|
|
99
|
+
<Callout kind="warning">
|
|
100
|
+
<Callout.Title>停止時間が発生します</Callout.Title>
|
|
101
|
+
<Callout.Description>
|
|
102
|
+
古いキーを使っている連携は、新しいキーを設定するまで認証に失敗します。
|
|
103
|
+
</Callout.Description>
|
|
104
|
+
</Callout>
|
|
105
|
+
<p>設定画面の「セキュリティ」タブから、いつでも再発行の履歴を確認できます。</p>
|
|
106
|
+
<Callout kind="note">
|
|
107
|
+
<Callout.Description>
|
|
108
|
+
履歴は90日間保持されます。それより古い記録は監査ログからのみ参照できます。
|
|
109
|
+
</Callout.Description>
|
|
110
|
+
</Callout>
|
|
111
|
+
</Prose>
|
|
112
|
+
</CardContent>
|
|
113
|
+
</Card>
|
|
114
|
+
|
|
115
|
+
<Card>
|
|
116
|
+
<CardHeader>
|
|
117
|
+
<CardTitle level={2}>Title-less · a single paragraph</CardTitle>
|
|
118
|
+
<CardDescription>
|
|
119
|
+
Callout.Title is optional, exactly as on Alert. With one line of copy the glyph and
|
|
120
|
+
the rail carry the kind on their own, and the aside stays the height of its text.
|
|
121
|
+
</CardDescription>
|
|
122
|
+
</CardHeader>
|
|
123
|
+
<CardContent>
|
|
124
|
+
<Flex direction="col" gap="md">
|
|
125
|
+
<Callout kind="note">
|
|
126
|
+
<Callout.Description>
|
|
127
|
+
Rates are shown in the organization's billing currency, not the viewer's
|
|
128
|
+
locale.
|
|
129
|
+
</Callout.Description>
|
|
130
|
+
</Callout>
|
|
131
|
+
<Callout kind="caution">
|
|
132
|
+
<Callout.Description>
|
|
133
|
+
Exporting includes personal data; the download link expires after one hour.
|
|
134
|
+
</Callout.Description>
|
|
135
|
+
</Callout>
|
|
136
|
+
</Flex>
|
|
137
|
+
</CardContent>
|
|
138
|
+
</Card>
|
|
139
|
+
|
|
140
|
+
<Card>
|
|
141
|
+
<CardHeader>
|
|
142
|
+
<CardTitle level={2}>Overrides · tone and icon, per instance</CardTitle>
|
|
143
|
+
<CardDescription>
|
|
144
|
+
kind is a preset, not a second colour axis. Pass tone to recolour one aside without
|
|
145
|
+
changing which admonition it is, or icon={false} to drop the glyph entirely. The tone
|
|
146
|
+
vocabulary is the SAME one Alert and Banner use.
|
|
147
|
+
</CardDescription>
|
|
148
|
+
</CardHeader>
|
|
149
|
+
<CardContent>
|
|
150
|
+
<Flex direction="col" gap="md">
|
|
151
|
+
<Callout kind="note" tone="muted">
|
|
152
|
+
<Callout.Title>Quieter than the default note</Callout.Title>
|
|
153
|
+
<Callout.Description>
|
|
154
|
+
tone="muted" keeps the note glyph and drops the colour to the neutral
|
|
155
|
+
surface.
|
|
156
|
+
</Callout.Description>
|
|
157
|
+
</Callout>
|
|
158
|
+
<Callout kind="important" icon={false}>
|
|
159
|
+
<Callout.Title>Glyphless</Callout.Title>
|
|
160
|
+
<Callout.Description>
|
|
161
|
+
icon={"{false}"} removes the leading glyph; the rail alone carries the tone.
|
|
162
|
+
</Callout.Description>
|
|
163
|
+
</Callout>
|
|
164
|
+
<Callout kind="tip" tone="info">
|
|
165
|
+
<Callout.Title>A tip in the note colour</Callout.Title>
|
|
166
|
+
<Callout.Description>
|
|
167
|
+
The lightbulb stays, so this is still readable as a tip without relying on the
|
|
168
|
+
hue.
|
|
169
|
+
</Callout.Description>
|
|
170
|
+
</Callout>
|
|
171
|
+
</Flex>
|
|
172
|
+
</CardContent>
|
|
173
|
+
</Card>
|
|
174
|
+
|
|
175
|
+
<Card>
|
|
176
|
+
<CardHeader>
|
|
177
|
+
<CardTitle level={2}>Long JA / EN / VI copy · 390px wrapping</CardTitle>
|
|
178
|
+
<CardDescription>
|
|
179
|
+
The text column wraps inside min-width 0 and the rail stays on the START edge in both
|
|
180
|
+
directions (logical properties throughout). Narrow this frame to 390px: nothing clips
|
|
181
|
+
and nothing overflows horizontally.
|
|
182
|
+
</CardDescription>
|
|
183
|
+
</CardHeader>
|
|
184
|
+
<CardContent>
|
|
185
|
+
<Flex direction="col" gap="md">
|
|
186
|
+
<Callout kind="important">
|
|
187
|
+
<Callout.Title>
|
|
188
|
+
ご契約中のプランでは、組織あたりのAPIリクエスト数に上限が設定されており、上限を超えた分は翌月の請求に自動的に加算されます
|
|
189
|
+
</Callout.Title>
|
|
190
|
+
<Callout.Description>
|
|
191
|
+
現在の消費量は請求ダッシュボードで確認できます。上限の引き上げをご希望の場合は、担当者にご連絡ください。
|
|
192
|
+
</Callout.Description>
|
|
193
|
+
</Callout>
|
|
194
|
+
<Callout kind="caution">
|
|
195
|
+
<Callout.Title>
|
|
196
|
+
Deleting an organization removes every project, dataset and audit record it owns,
|
|
197
|
+
and this cannot be undone by support
|
|
198
|
+
</Callout.Title>
|
|
199
|
+
<Callout.Description>
|
|
200
|
+
Members lose access immediately. Export anything you need to keep before you
|
|
201
|
+
confirm. The deletion runs as soon as the dialog closes.
|
|
202
|
+
</Callout.Description>
|
|
203
|
+
</Callout>
|
|
204
|
+
<Callout kind="tip">
|
|
205
|
+
<Callout.Title>
|
|
206
|
+
Bạn có thể gán vai trò cho cả một nhóm thay vì từng thành viên, và mọi thay đổi về
|
|
207
|
+
thành viên của nhóm sẽ tự động áp dụng
|
|
208
|
+
</Callout.Title>
|
|
209
|
+
<Callout.Description>
|
|
210
|
+
Cách này giữ cho danh sách phân quyền ngắn gọn và dễ kiểm toán hơn nhiều so với
|
|
211
|
+
việc cấp quyền riêng lẻ.
|
|
212
|
+
</Callout.Description>
|
|
213
|
+
</Callout>
|
|
214
|
+
</Flex>
|
|
215
|
+
</CardContent>
|
|
216
|
+
</Card>
|
|
217
|
+
</Flex>
|
|
218
|
+
</PageContainer>
|
|
219
|
+
);
|
|
220
|
+
}
|