@starci/grammar 0.4.2 → 0.4.4
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/common/registry.d.ts +3 -2
- package/dist/common/registry.d.ts.map +1 -1
- package/dist/common/registry.js +3 -3
- package/dist/common/registry.js.map +1 -1
- package/dist/common/renderers.d.ts +1 -0
- package/dist/common/renderers.d.ts.map +1 -1
- package/dist/common/renderers.js +1 -0
- package/dist/common/renderers.js.map +1 -1
- package/dist/common/styles.css +795 -9
- package/dist/core/branch/MarkdownArticle/classNames.d.ts +9 -4
- package/dist/core/branch/MarkdownArticle/classNames.d.ts.map +1 -1
- package/dist/core/branch/MarkdownArticle/classNames.js +9 -4
- package/dist/core/branch/MarkdownArticle/classNames.js.map +1 -1
- package/dist/core/branch/Rail/classNames.d.ts +8 -4
- package/dist/core/branch/Rail/classNames.d.ts.map +1 -1
- package/dist/core/branch/Rail/classNames.js +8 -4
- package/dist/core/branch/Rail/classNames.js.map +1 -1
- package/dist/core/branch/Rail/index.d.ts.map +1 -1
- package/dist/core/branch/Rail/index.js +1 -2
- package/dist/core/branch/Rail/index.js.map +1 -1
- package/dist/core/branch/Subnav/classNames.d.ts +14 -7
- package/dist/core/branch/Subnav/classNames.d.ts.map +1 -1
- package/dist/core/branch/Subnav/classNames.js +14 -7
- package/dist/core/branch/Subnav/classNames.js.map +1 -1
- package/dist/core/branch/Subnav/index.d.ts.map +1 -1
- package/dist/core/branch/Subnav/index.js +2 -2
- package/dist/core/branch/Subnav/index.js.map +1 -1
- package/dist/core/branch/SurfaceAccordionCard/classNames.d.ts +16 -8
- package/dist/core/branch/SurfaceAccordionCard/classNames.d.ts.map +1 -1
- package/dist/core/branch/SurfaceAccordionCard/classNames.js +17 -9
- package/dist/core/branch/SurfaceAccordionCard/classNames.js.map +1 -1
- package/dist/core/branch/SurfaceAccordionCard/index.d.ts.map +1 -1
- package/dist/core/branch/SurfaceAccordionCard/index.js +1 -1
- package/dist/core/branch/SurfaceAccordionCard/index.js.map +1 -1
- package/dist/core/branch/SurfaceCard/classNames.d.ts +16 -7
- package/dist/core/branch/SurfaceCard/classNames.d.ts.map +1 -1
- package/dist/core/branch/SurfaceCard/classNames.js +17 -8
- package/dist/core/branch/SurfaceCard/classNames.js.map +1 -1
- package/dist/core/branch/SurfaceCard/index.d.ts.map +1 -1
- package/dist/core/branch/SurfaceCard/index.js +6 -2
- package/dist/core/branch/SurfaceCard/index.js.map +1 -1
- package/dist/core/branch/SurfaceListCard/classNames.d.ts +14 -7
- package/dist/core/branch/SurfaceListCard/classNames.d.ts.map +1 -1
- package/dist/core/branch/SurfaceListCard/classNames.js +14 -7
- package/dist/core/branch/SurfaceListCard/classNames.js.map +1 -1
- package/dist/core/branch/SurfaceListCard/index.d.ts.map +1 -1
- package/dist/core/branch/SurfaceListCard/index.js +2 -2
- package/dist/core/branch/SurfaceListCard/index.js.map +1 -1
- package/dist/core/classNames.d.ts +3 -5
- package/dist/core/classNames.d.ts.map +1 -1
- package/dist/core/classNames.js +3 -5
- package/dist/core/classNames.js.map +1 -1
- package/dist/core/composite/EmptyNotice/index.js +1 -1
- package/dist/core/composite/EmptyNotice/index.js.map +1 -1
- package/dist/core/composition/ChatWorkspace/classNames.d.ts +16 -9
- package/dist/core/composition/ChatWorkspace/classNames.d.ts.map +1 -1
- package/dist/core/composition/ChatWorkspace/classNames.js +21 -14
- package/dist/core/composition/ChatWorkspace/classNames.js.map +1 -1
- package/dist/core/composition/NavigationFeatureNav/classNames.d.ts +13 -8
- package/dist/core/composition/NavigationFeatureNav/classNames.d.ts.map +1 -1
- package/dist/core/composition/NavigationFeatureNav/classNames.js +13 -8
- package/dist/core/composition/NavigationFeatureNav/classNames.js.map +1 -1
- package/dist/core/composition/NavigationFeatureNav/index.d.ts +16 -2
- package/dist/core/composition/NavigationFeatureNav/index.d.ts.map +1 -1
- package/dist/core/composition/NavigationFeatureNav/index.js +2 -2
- package/dist/core/composition/NavigationFeatureNav/index.js.map +1 -1
- package/dist/core/composition/PrimaryRailLayout/index.d.ts +7 -1
- package/dist/core/composition/PrimaryRailLayout/index.d.ts.map +1 -1
- package/dist/core/composition/PrimaryRailLayout/index.js +1 -1
- package/dist/core/composition/PrimaryRailLayout/index.js.map +1 -1
- package/dist/core/composition/Sidebar/classNames.d.ts +11 -0
- package/dist/core/composition/Sidebar/classNames.d.ts.map +1 -0
- package/dist/core/composition/Sidebar/classNames.js +12 -0
- package/dist/core/composition/Sidebar/classNames.js.map +1 -0
- package/dist/core/composition/Sidebar/index.d.ts +7 -1
- package/dist/core/composition/Sidebar/index.d.ts.map +1 -1
- package/dist/core/composition/Sidebar/index.js +10 -9
- package/dist/core/composition/Sidebar/index.js.map +1 -1
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/primitive/Button/index.d.ts +10 -0
- package/dist/core/primitive/Button/index.d.ts.map +1 -1
- package/dist/core/primitive/Button/index.js +3 -3
- package/dist/core/primitive/Button/index.js.map +1 -1
- package/dist/core/primitive/Divider/index.js +1 -1
- package/dist/core/primitive/Divider/index.js.map +1 -1
- package/dist/core/primitive/Icon/index.d.ts.map +1 -1
- package/dist/core/primitive/Icon/index.js +8 -7
- package/dist/core/primitive/Icon/index.js.map +1 -1
- package/dist/core/primitive/IconButton/index.d.ts.map +1 -1
- package/dist/core/primitive/IconButton/index.js +7 -5
- package/dist/core/primitive/IconButton/index.js.map +1 -1
- package/dist/core/primitive/IconTile/index.d.ts.map +1 -1
- package/dist/core/primitive/IconTile/index.js +7 -12
- package/dist/core/primitive/IconTile/index.js.map +1 -1
- package/dist/core/primitive/Input/index.d.ts.map +1 -1
- package/dist/core/primitive/Input/index.js +4 -4
- package/dist/core/primitive/Input/index.js.map +1 -1
- package/dist/core/primitive/Label/classNames.d.ts +10 -6
- package/dist/core/primitive/Label/classNames.d.ts.map +1 -1
- package/dist/core/primitive/Label/classNames.js +10 -6
- package/dist/core/primitive/Label/classNames.js.map +1 -1
- package/dist/core/primitive/Label/index.js +1 -1
- package/dist/core/primitive/Label/index.js.map +1 -1
- package/dist/core/primitive/PressableField/classNames.d.ts +5 -0
- package/dist/core/primitive/PressableField/classNames.d.ts.map +1 -0
- package/dist/core/primitive/PressableField/classNames.js +6 -0
- package/dist/core/primitive/PressableField/classNames.js.map +1 -0
- package/dist/core/primitive/PressableField/index.d.ts +22 -0
- package/dist/core/primitive/PressableField/index.d.ts.map +1 -0
- package/dist/core/primitive/PressableField/index.js +14 -0
- package/dist/core/primitive/PressableField/index.js.map +1 -0
- package/dist/core/primitive/Progress/index.d.ts.map +1 -1
- package/dist/core/primitive/Progress/index.js +6 -2
- package/dist/core/primitive/Progress/index.js.map +1 -1
- package/dist/core/primitive/Text/index.d.ts +8 -1
- package/dist/core/primitive/Text/index.d.ts.map +1 -1
- package/dist/core/primitive/Text/index.js +16 -20
- package/dist/core/primitive/Text/index.js.map +1 -1
- package/dist/core/primitive/TextAction/index.d.ts.map +1 -1
- package/dist/core/primitive/TextAction/index.js +24 -23
- package/dist/core/primitive/TextAction/index.js.map +1 -1
- package/dist/core/primitive/actionStyles.d.ts +10 -2
- package/dist/core/primitive/actionStyles.d.ts.map +1 -1
- package/dist/core/primitive/actionStyles.js +10 -18
- package/dist/core/primitive/actionStyles.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ProgressBar, skeletonVariants } from "@heroui/react";
|
|
3
|
+
/**
|
|
4
|
+
* Fluid width and the resting bar's height are SHIPPED by `.starci-core-progress` in
|
|
5
|
+
* `src/common/styles.css`, keyed by `data-loading`.
|
|
6
|
+
*/
|
|
3
7
|
const SKELETON_CLASS_NAME = skeletonVariants({ animationType: "shimmer" }).base({
|
|
4
|
-
className: "
|
|
8
|
+
className: "starci-core-progress",
|
|
5
9
|
});
|
|
6
10
|
/** Accessible, full-width completion bar with an inert initial-loading shape. */
|
|
7
11
|
export const Progress = ({ label, value = 0, isSkeleton = false }) => {
|
|
8
12
|
if (isSkeleton) {
|
|
9
13
|
return (_jsx("span", { "data-tier": "atom", "data-component": "Progress", "data-loading": "true", "aria-hidden": true, "data-contract": "MEASURE-2", className: SKELETON_CLASS_NAME }));
|
|
10
14
|
}
|
|
11
|
-
return (_jsx(ProgressBar, { "data-tier": "atom", "data-component": "Progress", "data-loading": "false", "aria-label": label, value: value, minValue: 0, maxValue: 100, color: "accent", size: "sm", "data-contract": "MEASURE-2", className: "
|
|
15
|
+
return (_jsx(ProgressBar, { "data-tier": "atom", "data-component": "Progress", "data-loading": "false", "aria-label": label, value: value, minValue: 0, maxValue: 100, color: "accent", size: "sm", "data-contract": "MEASURE-2", className: "starci-core-progress", children: _jsx(ProgressBar.Track, { children: _jsx(ProgressBar.Fill, {}) }) }));
|
|
12
16
|
};
|
|
13
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/primitive/Progress/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAW7D,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC;IAC5E,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/primitive/Progress/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAW7D;;;GAGG;AACH,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC;IAC5E,SAAS,EAAE,sBAAsB;CACpC,CAAC,CAAA;AAEF,iFAAiF;AACjF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,UAAU,GAAG,KAAK,EAAiB,EAAE,EAAE;IAChF,IAAI,UAAU,EAAE,CAAC;QACb,OAAO,CACH,4BACc,MAAM,oBACD,UAAU,kBACZ,MAAM,wCAIL,WAAW,EACzB,SAAS,EAAE,mBAAmB,GAChC,CACL,CAAA;IACL,CAAC;IAED,OAAO,CACH,KAAC,WAAW,iBACE,MAAM,oBACD,UAAU,kBACZ,OAAO,gBACR,KAAK,EACjB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,KAAK,EAAC,QAAQ,EACd,IAAI,EAAC,IAAI,mBAEK,WAAW,EACzB,SAAS,EAAC,sBAAsB,YAEhC,KAAC,WAAW,CAAC,KAAK,cACd,KAAC,WAAW,CAAC,IAAI,KAAG,GACJ,GACV,CACjB,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -4,6 +4,7 @@ export type TextTone = "default" | "muted" | "accent";
|
|
|
4
4
|
export type TextSize = "xs" | "sm" | "md" | "metric-lead";
|
|
5
5
|
export type TextWeight = "normal" | "medium" | "semibold";
|
|
6
6
|
export type TextLive = "off" | "polite" | "assertive";
|
|
7
|
+
export type TextOverflow = "wrap" | "truncate" | "clamp-2";
|
|
7
8
|
export type TextProps = {
|
|
8
9
|
/** Select the semantic line owner without exposing styling hooks. */
|
|
9
10
|
readonly as?: TextAs;
|
|
@@ -15,11 +16,17 @@ export type TextProps = {
|
|
|
15
16
|
readonly tone?: TextTone;
|
|
16
17
|
readonly weight?: TextWeight;
|
|
17
18
|
readonly live?: TextLive;
|
|
19
|
+
/**
|
|
20
|
+
* How the line answers copy longer than its box: wrap it, cut it with an ellipsis, or clamp it
|
|
21
|
+
* to two lines. Shipped by `.starci-core-text[data-overflow]`, so no consumer has to reach
|
|
22
|
+
* through the boundary with a descendant selector on `[data-size]` to force one.
|
|
23
|
+
*/
|
|
24
|
+
readonly overflow?: TextOverflow;
|
|
18
25
|
readonly isSkeleton?: boolean;
|
|
19
26
|
readonly isSuperseded?: boolean;
|
|
20
27
|
/** Opt into the shared selected-parent accent treatment. */
|
|
21
28
|
readonly parentEmphasis?: "accent-soft";
|
|
22
29
|
};
|
|
23
30
|
/** One resolved line of copy with explicit semantics, hierarchy and announcement behavior. */
|
|
24
|
-
export declare const Text: ({ as: Element, id, children, startContent, size, tone, weight, live, isSkeleton, isSuperseded, parentEmphasis, }: TextProps) => import("react").JSX.Element;
|
|
31
|
+
export declare const Text: ({ as: Element, id, children, startContent, size, tone, weight, live, overflow, isSkeleton, isSuperseded, parentEmphasis, }: TextProps) => import("react").JSX.Element;
|
|
25
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/primitive/Text/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,CAAA;AACzC,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;AACrD,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,aAAa,CAAA;AACzD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAA;AACzD,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/primitive/Text/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,CAAA;AACzC,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;AACrD,MAAM,MAAM,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-
|
|
4
|
+
/**
|
|
5
|
+
* Copy geometry and paint are SHIPPED.
|
|
6
|
+
*
|
|
7
|
+
* `.starci-core-text` in `src/common/styles.css` reads the `data-size`, `data-tone`, `data-weight`,
|
|
8
|
+
* `data-start-content`, `data-superseded`, `data-parent-emphasis` and `data-loading` attributes this
|
|
9
|
+
* element already emits, so a consumer gets the scale without scanning this package with Tailwind.
|
|
10
|
+
*/
|
|
11
|
+
const TEXT_CLASS_NAME = "starci-core-text";
|
|
5
12
|
const FONT_RULE_BY_SIZE = {
|
|
6
13
|
xs: "FONT-1",
|
|
7
14
|
sm: "FONT-2",
|
|
@@ -17,8 +24,8 @@ const TONE_RULE_BY_RESOLVED_TONE = {
|
|
|
17
24
|
* Rule ids this element can claim from its resolved size and tone.
|
|
18
25
|
* `size` selects the exact scale row in font.md `## Scale` (FONT-1/2/3/5); the
|
|
19
26
|
* resolved tone (forced `muted` at `size="xs"`) selects the exact row in
|
|
20
|
-
* tone.md `## Scale` (TONE-1/2/3).
|
|
21
|
-
* shown, matching the `Text` with `startContent` row in gap.md's
|
|
27
|
+
* tone.md `## Scale` (TONE-1/2/3). the 0.5rem inline gap fires only while `startContent`
|
|
28
|
+
* is shown, matching the `Text` with `startContent` row in gap.md's
|
|
22
29
|
* "Gaps Common already owns" table (GAP-2). Weight classes (`font-medium`,
|
|
23
30
|
* `font-semibold`) and the `parentEmphasis` accent-soft variant carry no rule
|
|
24
31
|
* id here and stay unclaimed.
|
|
@@ -34,24 +41,13 @@ const getTextContract = (size, resolvedTone, showsStartContent) => {
|
|
|
34
41
|
* `text-transparent`, so no tone is actually visible to claim.
|
|
35
42
|
*/
|
|
36
43
|
const getTextSkeletonContract = (size) => FONT_RULE_BY_SIZE[size];
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}),
|
|
41
|
-
sm: skeletonVariants({ animationType: "shimmer" }).base({
|
|
42
|
-
className: "inline-block w-12 select-none rounded text-sm leading-5 text-transparent",
|
|
43
|
-
}),
|
|
44
|
-
md: skeletonVariants({ animationType: "shimmer" }).base({
|
|
45
|
-
className: "inline-block w-40 max-w-full select-none rounded text-base leading-6 text-transparent",
|
|
46
|
-
}),
|
|
47
|
-
"metric-lead": skeletonVariants({ animationType: "shimmer" }).base({
|
|
48
|
-
className: "inline-block w-40 max-w-full select-none rounded text-3xl leading-9 text-transparent",
|
|
49
|
-
}),
|
|
50
|
-
};
|
|
44
|
+
const SKELETON_CLASS_NAME = skeletonVariants({ animationType: "shimmer" }).base({
|
|
45
|
+
className: TEXT_CLASS_NAME,
|
|
46
|
+
});
|
|
51
47
|
/** One resolved line of copy with explicit semantics, hierarchy and announcement behavior. */
|
|
52
|
-
export const Text = ({ as: Element = "div", id, children, startContent, size = "md", tone, weight = "normal", live = "off", isSkeleton = false, isSuperseded = false, parentEmphasis, }) => {
|
|
48
|
+
export const Text = ({ as: Element = "div", id, children, startContent, size = "md", tone, weight = "normal", live = "off", overflow, isSkeleton = false, isSuperseded = false, parentEmphasis, }) => {
|
|
53
49
|
const resolvedTone = size === "xs" ? "muted" : tone ?? "default";
|
|
54
50
|
const showsStartContent = startContent != null && !isSkeleton;
|
|
55
|
-
return (_jsxs(Element, { id: id, "data-tier": "atom", "data-component": "Text", "data-size": size, "data-tone": resolvedTone, "data-weight": weight, "data-start-content": showsStartContent ? "true" : "false", "data-superseded": isSuperseded ? "true" : "false", "data-parent-emphasis": parentEmphasis, "data-live": live, "data-loading": isSkeleton ? "true" : "false", "data-contract": isSkeleton ? getTextSkeletonContract(size) : getTextContract(size, resolvedTone, showsStartContent), role: isSkeleton ? undefined : LIVE_ROLES[live], "aria-live": isSkeleton || live === "off" ? undefined : live, "aria-hidden": isSkeleton || undefined, className: isSkeleton ?
|
|
51
|
+
return (_jsxs(Element, { id: id, "data-tier": "atom", "data-component": "Text", "data-size": size, "data-tone": resolvedTone, "data-weight": weight, "data-start-content": showsStartContent ? "true" : "false", "data-superseded": isSuperseded ? "true" : "false", "data-parent-emphasis": parentEmphasis, "data-live": live, "data-overflow": overflow, "data-loading": isSkeleton ? "true" : "false", "data-contract": isSkeleton ? getTextSkeletonContract(size) : getTextContract(size, resolvedTone, showsStartContent), role: isSkeleton ? undefined : LIVE_ROLES[live], "aria-live": isSkeleton || live === "off" ? undefined : live, "aria-hidden": isSkeleton || undefined, className: isSkeleton ? SKELETON_CLASS_NAME : TEXT_CLASS_NAME, children: [showsStartContent ? startContent : null, isSkeleton ? "\u00a0" : children] }));
|
|
56
52
|
};
|
|
57
53
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/primitive/Text/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/primitive/Text/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAiChD,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAW,CAAA;AAEpF;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,kBAAkB,CAAA;AAE1C,MAAM,iBAAiB,GAA6B;IAChD,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,aAAa,EAAE,QAAQ;CAC1B,CAAA;AAED,MAAM,0BAA0B,GAA6B;IACzD,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;CACnB,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,eAAe,GAAG,CAAC,IAAc,EAAE,YAAsB,EAAE,iBAA0B,EAAE,EAAE;IAC3F,MAAM,GAAG,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,0BAA0B,CAAC,YAAY,CAAC,CAAC,CAAA;IAC/E,IAAI,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C,CAAA;AA+E9E,+EAA+E;AAC/E,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,gCA8EhD,CAAA;AAED,YAAY,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,cAAc,IAAI,cAAc,EAAE,CAAA"}
|
|
@@ -4,7 +4,7 @@ import { Spinner, skeletonVariants } from "@heroui/react";
|
|
|
4
4
|
import { useRef } from "react";
|
|
5
5
|
import { getActionClassName } from "../actionStyles.js";
|
|
6
6
|
const SKELETON_CLASS_NAME = skeletonVariants({ animationType: "shimmer" }).base({
|
|
7
|
-
className: "
|
|
7
|
+
className: "starci-core-text-action-resting",
|
|
8
8
|
});
|
|
9
9
|
const FONT_RULE_BY_SIZE = {
|
|
10
10
|
xs: "FONT-1",
|
|
@@ -12,12 +12,11 @@ const FONT_RULE_BY_SIZE = {
|
|
|
12
12
|
md: "FONT-3",
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* Padding rule ids per appearance, from
|
|
16
|
-
* Each side is matched against padding.md's `## Scale` via the
|
|
17
|
-
*
|
|
18
|
-
* PADDING-
|
|
19
|
-
* inline
|
|
20
|
-
* `muted`, `disclosure` and `plain` add no inset class.
|
|
15
|
+
* Padding rule ids per appearance, from the shipped `.starci-core-text-action`
|
|
16
|
+
* appearance rules. Each side is matched against padding.md's `## Scale` via the
|
|
17
|
+
* axis-variant rule: choice is PADDING-2 inline / PADDING-1 block; route and
|
|
18
|
+
* section are PADDING-3 inline / PADDING-2 block; tab is PADDING-3 block only.
|
|
19
|
+
* `inline`, `muted`, `disclosure` and `plain` draw no inset.
|
|
21
20
|
*/
|
|
22
21
|
const PADDING_RULES_BY_APPEARANCE = {
|
|
23
22
|
choice: ["PADDING-2", "PADDING-1"],
|
|
@@ -26,11 +25,12 @@ const PADDING_RULES_BY_APPEARANCE = {
|
|
|
26
25
|
tab: ["PADDING-3"],
|
|
27
26
|
};
|
|
28
27
|
/**
|
|
29
|
-
* Tone rule ids per appearance, from
|
|
30
|
-
* matched against tone.md `## Scale`. `choice`, `route` and
|
|
31
|
-
* accent-soft foreground (TONE-3) only
|
|
32
|
-
* the already-known `isCurrent` prop.
|
|
33
|
-
* which tone.md does not
|
|
28
|
+
* Tone rule ids per appearance, from the shipped `.starci-core-text-action`
|
|
29
|
+
* appearance rules, matched against tone.md `## Scale`. `choice`, `route` and
|
|
30
|
+
* `section` swap to the accent-soft foreground (TONE-3) only at
|
|
31
|
+
* `data-current="true"`, mirrored here from the already-known `isCurrent` prop.
|
|
32
|
+
* `tab`'s current-state colour is the accent itself, which tone.md does not
|
|
33
|
+
* publish, so that state stays unclaimed.
|
|
34
34
|
*/
|
|
35
35
|
const getToneRule = (appearance, isCurrent) => {
|
|
36
36
|
switch (appearance) {
|
|
@@ -45,7 +45,7 @@ const getToneRule = (appearance, isCurrent) => {
|
|
|
45
45
|
case "route":
|
|
46
46
|
return isCurrent ? "TONE-3" : "TONE-2";
|
|
47
47
|
case "tab":
|
|
48
|
-
// Current state renders
|
|
48
|
+
// Current state renders the accent itself, which tone.md does not publish.
|
|
49
49
|
return isCurrent ? undefined : "TONE-2";
|
|
50
50
|
case "disclosure":
|
|
51
51
|
return "TONE-3";
|
|
@@ -53,17 +53,17 @@ const getToneRule = (appearance, isCurrent) => {
|
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
55
|
* Rule ids this element can claim from actionStyles.ts's shared recipe.
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
56
|
+
* The always-present 0.5rem gap matches gap.md's scale directly (GAP-2), and the
|
|
57
|
+
* content width matches measure.md's MEASURE-3 (Content width) catalog entry.
|
|
58
|
+
* Size selects the FONT-1/2/3 row. Appearance (with `isCurrent`) selects the tone
|
|
59
|
+
* row and any padding rows. Medium/semibold weight, the pill and section corners,
|
|
60
|
+
* and the `tab` underline/border carry no rule id in their topic files and stay
|
|
61
|
+
* unclaimed.
|
|
62
62
|
*/
|
|
63
63
|
/**
|
|
64
|
-
* `choice`, `route` and `section` swap to
|
|
65
|
-
* pairing with the same
|
|
66
|
-
* surface.md's SURFACE-4 catalog entry exactly.
|
|
64
|
+
* `choice`, `route` and `section` swap to the accent-soft surface only at
|
|
65
|
+
* `data-current="true"`, pairing with the same accent-soft foreground as TONE-3.
|
|
66
|
+
* That pair matches surface.md's SURFACE-4 catalog entry exactly.
|
|
67
67
|
*/
|
|
68
68
|
const CURRENT_SURFACE_APPEARANCES = new Set(["choice", "route", "section"]);
|
|
69
69
|
const getActionContract = (appearance, size, isCurrent) => {
|
|
@@ -91,8 +91,9 @@ export const TextAction = (props) => {
|
|
|
91
91
|
"data-current": isCurrent ? "true" : "false",
|
|
92
92
|
"data-action-pending": isPending ? "true" : "false",
|
|
93
93
|
"aria-busy": isPending || undefined,
|
|
94
|
+
"data-size": size,
|
|
94
95
|
"data-contract": getActionContract(appearance, size, isCurrent),
|
|
95
|
-
className: getActionClassName(
|
|
96
|
+
className: getActionClassName(),
|
|
96
97
|
};
|
|
97
98
|
const content = (_jsxs(_Fragment, { children: [isPending ? _jsx(Spinner, { size: "sm", color: "current", "aria-hidden": "true" }) : startContent, _jsx("span", { children: children }), isPending ? null : endContent] }));
|
|
98
99
|
if (props.href !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/primitive/TextAction/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAA8C,MAAM,oBAAoB,CAAA;AA6CnG,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC;IAC5E,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRo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AC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC9E,OAAO,EAAE,KAAK,YAEb,OAAO,GACH,CACZ,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export type ActionAppearance = "inline" | "muted" | "choice" | "route" | "tab" | "section" | "disclosure" | "plain";
|
|
2
2
|
export type ActionTextSize = "xs" | "sm" | "md";
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* One typography/selection recipe shared by native links and text-styled actions.
|
|
5
|
+
*
|
|
6
|
+
* The recipe itself is SHIPPED: `.starci-core-text-action` in `src/common/styles.css` reads
|
|
7
|
+
* `data-appearance`, `data-size` and `data-current` from the element, so every appearance - its
|
|
8
|
+
* scale, corner, inset, tone and current-state surface - exists without a consumer's Tailwind build
|
|
9
|
+
* scanning this package. `group` stays here as the marker a descendant `Text` selects its
|
|
10
|
+
* selected-parent accent through; it is a hook, not a utility, and emits nothing on its own.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getActionClassName: () => string;
|
|
5
13
|
//# sourceMappingURL=actionStyles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionStyles.d.ts","sourceRoot":"","sources":["../../../src/core/primitive/actionStyles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actionStyles.d.ts","sourceRoot":"","sources":["../../../src/core/primitive/actionStyles.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG,YAAY,GAAG,OAAO,CAAA;AACnH,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAE/C;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,cAAwC,CAAA"}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
route: "rounded-full px-3 py-2 text-muted data-[current=true]:bg-accent-soft data-[current=true]:font-semibold data-[current=true]:text-accent-soft-foreground",
|
|
12
|
-
tab: "border-b-2 border-transparent py-3 text-muted data-[current=true]:border-accent data-[current=true]:font-semibold data-[current=true]:text-accent",
|
|
13
|
-
section: "rounded-large px-3 py-2 text-foreground hover:bg-default focus-visible:bg-default data-[current=true]:bg-accent-soft data-[current=true]:font-semibold data-[current=true]:text-accent-soft-foreground",
|
|
14
|
-
disclosure: "font-semibold text-accent-soft-foreground underline-offset-4 hover:underline focus-visible:underline",
|
|
15
|
-
plain: "text-foreground no-underline",
|
|
16
|
-
};
|
|
17
|
-
/** One typography/selection recipe shared by native links and text-styled actions. */
|
|
18
|
-
export const getActionClassName = (appearance, size) => cn("group inline-flex w-fit min-w-0 shrink-0 items-center gap-2 outline-none", "disabled:cursor-default disabled:opacity-50", SIZE_CLASS_NAMES[size], APPEARANCE_CLASS_NAMES[appearance]);
|
|
1
|
+
/**
|
|
2
|
+
* One typography/selection recipe shared by native links and text-styled actions.
|
|
3
|
+
*
|
|
4
|
+
* The recipe itself is SHIPPED: `.starci-core-text-action` in `src/common/styles.css` reads
|
|
5
|
+
* `data-appearance`, `data-size` and `data-current` from the element, so every appearance - its
|
|
6
|
+
* scale, corner, inset, tone and current-state surface - exists without a consumer's Tailwind build
|
|
7
|
+
* scanning this package. `group` stays here as the marker a descendant `Text` selects its
|
|
8
|
+
* selected-parent accent through; it is a hook, not a utility, and emits nothing on its own.
|
|
9
|
+
*/
|
|
10
|
+
export const getActionClassName = () => "group starci-core-text-action";
|
|
19
11
|
//# sourceMappingURL=actionStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionStyles.js","sourceRoot":"","sources":["../../../src/core/primitive/actionStyles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actionStyles.js","sourceRoot":"","sources":["../../../src/core/primitive/actionStyles.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,+BAA+B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starci/grammar",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Reusable StarCi React components, compositions, and packaged visual DNA.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"starci",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "node scripts/clean.mjs && tsc -p tsconfig.build.json && node scripts/copy-css.mjs",
|
|
57
57
|
"typecheck": "tsc -p tsconfig.build.json --noEmit",
|
|
58
|
-
"test": "npm run build && node --test src/common/index.test.mjs src/core/index.test.mjs src/package-boundary.test.mjs && vitest run --config vitest.config.ts src/common/conformance.spec.ts src/common/styles.spec.ts src/core/family.spec.tsx src/core/styles.spec.ts src/core/surface-card-family.spec.tsx src/core/scrollable-surfaces.spec.tsx src/core/primitive/Badge/index.spec.tsx src/core/primitive/Button/index.spec.tsx src/core/primitive/Divider/index.spec.tsx src/core/primitive/Heading/index.spec.tsx src/core/primitive/Icon/index.spec.tsx src/core/primitive/IconButton/index.spec.tsx src/core/primitive/IconTile/index.spec.tsx src/core/primitive/Input/index.spec.tsx src/core/primitive/Progress/index.spec.tsx src/core/primitive/Text/index.spec.tsx src/core/primitive/TextAction/index.spec.tsx src/core/primitive/Label/index.spec.tsx src/core/primitive/RankArtwork/index.spec.tsx src/core/composite/EmptyNotice/index.spec.tsx src/core/branch/Tabs/index.spec.tsx src/core/branch/Subnav/index.spec.tsx src/core/branch/Tooltip/index.spec.tsx src/core/composition/NavigationFeatureNav/index.spec.tsx src/core/composition/NavigationFeatureNav/styles.spec.ts src/core/composition/Sidebar/index.spec.tsx src/core/composition/WorkspaceShell/index.spec.tsx src/core/composition/ChatWorkspace/index.spec.tsx src/heritage/index.spec.tsx src/heritage/styles.spec.ts src/offset-pop/index.spec.tsx src/offset-pop/render.spec.tsx src/offset-pop/styles.spec.ts",
|
|
58
|
+
"test": "npm run build && node --test src/common/index.test.mjs src/core/index.test.mjs src/package-boundary.test.mjs && vitest run --config vitest.config.ts src/shipped-geometry.spec.ts src/core/shipped-claims.spec.tsx src/common/conformance.spec.ts src/common/styles.spec.ts src/core/family.spec.tsx src/core/styles.spec.ts src/core/surface-card-family.spec.tsx src/core/scrollable-surfaces.spec.tsx src/core/primitive/Badge/index.spec.tsx src/core/primitive/Button/index.spec.tsx src/core/primitive/Divider/index.spec.tsx src/core/primitive/Heading/index.spec.tsx src/core/primitive/Icon/index.spec.tsx src/core/primitive/IconButton/index.spec.tsx src/core/primitive/IconTile/index.spec.tsx src/core/primitive/Input/index.spec.tsx src/core/primitive/PressableField/index.spec.tsx src/core/primitive/Progress/index.spec.tsx src/core/primitive/Text/index.spec.tsx src/core/primitive/TextAction/index.spec.tsx src/core/primitive/Label/index.spec.tsx src/core/primitive/RankArtwork/index.spec.tsx src/core/composite/EmptyNotice/index.spec.tsx src/core/branch/Tabs/index.spec.tsx src/core/branch/Subnav/index.spec.tsx src/core/branch/Tooltip/index.spec.tsx src/core/composition/NavigationFeatureNav/index.spec.tsx src/core/composition/NavigationFeatureNav/styles.spec.ts src/core/composition/Sidebar/index.spec.tsx src/core/composition/Sidebar/styles.spec.ts src/core/composition/WorkspaceShell/index.spec.tsx src/core/composition/ChatWorkspace/index.spec.tsx src/heritage/index.spec.tsx src/heritage/styles.spec.ts src/offset-pop/index.spec.tsx src/offset-pop/render.spec.tsx src/offset-pop/styles.spec.ts",
|
|
59
59
|
"prepack": "npm run typecheck && npm test"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|