@starci/grammar 0.1.0 → 0.3.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/LICENSE +21 -21
- package/README.md +22 -20
- package/dist/common/index.d.ts +1 -69
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +5 -197
- package/dist/common/index.js.map +1 -1
- package/dist/common/styles.css +2 -2
- package/dist/core/LeadingNumber.d.ts +12 -0
- package/dist/core/LeadingNumber.d.ts.map +1 -0
- package/dist/core/LeadingNumber.js +10 -0
- package/dist/core/LeadingNumber.js.map +1 -0
- package/dist/core/OtpInput.d.ts +12 -0
- package/dist/core/OtpInput.d.ts.map +1 -0
- package/dist/core/OtpInput.js +21 -0
- package/dist/core/OtpInput.js.map +1 -0
- package/dist/core/StateMark.d.ts +3 -1
- package/dist/core/StateMark.d.ts.map +1 -1
- package/dist/core/StateMark.js +3 -2
- package/dist/core/StateMark.js.map +1 -1
- package/dist/core/branch/MarkdownArticle/classNames.d.ts +9 -0
- package/dist/core/branch/MarkdownArticle/classNames.d.ts.map +1 -0
- package/dist/core/branch/MarkdownArticle/classNames.js +10 -0
- package/dist/core/branch/MarkdownArticle/classNames.js.map +1 -0
- package/dist/core/branch/MarkdownArticle/index.d.ts +30 -0
- package/dist/core/branch/MarkdownArticle/index.d.ts.map +1 -0
- package/dist/core/branch/MarkdownArticle/index.js +12 -0
- package/dist/core/branch/MarkdownArticle/index.js.map +1 -0
- package/dist/core/branch/Rail/classNames.d.ts +9 -0
- package/dist/core/branch/Rail/classNames.d.ts.map +1 -0
- package/dist/core/branch/Rail/classNames.js +10 -0
- package/dist/core/branch/Rail/classNames.js.map +1 -0
- package/dist/core/branch/Rail/index.d.ts +15 -7
- package/dist/core/branch/Rail/index.d.ts.map +1 -1
- package/dist/core/branch/Rail/index.js +19 -3
- package/dist/core/branch/Rail/index.js.map +1 -1
- package/dist/core/branch/SurfaceAccordionCard/classNames.d.ts +15 -0
- package/dist/core/branch/SurfaceAccordionCard/classNames.d.ts.map +1 -0
- package/dist/core/branch/SurfaceAccordionCard/classNames.js +16 -0
- package/dist/core/branch/SurfaceAccordionCard/classNames.js.map +1 -0
- package/dist/core/branch/SurfaceAccordionCard/index.d.ts +37 -0
- package/dist/core/branch/SurfaceAccordionCard/index.d.ts.map +1 -0
- package/dist/core/branch/SurfaceAccordionCard/index.js +24 -0
- package/dist/core/branch/SurfaceAccordionCard/index.js.map +1 -0
- package/dist/core/branch/SurfaceCard/classNames.d.ts +13 -0
- package/dist/core/branch/SurfaceCard/classNames.d.ts.map +1 -0
- package/dist/core/branch/SurfaceCard/classNames.js +14 -0
- package/dist/core/branch/SurfaceCard/classNames.js.map +1 -0
- package/dist/core/branch/SurfaceCard/index.d.ts +9 -6
- package/dist/core/branch/SurfaceCard/index.d.ts.map +1 -1
- package/dist/core/branch/SurfaceCard/index.js +7 -3
- package/dist/core/branch/SurfaceCard/index.js.map +1 -1
- package/dist/core/branch/SurfaceListCard/classNames.d.ts +11 -0
- package/dist/core/branch/SurfaceListCard/classNames.d.ts.map +1 -0
- package/dist/core/branch/SurfaceListCard/classNames.js +12 -0
- package/dist/core/branch/SurfaceListCard/classNames.js.map +1 -0
- package/dist/core/branch/SurfaceListCard/index.d.ts +11 -15
- package/dist/core/branch/SurfaceListCard/index.d.ts.map +1 -1
- package/dist/core/branch/SurfaceListCard/index.js +6 -11
- package/dist/core/branch/SurfaceListCard/index.js.map +1 -1
- package/dist/core/classNames.d.ts +23 -0
- package/dist/core/classNames.d.ts.map +1 -0
- package/dist/core/classNames.js +24 -0
- package/dist/core/classNames.js.map +1 -0
- package/dist/core/composite/HorizontalScrollRegion/index.d.ts +7 -0
- package/dist/core/composite/HorizontalScrollRegion/index.d.ts.map +1 -0
- package/dist/core/composite/HorizontalScrollRegion/index.js +7 -0
- package/dist/core/composite/HorizontalScrollRegion/index.js.map +1 -0
- package/dist/core/composite/StaticStateRow/index.d.ts +13 -0
- package/dist/core/composite/StaticStateRow/index.d.ts.map +1 -0
- package/dist/core/composite/StaticStateRow/index.js +12 -0
- package/dist/core/composite/StaticStateRow/index.js.map +1 -0
- package/dist/core/composite/VerticalScrollRegion/index.d.ts +8 -0
- package/dist/core/composite/VerticalScrollRegion/index.d.ts.map +1 -0
- package/dist/core/composite/VerticalScrollRegion/index.js +10 -0
- package/dist/core/composite/VerticalScrollRegion/index.js.map +1 -0
- package/dist/core/index.d.ts +12 -7
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +11 -7
- package/dist/core/index.js.map +1 -1
- package/dist/core/scrollable-surfaces.spec.d.ts +2 -0
- package/dist/core/scrollable-surfaces.spec.d.ts.map +1 -0
- package/dist/core/scrollable-surfaces.spec.js +37 -0
- package/dist/core/scrollable-surfaces.spec.js.map +1 -0
- package/dist/core/state.d.ts +4 -4
- package/dist/core/state.d.ts.map +1 -1
- package/dist/core/state.js +3 -3
- package/dist/core/state.js.map +1 -1
- package/dist/core/styles.css +598 -193
- package/dist/offset-pop/styles.css +393 -393
- package/package.json +68 -72
- package/dist/core/contracts.d.ts +0 -190
- package/dist/core/contracts.d.ts.map +0 -1
- package/dist/core/contracts.js +0 -91
- package/dist/core/contracts.js.map +0 -1
- package/dist/core/grammar.d.ts +0 -18
- package/dist/core/grammar.d.ts.map +0 -1
- package/dist/core/grammar.js +0 -27
- package/dist/core/grammar.js.map +0 -1
- package/dist/core/rules.d.ts +0 -45
- package/dist/core/rules.d.ts.map +0 -1
- package/dist/core/rules.js +0 -45
- package/dist/core/rules.js.map +0 -1
- package/dist/offset-pop/index.d.ts +0 -266
- package/dist/offset-pop/index.d.ts.map +0 -1
- package/dist/offset-pop/index.js +0 -69
- package/dist/offset-pop/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/HorizontalScrollRegion/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGvE,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IAChF,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC/B,CAAA;AAED,4FAA4F;AAC5F,eAAO,MAAM,sBAAsB,qIAEjC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { ScrollShadow } from "@heroui/react";
|
|
4
|
+
/** Preserve intrinsic inline content and expose HeroUI's horizontal overflow affordance. */
|
|
5
|
+
export const HorizontalScrollRegion = forwardRef((props, ref) => (_jsx(ScrollShadow, { ...props, ref: ref, orientation: "horizontal" })));
|
|
6
|
+
HorizontalScrollRegion.displayName = "HorizontalScrollRegion";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/HorizontalScrollRegion/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAuC,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAM5C,4FAA4F;AAC5F,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAA8C,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CAC1G,KAAC,YAAY,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,EAAC,YAAY,GAAG,CACjE,CAAC,CAAA;AAEF,sBAAsB,CAAC,WAAW,GAAG,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type PresentationState } from "../../state.js";
|
|
2
|
+
export type StaticStateRowData = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly description?: string;
|
|
6
|
+
readonly state?: PresentationState;
|
|
7
|
+
};
|
|
8
|
+
export type StaticStateRowProps = {
|
|
9
|
+
readonly item: StaticStateRowData;
|
|
10
|
+
};
|
|
11
|
+
/** One non-interactive, product-neutral row in a Core-owned static collection. */
|
|
12
|
+
export declare const StaticStateRow: (props: StaticStateRowProps) => import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/StaticStateRow/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGrE,MAAM,MAAM,kBAAkB,GAAG;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;CACpC,CAAA;AAED,kFAAkF;AAClF,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,gCAmBxD,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { StateMark } from "../../StateMark.js";
|
|
3
|
+
import { treatmentFor } from "../../state.js";
|
|
4
|
+
import { staticRowClassName, staticRowCopyClassName } from "../../classNames.js";
|
|
5
|
+
/** One non-interactive, product-neutral row in a Core-owned static collection. */
|
|
6
|
+
export const StaticStateRow = (props) => {
|
|
7
|
+
const item = props.item;
|
|
8
|
+
const state = item.state ?? "neutral";
|
|
9
|
+
const treatment = treatmentFor(state);
|
|
10
|
+
return (_jsxs("li", { className: staticRowClassName, "data-grammar-row": "true", "data-grammar-state": state, "data-grammar-treatment": treatment.tone, children: [_jsx(StateMark, { state: state }), _jsxs("span", { className: staticRowCopyClassName, children: [_jsx("span", { children: item.label }), item.description === undefined ? null : _jsx("span", { children: item.description })] })] }));
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/StaticStateRow/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAahF,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAE,EAAE;IACzD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAA;IACvB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,SAAS,CAAA;IACrC,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAErC,OAAO,CACH,cACI,SAAS,EAAE,kBAAkB,sBACZ,MAAM,wBACH,KAAK,4BACD,SAAS,CAAC,IAAI,aAEtC,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,GAAI,EAC3B,gBAAM,SAAS,EAAE,sBAAsB,aACnC,yBAAO,IAAI,CAAC,KAAK,GAAQ,EACxB,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAO,IAAI,CAAC,WAAW,GAAQ,IACrE,IACN,CACR,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
export type VerticalScrollRegionProps = Omit<ComponentProps<"div">, "children"> & {
|
|
3
|
+
readonly children: ReactNode;
|
|
4
|
+
readonly isScrollable: boolean;
|
|
5
|
+
};
|
|
6
|
+
/** Use HeroUI's Vertical ScrollShadow without making consumers own its DOM contract. */
|
|
7
|
+
export declare const VerticalScrollRegion: (props: VerticalScrollRegionProps) => import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/VerticalScrollRegion/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtD,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IAC9E,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;CACjC,CAAA;AAED,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,GAAI,OAAO,yBAAyB,gCAKpE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ScrollShadow } from "@heroui/react";
|
|
3
|
+
/** Use HeroUI's Vertical ScrollShadow without making consumers own its DOM contract. */
|
|
4
|
+
export const VerticalScrollRegion = (props) => {
|
|
5
|
+
const { children, isScrollable, ...regionProps } = props;
|
|
6
|
+
return isScrollable
|
|
7
|
+
? _jsx(ScrollShadow, { ...regionProps, orientation: "vertical", children: children })
|
|
8
|
+
: _jsx("div", { ...regionProps, children: children });
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/VerticalScrollRegion/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAO5C,wFAAwF;AACxF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAgC,EAAE,EAAE;IACrE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAA;IACxD,OAAO,YAAY;QACf,CAAC,CAAC,KAAC,YAAY,OAAK,WAAW,EAAE,WAAW,EAAC,UAAU,YAAE,QAAQ,GAAgB;QACjF,CAAC,CAAC,iBAAS,WAAW,YAAG,QAAQ,GAAO,CAAA;AAChD,CAAC,CAAA"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
1
|
+
export type { PresentationState } from "./state.js";
|
|
2
|
+
export { StateMark, type StateMarkProps } from "./StateMark.js";
|
|
3
|
+
export { LeadingNumber, type LeadingNumberProps } from "./LeadingNumber.js";
|
|
4
|
+
export { OtpInput, type OtpInputProps } from "./OtpInput.js";
|
|
5
|
+
export { StaticStateRow, type StaticStateRowData, type StaticStateRowProps } from "./composite/StaticStateRow/index.js";
|
|
6
|
+
export { HorizontalScrollRegion, type HorizontalScrollRegionProps } from "./composite/HorizontalScrollRegion/index.js";
|
|
7
|
+
export { SurfaceCard, type SurfaceCardProps, type WholeCardAction } from "./branch/SurfaceCard/index.js";
|
|
8
|
+
export { SurfaceListCard, type SurfaceListCardProps } from "./branch/SurfaceListCard/index.js";
|
|
9
|
+
export { FencedCodeBlock, MarkdownArticle, MarkdownTableFrame, type FencedCodeBlockProps, type MarkdownArticleProps, type MarkdownTableFrameProps } from "./branch/MarkdownArticle/index.js";
|
|
10
|
+
export { SurfaceAccordionCard, type SurfaceAccordionCardItem, type SurfaceAccordionCardProps } from "./branch/SurfaceAccordionCard/index.js";
|
|
11
|
+
export { Rail, type RailProps } from "./branch/Rail/index.js";
|
|
12
|
+
export { formCompactSurfaceClassName, formFieldClassName, formPageClassName, formScreenReaderLabelClassName, formScrollViewportClassName, formSurfaceClassName, horizontalScrollRegionClassName } from "./classNames.js";
|
|
8
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACvH,OAAO,EAAE,sBAAsB,EAAE,KAAK,2BAA2B,EAAE,MAAM,6CAA6C,CAAA;AACtH,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACxG,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC9F,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,KAAK,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAC5L,OAAO,EAAE,oBAAoB,EAAE,KAAK,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAC5I,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAA"}
|
package/dist/core/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
1
|
+
export { StateMark } from "./StateMark.js";
|
|
2
|
+
export { LeadingNumber } from "./LeadingNumber.js";
|
|
3
|
+
export { OtpInput } from "./OtpInput.js";
|
|
4
|
+
export { StaticStateRow } from "./composite/StaticStateRow/index.js";
|
|
5
|
+
export { HorizontalScrollRegion } from "./composite/HorizontalScrollRegion/index.js";
|
|
6
|
+
export { SurfaceCard } from "./branch/SurfaceCard/index.js";
|
|
7
|
+
export { SurfaceListCard } from "./branch/SurfaceListCard/index.js";
|
|
8
|
+
export { FencedCodeBlock, MarkdownArticle, MarkdownTableFrame } from "./branch/MarkdownArticle/index.js";
|
|
9
|
+
export { SurfaceAccordionCard } from "./branch/SurfaceAccordionCard/index.js";
|
|
10
|
+
export { Rail } from "./branch/Rail/index.js";
|
|
11
|
+
export { formCompactSurfaceClassName, formFieldClassName, formPageClassName, formScreenReaderLabelClassName, formScrollViewportClassName, formSurfaceClassName, horizontalScrollRegionClassName } from "./classNames.js";
|
|
8
12
|
//# sourceMappingURL=index.js.map
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAuB,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAA2B,MAAM,oBAAoB,CAAA;AAC3E,OAAO,EAAE,QAAQ,EAAsB,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAqD,MAAM,qCAAqC,CAAA;AACvH,OAAO,EAAE,sBAAsB,EAAoC,MAAM,6CAA6C,CAAA;AACtH,OAAO,EAAE,WAAW,EAA+C,MAAM,+BAA+B,CAAA;AACxG,OAAO,EAAE,eAAe,EAA6B,MAAM,mCAAmC,CAAA;AAC9F,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAsF,MAAM,mCAAmC,CAAA;AAC5L,OAAO,EAAE,oBAAoB,EAAiE,MAAM,wCAAwC,CAAA;AAC5I,OAAO,EAAE,IAAI,EAAkB,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollable-surfaces.spec.d.ts","sourceRoot":"","sources":["../../src/core/scrollable-surfaces.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
3
|
+
import { describe, expect, it, vi } from "vitest";
|
|
4
|
+
import { SurfaceAccordionCard } from "./branch/SurfaceAccordionCard/index.js";
|
|
5
|
+
import { SurfaceCard } from "./branch/SurfaceCard/index.js";
|
|
6
|
+
import { SurfaceListCard } from "./branch/SurfaceListCard/index.js";
|
|
7
|
+
import { HorizontalScrollRegion } from "./composite/HorizontalScrollRegion/index.js";
|
|
8
|
+
import { OtpInput } from "./OtpInput.js";
|
|
9
|
+
const expectVerticalScrollShadow = (markup) => {
|
|
10
|
+
expect(markup).toContain("data-grammar-scroll=\"contained\"");
|
|
11
|
+
expect(markup).toContain("scroll-shadow--vertical");
|
|
12
|
+
expect(markup).toContain("data-orientation=\"vertical\"");
|
|
13
|
+
};
|
|
14
|
+
describe("scrollable Core surfaces", () => {
|
|
15
|
+
it("preserves intrinsic-width content in a horizontal ScrollShadow", () => {
|
|
16
|
+
const markup = renderToStaticMarkup(_jsx(HorizontalScrollRegion, { children: _jsx("div", { children: "Six fixed slots" }) }));
|
|
17
|
+
expect(markup).toContain("scroll-shadow--horizontal");
|
|
18
|
+
expect(markup).toContain("data-orientation=\"horizontal\"");
|
|
19
|
+
});
|
|
20
|
+
it("owns the conventional six-slot OTP control inside that horizontal region", () => {
|
|
21
|
+
const markup = renderToStaticMarkup(_jsx(OtpInput, { id: "otp", name: "otp" }));
|
|
22
|
+
expect(markup).toContain("scroll-shadow--horizontal");
|
|
23
|
+
expect(markup.match(/data-slot="input-otp-slot"/g)).toHaveLength(6);
|
|
24
|
+
expect(markup).toContain("autocomplete=\"one-time-code\"");
|
|
25
|
+
expect(markup).toContain("inputmode=\"numeric\"");
|
|
26
|
+
});
|
|
27
|
+
it("makes SurfaceCard content vertically scrollable", () => {
|
|
28
|
+
expectVerticalScrollShadow(renderToStaticMarkup(_jsx(SurfaceCard, { ariaLabel: "Card", isScrollable: true, children: _jsx("p", { children: "Body" }) })));
|
|
29
|
+
});
|
|
30
|
+
it("makes SurfaceListCard rows vertically scrollable", () => {
|
|
31
|
+
expectVerticalScrollShadow(renderToStaticMarkup(_jsx(SurfaceListCard, { ariaLabel: "List", isScrollable: true, children: _jsx("p", { children: "Row" }) })));
|
|
32
|
+
});
|
|
33
|
+
it("makes SurfaceAccordionCard rows vertically scrollable", () => {
|
|
34
|
+
expectVerticalScrollShadow(renderToStaticMarkup(_jsx(SurfaceAccordionCard, { bodyRender: "Body", isOpen: true, isScrollable: true, onOpenChange: vi.fn(), renderBody: (body) => body, renderSummary: (summary) => summary, summaryRender: "Summary" })));
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=scrollable-surfaces.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
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|
2
|
-
export {
|
|
3
|
-
export
|
|
1
|
+
import { assertPresentationState, type PresentationState } from "../common/index.js";
|
|
2
|
+
export type { PresentationState } from "../common/index.js";
|
|
3
|
+
export { assertPresentationState };
|
|
4
|
+
type NeutralTreatment = {
|
|
4
5
|
readonly state: PresentationState;
|
|
5
6
|
readonly tone: "quiet" | "positive" | "information" | "warning" | "danger" | "inactive" | "pending";
|
|
6
7
|
readonly mark: "none" | "check";
|
|
7
8
|
};
|
|
8
|
-
export declare const CORE_NEUTRAL_TREATMENTS: Readonly<Record<PresentationState, NeutralTreatment>>;
|
|
9
9
|
export declare const treatmentFor: (state: PresentationState) => NeutralTreatment;
|
|
10
10
|
//# sourceMappingURL=state.d.ts.map
|
package/dist/core/state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/core/state.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/core/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,uBAAuB,EACvB,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAA;AAE3B,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,uBAAuB,EAAE,CAAA;AAElC,KAAK,gBAAgB,GAAG;IACpB,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAA;IACnG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAClC,CAAA;AAiBD,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,KAAG,gBAGvD,CAAA"}
|
package/dist/core/state.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PRESENTATION_STATES, assertPresentationState, } from "../common/index.js";
|
|
2
|
-
export {
|
|
2
|
+
export { assertPresentationState };
|
|
3
3
|
const neutralTreatment = (state) => {
|
|
4
4
|
const id = String(state);
|
|
5
5
|
if (id === "affirmative")
|
|
@@ -16,9 +16,9 @@ const neutralTreatment = (state) => {
|
|
|
16
16
|
return { state, tone: "inactive", mark: "none" };
|
|
17
17
|
return { state, tone: "quiet", mark: "none" };
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
const coreNeutralTreatments = Object.freeze(Object.fromEntries(PRESENTATION_STATES.map((state) => [state, Object.freeze(neutralTreatment(state))])));
|
|
20
20
|
export const treatmentFor = (state) => {
|
|
21
21
|
assertPresentationState(state);
|
|
22
|
-
return
|
|
22
|
+
return coreNeutralTreatments[state];
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=state.js.map
|
package/dist/core/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/core/state.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,uBAAuB,GAE1B,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/core/state.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,uBAAuB,GAE1B,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EAAE,uBAAuB,EAAE,CAAA;AAQlC,MAAM,gBAAgB,GAAG,CAAC,KAAwB,EAAoB,EAAE;IACpE,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IACxB,IAAI,EAAE,KAAK,aAAa;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;IAC3E,IAAI,EAAE,KAAK,aAAa;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;IAC7E,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