@starci/grammar 0.1.0 → 0.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/LICENSE +21 -21
- package/README.md +53 -40
- package/dist/common/styles.css +2 -2
- package/dist/core/StateMark.d.ts +4 -0
- package/dist/core/StateMark.d.ts.map +1 -1
- package/dist/core/StateMark.js +1 -0
- package/dist/core/StateMark.js.map +1 -1
- package/dist/core/branch/Rail/index.d.ts +13 -2
- package/dist/core/branch/Rail/index.d.ts.map +1 -1
- package/dist/core/branch/Rail/index.js +17 -2
- package/dist/core/branch/Rail/index.js.map +1 -1
- package/dist/core/branch/SurfaceCard/index.d.ts +7 -1
- package/dist/core/branch/SurfaceCard/index.d.ts.map +1 -1
- package/dist/core/branch/SurfaceCard/index.js +3 -2
- package/dist/core/branch/SurfaceCard/index.js.map +1 -1
- package/dist/core/branch/SurfaceListCard/index.d.ts +20 -10
- package/dist/core/branch/SurfaceListCard/index.d.ts.map +1 -1
- package/dist/core/branch/SurfaceListCard/index.js +7 -9
- package/dist/core/branch/SurfaceListCard/index.js.map +1 -1
- package/dist/core/composite/StaticStateRow/index.d.ts +17 -0
- package/dist/core/composite/StaticStateRow/index.d.ts.map +1 -0
- package/dist/core/composite/StaticStateRow/index.js +11 -0
- package/dist/core/composite/StaticStateRow/index.js.map +1 -0
- package/dist/core/contracts.d.ts +28 -28
- package/dist/core/contracts.d.ts.map +1 -1
- package/dist/core/contracts.js +65 -11
- package/dist/core/contracts.js.map +1 -1
- package/dist/core/grammar.d.ts +1 -1
- package/dist/core/grammar.js +1 -1
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/layout.d.ts +9 -0
- package/dist/core/layout.d.ts.map +1 -0
- package/dist/core/layout.js +43 -0
- package/dist/core/layout.js.map +1 -0
- package/dist/core/rules.d.ts +18 -0
- package/dist/core/rules.d.ts.map +1 -1
- package/dist/core/rules.js +21 -0
- package/dist/core/rules.js.map +1 -1
- package/dist/core/styles.css +211 -162
- package/dist/offset-pop/index.d.ts +29 -29
- package/dist/offset-pop/index.js +2 -2
- package/dist/offset-pop/styles.css +393 -393
- package/package.json +72 -72
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 StarCi
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 StarCi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,42 +1,55 @@
|
|
|
1
|
-
# `@starci/grammar`
|
|
2
|
-
|
|
3
|
-
Business-neutral UI contracts and versioned StarCi Grammar bundles.
|
|
4
|
-
|
|
5
|
-
## Public entry points
|
|
6
|
-
|
|
7
|
-
- `@starci/grammar/common` — contract kernel and runtime validation.
|
|
8
|
-
- `@starci/grammar/core` —
|
|
9
|
-
- `@starci/grammar/offset-pop` — one declared visual extension of Core.
|
|
10
|
-
- `@starci/grammar/common/styles.css`, `core/styles.css`, `offset-pop/styles.css` — canonical cascade entries. Short `.css` aliases are also exported.
|
|
11
|
-
|
|
12
|
-
Install this workspace package while it is under development. Published consumers must pin one
|
|
13
|
-
exact version rather than a range:
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
npm install ./packages/grammar
|
|
17
|
-
# after publication: npm install --save-exact @starci/grammar@0.
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
```ts
|
|
21
|
-
import { createContractRegistry } from "@starci/grammar/common"
|
|
22
|
-
import { CORE_COMPONENT_CONTRACTS } from "@starci/grammar/core"
|
|
23
|
-
import { offsetPopGrammar } from "@starci/grammar/offset-pop"
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
```css
|
|
27
|
-
@import "@starci/grammar/common/styles.css";
|
|
28
|
-
@import "@starci/grammar/core/styles.css";
|
|
29
|
-
@import "@starci/grammar/offset-pop/styles.css";
|
|
30
|
-
```
|
|
31
|
-
|
|
1
|
+
# `@starci/grammar`
|
|
2
|
+
|
|
3
|
+
Business-neutral UI contracts and versioned StarCi Grammar bundles.
|
|
4
|
+
|
|
5
|
+
## Public entry points
|
|
6
|
+
|
|
7
|
+
- `@starci/grammar/common` — contract kernel and runtime validation.
|
|
8
|
+
- `@starci/grammar/core` — batteries-included, product-neutral leaves, composites, branches, layout capabilities and base contracts.
|
|
9
|
+
- `@starci/grammar/offset-pop` — one declared visual extension of Core.
|
|
10
|
+
- `@starci/grammar/common/styles.css`, `core/styles.css`, `offset-pop/styles.css` — canonical cascade entries. Short `.css` aliases are also exported.
|
|
11
|
+
|
|
12
|
+
Install this workspace package while it is under development. Published consumers must pin one
|
|
13
|
+
exact version rather than a range:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm install ./packages/grammar
|
|
17
|
+
# after publication: npm install --save-exact @starci/grammar@0.2.0
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { createContractRegistry } from "@starci/grammar/common"
|
|
22
|
+
import { CORE_COMPONENT_CONTRACTS } from "@starci/grammar/core"
|
|
23
|
+
import { offsetPopGrammar } from "@starci/grammar/offset-pop"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```css
|
|
27
|
+
@import "@starci/grammar/common/styles.css";
|
|
28
|
+
@import "@starci/grammar/core/styles.css";
|
|
29
|
+
@import "@starci/grammar/offset-pop/styles.css";
|
|
30
|
+
```
|
|
31
|
+
|
|
32
32
|
`common` contains no React, Next.js, business entity, operation or domain state. A Product Block translates domain state into `PresentationState`; Grammar consumes only that neutral state.
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
Core owners expose additive, business-neutral capabilities without opening their anatomy:
|
|
35
|
+
|
|
36
|
+
- `StateMark` is a Core leaf for neutral presentation-state marks.
|
|
37
|
+
- `StaticStateRow` is a Core composite for one non-interactive row in a Core-owned collection.
|
|
38
|
+
- `SurfaceCard` supports bounded/frameless frames, page/contained scrolling and one label-end slot.
|
|
39
|
+
- `SurfaceListCard` supports Core-owned static rows or a content-owned interactive collection, an accessible hidden label and one footer.
|
|
40
|
+
- `Rail` supports a Core-owned complementary landmark or one content-owned navigation landmark, plus expanded/collapsed and motion/reduced-motion declarations.
|
|
41
|
+
|
|
42
|
+
`CORE_LAYOUT_CLASS_NAMES` is the closed product-neutral layout vocabulary. Product breakpoints,
|
|
43
|
+
token names and selectors remain in the consuming application's contract registry.
|
|
44
|
+
|
|
45
|
+
Adapters must bind directly to the `core.*` contract identity and emit the canonical `data-grammar-*` anatomy. A product-prefixed contract with no resolved Core axis is not a substitute for conformance.
|
|
46
|
+
|
|
47
|
+
Contracts are immutable. Extensions may resolve only axes explicitly opened by the base contract. They cannot replace anatomy, mutate a closed invariant, substitute the owner or silently replace a duplicate registry key.
|
|
48
|
+
|
|
49
|
+
## Package checks
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
npm run typecheck
|
|
53
|
+
npm test
|
|
54
|
+
npm pack --dry-run
|
|
55
|
+
```
|
package/dist/common/styles.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* Establish one deterministic cascade without owning product colour or business meaning. */
|
|
2
|
-
@layer starci-grammar-common, starci-grammar-core, starci-grammar-extension;
|
|
1
|
+
/* Establish one deterministic cascade without owning product colour or business meaning. */
|
|
2
|
+
@layer starci-grammar-common, starci-grammar-core, starci-grammar-extension;
|
package/dist/core/StateMark.d.ts
CHANGED
|
@@ -3,4 +3,8 @@ export type StateMarkProps = {
|
|
|
3
3
|
readonly state: PresentationState;
|
|
4
4
|
};
|
|
5
5
|
export declare const StateMark: ({ state }: StateMarkProps) => import("react").JSX.Element | null;
|
|
6
|
+
export declare const meta: {
|
|
7
|
+
readonly shape: "leaf";
|
|
8
|
+
readonly grammar: "core";
|
|
9
|
+
};
|
|
6
10
|
//# sourceMappingURL=StateMark.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateMark.d.ts","sourceRoot":"","sources":["../../src/core/StateMark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAGnD,MAAM,MAAM,cAAc,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,WAAW,cAAc,uCAclD,CAAA"}
|
|
1
|
+
{"version":3,"file":"StateMark.d.ts","sourceRoot":"","sources":["../../src/core/StateMark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAGnD,MAAM,MAAM,cAAc,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,WAAW,cAAc,uCAclD,CAAA;AAED,eAAO,MAAM,IAAI;;;CAA8C,CAAA"}
|
package/dist/core/StateMark.js
CHANGED
|
@@ -6,4 +6,5 @@ export const StateMark = ({ state }) => {
|
|
|
6
6
|
return null;
|
|
7
7
|
return (_jsx("svg", { "aria-hidden": "true", "data-grammar-state-mark": "check", focusable: "false", viewBox: "0 0 20 20", children: _jsx("path", { d: "M5 10.5 8.25 14 15 6.5", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2" }) }));
|
|
8
8
|
};
|
|
9
|
+
export const meta = { shape: "leaf", grammar: "core" };
|
|
9
10
|
//# sourceMappingURL=StateMark.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateMark.js","sourceRoot":"","sources":["../../src/core/StateMark.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAMzC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAkB,EAAE,EAAE;IACnD,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IACrC,IAAI,SAAS,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,IAAI,CAAA;IAE3C,OAAO,CACH,6BACgB,MAAM,6BACM,OAAO,EAC/B,SAAS,EAAC,OAAO,EACjB,OAAO,EAAC,WAAW,YAEnB,eAAM,CAAC,EAAC,wBAAwB,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,EAAC,WAAW,EAAC,GAAG,GAAG,GAChI,CACT,CAAA;AACL,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"StateMark.js","sourceRoot":"","sources":["../../src/core/StateMark.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAMzC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAkB,EAAE,EAAE;IACnD,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IACrC,IAAI,SAAS,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,IAAI,CAAA;IAE3C,OAAO,CACH,6BACgB,MAAM,6BACM,OAAO,EAC/B,SAAS,EAAC,OAAO,EACjB,OAAO,EAAC,WAAW,YAEnB,eAAM,CAAC,EAAC,wBAAwB,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,EAAC,WAAW,EAAC,GAAG,GAAG,GAChI,CACT,CAAA;AACL,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAW,CAAA"}
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type PresentationState } from "../../state.js";
|
|
3
|
-
|
|
3
|
+
type ComplementaryRailProps = {
|
|
4
4
|
readonly label: string;
|
|
5
|
+
readonly landmark?: "complementary";
|
|
6
|
+
};
|
|
7
|
+
type ContentNavigationRailProps = {
|
|
8
|
+
readonly label?: never;
|
|
9
|
+
/** The child owns the single navigation landmark; Core must not wrap it in another landmark. */
|
|
10
|
+
readonly landmark: "content-navigation";
|
|
11
|
+
};
|
|
12
|
+
export type RailProps = (ComplementaryRailProps | ContentNavigationRailProps) & {
|
|
5
13
|
readonly children: ReactNode;
|
|
6
14
|
readonly footer?: ReactNode;
|
|
7
15
|
readonly mode?: "flow" | "sticky";
|
|
8
16
|
readonly width?: "compact" | "standard" | "wide";
|
|
9
17
|
readonly state?: PresentationState;
|
|
18
|
+
readonly collapse?: "expanded" | "collapsed";
|
|
19
|
+
readonly motion?: "static" | "animated" | "reduced";
|
|
10
20
|
};
|
|
11
|
-
export declare const Rail: ({ label, children, footer, mode, width, state, }: RailProps) => import("react").JSX.Element;
|
|
21
|
+
export declare const Rail: ({ label, landmark, children, footer, mode, width, state, collapse, motion, }: RailProps) => import("react").JSX.Element;
|
|
12
22
|
export declare const meta: {
|
|
13
23
|
readonly shape: "branch";
|
|
14
24
|
readonly grammar: "core";
|
|
15
25
|
readonly contract: "core.branch.rail";
|
|
16
26
|
};
|
|
27
|
+
export {};
|
|
17
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/Rail/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAyC,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAE9F,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/Rail/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAyC,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAE9F,KAAK,sBAAsB,GAAG;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAA;CACtC,CAAA;AAED,KAAK,0BAA0B,GAAG;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;IACtB,gGAAgG;IAChG,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAA;CAC1C,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,sBAAsB,GAAG,0BAA0B,CAAC,GAAG;IAC5E,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAA;IAChD,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAA;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,WAAW,CAAA;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAA;CACtD,CAAA;AAED,eAAO,MAAM,IAAI,GAAI,8EAUlB,SAAS,gCAoCX,CAAA;AAED,eAAO,MAAM,IAAI;;;;CAA8E,CAAA"}
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
3
|
import { assertPresentationState, treatmentFor } from "../../state.js";
|
|
4
|
-
export const Rail = ({ label, children, footer, mode = "flow", width = "standard", state = "neutral", }) => {
|
|
4
|
+
export const Rail = ({ label, landmark = "complementary", children, footer, mode = "flow", width = "standard", state = "neutral", collapse = "expanded", motion = "static", }) => {
|
|
5
5
|
assertPresentationState(state);
|
|
6
6
|
const headingId = useId();
|
|
7
7
|
const treatment = treatmentFor(state);
|
|
8
|
-
|
|
8
|
+
const frame = (_jsxs("div", { className: "starci-core-rail-frame", "data-grammar-rail-frame": "true", children: [landmark === "content-navigation" ? null : _jsx("h2", { "data-grammar-rail-heading": "true", id: headingId, children: label }), _jsx("div", { className: "starci-core-rail-body", "data-grammar-rail-body": "true", children: children }), footer === undefined ? null : (_jsx("div", { className: "starci-core-rail-footer", "data-grammar-rail-footer": "true", children: footer }))] }));
|
|
9
|
+
const shared = {
|
|
10
|
+
className: "starci-core-rail",
|
|
11
|
+
"data-grammar-collapse": collapse,
|
|
12
|
+
"data-grammar-contract": "core.rail",
|
|
13
|
+
"data-grammar-landmark": landmark,
|
|
14
|
+
"data-grammar-motion": motion,
|
|
15
|
+
"data-grammar-rail": "true",
|
|
16
|
+
"data-grammar-rail-mode": mode,
|
|
17
|
+
"data-grammar-rail-width": width,
|
|
18
|
+
"data-grammar-state": state,
|
|
19
|
+
"data-grammar-treatment": treatment.tone,
|
|
20
|
+
};
|
|
21
|
+
if (landmark === "content-navigation")
|
|
22
|
+
return _jsx("div", { ...shared, children: frame });
|
|
23
|
+
return (_jsx("aside", { "aria-labelledby": headingId, ...shared, children: frame }));
|
|
9
24
|
};
|
|
10
25
|
export const meta = { shape: "branch", grammar: "core", contract: "core.branch.rail" };
|
|
11
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/Rail/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/Rail/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAA;AAuB9F,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EACjB,KAAK,EACL,QAAQ,GAAG,eAAe,EAC1B,QAAQ,EACR,MAAM,EACN,IAAI,GAAG,MAAM,EACb,KAAK,GAAG,UAAU,EAClB,KAAK,GAAG,SAAS,EACjB,QAAQ,GAAG,UAAU,EACrB,MAAM,GAAG,QAAQ,GACT,EAAE,EAAE;IACZ,uBAAuB,CAAC,KAAK,CAAC,CAAA;IAC9B,MAAM,SAAS,GAAG,KAAK,EAAE,CAAA;IACzB,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAErC,MAAM,KAAK,GAAG,CACV,eAAK,SAAS,EAAC,wBAAwB,6BAAyB,MAAM,aACjE,QAAQ,KAAK,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0CAA8B,MAAM,EAAC,EAAE,EAAE,SAAS,YAAG,KAAK,GAAM,EAC5G,cAAK,SAAS,EAAC,uBAAuB,4BAAwB,MAAM,YAAE,QAAQ,GAAO,EACpF,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC3B,cAAK,SAAS,EAAC,yBAAyB,8BAA0B,MAAM,YAAE,MAAM,GAAO,CAC1F,IACC,CACT,CAAA;IACD,MAAM,MAAM,GAAG;QACX,SAAS,EAAE,kBAAkB;QAC7B,uBAAuB,EAAE,QAAQ;QACjC,uBAAuB,EAAE,WAAW;QACpC,uBAAuB,EAAE,QAAQ;QACjC,qBAAqB,EAAE,MAAM;QAC7B,mBAAmB,EAAE,MAAM;QAC3B,wBAAwB,EAAE,IAAI;QAC9B,yBAAyB,EAAE,KAAK;QAChC,oBAAoB,EAAE,KAAK;QAC3B,wBAAwB,EAAE,SAAS,CAAC,IAAI;KAClC,CAAA;IAEV,IAAI,QAAQ,KAAK,oBAAoB;QAAE,OAAO,iBAAS,MAAM,YAAG,KAAK,GAAO,CAAA;IAC5E,OAAO,CACH,mCACqB,SAAS,KACtB,MAAM,YAET,KAAK,GACF,CACX,CAAA;AACL,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAW,CAAA"}
|
|
@@ -20,11 +20,17 @@ type SelfNamedSurfaceCard = {
|
|
|
20
20
|
export type SurfaceCardProps = (LabelledSurfaceCard | SelfNamedSurfaceCard) & {
|
|
21
21
|
readonly children: ReactNode;
|
|
22
22
|
readonly fact?: string;
|
|
23
|
+
/** Optional content at the end of the external label row. It takes the fact's single place. */
|
|
24
|
+
readonly labelEnd?: ReactNode;
|
|
23
25
|
readonly depth?: "top" | "nested";
|
|
24
26
|
readonly state?: PresentationState;
|
|
25
27
|
readonly wholeAction?: WholeCardAction;
|
|
28
|
+
/** Frameless content already owns its visible boundaries, so Core must not draw another shell. */
|
|
29
|
+
readonly frame?: "bounded" | "frameless";
|
|
30
|
+
/** Contained content has exactly one internal scroll owner. */
|
|
31
|
+
readonly scroll?: "page" | "contained";
|
|
26
32
|
};
|
|
27
|
-
export declare const SurfaceCard: ({ label, ariaLabel, children, fact, depth, state, wholeAction, }: SurfaceCardProps) => import("react").JSX.Element;
|
|
33
|
+
export declare const SurfaceCard: ({ label, ariaLabel, children, fact, labelEnd, depth, state, wholeAction, frame, scroll, }: SurfaceCardProps) => import("react").JSX.Element;
|
|
28
34
|
export declare const meta: {
|
|
29
35
|
readonly shape: "branch";
|
|
30
36
|
readonly grammar: "core";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/SurfaceCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAyC,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAE9F,MAAM,MAAM,eAAe,GACrB;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACzB,GACC;IACE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACzB,CAAA;AAEL,KAAK,mBAAmB,GAAG;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAED,KAAK,oBAAoB,GAAG;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,mBAAmB,GAAG,oBAAoB,CAAC,GAAG;IAC1E,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,G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,GAAG,QAAQ,CAAA;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAA;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAA;IACtC,kGAAkG;IAClG,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;IACxC,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,2FAWzB,gBAAgB,gCA4DlB,CAAA;AAED,eAAO,MAAM,IAAI;;;;CAAsF,CAAA"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
3
|
import { assertPresentationState, treatmentFor } from "../../state.js";
|
|
4
|
-
export const SurfaceCard = ({ label, ariaLabel, children, fact, depth = "top", state = "neutral", wholeAction, }) => {
|
|
4
|
+
export const SurfaceCard = ({ label, ariaLabel, children, fact, labelEnd, depth = "top", state = "neutral", wholeAction, frame = "bounded", scroll = "page", }) => {
|
|
5
5
|
assertPresentationState(state);
|
|
6
6
|
const headingId = useId();
|
|
7
7
|
const treatment = treatmentFor(state);
|
|
8
8
|
const disabled = state === "unavailable" || state === "pending";
|
|
9
9
|
const accessibleName = ariaLabel ?? label;
|
|
10
10
|
const action = wholeAction?.kind === "link" ? (_jsx("a", { "aria-disabled": disabled || undefined, "aria-label": wholeAction.label, "data-grammar-whole-action": "link", href: disabled ? undefined : wholeAction.href, tabIndex: disabled ? -1 : undefined })) : wholeAction?.kind === "button" ? (_jsx("button", { "aria-label": wholeAction.label, "data-grammar-whole-action": "button", disabled: disabled, onClick: wholeAction.press, type: "button" })) : null;
|
|
11
|
-
|
|
11
|
+
const surface = (_jsxs("div", { "aria-label": label === undefined ? accessibleName : undefined, "aria-labelledby": label === undefined ? undefined : headingId, className: frame === "bounded" ? "starci-core-surface" : "starci-core-surface starci-core-frameless-surface", "data-grammar-frame": frame, "data-grammar-scroll": scroll, "data-grammar-state": state, "data-grammar-surface": "true", "data-grammar-surface-depth": depth, "data-grammar-treatment": treatment.tone, children: [_jsx("div", { className: "starci-core-surface-content", "data-grammar-surface-content": "true", children: children }), action] }));
|
|
12
|
+
return (_jsxs("section", { className: "starci-core-surface-card", "data-grammar-contract": "core.surface-card", "data-grammar-frame": frame, "data-grammar-surface-card": "true", children: [label === undefined ? null : (_jsxs("div", { className: "starci-core-surface-label", "data-grammar-surface-label": "true", children: [_jsx("h3", { id: headingId, children: label }), labelEnd ?? (fact === undefined ? null : _jsx("span", { children: fact }))] })), surface] }));
|
|
12
13
|
};
|
|
13
14
|
export const meta = { shape: "branch", grammar: "core", contract: "core.branch.surface-card" };
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/SurfaceCard/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/SurfaceCard/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAA;AAsC9F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EACxB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,KAAK,GAAG,KAAK,EACb,KAAK,GAAG,SAAS,EACjB,WAAW,EACX,KAAK,GAAG,SAAS,EACjB,MAAM,GAAG,MAAM,GACA,EAAE,EAAE;IACnB,uBAAuB,CAAC,KAAK,CAAC,CAAA;IAC9B,MAA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CACH,mBACI,SAAS,EAAC,0BAA0B,2BACd,mBAAmB,wBACrB,KAAK,+BACC,MAAM,aAE/B,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC1B,eAAK,SAAS,EAAC,2BAA2B,gCAA4B,MAAM,aACxE,aAAI,EAAE,EAAE,SAAS,YAAG,KAAK,GAAM,EAC9B,QAAQ,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAO,IAAI,GAAQ,CAAC,IAC5D,CACT,EACA,OAAO,IACF,CACb,CAAA;AACL,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,0BAA0B,EAAW,CAAA"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
readonly label: string;
|
|
5
|
-
readonly description?: string;
|
|
6
|
-
readonly state?: PresentationState;
|
|
7
|
-
};
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type StaticStateRowData } from "../../composite/StaticStateRow/index.js";
|
|
3
|
+
export type SurfaceListItem = StaticStateRowData;
|
|
8
4
|
type LabelledSurfaceList = {
|
|
9
5
|
readonly label: string;
|
|
10
6
|
readonly ariaLabel?: string;
|
|
@@ -13,13 +9,27 @@ type SelfNamedSurfaceList = {
|
|
|
13
9
|
readonly label?: undefined;
|
|
14
10
|
readonly ariaLabel: string;
|
|
15
11
|
};
|
|
16
|
-
|
|
17
|
-
readonly items: ReadonlyArray<SurfaceListItem>;
|
|
12
|
+
type SurfaceListFrameProps = (LabelledSurfaceList | SelfNamedSurfaceList) & {
|
|
18
13
|
readonly fact?: string;
|
|
14
|
+
readonly labelEnd?: ReactNode;
|
|
15
|
+
readonly labelHidden?: boolean;
|
|
16
|
+
readonly footer?: ReactNode;
|
|
19
17
|
readonly depth?: "top" | "nested";
|
|
18
|
+
};
|
|
19
|
+
type StaticSurfaceListProps = {
|
|
20
|
+
readonly items: ReadonlyArray<SurfaceListItem>;
|
|
20
21
|
readonly emptyLabel?: string;
|
|
22
|
+
readonly children?: never;
|
|
23
|
+
readonly rowMode?: "static";
|
|
24
|
+
};
|
|
25
|
+
type ContentOwnedSurfaceListProps = {
|
|
26
|
+
readonly children: ReactNode;
|
|
27
|
+
readonly rowMode: "interactive";
|
|
28
|
+
readonly items?: never;
|
|
29
|
+
readonly emptyLabel?: never;
|
|
21
30
|
};
|
|
22
|
-
export
|
|
31
|
+
export type SurfaceListCardProps = SurfaceListFrameProps & (StaticSurfaceListProps | ContentOwnedSurfaceListProps);
|
|
32
|
+
export declare const SurfaceListCard: ({ label, ariaLabel, items, children, fact, labelEnd, labelHidden, footer, depth, emptyLabel, rowMode, }: SurfaceListCardProps) => import("react").JSX.Element;
|
|
23
33
|
export declare const meta: {
|
|
24
34
|
readonly shape: "branch";
|
|
25
35
|
readonly grammar: "core";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/SurfaceListCard/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/SurfaceListCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAGjG,MAAM,MAAM,eAAe,GAAG,kBAAkB,CAAA;AAEhD,KAAK,mBAAmB,GAAG;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAED,KAAK,oBAAoB,GAAG;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;IAC1B,Q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ard = ({ label, ariaLabel, items, fact, depth = "top", emptyLabel = "No items", }) => {
|
|
3
|
+
import { StaticStateRow } from "../../composite/StaticStateRow/index.js";
|
|
4
|
+
import { assertPresentationState } from "../../state.js";
|
|
5
|
+
export const SurfaceListCard = ({ label, ariaLabel, items, children, fact, labelEnd, labelHidden = false, footer, depth = "top", emptyLabel = "No items", rowMode = "static", }) => {
|
|
6
6
|
const headingId = useId();
|
|
7
|
-
for (const item of items)
|
|
7
|
+
for (const item of items ?? [])
|
|
8
8
|
assertPresentationState(item.state ?? "neutral");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return (_jsxs("li", { className: "starci-core-static-row", "data-grammar-row": "true", "data-grammar-state": state, "data-grammar-treatment": treatment.tone, children: [_jsx(StateMark, { state: state }), _jsxs("span", { className: "starci-core-static-row-copy", children: [_jsx("span", { children: item.label }), item.description === undefined ? null : _jsx("span", { children: item.description })] })] }, item.id));
|
|
13
|
-
}) })) })] }));
|
|
9
|
+
const accessibleName = ariaLabel ?? label;
|
|
10
|
+
const collection = rowMode === "interactive" ? (_jsx("div", { className: "starci-core-owned-collection", "data-grammar-list": "true", "data-grammar-list-mode": "interactive", children: children })) : items?.length === 0 ? (_jsx("p", { className: "starci-core-empty-row", "data-grammar-state": "neutral", children: emptyLabel })) : (_jsx("ul", { className: "starci-core-static-list", "data-grammar-list": "true", "data-grammar-list-mode": "static", children: (items ?? []).map((item) => _jsx(StaticStateRow, { item: item }, item.id)) }));
|
|
11
|
+
return (_jsxs("section", { className: "starci-core-surface-list", "data-grammar-contract": "core.surface-list-card", "data-grammar-label-visibility": labelHidden ? "hidden" : "visible", "data-grammar-list-mode": rowMode, "data-grammar-surface-list": "true", children: [label === undefined || labelHidden ? null : (_jsxs("div", { className: "starci-core-surface-label", "data-grammar-surface-label": "true", children: [_jsx("h3", { id: headingId, children: label }), labelEnd ?? (fact === undefined ? null : _jsx("span", { children: fact }))] })), _jsx("div", { "aria-label": labelHidden || label === undefined ? accessibleName : undefined, "aria-labelledby": !labelHidden && label !== undefined ? headingId : undefined, className: "starci-core-surface starci-core-list-shell", "data-grammar-surface": "true", "data-grammar-surface-depth": depth, children: collection }), footer === undefined ? null : (_jsx("div", { className: "starci-core-surface-footer", "data-grammar-surface-footer": "true", children: footer }))] }));
|
|
14
12
|
};
|
|
15
13
|
export const meta = { shape: "branch", grammar: "core", contract: "core.branch.surface-list-card" };
|
|
16
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/SurfaceListCard/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/SurfaceListCard/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,cAAc,EAA2B,MAAM,yCAAyC,CAAA;AACjG,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAsCxD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,WAAW,GAAG,KAAK,EACnB,MAAM,EACN,KAAK,GAAG,KAAK,EACb,UAAU,GAAG,UAAU,EACvB,OAAO,GAAG,QAAQ,GACC,EAAE,EAAE;IACvB,MAAM,SAAS,GAAG,KAAK,EAAE,CAAA;IACzB,KAAK,MAAM,IAAI,IAAI,KAAK,IAAI,EAAE;QAAE,uBAAuB,CAAC,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC,CAAA;IAChF,MAAM,cAAc,GAAG,SAAS,IAAI,KAAK,CAAA;IACzC,MAAM,UAAU,GAAG,OAAO,KAAK,aAAa,CAAC,CAAC,CAAC,CAC3C,cAAK,SAAS,EAAC,8BAA8B,uBAAmB,MAAM,4BAAwB,aA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AE,MAAM,GAAO,CAChG,IACK,CACb,CAAA;AACL,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,+BAA+B,EAAW,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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: ({ item }: StaticStateRowProps) => import("react").JSX.Element;
|
|
13
|
+
export declare const meta: {
|
|
14
|
+
readonly shape: "composite";
|
|
15
|
+
readonly grammar: "core";
|
|
16
|
+
};
|
|
17
|
+
//# 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;AAErE,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,UAAU,mBAAmB,gCAkB3D,CAAA;AAED,eAAO,MAAM,IAAI;;;CAAmD,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
/** One non-interactive, product-neutral row in a Core-owned static collection. */
|
|
5
|
+
export const StaticStateRow = ({ item }) => {
|
|
6
|
+
const state = item.state ?? "neutral";
|
|
7
|
+
const treatment = treatmentFor(state);
|
|
8
|
+
return (_jsxs("li", { className: "starci-core-static-row", "data-grammar-row": "true", "data-grammar-state": state, "data-grammar-treatment": treatment.tone, children: [_jsx(StateMark, { state: state }), _jsxs("span", { className: "starci-core-static-row-copy", children: [_jsx("span", { children: item.label }), item.description === undefined ? null : _jsx("span", { children: item.description })] })] }));
|
|
9
|
+
};
|
|
10
|
+
export const meta = { shape: "composite", grammar: "core" };
|
|
11
|
+
//# 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;AAarE,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,IAAI,EAAuB,EAAE,EAAE;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,SAAS,CAAA;IACrC,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAErC,OAAO,CACH,cACI,SAAS,EAAC,wBAAwB,sBACjB,MAAM,wBACH,KAAK,4BACD,SAAS,CAAC,IAAI,aAEtC,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,GAAI,EAC3B,gBAAM,SAAS,EAAC,6BAA6B,aACzC,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;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAW,CAAA"}
|