@cueplusplus/ui 0.17.0 → 0.18.1
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/CHANGELOG.md +84 -0
- package/dist/chrome/empty-state.js +8 -4
- package/dist/chrome/navigation-menu.js +3 -2
- package/dist/chrome/panel.js +2 -1
- package/dist/chrome/row.js +4 -3
- package/dist/chrome/scroll-area.js +4 -3
- package/dist/chrome/segmented-control.js +2 -1
- package/dist/chrome/tabs.js +5 -2
- package/dist/chrome/toolbar.js +5 -3
- package/dist/color/color-field.d.ts +7 -0
- package/dist/date/_trigger.js +4 -1
- package/dist/date/calendar.js +15 -9
- package/dist/forms/_chassis.d.ts +10 -2
- package/dist/forms/_chassis.js +15 -5
- package/dist/forms/_listbox.js +18 -13
- package/dist/forms/checkbox.js +9 -6
- package/dist/forms/field.js +5 -5
- package/dist/forms/input-group.js +11 -2
- package/dist/forms/multi-select.js +4 -3
- package/dist/forms/number-field.js +6 -3
- package/dist/forms/otp-field.js +15 -6
- package/dist/forms/radio-group.js +7 -5
- package/dist/forms/select.js +8 -5
- package/dist/forms/slider.js +5 -3
- package/dist/forms/switch.js +6 -4
- package/dist/forms/tags-input.js +4 -3
- package/dist/forms/textarea.js +2 -1
- package/dist/forms/toggle-group.js +2 -1
- package/dist/forms/toggle.js +3 -1
- package/dist/instruments/meter.js +2 -1
- package/dist/instruments/progress.js +6 -3
- package/dist/instruments/stat.js +5 -3
- package/dist/instruments/table.js +3 -2
- package/dist/layout/_collapse.js +24 -8
- package/dist/layout/accordion.js +2 -1
- package/dist/layout/breadcrumb.js +8 -7
- package/dist/layout/card.js +2 -1
- package/dist/layout/collapsible.js +2 -1
- package/dist/layout/link.d.ts +14 -0
- package/dist/layout/link.js +4 -4
- package/dist/layout/pagination.js +7 -8
- package/dist/overlays/_surface.d.ts +4 -4
- package/dist/overlays/_surface.js +8 -7
- package/dist/overlays/alert-dialog.js +1 -1
- package/dist/overlays/command-palette.js +23 -8
- package/dist/overlays/dialog.js +1 -1
- package/dist/overlays/drawer.js +8 -1
- package/dist/overlays/hover-card.js +3 -1
- package/dist/overlays/popover.js +2 -1
- package/dist/overlays/toast.js +8 -4
- package/dist/overlays/tooltip.js +3 -4
- package/dist/primitives/avatar.js +6 -2
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.js +10 -7
- package/dist/primitives/chip.d.ts +1 -37
- package/dist/primitives/chip.js +14 -46
- package/dist/primitives/icon-button.d.ts +1 -1
- package/dist/primitives/kbd.js +2 -2
- package/dist/primitives/skeleton.js +2 -1
- package/dist/system/_style-accordion-rule.js +32 -0
- package/dist/system/_style-avatar.js +20 -0
- package/dist/system/_style-body-leading.js +1 -3
- package/dist/system/_style-body.js +7 -2
- package/dist/system/_style-caption-ink.js +17 -0
- package/dist/system/_style-caption-size.js +19 -0
- package/dist/system/_style-caption-weight.js +18 -0
- package/dist/system/_style-card-gap.js +14 -0
- package/dist/system/_style-cell.js +18 -0
- package/dist/system/_style-check-glyph.js +14 -0
- package/dist/system/_style-check.js +8 -1
- package/dist/system/_style-chip.js +41 -1
- package/dist/system/_style-choice-gap.js +15 -0
- package/dist/system/_style-collapse.js +81 -1
- package/dist/system/_style-control-gap.js +14 -0
- package/dist/system/_style-control-label.js +8 -1
- package/dist/system/_style-crumb.js +44 -0
- package/dist/system/_style-day.js +25 -0
- package/dist/system/_style-disabled.js +70 -0
- package/dist/system/_style-disclosure.js +21 -0
- package/dist/system/_style-empty-state.js +42 -0
- package/dist/system/_style-field-chassis.js +38 -0
- package/dist/system/_style-field-gap.js +12 -0
- package/dist/system/_style-glyph-ink.js +20 -0
- package/dist/system/_style-glyph-opacity.js +20 -0
- package/dist/system/_style-glyph-size.js +21 -0
- package/dist/system/_style-group-gap.js +15 -0
- package/dist/system/_style-group-label-pad.js +14 -0
- package/dist/system/_style-group-label.js +24 -0
- package/dist/system/_style-help.js +10 -1
- package/dist/system/_style-hover-card-width.js +15 -0
- package/dist/system/_style-kbd.js +13 -1
- package/dist/system/_style-link.js +15 -3
- package/dist/system/_style-menu.js +14 -1
- package/dist/system/_style-meter.js +15 -0
- package/dist/system/_style-nav-menu.js +48 -0
- package/dist/system/_style-option.js +61 -4
- package/dist/system/_style-otp.js +15 -0
- package/dist/system/_style-outline-hover.js +18 -0
- package/dist/system/_style-page.js +17 -0
- package/dist/system/_style-palette.js +18 -0
- package/dist/system/_style-panel.js +21 -0
- package/dist/system/_style-popover-width.js +15 -0
- package/dist/system/_style-radio.js +19 -0
- package/dist/system/_style-row-disabled.js +17 -0
- package/dist/system/_style-row.js +30 -0
- package/dist/system/_style-scrollbar.js +19 -0
- package/dist/system/_style-segment-pad.js +15 -0
- package/dist/system/_style-skeleton.js +15 -0
- package/dist/system/_style-slider.js +26 -0
- package/dist/system/_style-stat.js +31 -0
- package/dist/system/_style-stepper.js +16 -0
- package/dist/system/_style-switch.js +26 -0
- package/dist/system/_style-tab-hover.js +15 -0
- package/dist/system/_style-text-focus.js +26 -0
- package/dist/system/_style-toast.js +22 -0
- package/dist/system/_style-toggle.js +50 -0
- package/dist/system/_style-toolbar.js +23 -0
- package/dist/system/_style-tooltip.js +30 -1
- package/manifest/components/accordion.json +22 -1
- package/manifest/components/alert-dialog.json +7 -0
- package/manifest/components/app-bar.json +42 -0
- package/manifest/components/autocomplete.json +48 -1
- package/manifest/components/avatar-group.json +7 -0
- package/manifest/components/avatar.json +7 -0
- package/manifest/components/breadcrumb.json +7 -2
- package/manifest/components/button.json +16 -1
- package/manifest/components/calendar.json +6 -0
- package/manifest/components/card.json +1 -0
- package/manifest/components/channel-matrix.json +6 -0
- package/manifest/components/chart-tooltip-content.json +6 -0
- package/manifest/components/checkbox-group.json +22 -1
- package/manifest/components/checkbox.json +22 -1
- package/manifest/components/chip.json +6 -0
- package/manifest/components/collapsible.json +22 -0
- package/manifest/components/color-field.json +29 -0
- package/manifest/components/color-picker.json +19 -0
- package/manifest/components/combobox.json +48 -1
- package/manifest/components/command-palette.json +11 -0
- package/manifest/components/composer.json +19 -0
- package/manifest/components/context-menu.json +6 -0
- package/manifest/components/date-field.json +18 -0
- package/manifest/components/date-picker.json +22 -0
- package/manifest/components/date-range-picker.json +22 -0
- package/manifest/components/dialog.json +7 -0
- package/manifest/components/disclosure.json +22 -0
- package/manifest/components/dmx-bar.json +6 -0
- package/manifest/components/dmx-strip.json +6 -0
- package/manifest/components/drawer.json +7 -0
- package/manifest/components/dropdown-menu.json +6 -0
- package/manifest/components/empty-state.json +13 -0
- package/manifest/components/env-var-input.json +19 -0
- package/manifest/components/field-description.json +2 -1
- package/manifest/components/field-error.json +2 -1
- package/manifest/components/field-label.json +2 -1
- package/manifest/components/field.json +2 -1
- package/manifest/components/hover-card.json +8 -0
- package/manifest/components/input-group.json +21 -0
- package/manifest/components/input.json +19 -0
- package/manifest/components/kbd.json +2 -0
- package/manifest/components/link.json +23 -0
- package/manifest/components/menubar.json +6 -0
- package/manifest/components/meter.json +1 -0
- package/manifest/components/multi-select.json +49 -1
- package/manifest/components/musical-time-input.json +19 -0
- package/manifest/components/navigation-menu.json +16 -0
- package/manifest/components/number-field.json +21 -0
- package/manifest/components/otp-field.json +20 -0
- package/manifest/components/pagination.json +19 -0
- package/manifest/components/panel-header.json +3 -0
- package/manifest/components/panel.json +3 -0
- package/manifest/components/password-input.json +19 -0
- package/manifest/components/popover.json +7 -0
- package/manifest/components/progress.json +4 -0
- package/manifest/components/radio-group.json +6 -0
- package/manifest/components/radio.json +6 -0
- package/manifest/components/row.json +3 -0
- package/manifest/components/scroll-area.json +3 -1
- package/manifest/components/scrollable-tabs-list.json +3 -0
- package/manifest/components/scrub-input.json +19 -0
- package/manifest/components/seam-list.json +3 -0
- package/manifest/components/search-input.json +19 -0
- package/manifest/components/segmented-control.json +1 -0
- package/manifest/components/select.json +25 -0
- package/manifest/components/sheet.json +6 -0
- package/manifest/components/skeleton.json +2 -0
- package/manifest/components/slider.json +8 -0
- package/manifest/components/stat.json +8 -0
- package/manifest/components/switch.json +22 -0
- package/manifest/components/table-scroll-region.json +2 -0
- package/manifest/components/table.json +2 -0
- package/manifest/components/tabs.json +3 -0
- package/manifest/components/tags-input.json +49 -1
- package/manifest/components/textarea.json +19 -0
- package/manifest/components/theme-configurator.json +6 -0
- package/manifest/components/time-field.json +18 -0
- package/manifest/components/toast.json +9 -0
- package/manifest/components/toggle-group.json +2 -1
- package/manifest/components/toggle.json +28 -0
- package/manifest/components/toolbar.json +19 -0
- package/manifest/components/tooltip.json +11 -0
- package/manifest/fixtures.json +45 -0
- package/manifest/manifest.json +84 -84
- package/manifest/tokens.json +155 -1
- package/package.json +5 -5
|
@@ -3,10 +3,13 @@ import { cn } from "../lib/cn.js";
|
|
|
3
3
|
import { FOCUS_RING_PAINT } from "../system/_focus-ring.js";
|
|
4
4
|
import { CONTROL_FACE } from "../system/_style-control-face.js";
|
|
5
5
|
import { REST_SHADE_CLASS } from "../system/_paint-rest-shade.js";
|
|
6
|
+
import { DISABLED_OPACITY, DISABLED_TONES } from "../system/_style-disabled.js";
|
|
6
7
|
import { cva } from "../lib/cva.js";
|
|
7
8
|
import { CONTROL_STEP_SIZE_LG } from "../system/_style-control-step.js";
|
|
8
9
|
import { GLOW_CLASSES, GLOW_DANGER_CLASSES } from "../system/_paint-glow.js";
|
|
9
10
|
import { CONTROL_CASE, CONTROL_PAD_LG, CONTROL_PAD_MD, CONTROL_PAD_SM, CONTROL_TRACKING, CONTROL_TRIM, CONTROL_WEIGHT, GHOST_INK, OUTLINE_EDGE, OUTLINE_INK, SECONDARY_EDGE, SECONDARY_GROUND, SECONDARY_INK } from "../system/_style-control.js";
|
|
11
|
+
import { CONTROL_GAP } from "../system/_style-control-gap.js";
|
|
12
|
+
import { OUTLINE_HOVER_EDGE, OUTLINE_HOVER_GROUND } from "../system/_style-outline-hover.js";
|
|
10
13
|
import * as React from "react";
|
|
11
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
15
|
import { useRender } from "@base-ui/react/use-render";
|
|
@@ -35,7 +38,7 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
35
38
|
*
|
|
36
39
|
* @internal Not part of the public API; imported by `icon-button.tsx`.
|
|
37
40
|
*/
|
|
38
|
-
const buttonChassis = `inline-flex select-none items-center justify-center
|
|
41
|
+
const buttonChassis = `inline-flex select-none items-center justify-center ${CONTROL_GAP} whitespace-nowrap rounded-control ${CONTROL_FACE} ${CONTROL_WEIGHT} ${CONTROL_TRACKING} ${CONTROL_TRIM} ${CONTROL_CASE} transition-colors duration-150 outline-none ${FOCUS_RING_PAINT} focus-visible:outline-offset-[var(--cue-style-focus-offset,1px)] disabled:pointer-events-none ${DISABLED_OPACITY}`;
|
|
39
42
|
/**
|
|
40
43
|
* The shared colour vocabulary. `accent` is theme-controlled, so `primary`
|
|
41
44
|
* reads as white-on-black in `cue` and cyan-on-near-black in `terminal` with no
|
|
@@ -54,12 +57,12 @@ const buttonChassis = `inline-flex select-none items-center justify-center gap-[
|
|
|
54
57
|
* @internal Not part of the public API; imported by `icon-button.tsx`.
|
|
55
58
|
*/
|
|
56
59
|
const buttonTones = {
|
|
57
|
-
primary: `bg-accent-fill text-accent-fill-fg hover:bg-accent-fill-hover border border-transparent ${GLOW_CLASSES}`,
|
|
58
|
-
secondary: `border ${SECONDARY_EDGE} ${SECONDARY_INK} hover:text-[color:var(--cue-style-secondary-hover-ink,var(--cue-fg))] hover:border-[color:var(--cue-style-secondary-hover-edge,var(--cue-border-strong))] ${SECONDARY_GROUND}`,
|
|
59
|
-
ghost: `${GHOST_INK} hover:text-fg hover:bg-surface-2 border border-transparent`,
|
|
60
|
-
outline: `border ${OUTLINE_EDGE} ${OUTLINE_INK}
|
|
61
|
-
danger: `bg-danger text-danger-fg hover:opacity-90 border border-transparent ${GLOW_DANGER_CLASSES}`,
|
|
62
|
-
"danger-outline":
|
|
60
|
+
primary: `bg-accent-fill text-accent-fill-fg hover:bg-accent-fill-hover border border-transparent ${GLOW_CLASSES} ${DISABLED_TONES.primary}`,
|
|
61
|
+
secondary: `border ${SECONDARY_EDGE} ${SECONDARY_INK} hover:text-[color:var(--cue-style-secondary-hover-ink,var(--cue-fg))] hover:border-[color:var(--cue-style-secondary-hover-edge,var(--cue-border-strong))] ${SECONDARY_GROUND} hover:bg-[color:var(--cue-style-secondary-hover-ground,var(--cue-style-secondary-ground,var(--cue-surface-2)))] ${DISABLED_TONES.secondary}`,
|
|
62
|
+
ghost: `${GHOST_INK} hover:text-fg hover:bg-surface-2 border border-transparent ${DISABLED_TONES.ghost}`,
|
|
63
|
+
outline: `border ${OUTLINE_EDGE} ${OUTLINE_INK} ${OUTLINE_HOVER_EDGE} hover:text-accent bg-transparent ${OUTLINE_HOVER_GROUND} ${REST_SHADE_CLASS} ${DISABLED_TONES.outline}`,
|
|
64
|
+
danger: `bg-danger text-danger-fg hover:opacity-90 border border-transparent ${GLOW_DANGER_CLASSES} ${DISABLED_TONES.danger}`,
|
|
65
|
+
"danger-outline": `border text-danger bg-transparent hover:bg-danger/10 border-danger/40 ${DISABLED_TONES["danger-outline"]}`
|
|
63
66
|
};
|
|
64
67
|
/**
|
|
65
68
|
* The `Button` class recipe, exported so other surfaces (a link that must look
|
|
@@ -1,44 +1,8 @@
|
|
|
1
1
|
import { ClassProp, VariantProps } from "../lib/cva.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
//#region src/primitives/chip.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* The tinted-chip recipe: `bg-<tone>/10 border-<tone>/35 text-<tone>`, and the
|
|
6
|
-
* two quieter readings of it — `outline`, which drops the fill, and `tag`,
|
|
7
|
-
* which drops the fill and the voice with it.
|
|
8
|
-
*
|
|
9
|
-
* Every property that varies is emitted from exactly one place: one rim, one
|
|
10
|
-
* ink, one fill, one gutter, one type size, always. Emitting `bg-<tone>/10`
|
|
11
|
-
* from the tone map and then cancelling it with `bg-transparent` would leave
|
|
12
|
-
* two competing utilities in the class string, and `chipVariants` is exported —
|
|
13
|
-
* a caller who uses it without `cn` gets a raw string where the winner is
|
|
14
|
-
* decided by stylesheet order rather than by which utility was written last.
|
|
15
|
-
* `h-chip h-4` proves the point at the other end: `tailwind-merge` cannot even
|
|
16
|
-
* see that as a conflict, because `chip` is a token name and not a scale step.
|
|
17
|
-
* So nothing here cancels anything. What varies moves into `variants` or
|
|
18
|
-
* `compoundVariants` until only one of it is ever emitted.
|
|
19
|
-
*
|
|
20
|
-
* That is why `neutral` carries no rim of its own. The other six tones rim
|
|
21
|
-
* themselves at `/35` in all three variants, but the neutral line has two
|
|
22
|
-
* weights in this system: `--cue-border` is a box edge, and a chip is a box;
|
|
23
|
-
* `--cue-hair-strong` is the rule between things, and a tag is a mark on the
|
|
24
|
-
* page rather than a container. The rim is therefore a compound of tone and
|
|
25
|
-
* variant, exactly as the fill is.
|
|
26
|
-
*
|
|
27
|
-
* **The recipe reads the style set** (spec 2026-09-26-looks-fidelity §3.6,
|
|
28
|
-
* `system/_style-chip.ts`): the six tones' fill and rim are
|
|
29
|
-
* `color-mix(in oklab, var(--cue-<tone>) var(--cue-style-chip-fill, 10%), transparent)`
|
|
30
|
-
* and the same with `--cue-style-chip-edge` at `35%` — exactly `bg-<tone>/10`
|
|
31
|
-
* and `border-<tone>/35` under no set, and a set's own shares inside one. The
|
|
32
|
-
* case, tracking, radius, size and weight read `--cue-style-chip-case`,
|
|
33
|
-
* `-tracking`, `-radius`, `-size` and `--cue-style-label-weight` the same way.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* <span className={chipVariants({ tone: "danger", variant: "outline" })}>fault</span>
|
|
37
|
-
* @example
|
|
38
|
-
* <span className={chipVariants({ variant: "tag" })}>mcp</span>
|
|
39
|
-
*/
|
|
40
4
|
declare const chipVariants: (props?: ({
|
|
41
|
-
tone?: "
|
|
5
|
+
tone?: "info" | "warn" | "danger" | "accent" | "ok" | "busy" | "neutral" | null | undefined;
|
|
42
6
|
variant?: "outline" | "tinted" | "tag" | null | undefined;
|
|
43
7
|
interactive?: boolean | null | undefined;
|
|
44
8
|
} & ClassProp) | undefined) => string;
|
package/dist/primitives/chip.js
CHANGED
|
@@ -2,52 +2,15 @@
|
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { FOCUS_RING } from "../system/_focus-ring.js";
|
|
4
4
|
import { cva } from "../lib/cva.js";
|
|
5
|
-
import { CHIP_CASE, CHIP_EDGE, CHIP_FILL, CHIP_HEIGHT, CHIP_PAD, CHIP_RADIUS, CHIP_SIZE, CHIP_SIZE_MICRO, CHIP_TRACKING, CHIP_TRACKING_TAG } from "../system/_style-chip.js";
|
|
5
|
+
import { CHIP_CASE, CHIP_EDGE, CHIP_FILL, CHIP_GAP, CHIP_HEIGHT, CHIP_INK_NEUTRAL, CHIP_LEADING, CHIP_LEADING_INHERIT, CHIP_PAD, CHIP_RADIUS, CHIP_SIZE, CHIP_SIZE_MICRO, CHIP_TRACKING, CHIP_TRACKING_TAG, TAG_EDGE, TAG_PAD } from "../system/_style-chip.js";
|
|
6
6
|
import { LABEL_FACE } from "../system/_style-label-face.js";
|
|
7
7
|
import { LABEL_WEIGHT } from "../system/_style-label-weight.js";
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The tinted-chip recipe: `bg-<tone>/10 border-<tone>/35 text-<tone>`, and the
|
|
13
|
-
* two quieter readings of it — `outline`, which drops the fill, and `tag`,
|
|
14
|
-
* which drops the fill and the voice with it.
|
|
15
|
-
*
|
|
16
|
-
* Every property that varies is emitted from exactly one place: one rim, one
|
|
17
|
-
* ink, one fill, one gutter, one type size, always. Emitting `bg-<tone>/10`
|
|
18
|
-
* from the tone map and then cancelling it with `bg-transparent` would leave
|
|
19
|
-
* two competing utilities in the class string, and `chipVariants` is exported —
|
|
20
|
-
* a caller who uses it without `cn` gets a raw string where the winner is
|
|
21
|
-
* decided by stylesheet order rather than by which utility was written last.
|
|
22
|
-
* `h-chip h-4` proves the point at the other end: `tailwind-merge` cannot even
|
|
23
|
-
* see that as a conflict, because `chip` is a token name and not a scale step.
|
|
24
|
-
* So nothing here cancels anything. What varies moves into `variants` or
|
|
25
|
-
* `compoundVariants` until only one of it is ever emitted.
|
|
26
|
-
*
|
|
27
|
-
* That is why `neutral` carries no rim of its own. The other six tones rim
|
|
28
|
-
* themselves at `/35` in all three variants, but the neutral line has two
|
|
29
|
-
* weights in this system: `--cue-border` is a box edge, and a chip is a box;
|
|
30
|
-
* `--cue-hair-strong` is the rule between things, and a tag is a mark on the
|
|
31
|
-
* page rather than a container. The rim is therefore a compound of tone and
|
|
32
|
-
* variant, exactly as the fill is.
|
|
33
|
-
*
|
|
34
|
-
* **The recipe reads the style set** (spec 2026-09-26-looks-fidelity §3.6,
|
|
35
|
-
* `system/_style-chip.ts`): the six tones' fill and rim are
|
|
36
|
-
* `color-mix(in oklab, var(--cue-<tone>) var(--cue-style-chip-fill, 10%), transparent)`
|
|
37
|
-
* and the same with `--cue-style-chip-edge` at `35%` — exactly `bg-<tone>/10`
|
|
38
|
-
* and `border-<tone>/35` under no set, and a set's own shares inside one. The
|
|
39
|
-
* case, tracking, radius, size and weight read `--cue-style-chip-case`,
|
|
40
|
-
* `-tracking`, `-radius`, `-size` and `--cue-style-label-weight` the same way.
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* <span className={chipVariants({ tone: "danger", variant: "outline" })}>fault</span>
|
|
44
|
-
* @example
|
|
45
|
-
* <span className={chipVariants({ variant: "tag" })}>mcp</span>
|
|
46
|
-
*/
|
|
47
|
-
const chipVariants = cva(`inline-flex ${CHIP_HEIGHT} select-none items-center justify-center gap-(--cue-space-2) whitespace-nowrap ${CHIP_RADIUS} border ${LABEL_FACE} ${LABEL_WEIGHT} leading-none ${CHIP_CASE} outline-none ${FOCUS_RING}`, {
|
|
10
|
+
const chipVariants = cva(`inline-flex ${CHIP_HEIGHT} select-none items-center justify-center ${CHIP_GAP} whitespace-nowrap ${CHIP_RADIUS} border ${LABEL_FACE} ${LABEL_WEIGHT} ${CHIP_CASE} outline-none ${FOCUS_RING}`, {
|
|
48
11
|
variants: {
|
|
49
12
|
tone: {
|
|
50
|
-
neutral:
|
|
13
|
+
neutral: CHIP_INK_NEUTRAL,
|
|
51
14
|
accent: `${CHIP_EDGE.accent} text-accent`,
|
|
52
15
|
ok: `${CHIP_EDGE.ok} text-ok`,
|
|
53
16
|
busy: `${CHIP_EDGE.busy} text-busy`,
|
|
@@ -56,9 +19,9 @@ const chipVariants = cva(`inline-flex ${CHIP_HEIGHT} select-none items-center ju
|
|
|
56
19
|
info: `${CHIP_EDGE.info} text-info`
|
|
57
20
|
},
|
|
58
21
|
variant: {
|
|
59
|
-
tinted: `${CHIP_PAD} ${CHIP_SIZE} ${CHIP_TRACKING}`,
|
|
60
|
-
outline: `bg-transparent ${CHIP_PAD} ${CHIP_SIZE} ${CHIP_TRACKING}`,
|
|
61
|
-
tag: `bg-transparent
|
|
22
|
+
tinted: `${CHIP_PAD} ${CHIP_SIZE} ${CHIP_LEADING} ${CHIP_TRACKING}`,
|
|
23
|
+
outline: `bg-transparent ${CHIP_PAD} ${CHIP_SIZE} ${CHIP_LEADING} ${CHIP_TRACKING}`,
|
|
24
|
+
tag: `bg-transparent ${TAG_PAD} ${CHIP_SIZE_MICRO} ${CHIP_LEADING} ${CHIP_TRACKING_TAG}`
|
|
62
25
|
},
|
|
63
26
|
interactive: {
|
|
64
27
|
true: "cursor-pointer disabled:pointer-events-none disabled:opacity-40",
|
|
@@ -68,13 +31,18 @@ const chipVariants = cva(`inline-flex ${CHIP_HEIGHT} select-none items-center ju
|
|
|
68
31
|
compoundVariants: [
|
|
69
32
|
{
|
|
70
33
|
tone: "neutral",
|
|
71
|
-
variant:
|
|
34
|
+
variant: "tinted",
|
|
72
35
|
class: "border-border"
|
|
73
36
|
},
|
|
37
|
+
{
|
|
38
|
+
tone: "neutral",
|
|
39
|
+
variant: "outline",
|
|
40
|
+
class: "border-[color:var(--cue-style-outline-edge,var(--cue-border))]"
|
|
41
|
+
},
|
|
74
42
|
{
|
|
75
43
|
tone: "neutral",
|
|
76
44
|
variant: "tag",
|
|
77
|
-
class:
|
|
45
|
+
class: TAG_EDGE
|
|
78
46
|
},
|
|
79
47
|
{
|
|
80
48
|
tone: "neutral",
|
|
@@ -240,7 +208,7 @@ const Chip = React.forwardRef(function Chip({ className, tone, variant, interact
|
|
|
240
208
|
tone,
|
|
241
209
|
variant,
|
|
242
210
|
interactive
|
|
243
|
-
}), className);
|
|
211
|
+
}), CHIP_LEADING_INHERIT, className);
|
|
244
212
|
if (interactive) return /* @__PURE__ */ jsx("button", {
|
|
245
213
|
ref,
|
|
246
214
|
type: "button",
|
|
@@ -8,7 +8,7 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
8
8
|
* every density.
|
|
9
9
|
*/
|
|
10
10
|
declare const iconButtonVariants: (props?: ({
|
|
11
|
-
variant?: "
|
|
11
|
+
variant?: "danger-outline" | "ghost" | "primary" | "secondary" | "outline" | "danger" | null | undefined;
|
|
12
12
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
13
13
|
} & ClassProp) | undefined) => string;
|
|
14
14
|
interface IconButtonProps extends Omit<React.ComponentPropsWithoutRef<"button">, "children">, VariantProps<typeof iconButtonVariants> {
|
package/dist/primitives/kbd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../lib/cn.js";
|
|
2
2
|
import { CONTROL_FACE } from "../system/_style-control-face.js";
|
|
3
3
|
import { LABEL_WEIGHT } from "../system/_style-label-weight.js";
|
|
4
|
-
import { KBD_BOX, KBD_EDGE, KBD_SIZE } from "../system/_style-kbd.js";
|
|
4
|
+
import { KBD_BOX, KBD_EDGE, KBD_FILL, KBD_LEADING, KBD_SIZE } from "../system/_style-kbd.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/primitives/kbd.tsx
|
|
@@ -24,7 +24,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
24
24
|
const Kbd = React.forwardRef(function Kbd({ className, children, ...elementProps }, ref) {
|
|
25
25
|
return /* @__PURE__ */ jsx("kbd", {
|
|
26
26
|
ref,
|
|
27
|
-
className: cn(`inline-flex ${KBD_BOX} select-none items-center justify-center border
|
|
27
|
+
className: cn(`inline-flex ${KBD_BOX} select-none items-center justify-center border ${KBD_FILL} text-fg-muted`, KBD_EDGE, CONTROL_FACE, KBD_SIZE, KBD_LEADING, LABEL_WEIGHT, className),
|
|
28
28
|
...elementProps,
|
|
29
29
|
children
|
|
30
30
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { SKELETON_RADIUS } from "../system/_style-skeleton.js";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
//#region src/primitives/skeleton.tsx
|
|
@@ -19,7 +20,7 @@ const Skeleton = React.forwardRef(function Skeleton({ className, ...elementProps
|
|
|
19
20
|
return /* @__PURE__ */ jsx("div", {
|
|
20
21
|
ref,
|
|
21
22
|
"aria-hidden": "true",
|
|
22
|
-
className: cn(
|
|
23
|
+
className: cn(`animate-pulse ${SKELETON_RADIUS} bg-surface-2 motion-reduce:animate-none`, className),
|
|
23
24
|
...elementProps
|
|
24
25
|
});
|
|
25
26
|
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/system/_style-accordion-rule.ts
|
|
2
|
+
/**
|
|
3
|
+
* The line style of the rule between two accordion sections (round 6, spec
|
|
4
|
+
* §11, lane R6.T: `style-accordion-rule-style`, KEY{solid, dashed}).
|
|
5
|
+
*
|
|
6
|
+
* `Accordion.Item` draws the rule with `border-t`, which writes
|
|
7
|
+
* `border-top-style: var(--tw-border-style)`, a slot Tailwind registers with
|
|
8
|
+
* `inherits: false` and `initial-value: solid`, so the section fills that slot
|
|
9
|
+
* rather than a raw `[border-top-style:…]` — the footer's reason
|
|
10
|
+
* (`_style-footer-rule.ts`): a caller's own `border-dotted` still wins. The
|
|
11
|
+
* fallback is the slot's `solid`. stripe.com's accordion draws its rules 1px
|
|
12
|
+
* dashed in the quiet border ink (`:where(.hds-accordion) .hds-details`), so
|
|
13
|
+
* tender sets `dashed` (T126).
|
|
14
|
+
*
|
|
15
|
+
* **Its own module**, and not in `_style-collapse.ts`, because docgen credits
|
|
16
|
+
* every `--cue-*` in a module to each component that imports it, and
|
|
17
|
+
* `Collapsible` and `Disclosure` draw no rule between sections.
|
|
18
|
+
*
|
|
19
|
+
* @internal Not part of the public API.
|
|
20
|
+
*/
|
|
21
|
+
const ACCORDION_RULE_STYLE = "[--tw-border-style:var(--cue-style-accordion-rule-style,solid)]";
|
|
22
|
+
/**
|
|
23
|
+
* The ink of the rule between two accordion sections (round 6, spec §11, lane
|
|
24
|
+
* R6.K: `style-accordion-rule-ink`), falling back to the `border` the item's
|
|
25
|
+
* `border-border` drew. replit.com rules its FAQ rows 1px #d7d5ce where its
|
|
26
|
+
* footer rule, the kiln theme's `border`, is #dad2ce — ΔE00 3.85 apart, so the
|
|
27
|
+
* rule takes a name of its own rather than moving the theme's anchor (K140). greptile.com's
|
|
28
|
+
* FAQ rules are 1px dashed in its heading ink, slate, which zine sets (Z111).
|
|
29
|
+
*/
|
|
30
|
+
const ACCORDION_RULE_INK = "border-[color:var(--cue-style-accordion-rule-ink,var(--cue-border))]";
|
|
31
|
+
//#endregion
|
|
32
|
+
export { ACCORDION_RULE_INK, ACCORDION_RULE_STYLE };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/system/_style-avatar.ts
|
|
2
|
+
/**
|
|
3
|
+
* The avatar's corner and edge (round 6, spec §11, lane R6.Z).
|
|
4
|
+
*
|
|
5
|
+
* `style-avatar-radius` is a proportion of a radius rung (RUNG(radius-*), as
|
|
6
|
+
* `style-dialog-radius` is), multiplied by `--cue-radius-scale` like every
|
|
7
|
+
* other corner, and falls back to the `rounded-full` (9999px) an avatar drew.
|
|
8
|
+
* `style-avatar-edge` is an INK, falling back to the `border` it drew.
|
|
9
|
+
* greptile.com zeroes every corner, its portrait's among them, and draws no
|
|
10
|
+
* edge on it (Z132), so zine sets the control corner and `transparent`.
|
|
11
|
+
*
|
|
12
|
+
* **Optional** (spec §3.0). Its own module for docgen's reason.
|
|
13
|
+
*
|
|
14
|
+
* @internal Not part of the public API.
|
|
15
|
+
*/
|
|
16
|
+
const AVATAR_RADIUS = "rounded-[calc(var(--cue-style-avatar-radius,9999px)*var(--cue-radius-scale))]";
|
|
17
|
+
/** @see AVATAR_RADIUS */
|
|
18
|
+
const AVATAR_EDGE = "border-[color:var(--cue-style-avatar-edge,var(--cue-border))]";
|
|
19
|
+
//#endregion
|
|
20
|
+
export { AVATAR_EDGE, AVATAR_RADIUS };
|
|
@@ -15,7 +15,5 @@
|
|
|
15
15
|
* @internal Not part of the public API.
|
|
16
16
|
*/
|
|
17
17
|
const BODY_LEADING = "leading-[var(--cue-style-body-leading,var(--cue-leading-ui))]";
|
|
18
|
-
/** @see BODY_LEADING — for a site that set none and inherited its box's. */
|
|
19
|
-
const BODY_LEADING_INHERIT = "leading-[var(--cue-style-body-leading,inherit)]";
|
|
20
18
|
//#endregion
|
|
21
|
-
export { BODY_LEADING
|
|
19
|
+
export { BODY_LEADING };
|
|
@@ -20,8 +20,13 @@ import { BODY_WEIGHT } from "./_style-body-weight.js";
|
|
|
20
20
|
* shared `[data-style]` reset by every shipped set, so under each the reader
|
|
21
21
|
* computes what `font-mono` and no weight computed at the element.
|
|
22
22
|
*
|
|
23
|
+
* A site that sets its own weight (a toast's medium title, round 6, P184) reads
|
|
24
|
+
* `BODY_FACE` alone, so a set's body weight does not thin it.
|
|
25
|
+
*
|
|
23
26
|
* @internal Not part of the public API.
|
|
24
27
|
*/
|
|
25
|
-
const
|
|
28
|
+
const BODY_FACE = "font-[family-name:var(--cue-style-body-face,var(--cue-font-mono))]";
|
|
29
|
+
/** @see BODY_FACE — the face with the weight, for copy whose weight is inherited. */
|
|
30
|
+
const BODY_VOICE = `${BODY_FACE} ${BODY_WEIGHT}`;
|
|
26
31
|
//#endregion
|
|
27
|
-
export { BODY_VOICE };
|
|
32
|
+
export { BODY_FACE, BODY_VOICE };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/system/_style-caption-ink.ts
|
|
2
|
+
/**
|
|
3
|
+
* A caption's ink (round 6, spec §11, lane R6.P: `style-caption-ink`): an avatar's
|
|
4
|
+
* initials and a progress bar's label and value, falling back to the
|
|
5
|
+
* `fg-muted` or `fg-subtle` each drew. coss.com/ui inks all three `fg`
|
|
6
|
+
* (P143.fallback-ink, P170.label-ink, P170.value).
|
|
7
|
+
*
|
|
8
|
+
* **Optional** (spec §3.0). Its own module for docgen's reason: one token per
|
|
9
|
+
* file, so only the components that read it are credited with it.
|
|
10
|
+
*
|
|
11
|
+
* @internal Not part of the public API.
|
|
12
|
+
*/
|
|
13
|
+
const CAPTION_INK_MUTED = "text-[color:var(--cue-style-caption-ink,var(--cue-fg-muted))]";
|
|
14
|
+
/** @see CAPTION_INK_MUTED */
|
|
15
|
+
const CAPTION_INK_SUBTLE = "text-[color:var(--cue-style-caption-ink,var(--cue-fg-subtle))]";
|
|
16
|
+
//#endregion
|
|
17
|
+
export { CAPTION_INK_MUTED, CAPTION_INK_SUBTLE };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/system/_style-caption-size.ts
|
|
2
|
+
/**
|
|
3
|
+
* A caption's type size (round 6, spec §11, lane R6.P: `style-caption-size`): an
|
|
4
|
+
* avatar's initials, a progress bar's and a slider's readout, and a calendar's
|
|
5
|
+
* month caption and weekday heads — the small type each set on the `text-label`
|
|
6
|
+
* or `text-micro` rung it falls back to. coss.com/ui sets the readouts and the
|
|
7
|
+
* month caption 14px (P170.label, P170.value-size, P178.value, P189.caption);
|
|
8
|
+
* its initials and weekday heads are 12px, which spec §6.2's G10 line quotes.
|
|
9
|
+
*
|
|
10
|
+
* **Optional** (spec §3.0). Its own module for docgen's reason: one token per
|
|
11
|
+
* file, so only the components that read it are credited with it.
|
|
12
|
+
*
|
|
13
|
+
* @internal Not part of the public API.
|
|
14
|
+
*/
|
|
15
|
+
const CAPTION_SIZE_LABEL = "text-[length:var(--cue-style-caption-size,var(--cue-text-label))]";
|
|
16
|
+
/** @see CAPTION_SIZE_LABEL */
|
|
17
|
+
const CAPTION_SIZE_MICRO = "text-[length:var(--cue-style-caption-size,var(--cue-text-micro))]";
|
|
18
|
+
//#endregion
|
|
19
|
+
export { CAPTION_SIZE_LABEL, CAPTION_SIZE_MICRO };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/system/_style-caption-weight.ts
|
|
2
|
+
/**
|
|
3
|
+
* A caption's weight (round 6, spec §11, lane R6.P: `style-caption-weight`): an
|
|
4
|
+
* avatar's initials, a progress bar's label, and a calendar's month caption and
|
|
5
|
+
* weekday heads, falling back to the inherited or `400` weight each drew.
|
|
6
|
+
* coss.com/ui sets all four at 500 (P143.fallback-weight, P170.label-weight,
|
|
7
|
+
* P189.caption-weight, P189.weekday-weight).
|
|
8
|
+
*
|
|
9
|
+
* **Optional** (spec §3.0). Its own module for docgen's reason: one token per
|
|
10
|
+
* file, so only the components that read it are credited with it.
|
|
11
|
+
*
|
|
12
|
+
* @internal Not part of the public API.
|
|
13
|
+
*/
|
|
14
|
+
const CAPTION_WEIGHT = "font-[number:var(--cue-style-caption-weight,inherit)]";
|
|
15
|
+
/** @see CAPTION_WEIGHT */
|
|
16
|
+
const CAPTION_WEIGHT_NORMAL = "font-[number:var(--cue-style-caption-weight,400)]";
|
|
17
|
+
//#endregion
|
|
18
|
+
export { CAPTION_WEIGHT, CAPTION_WEIGHT_NORMAL };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/system/_style-card-gap.ts
|
|
2
|
+
/**
|
|
3
|
+
* The gap between a card's title and its description (round 6, spec §11, lane
|
|
4
|
+
* R6.P: `style-card-gap`), falling back to the `space-1` the header drew.
|
|
5
|
+
* coss.com/ui's card header sets them 6px apart (P146.gap).
|
|
6
|
+
*
|
|
7
|
+
* **Optional** (spec §3.0). Its own module for docgen's reason: one token per
|
|
8
|
+
* file, so only the components that read it are credited with it.
|
|
9
|
+
*
|
|
10
|
+
* @internal Not part of the public API.
|
|
11
|
+
*/
|
|
12
|
+
const CARD_GAP = "gap-[var(--cue-style-card-gap,var(--cue-space-1))]";
|
|
13
|
+
//#endregion
|
|
14
|
+
export { CARD_GAP };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/system/_style-cell.ts
|
|
2
|
+
/**
|
|
3
|
+
* A table cell's inline padding and leading (round 6, spec §11, lane R6.P:
|
|
4
|
+
* `style-cell-pad`, `style-cell-leading`), falling back to the row's
|
|
5
|
+
* `pad-row-x` and the inherited leading. coss.com/ui pads its cells and heads
|
|
6
|
+
* 10px and sets them on a line of 1 (P181, P181.head-pad, P181.cell-leading).
|
|
7
|
+
*
|
|
8
|
+
* **Optional** (spec §3.0): each name is declared by `porcelain` alone and each
|
|
9
|
+
* reader falls back to what the component drew. Its own module for docgen's
|
|
10
|
+
* reason: one component's tokens per file.
|
|
11
|
+
*
|
|
12
|
+
* @internal Not part of the public API.
|
|
13
|
+
*/
|
|
14
|
+
const CELL_PAD = "px-[var(--cue-style-cell-pad,var(--cue-pad-row-x))]";
|
|
15
|
+
/** @see CELL_PAD */
|
|
16
|
+
const CELL_LEADING = "leading-[var(--cue-style-cell-leading,inherit)]";
|
|
17
|
+
//#endregion
|
|
18
|
+
export { CELL_LEADING, CELL_PAD };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/system/_style-check-glyph.ts
|
|
2
|
+
/**
|
|
3
|
+
* A checkbox's tick and dash (round 6, spec §11, lane R6.P:
|
|
4
|
+
* `style-check-glyph-size`), falling back to the `size-full` of the box they
|
|
5
|
+
* drew. coss.com/ui's tick is 12px inside its 16px box (P147.glyph-size).
|
|
6
|
+
*
|
|
7
|
+
* **Optional** (spec §3.0). Its own module for docgen's reason: one token per
|
|
8
|
+
* file, so only the components that read it are credited with it.
|
|
9
|
+
*
|
|
10
|
+
* @internal Not part of the public API.
|
|
11
|
+
*/
|
|
12
|
+
const CHECK_GLYPH_SIZE = "size-[var(--cue-style-check-glyph-size,100%)]";
|
|
13
|
+
//#endregion
|
|
14
|
+
export { CHECK_GLYPH_SIZE };
|
|
@@ -29,5 +29,12 @@ const CHECK_EDGE = "border-[color:var(--cue-style-check-edge,var(--cue-border))]
|
|
|
29
29
|
const CHECK_RADIUS = "rounded-[var(--cue-style-check-radius,calc(var(--cue-radius-control)*var(--cue-radius-scale)))]";
|
|
30
30
|
/** @see CHECK_RADIUS */
|
|
31
31
|
const CHECK_SIZE_MD = "size-[var(--cue-style-check-size,var(--cue-icon-md))]";
|
|
32
|
+
/**
|
|
33
|
+
* The checkbox's hover edge (round 6, spec §11, lane R6.T:
|
|
34
|
+
* `style-check-hover-edge`), falling back to the `border-strong` it drew.
|
|
35
|
+
* stripe.com's unchecked box draws its hover edge in its brand-500
|
|
36
|
+
* (`--hds-color-input-border-hover`, #665efd, T145).
|
|
37
|
+
*/
|
|
38
|
+
const CHECK_HOVER_EDGE = "hover:border-[color:var(--cue-style-check-hover-edge,var(--cue-border-strong))]";
|
|
32
39
|
//#endregion
|
|
33
|
-
export { CHECK_EDGE, CHECK_RADIUS, CHECK_SIZE_MD };
|
|
40
|
+
export { CHECK_EDGE, CHECK_HOVER_EDGE, CHECK_RADIUS, CHECK_SIZE_MD };
|
|
@@ -99,5 +99,45 @@ const CHIP_EDGE = {
|
|
|
99
99
|
const CHIP_HEIGHT = "h-[var(--cue-style-chip-height,var(--cue-chip-h))]";
|
|
100
100
|
/** @see CHIP_HEIGHT */
|
|
101
101
|
const CHIP_PAD = "px-[var(--cue-style-chip-pad,var(--cue-space-3))]";
|
|
102
|
+
/**
|
|
103
|
+
* The chip's leading (round 6, spec §11, lane R6.T: `style-chip-leading`).
|
|
104
|
+
* stripe.com's tag sets 14px on a 19.6px line, 1.4 (T134). A nowrap, centred
|
|
105
|
+
* chip lays its glyphs in the same place at any leading.
|
|
106
|
+
*
|
|
107
|
+
* Two fallbacks, because the recipe's two users rendered two leadings. The
|
|
108
|
+
* recipe spelled `leading-none`, so `chipVariants()` on a consumer's own
|
|
109
|
+
* element drew a line of 1: {@link CHIP_LEADING}, composed after the size so
|
|
110
|
+
* it survives, falls back to `1`. `Chip` merged that recipe in `cn()`, where
|
|
111
|
+
* `tailwind-merge` dropped `leading-none` because a font-size class follows
|
|
112
|
+
* it, so a `Chip` inherited its leading: it appends
|
|
113
|
+
* {@link CHIP_LEADING_INHERIT}, which replaces the recipe's in the merge (the
|
|
114
|
+
* closing pass's adversarial review).
|
|
115
|
+
*/
|
|
116
|
+
const CHIP_LEADING = "leading-[var(--cue-style-chip-leading,1)]";
|
|
117
|
+
/** @see CHIP_LEADING — `Chip`'s own, falling back to the leading it inherited. */
|
|
118
|
+
const CHIP_LEADING_INHERIT = "leading-[var(--cue-style-chip-leading,inherit)]";
|
|
119
|
+
/**
|
|
120
|
+
* The tag volume's own gutter (round 6: `style-tag-pad`, PAD2), falling back
|
|
121
|
+
* to the `space-2` it drew. stripe.com's small tag pads 4px (T135).
|
|
122
|
+
*/
|
|
123
|
+
const TAG_PAD = "px-[var(--cue-style-tag-pad,var(--cue-space-2))]";
|
|
124
|
+
/**
|
|
125
|
+
* The neutral tag's rim (round 6: `style-tag-edge`), falling back to the
|
|
126
|
+
* `hair-strong` it drew. stripe.com rims its small tag in its quiet border
|
|
127
|
+
* ink, #e5edf5, the md tag's own (T135).
|
|
128
|
+
*/
|
|
129
|
+
const TAG_EDGE = "border-[color:var(--cue-style-tag-edge,var(--cue-hair-strong))]";
|
|
130
|
+
/**
|
|
131
|
+
* The neutral chip's ink (round 6, spec §11, lane R6.K: `style-chip-ink`),
|
|
132
|
+
* falling back to the `fg-muted` it drew. The tinted tones keep their own ink.
|
|
133
|
+
* replit.com's tags are near-black, #151618, on a warm tint (K156).
|
|
134
|
+
*/
|
|
135
|
+
const CHIP_INK_NEUTRAL = "text-[color:var(--cue-style-chip-ink,var(--cue-fg-muted))]";
|
|
136
|
+
/**
|
|
137
|
+
* The gap between a chip's icon and its label (round 6, spec §11, lane R6.P:
|
|
138
|
+
* `style-chip-gap`), falling back to the `space-2` it drew. coss.com/ui's badge
|
|
139
|
+
* sets it 4px (P190.gap).
|
|
140
|
+
*/
|
|
141
|
+
const CHIP_GAP = "gap-[var(--cue-style-chip-gap,var(--cue-space-2))]";
|
|
102
142
|
//#endregion
|
|
103
|
-
export { CHIP_CASE, CHIP_EDGE, CHIP_FILL, CHIP_HEIGHT, CHIP_PAD, CHIP_RADIUS, CHIP_SIZE, CHIP_SIZE_MICRO, CHIP_TRACKING, CHIP_TRACKING_TAG };
|
|
143
|
+
export { CHIP_CASE, CHIP_EDGE, CHIP_FILL, CHIP_GAP, CHIP_HEIGHT, CHIP_INK_NEUTRAL, CHIP_LEADING, CHIP_LEADING_INHERIT, CHIP_PAD, CHIP_RADIUS, CHIP_SIZE, CHIP_SIZE_MICRO, CHIP_TRACKING, CHIP_TRACKING_TAG, TAG_EDGE, TAG_PAD };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/system/_style-choice-gap.ts
|
|
2
|
+
/**
|
|
3
|
+
* The gap between a stacked CheckboxGroup's or RadioGroup's items (round 6,
|
|
4
|
+
* spec §11, lane R6.P: `style-choice-gap`), falling back to the `space-2`
|
|
5
|
+
* both drew. coss.com/ui stacks both 12px apart (P148, P171.gap). A horizontal
|
|
6
|
+
* radio group keeps its own `space-5`.
|
|
7
|
+
*
|
|
8
|
+
* **Optional** (spec §3.0). Its own module for docgen's reason: one token per
|
|
9
|
+
* file, so only the components that read it are credited with it.
|
|
10
|
+
*
|
|
11
|
+
* @internal Not part of the public API.
|
|
12
|
+
*/
|
|
13
|
+
const CHOICE_GAP = "gap-[var(--cue-style-choice-gap,var(--cue-space-2))]";
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CHOICE_GAP };
|
|
@@ -10,5 +10,85 @@
|
|
|
10
10
|
* @internal Not part of the public API.
|
|
11
11
|
*/
|
|
12
12
|
const COLLAPSE_HEIGHT = "h-[var(--cue-style-collapse-height,var(--cue-control-md))]";
|
|
13
|
+
/**
|
|
14
|
+
* The disclosure trigger's and panel's inline padding (round 6, spec §11,
|
|
15
|
+
* lane R6.T: `style-collapse-pad`), falling back to the row gutter
|
|
16
|
+
* `--cue-pad-row-x` they drew. stripe.com's accordion summary and content sit
|
|
17
|
+
* flush with the rule between sections, so tender sets `0px` (T127, T130).
|
|
18
|
+
*/
|
|
19
|
+
const COLLAPSE_PAD = "px-[var(--cue-style-collapse-pad,var(--cue-pad-row-x))]";
|
|
20
|
+
/** The gap between the trigger's label and its caret (`style-collapse-gap`), falling back to `space-3` (T127). */
|
|
21
|
+
const COLLAPSE_GAP = "gap-[var(--cue-style-collapse-gap,var(--cue-space-3))]";
|
|
22
|
+
/** The trigger's hover ink (`style-collapse-hover-ink`), falling back to the `fg` it hovered to (T128). */
|
|
23
|
+
const COLLAPSE_HOVER_INK = "hover:text-[color:var(--cue-style-collapse-hover-ink,var(--cue-fg))]";
|
|
24
|
+
/** An open section's trigger ink (`style-collapse-open-ink`), falling back to `fg` (T129). */
|
|
25
|
+
const COLLAPSE_OPEN_INK = "data-[panel-open]:text-[color:var(--cue-style-collapse-open-ink,var(--cue-fg))]";
|
|
26
|
+
/**
|
|
27
|
+
* The panel body's block padding, start then end (`style-collapse-body-pad`,
|
|
28
|
+
* PAD2), falling back to the `space-1` over `space-4` it drew. stripe.com's
|
|
29
|
+
* content starts under the summary's own padding and ends 16px above the
|
|
30
|
+
* rule (T130).
|
|
31
|
+
*/
|
|
32
|
+
const COLLAPSE_BODY_PAD = "[padding-block:var(--cue-style-collapse-body-pad,var(--cue-space-1)_var(--cue-space-4))]";
|
|
33
|
+
/**
|
|
34
|
+
* The trigger's text size (round 6, spec §11, lane R6.K: `style-collapse-size`,
|
|
35
|
+
* a SIZE the font scale moves), falling back to the `text-ui` rung it drew.
|
|
36
|
+
* replit.com's FAQ rows set their question at 20px on a 28px line (K142); greptile.com's
|
|
37
|
+
* FAQ toggles are its 16px copy, 14px on a phone (Z112).
|
|
38
|
+
*/
|
|
39
|
+
const COLLAPSE_SIZE = "text-[length:var(--cue-style-collapse-size,var(--cue-text-ui))]";
|
|
40
|
+
/** The trigger's leading (`style-collapse-leading`), falling back to the `inherit` it drew (no leading class of its own). */
|
|
41
|
+
const COLLAPSE_LEADING = "leading-[var(--cue-style-collapse-leading,inherit)]";
|
|
42
|
+
/**
|
|
43
|
+
* The trigger's hover ground (`style-collapse-hover-ground`), falling back to
|
|
44
|
+
* the `transparent` it drew: the trigger painted no ground under the pointer.
|
|
45
|
+
* replit.com's FAQ rows fill with its recessed ground on hover (K143).
|
|
46
|
+
*/
|
|
47
|
+
const COLLAPSE_HOVER_GROUND = "hover:bg-[color:var(--cue-style-collapse-hover-ground,transparent)]";
|
|
48
|
+
/**
|
|
49
|
+
* The panel body's ink (`style-collapse-body-ink`), falling back to the
|
|
50
|
+
* `fg-muted` it drew. replit.com's FAQ answers are set in its quiet ink,
|
|
51
|
+
* #37383c, the ink of its headings and quiet controls (K144).
|
|
52
|
+
*/
|
|
53
|
+
const COLLAPSE_BODY_INK = "text-[color:var(--cue-style-collapse-body-ink,var(--cue-fg-muted))]";
|
|
54
|
+
/**
|
|
55
|
+
* The panel body's face: the body face (`style-body-face`, spec §3.5), falling back to the `font-mono` the body
|
|
56
|
+
* drew. The body was the one part of the disclosure still hard-coded mono under a sans Look (K144, the K44
|
|
57
|
+
* finding).
|
|
58
|
+
*/
|
|
59
|
+
const COLLAPSE_BODY_FACE = "font-[family-name:var(--cue-style-body-face,var(--cue-font-mono))]";
|
|
60
|
+
/**
|
|
61
|
+
* The disclosure trigger's corner (round 6, spec §11, lane R6.K: `style-collapse-radius`), falling
|
|
62
|
+
* back to the square it drew. replit.com's FAQ rows round their hover ground 6px (K141.radius).
|
|
63
|
+
*/
|
|
64
|
+
const COLLAPSE_RADIUS = "rounded-[var(--cue-style-collapse-radius,0px)]";
|
|
65
|
+
/**
|
|
66
|
+
* The trigger's weight (`style-collapse-weight`), falling back through the
|
|
67
|
+
* label weight to the `400` it drew (`LABEL_WEIGHT_NORMAL`). greptile.com's
|
|
68
|
+
* FAQ toggles are 600 beside its 400 labels, so the two are apart (Z112).
|
|
69
|
+
*/
|
|
70
|
+
const COLLAPSE_WEIGHT = "font-[number:var(--cue-style-collapse-weight,var(--cue-style-label-weight,400))]";
|
|
71
|
+
/** The caret's size (`style-collapse-caret-size`), falling back to the `icon-sm` it drew; greptile.com's chevron is 16px (Z113). */
|
|
72
|
+
const COLLAPSE_CARET_SIZE = "size-[var(--cue-style-collapse-caret-size,var(--cue-icon-sm))]";
|
|
73
|
+
/** The caret's ink (`style-collapse-caret-ink`), falling back to the `fg-subtle` it drew; greptile.com's chevron takes the label's slate (Z113). */
|
|
74
|
+
/**
|
|
75
|
+
* The caret's fade (round 6, spec §11, lane R6.P: `style-collapse-caret-opacity`),
|
|
76
|
+
* falling back to the opacity 1 it drew. coss.com/ui's accordion chevron sits
|
|
77
|
+
* at 0.8 (P150.caret-opacity).
|
|
78
|
+
*/
|
|
79
|
+
const COLLAPSE_CARET_OPACITY = "opacity-[var(--cue-style-collapse-caret-opacity,1)]";
|
|
80
|
+
/** @see COLLAPSE_CARET_SIZE */
|
|
81
|
+
const COLLAPSE_CARET_INK = "text-[color:var(--cue-style-collapse-caret-ink,var(--cue-fg-subtle))]";
|
|
82
|
+
/**
|
|
83
|
+
* The panel body's size, leading and tracking (round 6, spec §11, lane R6.Z: `style-collapse-body-size`,
|
|
84
|
+
* a type size the font scale moves, `-body-leading`, `-body-tracking`), each falling back to the class it
|
|
85
|
+
* replaced: the `text-ui` rung on `leading-ui`, and the tracking it inherited (no class of its own). greptile.com's FAQ answers are its running
|
|
86
|
+
* copy, 16px on 24px at −0.01em (Z114).
|
|
87
|
+
*/
|
|
88
|
+
const COLLAPSE_BODY_SIZE = "text-[length:var(--cue-style-collapse-body-size,var(--cue-text-ui))]";
|
|
89
|
+
/** @see COLLAPSE_BODY_SIZE */
|
|
90
|
+
const COLLAPSE_BODY_LEADING = "leading-[var(--cue-style-collapse-body-leading,var(--cue-leading-ui))]";
|
|
91
|
+
/** @see COLLAPSE_BODY_SIZE */
|
|
92
|
+
const COLLAPSE_BODY_TRACKING = "tracking-[var(--cue-style-collapse-body-tracking,inherit)]";
|
|
13
93
|
//#endregion
|
|
14
|
-
export { COLLAPSE_HEIGHT };
|
|
94
|
+
export { COLLAPSE_BODY_FACE, COLLAPSE_BODY_INK, COLLAPSE_BODY_LEADING, COLLAPSE_BODY_PAD, COLLAPSE_BODY_SIZE, COLLAPSE_BODY_TRACKING, COLLAPSE_CARET_INK, COLLAPSE_CARET_OPACITY, COLLAPSE_CARET_SIZE, COLLAPSE_GAP, COLLAPSE_HEIGHT, COLLAPSE_HOVER_GROUND, COLLAPSE_HOVER_INK, COLLAPSE_LEADING, COLLAPSE_OPEN_INK, COLLAPSE_PAD, COLLAPSE_RADIUS, COLLAPSE_SIZE, COLLAPSE_WEIGHT };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/system/_style-control-gap.ts
|
|
2
|
+
/**
|
|
3
|
+
* The gap between a button's icon and its label (round 6, spec §11, lane
|
|
4
|
+
* R6.P: `style-control-gap`), falling back to the `0.4em` the chassis drew.
|
|
5
|
+
* coss.com/ui's buttons set it 8px (`gap-2`, P145.gap).
|
|
6
|
+
*
|
|
7
|
+
* **Optional** (spec §3.0). Its own module for docgen's reason: one token per
|
|
8
|
+
* file, so only the components that read it are credited with it.
|
|
9
|
+
*
|
|
10
|
+
* @internal Not part of the public API.
|
|
11
|
+
*/
|
|
12
|
+
const CONTROL_GAP = "gap-[var(--cue-style-control-gap,0.4em)]";
|
|
13
|
+
//#endregion
|
|
14
|
+
export { CONTROL_GAP };
|
|
@@ -18,5 +18,12 @@
|
|
|
18
18
|
* @internal Not part of the public API.
|
|
19
19
|
*/
|
|
20
20
|
const CONTROL_LABEL_WEIGHT = "font-[number:var(--cue-style-body-weight,var(--cue-style-label-weight,inherit))]";
|
|
21
|
+
/**
|
|
22
|
+
* A checkbox's, a switch's and a radio's label leading (round 6, spec §11,
|
|
23
|
+
* lane R6.T: `style-control-label-leading`), falling back to the `inherit` it
|
|
24
|
+
* drew (no leading class of its own). stripe.com sets its checkbox and switch
|
|
25
|
+
* labels at 16px on a 19.2px line, 1.2 (T145, T146).
|
|
26
|
+
*/
|
|
27
|
+
const CONTROL_LABEL_LEADING = "leading-[var(--cue-style-control-label-leading,inherit)]";
|
|
21
28
|
//#endregion
|
|
22
|
-
export { CONTROL_LABEL_WEIGHT };
|
|
29
|
+
export { CONTROL_LABEL_LEADING, CONTROL_LABEL_WEIGHT };
|