@adea-ai/ui 0.134.0 → 0.136.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composites/stat/stat.d.ts +14 -2
- package/dist/components/composites/stat/stat.d.ts.map +1 -1
- package/dist/components/composites/stat/stat.js +13 -3
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/ui/callout/callout.d.ts +72 -0
- package/dist/components/ui/callout/callout.d.ts.map +1 -0
- package/dist/components/ui/callout/callout.js +123 -0
- package/dist/components/ui/callout/callout.js.map +1 -0
- package/dist/components/ui/callout/index.d.ts +2 -0
- package/dist/components/ui/callout/index.d.ts.map +1 -0
- package/dist/components/ui/callout/index.js +2 -0
- package/dist/components/ui/card/card.d.ts +9 -0
- package/dist/components/ui/card/card.d.ts.map +1 -1
- package/dist/components/ui/card/card.js +10 -1
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/r/callout.json +22 -0
- package/dist/r/registry.json +22 -0
- package/dist/r/src/components/composites/stat/stat.tsx +22 -4
- package/dist/r/src/components/ui/callout/callout.tsx +115 -0
- package/dist/r/src/components/ui/callout/index.ts +1 -0
- package/dist/r/src/components/ui/card/card.tsx +17 -1
- package/package.json +1 -1
- package/registry.json +22 -0
- package/src/components/composites/stat/stat.tsx +22 -4
- package/src/components/ui/callout/callout.tsx +115 -0
- package/src/components/ui/callout/index.ts +1 -0
- package/src/components/ui/card/card.tsx +17 -1
- package/src/index.ts +1 -0
|
@@ -24,8 +24,20 @@ export type StatProps = ComponentProps<'div'> & {
|
|
|
24
24
|
accent?: boolean;
|
|
25
25
|
};
|
|
26
26
|
export declare function Stat(props: StatProps): JSX.Element;
|
|
27
|
-
/**
|
|
28
|
-
|
|
27
|
+
/**
|
|
28
|
+
* A row of stats that shares one gap and wraps as the window narrows.
|
|
29
|
+
*
|
|
30
|
+
* By default the column count steps with the *viewport* (two from `sm`, four from
|
|
31
|
+
* `lg`), which is right for a group that spans the page. A group inside a pane
|
|
32
|
+
* whose width is not the window's (a docked panel, a resizable column, a view
|
|
33
|
+
* beside a sidebar) gets the wrong count from a viewport breakpoint. `fit` sizes
|
|
34
|
+
* from the group's own width instead: as many tiles per row as fit at the
|
|
35
|
+
* minimum tile width, each growing to share the remainder, however many stats
|
|
36
|
+
* there are.
|
|
37
|
+
*/
|
|
38
|
+
export declare function StatGroup(props: ComponentProps<'div'> & {
|
|
39
|
+
fit?: boolean;
|
|
40
|
+
}): JSX.Element;
|
|
29
41
|
/**
|
|
30
42
|
* PropertyList.
|
|
31
43
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/stat/stat.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAMnD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC9C,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8EAA8E;IAC9E,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;IACrC,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,eAmDpC;AAED
|
|
1
|
+
{"version":3,"file":"stat.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/stat/stat.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAMnD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC9C,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8EAA8E;IAC9E,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;IACrC,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,eAmDpC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,eAiBzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,eASvD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,eASvD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,eASxD;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,eAa1E"}
|
|
@@ -83,13 +83,23 @@ function Stat(props) {
|
|
|
83
83
|
return _el$;
|
|
84
84
|
})();
|
|
85
85
|
}
|
|
86
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* A row of stats that shares one gap and wraps as the window narrows.
|
|
88
|
+
*
|
|
89
|
+
* By default the column count steps with the *viewport* (two from `sm`, four from
|
|
90
|
+
* `lg`), which is right for a group that spans the page. A group inside a pane
|
|
91
|
+
* whose width is not the window's (a docked panel, a resizable column, a view
|
|
92
|
+
* beside a sidebar) gets the wrong count from a viewport breakpoint. `fit` sizes
|
|
93
|
+
* from the group's own width instead: as many tiles per row as fit at the
|
|
94
|
+
* minimum tile width, each growing to share the remainder, however many stats
|
|
95
|
+
* there are.
|
|
96
|
+
*/
|
|
87
97
|
function StatGroup(props) {
|
|
88
|
-
const [local, rest] = splitProps(props, ["class"]);
|
|
98
|
+
const [local, rest] = splitProps(props, ["class", "fit"]);
|
|
89
99
|
return (() => {
|
|
90
100
|
var _el$6 = _tmpl$3();
|
|
91
101
|
spread(_el$6, mergeProps({ get ["class"]() {
|
|
92
|
-
return cn("grid gap-3 sm:grid-cols-2 lg:grid-cols-4", local.class);
|
|
102
|
+
return cn("grid gap-3", local.fit ? "grid-cols-[repeat(auto-fill,minmax(9.375rem,1fr))]" : "sm:grid-cols-2 lg:grid-cols-4", local.class);
|
|
93
103
|
} }, rest), false, false);
|
|
94
104
|
return _el$6;
|
|
95
105
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat.js","names":["ArrowDownRight","ArrowUpRight","ComponentProps","JSX","Show","splitProps","Dynamic","cn","Heading","Text","StatProps","label","value","Element","unit","delta","deltaTone","accent","Stat","props","local","rest","_el$","_tmpl$2","_el$2","firstChild","_el$3","nextSibling","_$spread","_$mergeProps","class","_$insert","_$createComponent","as","size","numeric","children","when","variant","tone","_el$4","_tmpl$","_el$5","component","StatGroup","_el$6","_tmpl$3","PropertyList","_el$7","_tmpl$4","PropertyTerm","_el$8","_tmpl$5","PropertyValue","_el$9","_tmpl$6","PropertyRow","term","_el$0","_tmpl$7","_el$1","_el$10","_$mergeProps","_$createComponent"],"sources":["../../../../src/components/composites/stat/stat.tsx"],"sourcesContent":["import { ArrowDownRight, ArrowUpRight } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cn } from '#lib/utils'\nimport { Heading, Text } from '../../ui/typography'\n\n/**\n * Stat.\n *\n * A single measured number with its label and, optionally, its change. The\n * whole component is a decision about honesty: a value shown without its\n * comparison is not information, so `delta` carries the direction, the amount\n * and — through `deltaTone` — whether the direction is *good*. A rising number\n * is not always a rising outcome, and only the caller knows which way is which.\n *\n * `tabular-nums` on the value is what lets two stats in a row be compared\n * without the digits shifting under the reader.\n */\nexport type StatProps = ComponentProps<'div'> & {\n label: string\n value: JSX.Element\n /** A unit or qualifier after the value, e.g. \"ms\", \"of 10\". */\n unit?: string\n /** The change, e.g. \"+12% from last week\". */\n delta?: string\n /** Whether the change is an improvement. Decides the arrow and the colour. */\n deltaTone?: 'up' | 'down' | 'neutral'\n /** Draws the leading accent rule used for a row of headline numbers. */\n accent?: boolean\n}\n\nexport function Stat(props: StatProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'value',\n 'unit',\n 'delta',\n 'deltaTone',\n 'accent',\n 'children',\n ])\n\n return (\n <div\n data-slot=\"stat\"\n class={cn(\n 'flex min-w-0 flex-col gap-1 rounded-lg border border-border bg-card p-3',\n { 'border-t-2 border-t-primary': local.accent },\n local.class\n )}\n {...rest}\n >\n <div class=\"text-muted-foreground truncate text-xs font-medium\">{local.label}</div>\n <div class=\"flex items-baseline gap-1\">\n <Heading as=\"span\" size=\"page\" numeric>\n {local.value}\n </Heading>\n <Show when={local.unit}>\n <Text variant=\"caption\" tone=\"muted\">\n {local.unit}\n </Text>\n </Show>\n </div>\n <Show when={local.delta}>\n <div class=\"text-foreground flex items-center gap-1 text-xs\">\n <Show when={local.deltaTone === 'up' || local.deltaTone === 'down'}>\n <Dynamic\n component={local.deltaTone === 'down' ? ArrowDownRight : ArrowUpRight}\n aria-hidden=\"true\"\n class={cn('size-3', {\n 'text-success': local.deltaTone === 'up',\n 'text-destructive': local.deltaTone === 'down',\n })}\n />\n </Show>\n <span class=\"tabular-nums\">{local.delta}</span>\n </div>\n </Show>\n {local.children}\n </div>\n )\n}\n\n
|
|
1
|
+
{"version":3,"file":"stat.js","names":["ArrowDownRight","ArrowUpRight","ComponentProps","JSX","Show","splitProps","Dynamic","cn","Heading","Text","StatProps","label","value","Element","unit","delta","deltaTone","accent","Stat","props","local","rest","_el$","_tmpl$2","_el$2","firstChild","_el$3","nextSibling","_$spread","_$mergeProps","class","_$insert","_$createComponent","as","size","numeric","children","when","variant","tone","_el$4","_tmpl$","_el$5","component","StatGroup","fit","_el$6","_tmpl$3","PropertyList","_el$7","_tmpl$4","PropertyTerm","_el$8","_tmpl$5","PropertyValue","_el$9","_tmpl$6","PropertyRow","term","_el$0","_tmpl$7","_el$1","_el$10","_$mergeProps","_$createComponent"],"sources":["../../../../src/components/composites/stat/stat.tsx"],"sourcesContent":["import { ArrowDownRight, ArrowUpRight } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cn } from '#lib/utils'\nimport { Heading, Text } from '../../ui/typography'\n\n/**\n * Stat.\n *\n * A single measured number with its label and, optionally, its change. The\n * whole component is a decision about honesty: a value shown without its\n * comparison is not information, so `delta` carries the direction, the amount\n * and — through `deltaTone` — whether the direction is *good*. A rising number\n * is not always a rising outcome, and only the caller knows which way is which.\n *\n * `tabular-nums` on the value is what lets two stats in a row be compared\n * without the digits shifting under the reader.\n */\nexport type StatProps = ComponentProps<'div'> & {\n label: string\n value: JSX.Element\n /** A unit or qualifier after the value, e.g. \"ms\", \"of 10\". */\n unit?: string\n /** The change, e.g. \"+12% from last week\". */\n delta?: string\n /** Whether the change is an improvement. Decides the arrow and the colour. */\n deltaTone?: 'up' | 'down' | 'neutral'\n /** Draws the leading accent rule used for a row of headline numbers. */\n accent?: boolean\n}\n\nexport function Stat(props: StatProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'value',\n 'unit',\n 'delta',\n 'deltaTone',\n 'accent',\n 'children',\n ])\n\n return (\n <div\n data-slot=\"stat\"\n class={cn(\n 'flex min-w-0 flex-col gap-1 rounded-lg border border-border bg-card p-3',\n { 'border-t-2 border-t-primary': local.accent },\n local.class\n )}\n {...rest}\n >\n <div class=\"text-muted-foreground truncate text-xs font-medium\">{local.label}</div>\n <div class=\"flex items-baseline gap-1\">\n <Heading as=\"span\" size=\"page\" numeric>\n {local.value}\n </Heading>\n <Show when={local.unit}>\n <Text variant=\"caption\" tone=\"muted\">\n {local.unit}\n </Text>\n </Show>\n </div>\n <Show when={local.delta}>\n <div class=\"text-foreground flex items-center gap-1 text-xs\">\n <Show when={local.deltaTone === 'up' || local.deltaTone === 'down'}>\n <Dynamic\n component={local.deltaTone === 'down' ? ArrowDownRight : ArrowUpRight}\n aria-hidden=\"true\"\n class={cn('size-3', {\n 'text-success': local.deltaTone === 'up',\n 'text-destructive': local.deltaTone === 'down',\n })}\n />\n </Show>\n <span class=\"tabular-nums\">{local.delta}</span>\n </div>\n </Show>\n {local.children}\n </div>\n )\n}\n\n/**\n * A row of stats that shares one gap and wraps as the window narrows.\n *\n * By default the column count steps with the *viewport* (two from `sm`, four from\n * `lg`), which is right for a group that spans the page. A group inside a pane\n * whose width is not the window's (a docked panel, a resizable column, a view\n * beside a sidebar) gets the wrong count from a viewport breakpoint. `fit` sizes\n * from the group's own width instead: as many tiles per row as fit at the\n * minimum tile width, each growing to share the remainder, however many stats\n * there are.\n */\nexport function StatGroup(props: ComponentProps<'div'> & { fit?: boolean }) {\n const [local, rest] = splitProps(props, ['class', 'fit'])\n return (\n <div\n data-slot=\"stat-group\"\n class={cn(\n 'grid gap-3',\n // 9.375rem is 150px at the default root size: room for a label of about\n // twenty characters and a six-digit value before the tile truncates.\n local.fit\n ? 'grid-cols-[repeat(auto-fill,minmax(9.375rem,1fr))]'\n : 'sm:grid-cols-2 lg:grid-cols-4',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * PropertyList.\n *\n * A definition list for read-only metadata: the details of a file, a session, a\n * build. This is a `<dl>`, not a table and not a grid of divs, because the\n * relationship being expressed is term-and-definition and the platform has an\n * element for exactly that.\n *\n * Values are selectable by default. Metadata is the thing users copy most and\n * get the least often: a commit hash behind a drag-to-select gesture is a small\n * daily failure.\n */\nexport function PropertyList(props: ComponentProps<'dl'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <dl\n data-slot=\"property-list\"\n class={cn('grid grid-cols-[auto_1fr] items-baseline gap-x-4 gap-y-2 text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function PropertyTerm(props: ComponentProps<'dt'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <dt\n data-slot=\"property-term\"\n class={cn('text-muted-foreground whitespace-nowrap', local.class)}\n {...rest}\n />\n )\n}\n\nexport function PropertyValue(props: ComponentProps<'dd'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <dd\n data-slot=\"property-value\"\n class={cn('min-w-0 break-words select-text', local.class)}\n {...rest}\n />\n )\n}\n\n/** A single term/value pair, for a list built one row at a time. */\nexport function PropertyRow(props: ComponentProps<'div'> & { term: string }) {\n const [local, rest] = splitProps(props, ['class', 'term', 'children'])\n\n return (\n <div\n data-slot=\"property-row\"\n class={cn('flex items-baseline justify-between gap-4 text-sm', local.class)}\n {...rest}\n >\n <span class=\"text-muted-foreground shrink-0\">{local.term}</span>\n <span class=\"min-w-0 truncate text-end select-text\">{local.children}</span>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAgCA,SAAgBkB,KAAKC,OAAkB;CACrC,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,cAAA;EAAA,IAAAG,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAG;EAAAC,OAAAN,MAAAO,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWtB,GACL,2EACA,EAAE,+BAA+Ba,MAAMH,OAAO,GAC9CG,MAAMU,KACR;EAAC,EAAA,GACGT,IAAI,GAAA,OAAA,IAAA;EAAAU,OAAAP,aAEyDJ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tC,OAAiD;CAC3E,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO;EAAC;EAAS;EAAQ;CAAU,CAAC;CAErE,cAAA;EAAA,IAAAwC,QAAAC,QAAA,GAAAC,QAAAF,MAAAlC,YAAAqC,SAAAD,MAAAlC;EAAAC,OAAA+B,OAAA9B,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWtB,GAAG,qDAAqDa,MAAMU,KAAK;EAAC,EAAA,GACvET,IAAI,GAAA,OAAA,IAAA;EAAAU,OAAA8B,aAEsCzC,MAAMsC,IAAI;EAAA3B,OAAA+B,cACH1C,MAAMgB,QAAQ;EAAA,OAAAuB;CAAA,EAAA,CAAA;AAGzE"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ComponentProps } from 'solid-js';
|
|
2
|
+
import { type VariantProps } from '#lib/variants';
|
|
3
|
+
/**
|
|
4
|
+
* Callout.
|
|
5
|
+
*
|
|
6
|
+
* A quiet aside that belongs to the content around it: the summary at the top of
|
|
7
|
+
* an answer, a note in documentation, a remembered fact beside the reply that
|
|
8
|
+
* used it. It is a card-coloured block with one rule on its start edge, and
|
|
9
|
+
* nothing about it interrupts the reader.
|
|
10
|
+
*
|
|
11
|
+
* That is the difference from `Alert`. An `Alert` is a message about the state of
|
|
12
|
+
* the surface it sits in — a failed sync, a validation summary — so it is always
|
|
13
|
+
* `role="alert"`, a live announcement, with a tone glyph and a tinted status
|
|
14
|
+
* surface. A callout is static page content: a plain `div` with `role="note"`, no
|
|
15
|
+
* live region, no icon, and no tint. A caller whose note really is a status
|
|
16
|
+
* message uses `Alert`; one whose note needs a different landmark role passes
|
|
17
|
+
* `role`. Reach for `Card` when the block is a self-contained object with its own
|
|
18
|
+
* header, content and footer; a callout has no parts beyond an optional
|
|
19
|
+
* `CalloutTitle`.
|
|
20
|
+
*
|
|
21
|
+
* The rule is the only thing that varies by `variant`: `default` is the accent
|
|
22
|
+
* (`--primary`), and the four status hues use the same tokens `Alert` does. The
|
|
23
|
+
* rule is a logical `border-s-*`, so it moves to the right in RTL. The corners
|
|
24
|
+
* stay square because a rounded box would curve the rule into a crescent.
|
|
25
|
+
*
|
|
26
|
+
* `size` is the padding rung and the rule's weight together, so a caller never
|
|
27
|
+
* sets `p-*` or a border width to make one denser. The rungs are Cortana's three
|
|
28
|
+
* answer-view callouts, expressed in the Tailwind spacing scale:
|
|
29
|
+
*
|
|
30
|
+
* - `lg`: 22px / 24px padding, 3px rule — Cortana's `.answer-copy`.
|
|
31
|
+
* - `md`: 18px / 20px padding, 3px rule — Cortana's `.answer-memory`.
|
|
32
|
+
* - `sm`: 12px / 14px padding, 2px rule — Cortana's `.answer-note`.
|
|
33
|
+
*
|
|
34
|
+
* Type size and colour are inherited rather than set (only the card foreground is
|
|
35
|
+
* applied), so a callout in a dense panel and one in an article both read at the
|
|
36
|
+
* size of the text around them.
|
|
37
|
+
*
|
|
38
|
+
* Text that has no break opportunity (a 200-character token, a URL, a file path)
|
|
39
|
+
* wraps with `overflow-wrap: anywhere` rather than overflowing the box. `anywhere`
|
|
40
|
+
* and not `break-word`, because only `anywhere` lowers the box's min-content width:
|
|
41
|
+
* a callout that is a flex or grid item (auto minimum size) then shrinks to its
|
|
42
|
+
* track instead of stretching it. The callout's own padding, rule and width are
|
|
43
|
+
* untouched, so none of its sizing differs from Cortana's.
|
|
44
|
+
*
|
|
45
|
+
* The block is deliberately not a flex or grid container: its children are inline
|
|
46
|
+
* text, links and code, and a flex root would turn each of those into a separate
|
|
47
|
+
* item and break the line.
|
|
48
|
+
*/
|
|
49
|
+
export declare const calloutVariants: (props?: ({
|
|
50
|
+
variant?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
51
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
52
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
53
|
+
export type CalloutProps = ComponentProps<'div'> & VariantProps<typeof calloutVariants>;
|
|
54
|
+
export declare function Callout(props: CalloutProps): import("solid-js").JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* An optional heading line for the callout. It is a styled `div`, not a heading
|
|
57
|
+
* element: a callout sits inside someone else's outline, and a fixed heading
|
|
58
|
+
* level would break it. Pass `role="heading"` with `aria-level` where the
|
|
59
|
+
* content does belong in the outline.
|
|
60
|
+
*
|
|
61
|
+
* The title always carries a 4px (`mb-1`) margin below it, whatever follows: a
|
|
62
|
+
* paragraph, a list, or bare text. CSS cannot see text nodes, so a selector such
|
|
63
|
+
* as `:last-child` or `:only-child` cannot tell `<Title/>text` (needs the gap)
|
|
64
|
+
* from `<Title/>` (needs none), and `not-last:mb-1` silently dropped the gap for
|
|
65
|
+
* bare text, the most common body. The unconditional margin is the less
|
|
66
|
+
* surprising failure: it is never missing where text follows. The price is the
|
|
67
|
+
* title-only callout, which would end 4px taller than its padding says. Pass
|
|
68
|
+
* `class="mb-0"` there (`cn` lets the caller's margin win); the `WithTitle` story
|
|
69
|
+
* shows it.
|
|
70
|
+
*/
|
|
71
|
+
export declare function CalloutTitle(props: ComponentProps<'div'>): import("solid-js").JSX.Element;
|
|
72
|
+
//# sourceMappingURL=callout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/callout/callout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,eAAe;;;8EAsB3B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvF,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,kCAU1C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCASxD"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { cva } from "../../../lib/variants.js";
|
|
3
|
+
import { mergeProps, spread, template } from "solid-js/web";
|
|
4
|
+
import { splitProps } from "solid-js";
|
|
5
|
+
//#region src/components/ui/callout/callout.tsx
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=callout role=note>`);
|
|
7
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=callout-title>`);
|
|
8
|
+
/**
|
|
9
|
+
* Callout.
|
|
10
|
+
*
|
|
11
|
+
* A quiet aside that belongs to the content around it: the summary at the top of
|
|
12
|
+
* an answer, a note in documentation, a remembered fact beside the reply that
|
|
13
|
+
* used it. It is a card-coloured block with one rule on its start edge, and
|
|
14
|
+
* nothing about it interrupts the reader.
|
|
15
|
+
*
|
|
16
|
+
* That is the difference from `Alert`. An `Alert` is a message about the state of
|
|
17
|
+
* the surface it sits in — a failed sync, a validation summary — so it is always
|
|
18
|
+
* `role="alert"`, a live announcement, with a tone glyph and a tinted status
|
|
19
|
+
* surface. A callout is static page content: a plain `div` with `role="note"`, no
|
|
20
|
+
* live region, no icon, and no tint. A caller whose note really is a status
|
|
21
|
+
* message uses `Alert`; one whose note needs a different landmark role passes
|
|
22
|
+
* `role`. Reach for `Card` when the block is a self-contained object with its own
|
|
23
|
+
* header, content and footer; a callout has no parts beyond an optional
|
|
24
|
+
* `CalloutTitle`.
|
|
25
|
+
*
|
|
26
|
+
* The rule is the only thing that varies by `variant`: `default` is the accent
|
|
27
|
+
* (`--primary`), and the four status hues use the same tokens `Alert` does. The
|
|
28
|
+
* rule is a logical `border-s-*`, so it moves to the right in RTL. The corners
|
|
29
|
+
* stay square because a rounded box would curve the rule into a crescent.
|
|
30
|
+
*
|
|
31
|
+
* `size` is the padding rung and the rule's weight together, so a caller never
|
|
32
|
+
* sets `p-*` or a border width to make one denser. The rungs are Cortana's three
|
|
33
|
+
* answer-view callouts, expressed in the Tailwind spacing scale:
|
|
34
|
+
*
|
|
35
|
+
* - `lg`: 22px / 24px padding, 3px rule — Cortana's `.answer-copy`.
|
|
36
|
+
* - `md`: 18px / 20px padding, 3px rule — Cortana's `.answer-memory`.
|
|
37
|
+
* - `sm`: 12px / 14px padding, 2px rule — Cortana's `.answer-note`.
|
|
38
|
+
*
|
|
39
|
+
* Type size and colour are inherited rather than set (only the card foreground is
|
|
40
|
+
* applied), so a callout in a dense panel and one in an article both read at the
|
|
41
|
+
* size of the text around them.
|
|
42
|
+
*
|
|
43
|
+
* Text that has no break opportunity (a 200-character token, a URL, a file path)
|
|
44
|
+
* wraps with `overflow-wrap: anywhere` rather than overflowing the box. `anywhere`
|
|
45
|
+
* and not `break-word`, because only `anywhere` lowers the box's min-content width:
|
|
46
|
+
* a callout that is a flex or grid item (auto minimum size) then shrinks to its
|
|
47
|
+
* track instead of stretching it. The callout's own padding, rule and width are
|
|
48
|
+
* untouched, so none of its sizing differs from Cortana's.
|
|
49
|
+
*
|
|
50
|
+
* The block is deliberately not a flex or grid container: its children are inline
|
|
51
|
+
* text, links and code, and a flex root would turn each of those into a separate
|
|
52
|
+
* item and break the line.
|
|
53
|
+
*/
|
|
54
|
+
var calloutVariants = cva("bg-card text-card-foreground block rounded-none wrap-anywhere", {
|
|
55
|
+
variants: {
|
|
56
|
+
variant: {
|
|
57
|
+
default: "border-s-primary",
|
|
58
|
+
destructive: "border-s-destructive",
|
|
59
|
+
success: "border-s-success",
|
|
60
|
+
warning: "border-s-warning",
|
|
61
|
+
info: "border-s-info"
|
|
62
|
+
},
|
|
63
|
+
size: {
|
|
64
|
+
/** 12px block / 14px inline padding, 2px rule: a short inline note. */
|
|
65
|
+
sm: "border-s-2 px-3.5 py-3",
|
|
66
|
+
/** 18px block / 20px inline padding, 3px rule: a supporting aside. */
|
|
67
|
+
md: "border-s-3 px-5 py-4.5",
|
|
68
|
+
/** 22px block / 24px inline padding, 3px rule: the lead summary of a view. */
|
|
69
|
+
lg: "border-s-3 px-6 py-5.5"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
defaultVariants: {
|
|
73
|
+
variant: "default",
|
|
74
|
+
size: "md"
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
function Callout(props) {
|
|
78
|
+
const [local, rest] = splitProps(props, [
|
|
79
|
+
"class",
|
|
80
|
+
"variant",
|
|
81
|
+
"size"
|
|
82
|
+
]);
|
|
83
|
+
return (() => {
|
|
84
|
+
var _el$ = _tmpl$();
|
|
85
|
+
spread(_el$, mergeProps({ get ["class"]() {
|
|
86
|
+
return cn(calloutVariants({
|
|
87
|
+
variant: local.variant,
|
|
88
|
+
size: local.size
|
|
89
|
+
}), local.class);
|
|
90
|
+
} }, rest), false, false);
|
|
91
|
+
return _el$;
|
|
92
|
+
})();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* An optional heading line for the callout. It is a styled `div`, not a heading
|
|
96
|
+
* element: a callout sits inside someone else's outline, and a fixed heading
|
|
97
|
+
* level would break it. Pass `role="heading"` with `aria-level` where the
|
|
98
|
+
* content does belong in the outline.
|
|
99
|
+
*
|
|
100
|
+
* The title always carries a 4px (`mb-1`) margin below it, whatever follows: a
|
|
101
|
+
* paragraph, a list, or bare text. CSS cannot see text nodes, so a selector such
|
|
102
|
+
* as `:last-child` or `:only-child` cannot tell `<Title/>text` (needs the gap)
|
|
103
|
+
* from `<Title/>` (needs none), and `not-last:mb-1` silently dropped the gap for
|
|
104
|
+
* bare text, the most common body. The unconditional margin is the less
|
|
105
|
+
* surprising failure: it is never missing where text follows. The price is the
|
|
106
|
+
* title-only callout, which would end 4px taller than its padding says. Pass
|
|
107
|
+
* `class="mb-0"` there (`cn` lets the caller's margin win); the `WithTitle` story
|
|
108
|
+
* shows it.
|
|
109
|
+
*/
|
|
110
|
+
function CalloutTitle(props) {
|
|
111
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
112
|
+
return (() => {
|
|
113
|
+
var _el$2 = _tmpl$2();
|
|
114
|
+
spread(_el$2, mergeProps({ get ["class"]() {
|
|
115
|
+
return cn("mb-1 font-medium tracking-tight", local.class);
|
|
116
|
+
} }, rest), false, false);
|
|
117
|
+
return _el$2;
|
|
118
|
+
})();
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { Callout, CalloutTitle, calloutVariants };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=callout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.js","names":["ComponentProps","splitProps","cva","VariantProps","cn","calloutVariants","variants","variant","default","destructive","success","warning","info","size","sm","md","lg","defaultVariants","CalloutProps","Callout","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","CalloutTitle","_el$2","_tmpl$2","_$mergeProps"],"sources":["../../../../src/components/ui/callout/callout.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Callout.\n *\n * A quiet aside that belongs to the content around it: the summary at the top of\n * an answer, a note in documentation, a remembered fact beside the reply that\n * used it. It is a card-coloured block with one rule on its start edge, and\n * nothing about it interrupts the reader.\n *\n * That is the difference from `Alert`. An `Alert` is a message about the state of\n * the surface it sits in — a failed sync, a validation summary — so it is always\n * `role=\"alert\"`, a live announcement, with a tone glyph and a tinted status\n * surface. A callout is static page content: a plain `div` with `role=\"note\"`, no\n * live region, no icon, and no tint. A caller whose note really is a status\n * message uses `Alert`; one whose note needs a different landmark role passes\n * `role`. Reach for `Card` when the block is a self-contained object with its own\n * header, content and footer; a callout has no parts beyond an optional\n * `CalloutTitle`.\n *\n * The rule is the only thing that varies by `variant`: `default` is the accent\n * (`--primary`), and the four status hues use the same tokens `Alert` does. The\n * rule is a logical `border-s-*`, so it moves to the right in RTL. The corners\n * stay square because a rounded box would curve the rule into a crescent.\n *\n * `size` is the padding rung and the rule's weight together, so a caller never\n * sets `p-*` or a border width to make one denser. The rungs are Cortana's three\n * answer-view callouts, expressed in the Tailwind spacing scale:\n *\n * - `lg`: 22px / 24px padding, 3px rule — Cortana's `.answer-copy`.\n * - `md`: 18px / 20px padding, 3px rule — Cortana's `.answer-memory`.\n * - `sm`: 12px / 14px padding, 2px rule — Cortana's `.answer-note`.\n *\n * Type size and colour are inherited rather than set (only the card foreground is\n * applied), so a callout in a dense panel and one in an article both read at the\n * size of the text around them.\n *\n * Text that has no break opportunity (a 200-character token, a URL, a file path)\n * wraps with `overflow-wrap: anywhere` rather than overflowing the box. `anywhere`\n * and not `break-word`, because only `anywhere` lowers the box's min-content width:\n * a callout that is a flex or grid item (auto minimum size) then shrinks to its\n * track instead of stretching it. The callout's own padding, rule and width are\n * untouched, so none of its sizing differs from Cortana's.\n *\n * The block is deliberately not a flex or grid container: its children are inline\n * text, links and code, and a flex root would turn each of those into a separate\n * item and break the line.\n */\nexport const calloutVariants = cva(\n 'bg-card text-card-foreground block rounded-none wrap-anywhere',\n {\n variants: {\n variant: {\n default: 'border-s-primary',\n destructive: 'border-s-destructive',\n success: 'border-s-success',\n warning: 'border-s-warning',\n info: 'border-s-info',\n },\n size: {\n /** 12px block / 14px inline padding, 2px rule: a short inline note. */\n sm: 'border-s-2 px-3.5 py-3',\n /** 18px block / 20px inline padding, 3px rule: a supporting aside. */\n md: 'border-s-3 px-5 py-4.5',\n /** 22px block / 24px inline padding, 3px rule: the lead summary of a view. */\n lg: 'border-s-3 px-6 py-5.5',\n },\n },\n defaultVariants: { variant: 'default', size: 'md' },\n }\n)\n\nexport type CalloutProps = ComponentProps<'div'> & VariantProps<typeof calloutVariants>\n\nexport function Callout(props: CalloutProps) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'size'])\n return (\n <div\n data-slot=\"callout\"\n role=\"note\"\n class={cn(calloutVariants({ variant: local.variant, size: local.size }), local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * An optional heading line for the callout. It is a styled `div`, not a heading\n * element: a callout sits inside someone else's outline, and a fixed heading\n * level would break it. Pass `role=\"heading\"` with `aria-level` where the\n * content does belong in the outline.\n *\n * The title always carries a 4px (`mb-1`) margin below it, whatever follows: a\n * paragraph, a list, or bare text. CSS cannot see text nodes, so a selector such\n * as `:last-child` or `:only-child` cannot tell `<Title/>text` (needs the gap)\n * from `<Title/>` (needs none), and `not-last:mb-1` silently dropped the gap for\n * bare text, the most common body. The unconditional margin is the less\n * surprising failure: it is never missing where text follows. The price is the\n * title-only callout, which would end 4px taller than its padding says. Pass\n * `class=\"mb-0\"` there (`cn` lets the caller's margin win); the `WithTitle` story\n * shows it.\n */\nexport function CalloutTitle(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"callout-title\"\n class={cn('mb-1 font-medium tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAaK,kBAAkBH,IAC7B,iEACA;CACEI,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,aAAa;GACbC,SAAS;GACTC,SAAS;GACTC,MAAM;EACR;EACAC,MAAM;;GAEJC,IAAI;;GAEJC,IAAI;;GAEJC,IAAI;EACN;CACF;CACAC,iBAAiB;EAAEV,SAAS;EAAWM,MAAM;CAAK;AACpD,CACF;AAIA,SAAgBM,QAAQC,OAAqB;CAC3C,MAAM,CAACC,OAAOC,QAAQrB,WAAWmB,OAAO;EAAC;EAAS;EAAW;CAAM,CAAC;CACpE,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAIWtB,GAAGC,gBAAgB;IAAEE,SAASc,MAAMd;IAASM,MAAMQ,MAAMR;GAAK,CAAC,GAAGQ,MAAMM,KAAK;EAAC,EAAA,GACjFL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAGd;;;;;;;;;;;;;;;;;AAkBA,SAAgBK,aAAaR,OAA8B;CACzD,MAAM,CAACC,OAAOC,QAAQrB,WAAWmB,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAS,QAAAC,QAAA;EAAAL,OAAAI,OAAAH,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWtB,GAAG,mCAAmCiB,MAAMM,KAAK;EAAC,EAAA,GACrDL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAO;CAAA,EAAA,CAAA;AAGd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/callout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -24,6 +24,15 @@ export declare const cardVariants: (props?: ({
|
|
|
24
24
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
25
25
|
export type CardProps = ComponentProps<'div'> & VariantProps<typeof cardVariants>;
|
|
26
26
|
export declare function Card(props: CardProps): import("solid-js").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* The header is a grid so that `CardAction` has tracks to be placed in: the
|
|
29
|
+
* action is a direct child that takes a second column spanning the title and
|
|
30
|
+
* description rows. A flex column gives `col-start-2` nothing to land on and
|
|
31
|
+
* the action would simply stack under the copy. The extra column exists only
|
|
32
|
+
* for a direct-child action: a wrapper around it is then the header's single
|
|
33
|
+
* grid item, so it keeps the full width. A header without an action lays out as
|
|
34
|
+
* it always did (one full-width column, 4px between its children).
|
|
35
|
+
*/
|
|
27
36
|
export declare function CardHeader(props: ComponentProps<'div'>): import("solid-js").JSX.Element;
|
|
28
37
|
export declare function CardTitle(props: ComponentProps<'div'>): import("solid-js").JSX.Element;
|
|
29
38
|
export declare function CardDescription(props: ComponentProps<'div'>): import("solid-js").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/card/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAItD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY;;8EAexB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAA;AAEjF,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,kCAKpC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/card/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAItD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY;;8EAexB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAA;AAEjF,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,kCAKpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAYtD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCASrD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAS3D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAStD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAGvD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAGtD"}
|
|
@@ -51,12 +51,21 @@ function Card(props) {
|
|
|
51
51
|
return _el$;
|
|
52
52
|
})();
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* The header is a grid so that `CardAction` has tracks to be placed in: the
|
|
56
|
+
* action is a direct child that takes a second column spanning the title and
|
|
57
|
+
* description rows. A flex column gives `col-start-2` nothing to land on and
|
|
58
|
+
* the action would simply stack under the copy. The extra column exists only
|
|
59
|
+
* for a direct-child action: a wrapper around it is then the header's single
|
|
60
|
+
* grid item, so it keeps the full width. A header without an action lays out as
|
|
61
|
+
* it always did (one full-width column, 4px between its children).
|
|
62
|
+
*/
|
|
54
63
|
function CardHeader(props) {
|
|
55
64
|
const [local, rest] = splitProps(props, ["class"]);
|
|
56
65
|
return (() => {
|
|
57
66
|
var _el$2 = _tmpl$2();
|
|
58
67
|
spread(_el$2, mergeProps({ get ["class"]() {
|
|
59
|
-
return cn("
|
|
68
|
+
return cn("grid grid-cols-1 auto-rows-min gap-x-4 gap-y-1 px-4 has-[>[data-slot=card-action]]:grid-cols-[minmax(0,1fr)_auto]", local.class);
|
|
60
69
|
} }, rest), false, false);
|
|
61
70
|
return _el$2;
|
|
62
71
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","names":["ComponentProps","splitProps","cva","VariantProps","cn","headingVariants","cardVariants","variants","size","default","sm","flush","defaultVariants","CardProps","Card","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","CardHeader","_el$2","_tmpl$2","CardTitle","_el$3","_tmpl$3","leading","CardDescription","_el$4","_tmpl$4","CardAction","_el$5","_tmpl$5","CardContent","_el$6","_tmpl$6","CardFooter","_el$7","_tmpl$7","_$mergeProps"],"sources":["../../../../src/components/ui/card/card.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { headingVariants } from '../typography'\n\n/**\n * Card.\n *\n * A surface that sits on the canvas. Every card carries its own edge — a\n * border — because in the light theme `--card` is one faint step off a white\n * `--background`, and a borderless card there all but disappears. Making the border\n * structural rather than optional is what stops one app's cards from reading\n * as floating panels and another's as nothing at all.\n *\n * The parts are separate components rather than a template because a card's\n * header, content and footer have different padding on purpose: the header and\n * footer are tight, the content breathes.\n *\n * `size` is the card's padding rung, so a caller never sets `p-*` or `gap-*` on\n * a card to make it denser. `sm` tightens the card and its header, content and\n * footer together (the parts' inline padding follows the card, so they stay\n * aligned with each other); `flush` removes the block padding and gap for a\n * card whose body is a list of rows or a scroll area that runs edge to edge.\n */\nexport const cardVariants = cva(\n 'bg-card text-card-foreground flex flex-col rounded-xl border border-border shadow-xs',\n {\n variants: {\n size: {\n /** 16px block padding and gap; the parts carry 16px inline padding. */\n default: 'gap-4 py-4',\n /** 12px everywhere: a dense settings or status card. */\n sm: 'gap-3 py-3 *:data-[slot=card-content]:px-3 *:data-[slot=card-footer]:px-3 *:data-[slot=card-header]:px-3',\n /** No block padding or gap: the card hosts a row list or a scroller. */\n flush: 'gap-0 py-0',\n },\n },\n defaultVariants: { size: 'default' },\n }\n)\n\nexport type CardProps = ComponentProps<'div'> & VariantProps<typeof cardVariants>\n\nexport function Card(props: CardProps) {\n const [local, rest] = splitProps(props, ['class', 'size'])\n return (\n <div data-slot=\"card\" class={cn(cardVariants({ size: local.size }), local.class)} {...rest} />\n )\n}\n\nexport function CardHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div
|
|
1
|
+
{"version":3,"file":"card.js","names":["ComponentProps","splitProps","cva","VariantProps","cn","headingVariants","cardVariants","variants","size","default","sm","flush","defaultVariants","CardProps","Card","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","CardHeader","_el$2","_tmpl$2","CardTitle","_el$3","_tmpl$3","leading","CardDescription","_el$4","_tmpl$4","CardAction","_el$5","_tmpl$5","CardContent","_el$6","_tmpl$6","CardFooter","_el$7","_tmpl$7","_$mergeProps"],"sources":["../../../../src/components/ui/card/card.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { headingVariants } from '../typography'\n\n/**\n * Card.\n *\n * A surface that sits on the canvas. Every card carries its own edge — a\n * border — because in the light theme `--card` is one faint step off a white\n * `--background`, and a borderless card there all but disappears. Making the border\n * structural rather than optional is what stops one app's cards from reading\n * as floating panels and another's as nothing at all.\n *\n * The parts are separate components rather than a template because a card's\n * header, content and footer have different padding on purpose: the header and\n * footer are tight, the content breathes.\n *\n * `size` is the card's padding rung, so a caller never sets `p-*` or `gap-*` on\n * a card to make it denser. `sm` tightens the card and its header, content and\n * footer together (the parts' inline padding follows the card, so they stay\n * aligned with each other); `flush` removes the block padding and gap for a\n * card whose body is a list of rows or a scroll area that runs edge to edge.\n */\nexport const cardVariants = cva(\n 'bg-card text-card-foreground flex flex-col rounded-xl border border-border shadow-xs',\n {\n variants: {\n size: {\n /** 16px block padding and gap; the parts carry 16px inline padding. */\n default: 'gap-4 py-4',\n /** 12px everywhere: a dense settings or status card. */\n sm: 'gap-3 py-3 *:data-[slot=card-content]:px-3 *:data-[slot=card-footer]:px-3 *:data-[slot=card-header]:px-3',\n /** No block padding or gap: the card hosts a row list or a scroller. */\n flush: 'gap-0 py-0',\n },\n },\n defaultVariants: { size: 'default' },\n }\n)\n\nexport type CardProps = ComponentProps<'div'> & VariantProps<typeof cardVariants>\n\nexport function Card(props: CardProps) {\n const [local, rest] = splitProps(props, ['class', 'size'])\n return (\n <div data-slot=\"card\" class={cn(cardVariants({ size: local.size }), local.class)} {...rest} />\n )\n}\n\n/**\n * The header is a grid so that `CardAction` has tracks to be placed in: the\n * action is a direct child that takes a second column spanning the title and\n * description rows. A flex column gives `col-start-2` nothing to land on and\n * the action would simply stack under the copy. The extra column exists only\n * for a direct-child action: a wrapper around it is then the header's single\n * grid item, so it keeps the full width. A header without an action lays out as\n * it always did (one full-width column, 4px between its children).\n */\nexport function CardHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"card-header\"\n class={cn(\n 'grid grid-cols-1 auto-rows-min gap-x-4 gap-y-1 px-4 has-[>[data-slot=card-action]]:grid-cols-[minmax(0,1fr)_auto]',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CardTitle(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"card-title\"\n class={cn(headingVariants({ size: 'card', leading: 'none' }), local.class)}\n {...rest}\n />\n )\n}\n\nexport function CardDescription(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"card-description\"\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function CardAction(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"card-action\"\n class={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', local.class)}\n {...rest}\n />\n )\n}\n\nexport function CardContent(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <div data-slot=\"card-content\" class={cn('px-4', local.class)} {...rest} />\n}\n\nexport function CardFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <div data-slot=\"card-footer\" class={cn('flex items-center px-4', local.class)} {...rest} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAaM,eAAeJ,IAC1B,wFACA;CACEK,UAAU,EACRC,MAAM;;EAEJC,SAAS;;EAETC,IAAI;;EAEJC,OAAO;CACT,EACF;CACAC,iBAAiB,EA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,GAAG,iCAAiCY,MAAMM,KAAK;EAAC,EAAA,GACnDL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAc;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,WAAWlB,OAA8B;CACvD,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAmB,QAAAC,QAAA;EAAAf,OAAAc,OAAAb,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWjB,GAAG,kEAAkEY,MAAMM,KAAK;EAAC,EAAA,GACpFL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAiB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,YAAYrB,OAA8B;CACxD,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAsB,QAAAC,QAAA;EAAAlB,OAAAiB,OAAAhB,WAAA,EAAA,KAAA,WAAA;GAAA,OAA4CjB,GAAG,QAAQY,MAAMM,KAAK;EAAC,EAAA,GAAML,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAoB;CAAA,EAAA,CAAA;AAC/E;AAEA,SAAgBE,WAAWxB,OAA8B;CACvD,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAyB,QAAAC,QAAA;EAAArB,OAAAoB,OAAAnB,WAAA,EAAA,KAAA,WAAA;GAAA,OAA2CjB,GAAG,0BAA0BY,MAAMM,KAAK;EAAC,EAAA,GAAML,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAuB;CAAA,EAAA,CAAA;AAChG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export * from './components/ui/breadcrumb';
|
|
|
25
25
|
export * from './components/ui/button';
|
|
26
26
|
export * from './components/ui/button-group';
|
|
27
27
|
export * from './components/ui/calendar';
|
|
28
|
+
export * from './components/ui/callout';
|
|
28
29
|
export * from './components/ui/card';
|
|
29
30
|
export * from './components/ui/checkbox';
|
|
30
31
|
export * from './components/ui/collapsible';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B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 +14,7 @@ import { Button, buttonVariants } from "./components/ui/button/button.js";
|
|
|
14
14
|
import { Separator } from "./components/ui/separator/separator.js";
|
|
15
15
|
import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText } from "./components/ui/button-group/button-group.js";
|
|
16
16
|
import { CalendarSurface, DatePicker } from "./components/ui/calendar/calendar.js";
|
|
17
|
+
import { Callout, CalloutTitle, calloutVariants } from "./components/ui/callout/callout.js";
|
|
17
18
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants } from "./components/ui/card/card.js";
|
|
18
19
|
import { Checkbox, CheckboxDescription, CheckboxLabel } from "./components/ui/checkbox/checkbox.js";
|
|
19
20
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible/collapsible.js";
|
|
@@ -145,4 +146,4 @@ import { AboutDialog } from "./components/composites/about-dialog/about-dialog.j
|
|
|
145
146
|
import { HelpCenter } from "./components/composites/help-center/help-center.js";
|
|
146
147
|
import { WorkspaceMark } from "./components/composites/workspace-mark/workspace-mark.js";
|
|
147
148
|
import { writeClipboardText } from "./lib/clipboard.js";
|
|
148
|
-
export { APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, AspectRatio, AttachmentCard, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CalendarSurface, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChatComposer, Checkbox, CheckboxDescription, CheckboxLabel, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MessageBody, MessageComposer, MessageDayDivider, MessageGroup, MessageRow, ModalDialog, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelResizeHandle, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Spinner, SplitLayout, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, TranscriptComposition, Tree, TreeRow, TreeRowActions, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, accentPresets, alertVariants, allTokens, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, builtinThemes, buttonVariants, cardVariants, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, closePane, cn, colorTokens, computeLayoutFrames, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countLeaves, countLines, createAppMenuItems, createLayoutState, createVersionedPersistence, cva, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findTokenRanges, focusPane, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatBytes, formatReleaseDate, formatToken, headingElement, headingVariants, initialsFrom, inlineScriptLiteral, isCustomAccent, isPasteBlock, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, localStoragePersistence, monogram, motionTokens, movePane, neighborLeaf, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeLayout, normalizeSurface, paintAccentRoles, parseDiff, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, recollapsePastes, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, searchShortcutKeyshortcuts, searchShortcutLabel, sheetVariants, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stripTrailingBlankLines, surfaceAlpha, surfaceInteractive, swapPanes, terminalCssVariables, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, writeClipboardText, writeVersionedRecord, zIndexTokens };
|
|
149
|
+
export { APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, AspectRatio, AttachmentCard, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CalendarSurface, Callout, CalloutTitle, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChatComposer, Checkbox, CheckboxDescription, CheckboxLabel, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MessageBody, MessageComposer, MessageDayDivider, MessageGroup, MessageRow, ModalDialog, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelResizeHandle, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Spinner, SplitLayout, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, TranscriptComposition, Tree, TreeRow, TreeRowActions, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, accentPresets, alertVariants, allTokens, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, builtinThemes, buttonVariants, calloutVariants, cardVariants, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, closePane, cn, colorTokens, computeLayoutFrames, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countLeaves, countLines, createAppMenuItems, createLayoutState, createVersionedPersistence, cva, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findTokenRanges, focusPane, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatBytes, formatReleaseDate, formatToken, headingElement, headingVariants, initialsFrom, inlineScriptLiteral, isCustomAccent, isPasteBlock, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, localStoragePersistence, monogram, motionTokens, movePane, neighborLeaf, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeLayout, normalizeSurface, paintAccentRoles, parseDiff, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, recollapsePastes, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, searchShortcutKeyshortcuts, searchShortcutLabel, sheetVariants, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stripTrailingBlankLines, surfaceAlpha, surfaceInteractive, swapPanes, terminalCssVariables, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, writeClipboardText, writeVersionedRecord, zIndexTokens };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "callout",
|
|
3
|
+
"type": "registry:ui",
|
|
4
|
+
"title": "Callout",
|
|
5
|
+
"description": "",
|
|
6
|
+
"dependencies": [],
|
|
7
|
+
"registryDependencies": [
|
|
8
|
+
"lib"
|
|
9
|
+
],
|
|
10
|
+
"files": [
|
|
11
|
+
{
|
|
12
|
+
"path": "src/components/ui/callout/callout.tsx",
|
|
13
|
+
"type": "registry:ui",
|
|
14
|
+
"target": "components/ui/callout/callout.tsx"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"path": "src/components/ui/callout/index.ts",
|
|
18
|
+
"type": "registry:ui",
|
|
19
|
+
"target": "components/ui/callout/index.ts"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
package/dist/r/registry.json
CHANGED
|
@@ -297,6 +297,28 @@
|
|
|
297
297
|
}
|
|
298
298
|
]
|
|
299
299
|
},
|
|
300
|
+
{
|
|
301
|
+
"name": "callout",
|
|
302
|
+
"type": "registry:ui",
|
|
303
|
+
"title": "Callout",
|
|
304
|
+
"description": "",
|
|
305
|
+
"dependencies": [],
|
|
306
|
+
"registryDependencies": [
|
|
307
|
+
"lib"
|
|
308
|
+
],
|
|
309
|
+
"files": [
|
|
310
|
+
{
|
|
311
|
+
"path": "src/components/ui/callout/callout.tsx",
|
|
312
|
+
"type": "registry:ui",
|
|
313
|
+
"target": "components/ui/callout/callout.tsx"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"path": "src/components/ui/callout/index.ts",
|
|
317
|
+
"type": "registry:ui",
|
|
318
|
+
"target": "components/ui/callout/index.ts"
|
|
319
|
+
}
|
|
320
|
+
]
|
|
321
|
+
},
|
|
300
322
|
{
|
|
301
323
|
"name": "card",
|
|
302
324
|
"type": "registry:ui",
|
|
@@ -83,13 +83,31 @@ export function Stat(props: StatProps) {
|
|
|
83
83
|
)
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
/**
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
/**
|
|
87
|
+
* A row of stats that shares one gap and wraps as the window narrows.
|
|
88
|
+
*
|
|
89
|
+
* By default the column count steps with the *viewport* (two from `sm`, four from
|
|
90
|
+
* `lg`), which is right for a group that spans the page. A group inside a pane
|
|
91
|
+
* whose width is not the window's (a docked panel, a resizable column, a view
|
|
92
|
+
* beside a sidebar) gets the wrong count from a viewport breakpoint. `fit` sizes
|
|
93
|
+
* from the group's own width instead: as many tiles per row as fit at the
|
|
94
|
+
* minimum tile width, each growing to share the remainder, however many stats
|
|
95
|
+
* there are.
|
|
96
|
+
*/
|
|
97
|
+
export function StatGroup(props: ComponentProps<'div'> & { fit?: boolean }) {
|
|
98
|
+
const [local, rest] = splitProps(props, ['class', 'fit'])
|
|
89
99
|
return (
|
|
90
100
|
<div
|
|
91
101
|
data-slot="stat-group"
|
|
92
|
-
class={cn(
|
|
102
|
+
class={cn(
|
|
103
|
+
'grid gap-3',
|
|
104
|
+
// 9.375rem is 150px at the default root size: room for a label of about
|
|
105
|
+
// twenty characters and a six-digit value before the tile truncates.
|
|
106
|
+
local.fit
|
|
107
|
+
? 'grid-cols-[repeat(auto-fill,minmax(9.375rem,1fr))]'
|
|
108
|
+
: 'sm:grid-cols-2 lg:grid-cols-4',
|
|
109
|
+
local.class
|
|
110
|
+
)}
|
|
93
111
|
{...rest}
|
|
94
112
|
/>
|
|
95
113
|
)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { ComponentProps } from 'solid-js'
|
|
2
|
+
import { splitProps } from 'solid-js'
|
|
3
|
+
import { cva, type VariantProps } from '../../../lib/variants'
|
|
4
|
+
import { cn } from '../../../lib/utils'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Callout.
|
|
8
|
+
*
|
|
9
|
+
* A quiet aside that belongs to the content around it: the summary at the top of
|
|
10
|
+
* an answer, a note in documentation, a remembered fact beside the reply that
|
|
11
|
+
* used it. It is a card-coloured block with one rule on its start edge, and
|
|
12
|
+
* nothing about it interrupts the reader.
|
|
13
|
+
*
|
|
14
|
+
* That is the difference from `Alert`. An `Alert` is a message about the state of
|
|
15
|
+
* the surface it sits in — a failed sync, a validation summary — so it is always
|
|
16
|
+
* `role="alert"`, a live announcement, with a tone glyph and a tinted status
|
|
17
|
+
* surface. A callout is static page content: a plain `div` with `role="note"`, no
|
|
18
|
+
* live region, no icon, and no tint. A caller whose note really is a status
|
|
19
|
+
* message uses `Alert`; one whose note needs a different landmark role passes
|
|
20
|
+
* `role`. Reach for `Card` when the block is a self-contained object with its own
|
|
21
|
+
* header, content and footer; a callout has no parts beyond an optional
|
|
22
|
+
* `CalloutTitle`.
|
|
23
|
+
*
|
|
24
|
+
* The rule is the only thing that varies by `variant`: `default` is the accent
|
|
25
|
+
* (`--primary`), and the four status hues use the same tokens `Alert` does. The
|
|
26
|
+
* rule is a logical `border-s-*`, so it moves to the right in RTL. The corners
|
|
27
|
+
* stay square because a rounded box would curve the rule into a crescent.
|
|
28
|
+
*
|
|
29
|
+
* `size` is the padding rung and the rule's weight together, so a caller never
|
|
30
|
+
* sets `p-*` or a border width to make one denser. The rungs are Cortana's three
|
|
31
|
+
* answer-view callouts, expressed in the Tailwind spacing scale:
|
|
32
|
+
*
|
|
33
|
+
* - `lg`: 22px / 24px padding, 3px rule — Cortana's `.answer-copy`.
|
|
34
|
+
* - `md`: 18px / 20px padding, 3px rule — Cortana's `.answer-memory`.
|
|
35
|
+
* - `sm`: 12px / 14px padding, 2px rule — Cortana's `.answer-note`.
|
|
36
|
+
*
|
|
37
|
+
* Type size and colour are inherited rather than set (only the card foreground is
|
|
38
|
+
* applied), so a callout in a dense panel and one in an article both read at the
|
|
39
|
+
* size of the text around them.
|
|
40
|
+
*
|
|
41
|
+
* Text that has no break opportunity (a 200-character token, a URL, a file path)
|
|
42
|
+
* wraps with `overflow-wrap: anywhere` rather than overflowing the box. `anywhere`
|
|
43
|
+
* and not `break-word`, because only `anywhere` lowers the box's min-content width:
|
|
44
|
+
* a callout that is a flex or grid item (auto minimum size) then shrinks to its
|
|
45
|
+
* track instead of stretching it. The callout's own padding, rule and width are
|
|
46
|
+
* untouched, so none of its sizing differs from Cortana's.
|
|
47
|
+
*
|
|
48
|
+
* The block is deliberately not a flex or grid container: its children are inline
|
|
49
|
+
* text, links and code, and a flex root would turn each of those into a separate
|
|
50
|
+
* item and break the line.
|
|
51
|
+
*/
|
|
52
|
+
export const calloutVariants = cva(
|
|
53
|
+
'bg-card text-card-foreground block rounded-none wrap-anywhere',
|
|
54
|
+
{
|
|
55
|
+
variants: {
|
|
56
|
+
variant: {
|
|
57
|
+
default: 'border-s-primary',
|
|
58
|
+
destructive: 'border-s-destructive',
|
|
59
|
+
success: 'border-s-success',
|
|
60
|
+
warning: 'border-s-warning',
|
|
61
|
+
info: 'border-s-info',
|
|
62
|
+
},
|
|
63
|
+
size: {
|
|
64
|
+
/** 12px block / 14px inline padding, 2px rule: a short inline note. */
|
|
65
|
+
sm: 'border-s-2 px-3.5 py-3',
|
|
66
|
+
/** 18px block / 20px inline padding, 3px rule: a supporting aside. */
|
|
67
|
+
md: 'border-s-3 px-5 py-4.5',
|
|
68
|
+
/** 22px block / 24px inline padding, 3px rule: the lead summary of a view. */
|
|
69
|
+
lg: 'border-s-3 px-6 py-5.5',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
defaultVariants: { variant: 'default', size: 'md' },
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
export type CalloutProps = ComponentProps<'div'> & VariantProps<typeof calloutVariants>
|
|
77
|
+
|
|
78
|
+
export function Callout(props: CalloutProps) {
|
|
79
|
+
const [local, rest] = splitProps(props, ['class', 'variant', 'size'])
|
|
80
|
+
return (
|
|
81
|
+
<div
|
|
82
|
+
data-slot="callout"
|
|
83
|
+
role="note"
|
|
84
|
+
class={cn(calloutVariants({ variant: local.variant, size: local.size }), local.class)}
|
|
85
|
+
{...rest}
|
|
86
|
+
/>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* An optional heading line for the callout. It is a styled `div`, not a heading
|
|
92
|
+
* element: a callout sits inside someone else's outline, and a fixed heading
|
|
93
|
+
* level would break it. Pass `role="heading"` with `aria-level` where the
|
|
94
|
+
* content does belong in the outline.
|
|
95
|
+
*
|
|
96
|
+
* The title always carries a 4px (`mb-1`) margin below it, whatever follows: a
|
|
97
|
+
* paragraph, a list, or bare text. CSS cannot see text nodes, so a selector such
|
|
98
|
+
* as `:last-child` or `:only-child` cannot tell `<Title/>text` (needs the gap)
|
|
99
|
+
* from `<Title/>` (needs none), and `not-last:mb-1` silently dropped the gap for
|
|
100
|
+
* bare text, the most common body. The unconditional margin is the less
|
|
101
|
+
* surprising failure: it is never missing where text follows. The price is the
|
|
102
|
+
* title-only callout, which would end 4px taller than its padding says. Pass
|
|
103
|
+
* `class="mb-0"` there (`cn` lets the caller's margin win); the `WithTitle` story
|
|
104
|
+
* shows it.
|
|
105
|
+
*/
|
|
106
|
+
export function CalloutTitle(props: ComponentProps<'div'>) {
|
|
107
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
108
|
+
return (
|
|
109
|
+
<div
|
|
110
|
+
data-slot="callout-title"
|
|
111
|
+
class={cn('mb-1 font-medium tracking-tight', local.class)}
|
|
112
|
+
{...rest}
|
|
113
|
+
/>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Callout, CalloutTitle, calloutVariants, type CalloutProps } from './callout'
|
|
@@ -49,10 +49,26 @@ export function Card(props: CardProps) {
|
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* The header is a grid so that `CardAction` has tracks to be placed in: the
|
|
54
|
+
* action is a direct child that takes a second column spanning the title and
|
|
55
|
+
* description rows. A flex column gives `col-start-2` nothing to land on and
|
|
56
|
+
* the action would simply stack under the copy. The extra column exists only
|
|
57
|
+
* for a direct-child action: a wrapper around it is then the header's single
|
|
58
|
+
* grid item, so it keeps the full width. A header without an action lays out as
|
|
59
|
+
* it always did (one full-width column, 4px between its children).
|
|
60
|
+
*/
|
|
52
61
|
export function CardHeader(props: ComponentProps<'div'>) {
|
|
53
62
|
const [local, rest] = splitProps(props, ['class'])
|
|
54
63
|
return (
|
|
55
|
-
<div
|
|
64
|
+
<div
|
|
65
|
+
data-slot="card-header"
|
|
66
|
+
class={cn(
|
|
67
|
+
'grid grid-cols-1 auto-rows-min gap-x-4 gap-y-1 px-4 has-[>[data-slot=card-action]]:grid-cols-[minmax(0,1fr)_auto]',
|
|
68
|
+
local.class
|
|
69
|
+
)}
|
|
70
|
+
{...rest}
|
|
71
|
+
/>
|
|
56
72
|
)
|
|
57
73
|
}
|
|
58
74
|
|
package/package.json
CHANGED
package/registry.json
CHANGED
|
@@ -297,6 +297,28 @@
|
|
|
297
297
|
}
|
|
298
298
|
]
|
|
299
299
|
},
|
|
300
|
+
{
|
|
301
|
+
"name": "callout",
|
|
302
|
+
"type": "registry:ui",
|
|
303
|
+
"title": "Callout",
|
|
304
|
+
"description": "",
|
|
305
|
+
"dependencies": [],
|
|
306
|
+
"registryDependencies": [
|
|
307
|
+
"lib"
|
|
308
|
+
],
|
|
309
|
+
"files": [
|
|
310
|
+
{
|
|
311
|
+
"path": "src/components/ui/callout/callout.tsx",
|
|
312
|
+
"type": "registry:ui",
|
|
313
|
+
"target": "components/ui/callout/callout.tsx"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"path": "src/components/ui/callout/index.ts",
|
|
317
|
+
"type": "registry:ui",
|
|
318
|
+
"target": "components/ui/callout/index.ts"
|
|
319
|
+
}
|
|
320
|
+
]
|
|
321
|
+
},
|
|
300
322
|
{
|
|
301
323
|
"name": "card",
|
|
302
324
|
"type": "registry:ui",
|
|
@@ -83,13 +83,31 @@ export function Stat(props: StatProps) {
|
|
|
83
83
|
)
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
/**
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
/**
|
|
87
|
+
* A row of stats that shares one gap and wraps as the window narrows.
|
|
88
|
+
*
|
|
89
|
+
* By default the column count steps with the *viewport* (two from `sm`, four from
|
|
90
|
+
* `lg`), which is right for a group that spans the page. A group inside a pane
|
|
91
|
+
* whose width is not the window's (a docked panel, a resizable column, a view
|
|
92
|
+
* beside a sidebar) gets the wrong count from a viewport breakpoint. `fit` sizes
|
|
93
|
+
* from the group's own width instead: as many tiles per row as fit at the
|
|
94
|
+
* minimum tile width, each growing to share the remainder, however many stats
|
|
95
|
+
* there are.
|
|
96
|
+
*/
|
|
97
|
+
export function StatGroup(props: ComponentProps<'div'> & { fit?: boolean }) {
|
|
98
|
+
const [local, rest] = splitProps(props, ['class', 'fit'])
|
|
89
99
|
return (
|
|
90
100
|
<div
|
|
91
101
|
data-slot="stat-group"
|
|
92
|
-
class={cn(
|
|
102
|
+
class={cn(
|
|
103
|
+
'grid gap-3',
|
|
104
|
+
// 9.375rem is 150px at the default root size: room for a label of about
|
|
105
|
+
// twenty characters and a six-digit value before the tile truncates.
|
|
106
|
+
local.fit
|
|
107
|
+
? 'grid-cols-[repeat(auto-fill,minmax(9.375rem,1fr))]'
|
|
108
|
+
: 'sm:grid-cols-2 lg:grid-cols-4',
|
|
109
|
+
local.class
|
|
110
|
+
)}
|
|
93
111
|
{...rest}
|
|
94
112
|
/>
|
|
95
113
|
)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { ComponentProps } from 'solid-js'
|
|
2
|
+
import { splitProps } from 'solid-js'
|
|
3
|
+
import { cva, type VariantProps } from '#lib/variants'
|
|
4
|
+
import { cn } from '#lib/utils'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Callout.
|
|
8
|
+
*
|
|
9
|
+
* A quiet aside that belongs to the content around it: the summary at the top of
|
|
10
|
+
* an answer, a note in documentation, a remembered fact beside the reply that
|
|
11
|
+
* used it. It is a card-coloured block with one rule on its start edge, and
|
|
12
|
+
* nothing about it interrupts the reader.
|
|
13
|
+
*
|
|
14
|
+
* That is the difference from `Alert`. An `Alert` is a message about the state of
|
|
15
|
+
* the surface it sits in — a failed sync, a validation summary — so it is always
|
|
16
|
+
* `role="alert"`, a live announcement, with a tone glyph and a tinted status
|
|
17
|
+
* surface. A callout is static page content: a plain `div` with `role="note"`, no
|
|
18
|
+
* live region, no icon, and no tint. A caller whose note really is a status
|
|
19
|
+
* message uses `Alert`; one whose note needs a different landmark role passes
|
|
20
|
+
* `role`. Reach for `Card` when the block is a self-contained object with its own
|
|
21
|
+
* header, content and footer; a callout has no parts beyond an optional
|
|
22
|
+
* `CalloutTitle`.
|
|
23
|
+
*
|
|
24
|
+
* The rule is the only thing that varies by `variant`: `default` is the accent
|
|
25
|
+
* (`--primary`), and the four status hues use the same tokens `Alert` does. The
|
|
26
|
+
* rule is a logical `border-s-*`, so it moves to the right in RTL. The corners
|
|
27
|
+
* stay square because a rounded box would curve the rule into a crescent.
|
|
28
|
+
*
|
|
29
|
+
* `size` is the padding rung and the rule's weight together, so a caller never
|
|
30
|
+
* sets `p-*` or a border width to make one denser. The rungs are Cortana's three
|
|
31
|
+
* answer-view callouts, expressed in the Tailwind spacing scale:
|
|
32
|
+
*
|
|
33
|
+
* - `lg`: 22px / 24px padding, 3px rule — Cortana's `.answer-copy`.
|
|
34
|
+
* - `md`: 18px / 20px padding, 3px rule — Cortana's `.answer-memory`.
|
|
35
|
+
* - `sm`: 12px / 14px padding, 2px rule — Cortana's `.answer-note`.
|
|
36
|
+
*
|
|
37
|
+
* Type size and colour are inherited rather than set (only the card foreground is
|
|
38
|
+
* applied), so a callout in a dense panel and one in an article both read at the
|
|
39
|
+
* size of the text around them.
|
|
40
|
+
*
|
|
41
|
+
* Text that has no break opportunity (a 200-character token, a URL, a file path)
|
|
42
|
+
* wraps with `overflow-wrap: anywhere` rather than overflowing the box. `anywhere`
|
|
43
|
+
* and not `break-word`, because only `anywhere` lowers the box's min-content width:
|
|
44
|
+
* a callout that is a flex or grid item (auto minimum size) then shrinks to its
|
|
45
|
+
* track instead of stretching it. The callout's own padding, rule and width are
|
|
46
|
+
* untouched, so none of its sizing differs from Cortana's.
|
|
47
|
+
*
|
|
48
|
+
* The block is deliberately not a flex or grid container: its children are inline
|
|
49
|
+
* text, links and code, and a flex root would turn each of those into a separate
|
|
50
|
+
* item and break the line.
|
|
51
|
+
*/
|
|
52
|
+
export const calloutVariants = cva(
|
|
53
|
+
'bg-card text-card-foreground block rounded-none wrap-anywhere',
|
|
54
|
+
{
|
|
55
|
+
variants: {
|
|
56
|
+
variant: {
|
|
57
|
+
default: 'border-s-primary',
|
|
58
|
+
destructive: 'border-s-destructive',
|
|
59
|
+
success: 'border-s-success',
|
|
60
|
+
warning: 'border-s-warning',
|
|
61
|
+
info: 'border-s-info',
|
|
62
|
+
},
|
|
63
|
+
size: {
|
|
64
|
+
/** 12px block / 14px inline padding, 2px rule: a short inline note. */
|
|
65
|
+
sm: 'border-s-2 px-3.5 py-3',
|
|
66
|
+
/** 18px block / 20px inline padding, 3px rule: a supporting aside. */
|
|
67
|
+
md: 'border-s-3 px-5 py-4.5',
|
|
68
|
+
/** 22px block / 24px inline padding, 3px rule: the lead summary of a view. */
|
|
69
|
+
lg: 'border-s-3 px-6 py-5.5',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
defaultVariants: { variant: 'default', size: 'md' },
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
export type CalloutProps = ComponentProps<'div'> & VariantProps<typeof calloutVariants>
|
|
77
|
+
|
|
78
|
+
export function Callout(props: CalloutProps) {
|
|
79
|
+
const [local, rest] = splitProps(props, ['class', 'variant', 'size'])
|
|
80
|
+
return (
|
|
81
|
+
<div
|
|
82
|
+
data-slot="callout"
|
|
83
|
+
role="note"
|
|
84
|
+
class={cn(calloutVariants({ variant: local.variant, size: local.size }), local.class)}
|
|
85
|
+
{...rest}
|
|
86
|
+
/>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* An optional heading line for the callout. It is a styled `div`, not a heading
|
|
92
|
+
* element: a callout sits inside someone else's outline, and a fixed heading
|
|
93
|
+
* level would break it. Pass `role="heading"` with `aria-level` where the
|
|
94
|
+
* content does belong in the outline.
|
|
95
|
+
*
|
|
96
|
+
* The title always carries a 4px (`mb-1`) margin below it, whatever follows: a
|
|
97
|
+
* paragraph, a list, or bare text. CSS cannot see text nodes, so a selector such
|
|
98
|
+
* as `:last-child` or `:only-child` cannot tell `<Title/>text` (needs the gap)
|
|
99
|
+
* from `<Title/>` (needs none), and `not-last:mb-1` silently dropped the gap for
|
|
100
|
+
* bare text, the most common body. The unconditional margin is the less
|
|
101
|
+
* surprising failure: it is never missing where text follows. The price is the
|
|
102
|
+
* title-only callout, which would end 4px taller than its padding says. Pass
|
|
103
|
+
* `class="mb-0"` there (`cn` lets the caller's margin win); the `WithTitle` story
|
|
104
|
+
* shows it.
|
|
105
|
+
*/
|
|
106
|
+
export function CalloutTitle(props: ComponentProps<'div'>) {
|
|
107
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
108
|
+
return (
|
|
109
|
+
<div
|
|
110
|
+
data-slot="callout-title"
|
|
111
|
+
class={cn('mb-1 font-medium tracking-tight', local.class)}
|
|
112
|
+
{...rest}
|
|
113
|
+
/>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Callout, CalloutTitle, calloutVariants, type CalloutProps } from './callout'
|
|
@@ -49,10 +49,26 @@ export function Card(props: CardProps) {
|
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* The header is a grid so that `CardAction` has tracks to be placed in: the
|
|
54
|
+
* action is a direct child that takes a second column spanning the title and
|
|
55
|
+
* description rows. A flex column gives `col-start-2` nothing to land on and
|
|
56
|
+
* the action would simply stack under the copy. The extra column exists only
|
|
57
|
+
* for a direct-child action: a wrapper around it is then the header's single
|
|
58
|
+
* grid item, so it keeps the full width. A header without an action lays out as
|
|
59
|
+
* it always did (one full-width column, 4px between its children).
|
|
60
|
+
*/
|
|
52
61
|
export function CardHeader(props: ComponentProps<'div'>) {
|
|
53
62
|
const [local, rest] = splitProps(props, ['class'])
|
|
54
63
|
return (
|
|
55
|
-
<div
|
|
64
|
+
<div
|
|
65
|
+
data-slot="card-header"
|
|
66
|
+
class={cn(
|
|
67
|
+
'grid grid-cols-1 auto-rows-min gap-x-4 gap-y-1 px-4 has-[>[data-slot=card-action]]:grid-cols-[minmax(0,1fr)_auto]',
|
|
68
|
+
local.class
|
|
69
|
+
)}
|
|
70
|
+
{...rest}
|
|
71
|
+
/>
|
|
56
72
|
)
|
|
57
73
|
}
|
|
58
74
|
|
package/src/index.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from './components/ui/breadcrumb'
|
|
|
27
27
|
export * from './components/ui/button'
|
|
28
28
|
export * from './components/ui/button-group'
|
|
29
29
|
export * from './components/ui/calendar'
|
|
30
|
+
export * from './components/ui/callout'
|
|
30
31
|
export * from './components/ui/card'
|
|
31
32
|
export * from './components/ui/checkbox'
|
|
32
33
|
export * from './components/ui/collapsible'
|