@sereno-ds/ui 0.39.0 → 0.40.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.
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+
3
+ type ActionCardVariant = 'default' | 'primary' | 'error';
4
+ /**
5
+ * A whole card you press: an icon, a title, a line of explanation and an arrow, in a real
6
+ * `<button>`. For the options of a decision ("Reschedule", "Cancel the booking") and for the
7
+ * entries of a settings flow. A `Card` with `interactive` is the bare surface; this is the
8
+ * finished control, with the keyboard, the focus ring and the disabled state taken care of.
9
+ *
10
+ * It is an action, not a radio: arrow keys do not move between cards. `selected` marks a card as
11
+ * a toggle (`aria-pressed`); for "choose exactly one of these" the semantics are a radio group's,
12
+ * which this is not.
13
+ */
14
+ interface ActionCardProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'title' | 'children'> {
15
+ /** What the card does. Short: it is the name a screen reader says. */
16
+ title: React.ReactNode;
17
+ /** One line that says what happens. */
18
+ description?: React.ReactNode;
19
+ /** An icon (a `lucide-react` element), drawn in a tile on the left. Hidden from a screen reader: the title says it. */
20
+ icon?: React.ReactNode;
21
+ /** What sits on the right. An arrow by default; any node, or `null` for nothing. */
22
+ trailing?: React.ReactNode;
23
+ /**
24
+ * Passing it (true or false) makes the card a toggle: it reports `aria-pressed` and, when true,
25
+ * wears the brand ring. Leave it out for a plain action.
26
+ */
27
+ selected?: boolean;
28
+ /** `primary` is the option to steer toward, `error` a destructive one. */
29
+ variant?: ActionCardVariant;
30
+ }
31
+ declare function ActionCard({ title, description, icon, trailing, selected, variant, disabled, style, ...rest }: ActionCardProps): React.JSX.Element;
32
+
33
+ export { ActionCard, type ActionCardProps, type ActionCardVariant };
@@ -0,0 +1,91 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { ChevronRight } from "lucide-react";
4
+ import { sx } from "../_internal/style.js";
5
+ import { useInteract } from "./Button.js";
6
+ import { Typography } from "./Typography.js";
7
+ const VARIANTS = {
8
+ default: { tileBg: "var(--bg-subtle)", tileFg: "var(--text-secondary)", edge: "var(--border-brand)" },
9
+ primary: { tileBg: "var(--interactive-primary)", tileFg: "var(--interactive-primary-fg)", edge: "var(--border-brand)" },
10
+ error: { tileBg: "var(--status-error-bg)", tileFg: "var(--status-error-fg)", edge: "var(--status-error-dot)", title: "var(--status-error-fg)" }
11
+ };
12
+ const hoverFill = (edge) => "color-mix(in srgb, " + edge + " 6%, var(--bg-surface))";
13
+ function ActionCard({
14
+ title,
15
+ description,
16
+ icon,
17
+ trailing,
18
+ selected,
19
+ variant = "default",
20
+ disabled = false,
21
+ style,
22
+ ...rest
23
+ }) {
24
+ const st = useInteract(disabled);
25
+ const v = VARIANTS[variant] || VARIANTS.default;
26
+ const on = selected === true;
27
+ const arrow = trailing === void 0 ? /* @__PURE__ */ jsx(ChevronRight, { size: 18, strokeWidth: 1.75, "aria-hidden": true }) : trailing;
28
+ const ring = on ? "0 0 0 1.5px " + v.edge : "0 0 0 1px " + (!disabled && st.hover ? v.edge : disabled ? "var(--border-subtle)" : "var(--border-default)");
29
+ const muted = disabled ? { color: "var(--text-disabled)" } : void 0;
30
+ const titleStyle = disabled ? muted : v.title ? { color: v.title } : void 0;
31
+ return /* @__PURE__ */ jsxs(
32
+ "button",
33
+ {
34
+ type: "button",
35
+ disabled,
36
+ "aria-pressed": selected,
37
+ ...st.handlers,
38
+ ...rest,
39
+ style: sx({
40
+ display: "flex",
41
+ alignItems: "center",
42
+ gap: "var(--space-3)",
43
+ width: "100%",
44
+ minWidth: 0,
45
+ padding: "var(--space-3) var(--space-4)",
46
+ textAlign: "left",
47
+ fontFamily: "var(--font-body)",
48
+ color: "inherit",
49
+ border: "none",
50
+ borderRadius: "var(--radius-card)",
51
+ background: !disabled && st.hover ? hoverFill(v.edge) : "var(--bg-surface)",
52
+ boxShadow: [ring, st.focus ? "var(--focus-ring)" : null].filter(Boolean).join(", "),
53
+ transform: st.press && !disabled ? "scale(var(--press-scale))" : "none",
54
+ cursor: disabled ? "not-allowed" : "pointer",
55
+ transition: "var(--transition-control)",
56
+ // The focus ring above is the box-shadow, the same substitute `Button` and `Card` use.
57
+ outline: "none",
58
+ ...style
59
+ }),
60
+ children: [
61
+ icon ? /* @__PURE__ */ jsx(
62
+ "span",
63
+ {
64
+ "aria-hidden": true,
65
+ style: sx({
66
+ display: "inline-flex",
67
+ alignItems: "center",
68
+ justifyContent: "center",
69
+ flex: "0 0 auto",
70
+ width: 40,
71
+ height: 40,
72
+ borderRadius: "var(--radius-md)",
73
+ background: disabled ? "var(--interactive-disabled-bg)" : v.tileBg,
74
+ color: disabled ? "var(--interactive-disabled-fg)" : v.tileFg
75
+ }),
76
+ children: icon
77
+ }
78
+ ) : null,
79
+ /* @__PURE__ */ jsxs("span", { style: sx({ display: "flex", flexDirection: "column", gap: 2, flex: "1 1 auto", minWidth: 0 }), children: [
80
+ /* @__PURE__ */ jsx(Typography, { as: "span", variant: "label", style: titleStyle, children: title }),
81
+ description ? /* @__PURE__ */ jsx(Typography, { as: "span", variant: "bodySm", style: muted, children: description }) : null
82
+ ] }),
83
+ arrow ? /* @__PURE__ */ jsx("span", { style: sx({ display: "inline-flex", flex: "0 0 auto", color: disabled ? "var(--text-disabled)" : "var(--text-muted)" }), children: arrow }) : null
84
+ ]
85
+ }
86
+ );
87
+ }
88
+ export {
89
+ ActionCard
90
+ };
91
+ //# sourceMappingURL=ActionCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/ActionCard.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChevronRight } from 'lucide-react';\nimport { sx } from '../_internal/style';\nimport { useInteract } from './Button';\nimport { Typography } from './Typography';\n\nexport type ActionCardVariant = 'default' | 'primary' | 'error';\n\n/**\n * A whole card you press: an icon, a title, a line of explanation and an arrow, in a real\n * `<button>`. For the options of a decision (\"Reschedule\", \"Cancel the booking\") and for the\n * entries of a settings flow. A `Card` with `interactive` is the bare surface; this is the\n * finished control, with the keyboard, the focus ring and the disabled state taken care of.\n *\n * It is an action, not a radio: arrow keys do not move between cards. `selected` marks a card as\n * a toggle (`aria-pressed`); for \"choose exactly one of these\" the semantics are a radio group's,\n * which this is not.\n */\nexport interface ActionCardProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'title' | 'children'> {\n /** What the card does. Short: it is the name a screen reader says. */\n title: React.ReactNode;\n /** One line that says what happens. */\n description?: React.ReactNode;\n /** An icon (a `lucide-react` element), drawn in a tile on the left. Hidden from a screen reader: the title says it. */\n icon?: React.ReactNode;\n /** What sits on the right. An arrow by default; any node, or `null` for nothing. */\n trailing?: React.ReactNode;\n /**\n * Passing it (true or false) makes the card a toggle: it reports `aria-pressed` and, when true,\n * wears the brand ring. Leave it out for a plain action.\n */\n selected?: boolean;\n /** `primary` is the option to steer toward, `error` a destructive one. */\n variant?: ActionCardVariant;\n}\n\n// `title` is the text color of the variant, when it has one. The error one is `--status-error-fg`, not\n// `--interactive-error`: on the hover fill the latter is 3.53:1 in the light theme (4.2:1 in the dark one),\n// under AA for text this size, where the status text color stays at 4.86:1 and 6.69:1.\nconst VARIANTS: Record<ActionCardVariant, { tileBg: string; tileFg: string; edge: string; title?: string }> = {\n default: { tileBg: 'var(--bg-subtle)', tileFg: 'var(--text-secondary)', edge: 'var(--border-brand)' },\n primary: { tileBg: 'var(--interactive-primary)', tileFg: 'var(--interactive-primary-fg)', edge: 'var(--border-brand)' },\n error: { tileBg: 'var(--status-error-bg)', tileFg: 'var(--status-error-fg)', edge: 'var(--status-error-dot)', title: 'var(--status-error-fg)' },\n};\n\n// The fill of a hovered card: a few percent of the variant's own ring color over the surface. Not\n// `--interactive-ghost-hover`: that grey is the very color of the icon tile (`--bg-subtle`), so on hover the\n// tile vanished into the card. This tint keeps the tile showing (1.20:1 against it in the light theme, 1.17:1\n// in the dark one, close to the 1.28:1 and 1.23:1 it has against the idle card) and keeps every text above AA.\nconst hoverFill = (edge: string) => 'color-mix(in srgb, ' + edge + ' 6%, var(--bg-surface))';\n\nexport function ActionCard({\n title,\n description,\n icon,\n trailing,\n selected,\n variant = 'default',\n disabled = false,\n style,\n ...rest\n}: ActionCardProps) {\n const st = useInteract(disabled);\n const v = VARIANTS[variant] || VARIANTS.default;\n const on = selected === true;\n const arrow = trailing === undefined ? <ChevronRight size={18} strokeWidth={1.75} aria-hidden /> : trailing;\n\n const ring = on ? '0 0 0 1.5px ' + v.edge : '0 0 0 1px ' + (!disabled && st.hover ? v.edge : disabled ? 'var(--border-subtle)' : 'var(--border-default)');\n // Only set when disabled: a `color: undefined` in a style would wipe the Typography's own.\n const muted = disabled ? { color: 'var(--text-disabled)' } : undefined;\n const titleStyle = disabled ? muted : v.title ? { color: v.title } : undefined;\n\n return (\n <button\n type=\"button\"\n disabled={disabled}\n aria-pressed={selected}\n {...st.handlers}\n {...rest}\n style={sx({\n display: 'flex',\n alignItems: 'center',\n gap: 'var(--space-3)',\n width: '100%',\n minWidth: 0,\n padding: 'var(--space-3) var(--space-4)',\n textAlign: 'left',\n fontFamily: 'var(--font-body)',\n color: 'inherit',\n border: 'none',\n borderRadius: 'var(--radius-card)',\n background: !disabled && st.hover ? hoverFill(v.edge) : 'var(--bg-surface)',\n boxShadow: [ring, st.focus ? 'var(--focus-ring)' : null].filter(Boolean).join(', '),\n transform: st.press && !disabled ? 'scale(var(--press-scale))' : 'none',\n cursor: disabled ? 'not-allowed' : 'pointer',\n transition: 'var(--transition-control)',\n // The focus ring above is the box-shadow, the same substitute `Button` and `Card` use.\n outline: 'none',\n ...style,\n })}\n >\n {icon ? (\n <span\n aria-hidden\n style={sx({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n flex: '0 0 auto',\n width: 40,\n height: 40,\n borderRadius: 'var(--radius-md)',\n background: disabled ? 'var(--interactive-disabled-bg)' : v.tileBg,\n color: disabled ? 'var(--interactive-disabled-fg)' : v.tileFg,\n })}\n >\n {icon}\n </span>\n ) : null}\n\n <span style={sx({ display: 'flex', flexDirection: 'column', gap: 2, flex: '1 1 auto', minWidth: 0 })}>\n <Typography as=\"span\" variant=\"label\" style={titleStyle}>\n {title}\n </Typography>\n {description ? (\n <Typography as=\"span\" variant=\"bodySm\" style={muted}>\n {description}\n </Typography>\n ) : null}\n </span>\n\n {arrow ? (\n <span style={sx({ display: 'inline-flex', flex: '0 0 auto', color: disabled ? 'var(--text-disabled)' : 'var(--text-muted)' })}>\n {arrow}\n </span>\n ) : null}\n </button>\n );\n}\n"],"mappings":"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","names":[]}
@@ -9,8 +9,14 @@ interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
9
9
  size?: 'sm' | 'md';
10
10
  /** Leading status dot. Keep it on for lifecycle states. */
11
11
  dot?: boolean;
12
+ /**
13
+ * A soft ring pulses out of the dot, for a state that is live ("Open now", "Online"). Only
14
+ * with `dot`. Off by default: use it on one or two badges, never on a list. It does not show
15
+ * when the user asks for reduced motion.
16
+ */
17
+ pulse?: boolean;
12
18
  children?: React.ReactNode;
13
19
  }
14
- declare function Badge({ tone, size, dot, children, style, ...rest }: BadgeProps): React.JSX.Element;
20
+ declare function Badge({ tone, size, dot, pulse, children, style, ...rest }: BadgeProps): React.JSX.Element;
15
21
 
16
22
  export { Badge, type BadgeProps };
@@ -1,17 +1,18 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { sx } from "../_internal/style.js";
4
+ import { StatusDot, statusDotStyle } from "./StatusDot.js";
4
5
  const TONES = {
5
- success: ["--status-success-bg", "--status-success-fg", "--status-success-dot"],
6
- warning: ["--status-warning-bg", "--status-warning-fg", "--status-warning-dot"],
7
- error: ["--status-error-bg", "--status-error-fg", "--status-error-dot"],
8
- info: ["--status-info-bg", "--status-info-fg", "--status-info-dot"],
6
+ success: ["--status-success-bg", "--status-success-fg"],
7
+ warning: ["--status-warning-bg", "--status-warning-fg"],
8
+ error: ["--status-error-bg", "--status-error-fg"],
9
+ info: ["--status-info-bg", "--status-info-fg"],
9
10
  // Neutral = an outlined chip (surface fill + hairline border, added below) so it
10
11
  // reads on any background, including a tinted one.
11
- neutral: ["--bg-surface", "--text-secondary", "--text-muted"]
12
+ neutral: ["--bg-surface", "--text-secondary"]
12
13
  };
13
- function Badge({ tone = "neutral", size = "md", dot = true, children, style, ...rest }) {
14
- const [bg, fg, dt] = TONES[tone] || TONES.neutral;
14
+ function Badge({ tone = "neutral", size = "md", dot = true, pulse = false, children, style, ...rest }) {
15
+ const [bg, fg] = TONES[tone] || TONES.neutral;
15
16
  const sm = size === "sm";
16
17
  return /* @__PURE__ */ jsxs(
17
18
  "span",
@@ -37,7 +38,7 @@ function Badge({ tone = "neutral", size = "md", dot = true, children, style, ...
37
38
  ...style
38
39
  }),
39
40
  children: [
40
- dot && /* @__PURE__ */ jsx("span", { style: sx({ width: sm ? 5 : 6, height: sm ? 5 : 6, borderRadius: "999px", background: "var(" + dt + ")", flex: "0 0 auto" }) }),
41
+ dot && (pulse ? /* @__PURE__ */ jsx(StatusDot, { tone, size: sm ? "sm" : "md", pulse: true }) : /* @__PURE__ */ jsx("span", { style: statusDotStyle(tone, sm ? "sm" : "md") })),
41
42
  children
42
43
  ]
43
44
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/Badge.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { sx } from '../_internal/style';\n\n/**\n * Status pill for the booking lifecycle and other short labels.\n */\nexport interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Semantic tone. Same five tones across Badge, Alert and Toast. */\n tone?: 'success' | 'warning' | 'error' | 'info' | 'neutral';\n size?: 'sm' | 'md';\n /** Leading status dot. Keep it on for lifecycle states. */\n dot?: boolean;\n children?: React.ReactNode;\n}\n\nconst TONES: Record<NonNullable<BadgeProps['tone']>, [string, string, string]> = {\n success: ['--status-success-bg', '--status-success-fg', '--status-success-dot'],\n warning: ['--status-warning-bg', '--status-warning-fg', '--status-warning-dot'],\n error: ['--status-error-bg', '--status-error-fg', '--status-error-dot'],\n info: ['--status-info-bg', '--status-info-fg', '--status-info-dot'],\n // Neutral = an outlined chip (surface fill + hairline border, added below) so it\n // reads on any background, including a tinted one.\n neutral: ['--bg-surface', '--text-secondary', '--text-muted'],\n};\n\nexport function Badge({ tone = 'neutral', size = 'md', dot = true, children, style, ...rest }: BadgeProps) {\n const [bg, fg, dt] = TONES[tone] || TONES.neutral;\n const sm = size === 'sm';\n return (\n <span\n {...rest}\n style={sx({\n display: 'inline-flex',\n alignItems: 'center',\n gap: sm ? 5 : 6,\n padding: sm ? '2px 8px' : '4px 10px',\n borderRadius: 'var(--radius-chip)',\n background: 'var(' + bg + ')',\n // The neutral fill can match a tinted surface it sits on - a hairline\n // keeps the chip defined on any background. Tinted tones read on their own.\n border: 'var(--border-width-hairline) solid ' + (tone === 'neutral' ? 'var(--border-default)' : 'transparent'),\n color: 'var(' + fg + ')',\n fontFamily: 'var(--font-body)',\n fontSize: sm ? 'var(--text-2xs)' : 'var(--text-xs)',\n fontWeight: 'var(--weight-semibold)',\n letterSpacing: 'var(--tracking-snug)',\n lineHeight: 1.4,\n whiteSpace: 'nowrap',\n ...style,\n })}\n >\n {dot && <span style={sx({ width: sm ? 5 : 6, height: sm ? 5 : 6, borderRadius: '999px', background: 'var(' + dt + ')', flex: '0 0 auto' })} />}\n {children}\n </span>\n );\n}"],"mappings":";AA+BI,SAsBU,KAtBV;AA5BJ,SAAS,UAAU;AAcnB,MAAM,QAA2E;AAAA,EAC/E,SAAS,CAAC,uBAAuB,uBAAuB,sBAAsB;AAAA,EAC9E,SAAS,CAAC,uBAAuB,uBAAuB,sBAAsB;AAAA,EAC9E,OAAO,CAAC,qBAAqB,qBAAqB,oBAAoB;AAAA,EACtE,MAAM,CAAC,oBAAoB,oBAAoB,mBAAmB;AAAA;AAAA;AAAA,EAGlE,SAAS,CAAC,gBAAgB,oBAAoB,cAAc;AAC9D;AAEO,SAAS,MAAM,EAAE,OAAO,WAAW,OAAO,MAAM,MAAM,MAAM,UAAU,OAAO,GAAG,KAAK,GAAe;AACzG,QAAM,CAAC,IAAI,IAAI,EAAE,IAAI,MAAM,IAAI,KAAK,MAAM;AAC1C,QAAM,KAAK,SAAS;AACpB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO,GAAG;AAAA,QACR,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,KAAK,KAAK,IAAI;AAAA,QACd,SAAS,KAAK,YAAY;AAAA,QAC1B,cAAc;AAAA,QACd,YAAY,SAAS,KAAK;AAAA;AAAA;AAAA,QAG1B,QAAQ,yCAAyC,SAAS,YAAY,0BAA0B;AAAA,QAChG,OAAO,SAAS,KAAK;AAAA,QACrB,YAAY;AAAA,QACZ,UAAU,KAAK,oBAAoB;AAAA,QACnC,YAAY;AAAA,QACZ,eAAe;AAAA,QACf,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,GAAG;AAAA,MACL,CAAC;AAAA,MAEA;AAAA,eAAO,oBAAC,UAAK,OAAO,GAAG,EAAE,OAAO,KAAK,IAAI,GAAG,QAAQ,KAAK,IAAI,GAAG,cAAc,SAAS,YAAY,SAAS,KAAK,KAAK,MAAM,WAAW,CAAC,GAAG;AAAA,QAC3I;AAAA;AAAA;AAAA,EACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/core/Badge.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { sx } from '../_internal/style';\nimport { StatusDot, statusDotStyle } from './StatusDot';\n\n/**\n * Status pill for the booking lifecycle and other short labels.\n */\nexport interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Semantic tone. Same five tones across Badge, Alert and Toast. */\n tone?: 'success' | 'warning' | 'error' | 'info' | 'neutral';\n size?: 'sm' | 'md';\n /** Leading status dot. Keep it on for lifecycle states. */\n dot?: boolean;\n /**\n * A soft ring pulses out of the dot, for a state that is live (\"Open now\", \"Online\"). Only\n * with `dot`. Off by default: use it on one or two badges, never on a list. It does not show\n * when the user asks for reduced motion.\n */\n pulse?: boolean;\n children?: React.ReactNode;\n}\n\n// The dot's own color comes from `StatusDot`, so the two cannot drift apart.\nconst TONES: Record<NonNullable<BadgeProps['tone']>, [string, string]> = {\n success: ['--status-success-bg', '--status-success-fg'],\n warning: ['--status-warning-bg', '--status-warning-fg'],\n error: ['--status-error-bg', '--status-error-fg'],\n info: ['--status-info-bg', '--status-info-fg'],\n // Neutral = an outlined chip (surface fill + hairline border, added below) so it\n // reads on any background, including a tinted one.\n neutral: ['--bg-surface', '--text-secondary'],\n};\n\nexport function Badge({ tone = 'neutral', size = 'md', dot = true, pulse = false, children, style, ...rest }: BadgeProps) {\n const [bg, fg] = TONES[tone] || TONES.neutral;\n const sm = size === 'sm';\n return (\n <span\n {...rest}\n style={sx({\n display: 'inline-flex',\n alignItems: 'center',\n gap: sm ? 5 : 6,\n padding: sm ? '2px 8px' : '4px 10px',\n borderRadius: 'var(--radius-chip)',\n background: 'var(' + bg + ')',\n // The neutral fill can match a tinted surface it sits on - a hairline\n // keeps the chip defined on any background. Tinted tones read on their own.\n border: 'var(--border-width-hairline) solid ' + (tone === 'neutral' ? 'var(--border-default)' : 'transparent'),\n color: 'var(' + fg + ')',\n fontFamily: 'var(--font-body)',\n fontSize: sm ? 'var(--text-2xs)' : 'var(--text-xs)',\n fontWeight: 'var(--weight-semibold)',\n letterSpacing: 'var(--tracking-snug)',\n lineHeight: 1.4,\n whiteSpace: 'nowrap',\n ...style,\n })}\n >\n {dot &&\n (pulse ? (\n <StatusDot tone={tone} size={sm ? 'sm' : 'md'} pulse />\n ) : (\n <span style={statusDotStyle(tone, sm ? 'sm' : 'md')} />\n ))}\n {children}\n </span>\n );\n}"],"mappings":";AAuCI,SAwBM,KAxBN;AApCJ,SAAS,UAAU;AACnB,SAAS,WAAW,sBAAsB;AAqB1C,MAAM,QAAmE;AAAA,EACvE,SAAS,CAAC,uBAAuB,qBAAqB;AAAA,EACtD,SAAS,CAAC,uBAAuB,qBAAqB;AAAA,EACtD,OAAO,CAAC,qBAAqB,mBAAmB;AAAA,EAChD,MAAM,CAAC,oBAAoB,kBAAkB;AAAA;AAAA;AAAA,EAG7C,SAAS,CAAC,gBAAgB,kBAAkB;AAC9C;AAEO,SAAS,MAAM,EAAE,OAAO,WAAW,OAAO,MAAM,MAAM,MAAM,QAAQ,OAAO,UAAU,OAAO,GAAG,KAAK,GAAe;AACxH,QAAM,CAAC,IAAI,EAAE,IAAI,MAAM,IAAI,KAAK,MAAM;AACtC,QAAM,KAAK,SAAS;AACpB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO,GAAG;AAAA,QACR,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,KAAK,KAAK,IAAI;AAAA,QACd,SAAS,KAAK,YAAY;AAAA,QAC1B,cAAc;AAAA,QACd,YAAY,SAAS,KAAK;AAAA;AAAA;AAAA,QAG1B,QAAQ,yCAAyC,SAAS,YAAY,0BAA0B;AAAA,QAChG,OAAO,SAAS,KAAK;AAAA,QACrB,YAAY;AAAA,QACZ,UAAU,KAAK,oBAAoB;AAAA,QACnC,YAAY;AAAA,QACZ,eAAe;AAAA,QACf,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,GAAG;AAAA,MACL,CAAC;AAAA,MAEA;AAAA,gBACE,QACC,oBAAC,aAAU,MAAY,MAAM,KAAK,OAAO,MAAM,OAAK,MAAC,IAErD,oBAAC,UAAK,OAAO,eAAe,MAAM,KAAK,OAAO,IAAI,GAAG;AAAA,QAExD;AAAA;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * A horizontal line that separates two stretches of content. `default` is the subtle hairline of
5
+ * a list or a card; `strong` is a firmer one for a page background, where the subtle one nearly
6
+ * disappears.
7
+ *
8
+ * It has no margin of its own: the space around it is the caller's (a `gap` on the parent, or a
9
+ * `style` on the divider).
10
+ */
11
+ interface DividerProps extends Omit<React.HTMLAttributes<HTMLHRElement>, 'children'> {
12
+ /**
13
+ * `strong` is `--border-strong`, firmer than the `--border-subtle` of `default`. Firmer, not
14
+ * high contrast: it is 1.63:1 against a card and 1.38:1 against the page in the light theme
15
+ * (1.83:1 and 2.03:1 in the dark one), which is right for a separator and short of what a
16
+ * control's edge would need.
17
+ */
18
+ variant?: 'default' | 'strong';
19
+ /**
20
+ * Hides the line from a screen reader (`role="none"`). For lines between rows that repeat, so
21
+ * the reader does not announce a separator after every one. Without it the line is a
22
+ * separator, which is right between two sections.
23
+ */
24
+ decorative?: boolean;
25
+ }
26
+ declare function Divider({ variant, decorative, style, ...rest }: DividerProps): React.JSX.Element;
27
+
28
+ export { Divider, type DividerProps };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { sx } from "../_internal/style.js";
4
+ const COLOR = { default: "--border-subtle", strong: "--border-strong" };
5
+ function Divider({ variant = "default", decorative = false, style, ...rest }) {
6
+ return /* @__PURE__ */ jsx(
7
+ "hr",
8
+ {
9
+ role: decorative ? "none" : void 0,
10
+ ...rest,
11
+ style: sx({
12
+ // Longhands only (no `border` shorthand), so a later render never mixes the two.
13
+ borderStyle: "solid",
14
+ borderColor: "var(" + (COLOR[variant] || COLOR.default) + ")",
15
+ borderWidth: "var(--border-width-hairline) 0 0 0",
16
+ height: 0,
17
+ width: "100%",
18
+ margin: 0,
19
+ flex: "0 0 auto",
20
+ ...style
21
+ })
22
+ }
23
+ );
24
+ }
25
+ export {
26
+ Divider
27
+ };
28
+ //# sourceMappingURL=Divider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/Divider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { sx } from '../_internal/style';\n\n/**\n * A horizontal line that separates two stretches of content. `default` is the subtle hairline of\n * a list or a card; `strong` is a firmer one for a page background, where the subtle one nearly\n * disappears.\n *\n * It has no margin of its own: the space around it is the caller's (a `gap` on the parent, or a\n * `style` on the divider).\n */\nexport interface DividerProps extends Omit<React.HTMLAttributes<HTMLHRElement>, 'children'> {\n /**\n * `strong` is `--border-strong`, firmer than the `--border-subtle` of `default`. Firmer, not\n * high contrast: it is 1.63:1 against a card and 1.38:1 against the page in the light theme\n * (1.83:1 and 2.03:1 in the dark one), which is right for a separator and short of what a\n * control's edge would need.\n */\n variant?: 'default' | 'strong';\n /**\n * Hides the line from a screen reader (`role=\"none\"`). For lines between rows that repeat, so\n * the reader does not announce a separator after every one. Without it the line is a\n * separator, which is right between two sections.\n */\n decorative?: boolean;\n}\n\nconst COLOR = { default: '--border-subtle', strong: '--border-strong' } as const;\n\nexport function Divider({ variant = 'default', decorative = false, style, ...rest }: DividerProps) {\n return (\n <hr\n role={decorative ? 'none' : undefined}\n {...rest}\n style={sx({\n // Longhands only (no `border` shorthand), so a later render never mixes the two.\n borderStyle: 'solid',\n borderColor: 'var(' + (COLOR[variant] || COLOR.default) + ')',\n borderWidth: 'var(--border-width-hairline) 0 0 0',\n height: 0,\n width: '100%',\n margin: 0,\n flex: '0 0 auto',\n ...style,\n })}\n />\n );\n}\n"],"mappings":";AAiCI;AA9BJ,SAAS,UAAU;AA0BnB,MAAM,QAAQ,EAAE,SAAS,mBAAmB,QAAQ,kBAAkB;AAE/D,SAAS,QAAQ,EAAE,UAAU,WAAW,aAAa,OAAO,OAAO,GAAG,KAAK,GAAiB;AACjG,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,aAAa,SAAS;AAAA,MAC3B,GAAG;AAAA,MACJ,OAAO,GAAG;AAAA;AAAA,QAER,aAAa;AAAA,QACb,aAAa,UAAU,MAAM,OAAO,KAAK,MAAM,WAAW;AAAA,QAC1D,aAAa;AAAA,QACb,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,GAAG;AAAA,MACL,CAAC;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ import { CSSProperties } from 'react';
3
+
4
+ type StatusDotTone = 'success' | 'warning' | 'error' | 'info' | 'neutral';
5
+ type StatusDotSize = 'sm' | 'md';
6
+ /**
7
+ * A small colored dot for a state ("Open now", "Online"), optionally with a soft ring that
8
+ * pulses outward for a state that is live. The same dot `Badge` draws before its label, as its
9
+ * own piece for the places that have no pill around it (next to a name, on a list row).
10
+ *
11
+ * The dot says nothing to a screen reader by itself: put the meaning in the text next to it, or
12
+ * give it a `label` and it becomes an image with that name.
13
+ */
14
+ interface StatusDotProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
15
+ /** The same words `Badge`, `Alert` and `Toast` use. */
16
+ tone?: StatusDotTone;
17
+ /** `sm` (5px) and `md` (6px) are the two dot sizes of `Badge`. */
18
+ size?: StatusDotSize;
19
+ /**
20
+ * A translucent ring that grows and fades around the dot, over and over. For a live state
21
+ * (open now, online), not for decoration: use it on one or two dots, never on a list. It does
22
+ * not show when the user asks for reduced motion.
23
+ */
24
+ pulse?: boolean;
25
+ /** What a screen reader says for the dot. Without it the dot is decorative. */
26
+ label?: string;
27
+ }
28
+ /**
29
+ * The look of a plain dot, in the form `Badge` has always drawn it. A function so `Badge` and
30
+ * `StatusDot` cannot drift apart. It sets no `display`: the dot is a flex item inside a `Badge`,
31
+ * and `StatusDot` adds its own.
32
+ */
33
+ declare function statusDotStyle(tone?: StatusDotTone, size?: StatusDotSize): CSSProperties;
34
+ declare function StatusDot({ tone, size, pulse, label, style, ...rest }: StatusDotProps): React.JSX.Element;
35
+
36
+ export { StatusDot, type StatusDotProps, type StatusDotSize, type StatusDotTone, statusDotStyle };
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { sx } from "../_internal/style.js";
4
+ const TONE_VAR = {
5
+ success: "--status-success-dot",
6
+ warning: "--status-warning-dot",
7
+ error: "--status-error-dot",
8
+ info: "--status-info-dot",
9
+ neutral: "--text-muted"
10
+ };
11
+ const SIZE_PX = { sm: 5, md: 6 };
12
+ function color(tone) {
13
+ return "var(" + (TONE_VAR[tone] || TONE_VAR.neutral) + ")";
14
+ }
15
+ function statusDotStyle(tone = "neutral", size = "md") {
16
+ const px = SIZE_PX[size] ?? SIZE_PX.md;
17
+ return { width: px, height: px, borderRadius: "999px", background: color(tone), flex: "0 0 auto" };
18
+ }
19
+ function StatusDot({ tone = "neutral", size = "md", pulse = false, label, style, ...rest }) {
20
+ const px = SIZE_PX[size] ?? SIZE_PX.md;
21
+ const named = label ? { role: "img", "aria-label": label } : null;
22
+ if (!pulse) return /* @__PURE__ */ jsx("span", { ...rest, ...named, style: sx({ ...statusDotStyle(tone, size), display: "inline-block", ...style }) });
23
+ return /* @__PURE__ */ jsxs("span", { ...rest, ...named, style: sx({ position: "relative", display: "inline-flex", width: px, height: px, flex: "0 0 auto", ...style }), children: [
24
+ /* @__PURE__ */ jsx("span", { className: "sereno-status-ping", style: sx({ position: "absolute", inset: 0, borderRadius: "999px", background: color(tone), opacity: 0 }) }),
25
+ /* @__PURE__ */ jsx("span", { style: sx({ position: "relative", width: px, height: px, borderRadius: "999px", background: color(tone) }) })
26
+ ] });
27
+ }
28
+ export {
29
+ StatusDot,
30
+ statusDotStyle
31
+ };
32
+ //# sourceMappingURL=StatusDot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/StatusDot.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { CSSProperties } from 'react';\nimport { sx } from '../_internal/style';\n\nexport type StatusDotTone = 'success' | 'warning' | 'error' | 'info' | 'neutral';\nexport type StatusDotSize = 'sm' | 'md';\n\n/**\n * A small colored dot for a state (\"Open now\", \"Online\"), optionally with a soft ring that\n * pulses outward for a state that is live. The same dot `Badge` draws before its label, as its\n * own piece for the places that have no pill around it (next to a name, on a list row).\n *\n * The dot says nothing to a screen reader by itself: put the meaning in the text next to it, or\n * give it a `label` and it becomes an image with that name.\n */\nexport interface StatusDotProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {\n /** The same words `Badge`, `Alert` and `Toast` use. */\n tone?: StatusDotTone;\n /** `sm` (5px) and `md` (6px) are the two dot sizes of `Badge`. */\n size?: StatusDotSize;\n /**\n * A translucent ring that grows and fades around the dot, over and over. For a live state\n * (open now, online), not for decoration: use it on one or two dots, never on a list. It does\n * not show when the user asks for reduced motion.\n */\n pulse?: boolean;\n /** What a screen reader says for the dot. Without it the dot is decorative. */\n label?: string;\n}\n\nconst TONE_VAR: Record<StatusDotTone, string> = {\n success: '--status-success-dot',\n warning: '--status-warning-dot',\n error: '--status-error-dot',\n info: '--status-info-dot',\n neutral: '--text-muted',\n};\n\nconst SIZE_PX: Record<StatusDotSize, number> = { sm: 5, md: 6 };\n\nfunction color(tone: StatusDotTone): string {\n return 'var(' + (TONE_VAR[tone] || TONE_VAR.neutral) + ')';\n}\n\n/**\n * The look of a plain dot, in the form `Badge` has always drawn it. A function so `Badge` and\n * `StatusDot` cannot drift apart. It sets no `display`: the dot is a flex item inside a `Badge`,\n * and `StatusDot` adds its own.\n */\nexport function statusDotStyle(tone: StatusDotTone = 'neutral', size: StatusDotSize = 'md'): CSSProperties {\n const px = SIZE_PX[size] ?? SIZE_PX.md;\n return { width: px, height: px, borderRadius: '999px', background: color(tone), flex: '0 0 auto' };\n}\n\nexport function StatusDot({ tone = 'neutral', size = 'md', pulse = false, label, style, ...rest }: StatusDotProps) {\n const px = SIZE_PX[size] ?? SIZE_PX.md;\n const named = label ? ({ role: 'img', 'aria-label': label } as const) : null;\n\n if (!pulse) return <span {...rest} {...named} style={sx({ ...statusDotStyle(tone, size), display: 'inline-block', ...style })} />;\n\n return (\n <span {...rest} {...named} style={sx({ position: 'relative', display: 'inline-flex', width: px, height: px, flex: '0 0 auto', ...style })}>\n {/* the ring: invisible at rest, so nothing shows where the animation does not run */}\n <span className=\"sereno-status-ping\" style={sx({ position: 'absolute', inset: 0, borderRadius: '999px', background: color(tone), opacity: 0 })} />\n <span style={sx({ position: 'relative', width: px, height: px, borderRadius: '999px', background: color(tone) })} />\n </span>\n );\n}\n"],"mappings":";AA4DqB,cAGjB,YAHiB;AAxDrB,SAAS,UAAU;AA4BnB,MAAM,WAA0C;AAAA,EAC9C,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AACX;AAEA,MAAM,UAAyC,EAAE,IAAI,GAAG,IAAI,EAAE;AAE9D,SAAS,MAAM,MAA6B;AAC1C,SAAO,UAAU,SAAS,IAAI,KAAK,SAAS,WAAW;AACzD;AAOO,SAAS,eAAe,OAAsB,WAAW,OAAsB,MAAqB;AACzG,QAAM,KAAK,QAAQ,IAAI,KAAK,QAAQ;AACpC,SAAO,EAAE,OAAO,IAAI,QAAQ,IAAI,cAAc,SAAS,YAAY,MAAM,IAAI,GAAG,MAAM,WAAW;AACnG;AAEO,SAAS,UAAU,EAAE,OAAO,WAAW,OAAO,MAAM,QAAQ,OAAO,OAAO,OAAO,GAAG,KAAK,GAAmB;AACjH,QAAM,KAAK,QAAQ,IAAI,KAAK,QAAQ;AACpC,QAAM,QAAQ,QAAS,EAAE,MAAM,OAAO,cAAc,MAAM,IAAc;AAExE,MAAI,CAAC,MAAO,QAAO,oBAAC,UAAM,GAAG,MAAO,GAAG,OAAO,OAAO,GAAG,EAAE,GAAG,eAAe,MAAM,IAAI,GAAG,SAAS,gBAAgB,GAAG,MAAM,CAAC,GAAG;AAE/H,SACE,qBAAC,UAAM,GAAG,MAAO,GAAG,OAAO,OAAO,GAAG,EAAE,UAAU,YAAY,SAAS,eAAe,OAAO,IAAI,QAAQ,IAAI,MAAM,YAAY,GAAG,MAAM,CAAC,GAEtI;AAAA,wBAAC,UAAK,WAAU,sBAAqB,OAAO,GAAG,EAAE,UAAU,YAAY,OAAO,GAAG,cAAc,SAAS,YAAY,MAAM,IAAI,GAAG,SAAS,EAAE,CAAC,GAAG;AAAA,IAChJ,oBAAC,UAAK,OAAO,GAAG,EAAE,UAAU,YAAY,OAAO,IAAI,QAAQ,IAAI,cAAc,SAAS,YAAY,MAAM,IAAI,EAAE,CAAC,GAAG;AAAA,KACpH;AAEJ;","names":[]}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,10 @@ export { Typography, TypographyColor, TypographyProps, TypographyVariant } from
2
2
  export { Button, ButtonProps } from './core/Button.js';
3
3
  export { IconButton, IconButtonProps } from './core/IconButton.js';
4
4
  export { Badge, BadgeProps } from './core/Badge.js';
5
+ export { StatusDot, StatusDotProps, StatusDotSize, StatusDotTone } from './core/StatusDot.js';
6
+ export { Divider, DividerProps } from './core/Divider.js';
5
7
  export { Card, CardProps } from './core/Card.js';
8
+ export { ActionCard, ActionCardProps, ActionCardVariant } from './core/ActionCard.js';
6
9
  export { StatCard, StatCardProps, StatCardTone } from './core/StatCard.js';
7
10
  export { Avatar, AvatarProps } from './core/Avatar.js';
8
11
  export { Brand, BrandProps } from './core/Brand.js';
package/dist/index.js CHANGED
@@ -2,7 +2,10 @@ import { Typography } from "./core/Typography.js";
2
2
  import { Button } from "./core/Button.js";
3
3
  import { IconButton } from "./core/IconButton.js";
4
4
  import { Badge } from "./core/Badge.js";
5
+ import { StatusDot } from "./core/StatusDot.js";
6
+ import { Divider } from "./core/Divider.js";
5
7
  import { Card } from "./core/Card.js";
8
+ import { ActionCard } from "./core/ActionCard.js";
6
9
  import { StatCard } from "./core/StatCard.js";
7
10
  import { Avatar } from "./core/Avatar.js";
8
11
  import { Brand } from "./core/Brand.js";
@@ -44,6 +47,7 @@ import { EmptyState } from "./feedback/EmptyState.js";
44
47
  import { ThemeProvider } from "./theme/ThemeProvider.js";
45
48
  import { ThemeToggle } from "./theme/ThemeToggle.js";
46
49
  export {
50
+ ActionCard,
47
51
  Alert,
48
52
  Avatar,
49
53
  AvatarUpload,
@@ -57,6 +61,7 @@ export {
57
61
  DatePicker,
58
62
  DateTimePicker,
59
63
  Dialog,
64
+ Divider,
60
65
  EmptyState,
61
66
  FileUpload,
62
67
  IconButton,
@@ -69,6 +74,7 @@ export {
69
74
  SidebarNav,
70
75
  Skeleton,
71
76
  StatCard,
77
+ StatusDot,
72
78
  Stepper,
73
79
  Switch,
74
80
  Table,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Sereno Design System - public component surface. See the /design-system\n// showcase for the live catalog, or the barrel smoke test for the full list.\n// Icons are passed in as props (lucide-react), never imported here; theming is\n// 100% CSS custom properties.\n\n// core\nexport { Typography, type TypographyProps, type TypographyVariant, type TypographyColor } from './core/Typography';\nexport { Button, type ButtonProps } from './core/Button';\nexport { IconButton, type IconButtonProps } from './core/IconButton';\nexport { Badge, type BadgeProps } from './core/Badge';\nexport { Card, type CardProps } from './core/Card';\nexport { StatCard, type StatCardProps, type StatCardTone } from './core/StatCard';\nexport { Avatar, type AvatarProps } from './core/Avatar';\nexport { Brand, type BrandProps } from './core/Brand';\nexport { Menu, type MenuProps, type MenuItem, type MenuEntry, type MenuSeparator, type MenuHeading } from './core/Menu';\nexport {\n Table,\n type TableProps,\n type TableRowProps,\n type HeaderCellProps,\n type CellProps,\n type TableSort,\n type SortDirection,\n} from './core/Table';\n\n// forms\nexport { Input, type InputProps } from './forms/Input';\nexport { Textarea, type TextareaProps } from './forms/Textarea';\nexport { Select, type SelectProps, type SelectOption } from './forms/Select';\nexport { Checkbox, type CheckboxProps } from './forms/Checkbox';\nexport { Radio, type RadioProps } from './forms/Radio';\nexport { Switch, type SwitchProps } from './forms/Switch';\nexport {\n DateTimePicker,\n type DateTimePickerProps,\n type TimeSlot,\n type CalendarDayContext,\n type CalendarDayDot,\n type CalendarDayDots,\n type CalendarDotTone,\n} from './forms/DateTimePicker';\nexport { CalendarLegend, type CalendarLegendProps, type CalendarLegendItem } from './forms/CalendarLegend';\nexport { DatePicker, type DatePickerProps, type DatePickerHandle } from './forms/DatePicker';\nexport { FileUpload, type FileUploadProps } from './forms/FileUpload';\nexport { AvatarUpload, type AvatarUploadProps } from './forms/AvatarUpload';\nexport { SearchInput, type SearchInputProps } from './forms/SearchInput';\n\n// navigation\nexport { TopBar, type TopBarProps, type TopBarLeadingProps, type TopBarTitleProps, type TopBarActionsProps } from './navigation/TopBar';\nexport { Tabs, type TabsProps, type TabsListProps, type TabsTabProps, type TabsPanelProps } from './navigation/Tabs';\nexport { BottomNav, type BottomNavProps, type BottomNavItemProps } from './navigation/BottomNav';\nexport {\n SidebarNav,\n type SidebarNavProps,\n type SidebarNavSectionProps,\n type SidebarNavItemProps,\n type SidebarNavSubItemProps,\n} from './navigation/SidebarNav';\nexport { Stepper, type StepperProps, type StepperStepProps } from './navigation/Stepper';\nexport { Pagination, type PaginationProps, type PaginationLabels } from './navigation/Pagination';\n\n// feedback\nexport { Alert, type AlertProps } from './feedback/Alert';\nexport { Toast, type ToastProps } from './feedback/Toast';\nexport {\n ToastProvider,\n useToast,\n type ToastProviderProps,\n type ToastOptions,\n type ToastApi,\n type ToastContextValue,\n type ToastPosition,\n} from './feedback/ToastProvider';\nexport { Dialog, type DialogProps, type DialogHeaderProps, type DialogBodyProps, type DialogFooterProps } from './feedback/Dialog';\nexport { Skeleton, type SkeletonProps } from './feedback/Skeleton';\nexport { EmptyState, type EmptyStateProps } from './feedback/EmptyState';\n\n// theme - the `data-theme` provider (next-themes) + the light/dark toggle\nexport { ThemeProvider } from './theme/ThemeProvider';\nexport { ThemeToggle } from './theme/ThemeToggle';\n"],"mappings":"AAMA,SAAS,kBAAsF;AAC/F,SAAS,cAAgC;AACzC,SAAS,kBAAwC;AACjD,SAAS,aAA8B;AACvC,SAAS,YAA4B;AACrC,SAAS,gBAAuD;AAChE,SAAS,cAAgC;AACzC,SAAS,aAA8B;AACvC,SAAS,YAAiG;AAC1G;AAAA,EACE;AAAA,OAOK;AAGP,SAAS,aAA8B;AACvC,SAAS,gBAAoC;AAC7C,SAAS,cAAmD;AAC5D,SAAS,gBAAoC;AAC7C,SAAS,aAA8B;AACvC,SAAS,cAAgC;AACzC;AAAA,EACE;AAAA,OAOK;AACP,SAAS,sBAAyE;AAClF,SAAS,kBAA+D;AACxE,SAAS,kBAAwC;AACjD,SAAS,oBAA4C;AACrD,SAAS,mBAA0C;AAGnD,SAAS,cAAyG;AAClH,SAAS,YAAwF;AACjG,SAAS,iBAA+D;AACxE;AAAA,EACE;AAAA,OAKK;AACP,SAAS,eAAyD;AAClE,SAAS,kBAA+D;AAGxE,SAAS,aAA8B;AACvC,SAAS,aAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP,SAAS,cAAsG;AAC/G,SAAS,gBAAoC;AAC7C,SAAS,kBAAwC;AAGjD,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Sereno Design System - public component surface. See the /design-system\n// showcase for the live catalog, or the barrel smoke test for the full list.\n// Icons are passed in as props (lucide-react), never imported here; theming is\n// 100% CSS custom properties.\n\n// core\nexport { Typography, type TypographyProps, type TypographyVariant, type TypographyColor } from './core/Typography';\nexport { Button, type ButtonProps } from './core/Button';\nexport { IconButton, type IconButtonProps } from './core/IconButton';\nexport { Badge, type BadgeProps } from './core/Badge';\nexport { StatusDot, type StatusDotProps, type StatusDotTone, type StatusDotSize } from './core/StatusDot';\nexport { Divider, type DividerProps } from './core/Divider';\nexport { Card, type CardProps } from './core/Card';\nexport { ActionCard, type ActionCardProps, type ActionCardVariant } from './core/ActionCard';\nexport { StatCard, type StatCardProps, type StatCardTone } from './core/StatCard';\nexport { Avatar, type AvatarProps } from './core/Avatar';\nexport { Brand, type BrandProps } from './core/Brand';\nexport { Menu, type MenuProps, type MenuItem, type MenuEntry, type MenuSeparator, type MenuHeading } from './core/Menu';\nexport {\n Table,\n type TableProps,\n type TableRowProps,\n type HeaderCellProps,\n type CellProps,\n type TableSort,\n type SortDirection,\n} from './core/Table';\n\n// forms\nexport { Input, type InputProps } from './forms/Input';\nexport { Textarea, type TextareaProps } from './forms/Textarea';\nexport { Select, type SelectProps, type SelectOption } from './forms/Select';\nexport { Checkbox, type CheckboxProps } from './forms/Checkbox';\nexport { Radio, type RadioProps } from './forms/Radio';\nexport { Switch, type SwitchProps } from './forms/Switch';\nexport {\n DateTimePicker,\n type DateTimePickerProps,\n type TimeSlot,\n type CalendarDayContext,\n type CalendarDayDot,\n type CalendarDayDots,\n type CalendarDotTone,\n} from './forms/DateTimePicker';\nexport { CalendarLegend, type CalendarLegendProps, type CalendarLegendItem } from './forms/CalendarLegend';\nexport { DatePicker, type DatePickerProps, type DatePickerHandle } from './forms/DatePicker';\nexport { FileUpload, type FileUploadProps } from './forms/FileUpload';\nexport { AvatarUpload, type AvatarUploadProps } from './forms/AvatarUpload';\nexport { SearchInput, type SearchInputProps } from './forms/SearchInput';\n\n// navigation\nexport { TopBar, type TopBarProps, type TopBarLeadingProps, type TopBarTitleProps, type TopBarActionsProps } from './navigation/TopBar';\nexport { Tabs, type TabsProps, type TabsListProps, type TabsTabProps, type TabsPanelProps } from './navigation/Tabs';\nexport { BottomNav, type BottomNavProps, type BottomNavItemProps } from './navigation/BottomNav';\nexport {\n SidebarNav,\n type SidebarNavProps,\n type SidebarNavSectionProps,\n type SidebarNavItemProps,\n type SidebarNavSubItemProps,\n} from './navigation/SidebarNav';\nexport { Stepper, type StepperProps, type StepperStepProps } from './navigation/Stepper';\nexport { Pagination, type PaginationProps, type PaginationLabels } from './navigation/Pagination';\n\n// feedback\nexport { Alert, type AlertProps } from './feedback/Alert';\nexport { Toast, type ToastProps } from './feedback/Toast';\nexport {\n ToastProvider,\n useToast,\n type ToastProviderProps,\n type ToastOptions,\n type ToastApi,\n type ToastContextValue,\n type ToastPosition,\n} from './feedback/ToastProvider';\nexport { Dialog, type DialogProps, type DialogHeaderProps, type DialogBodyProps, type DialogFooterProps } from './feedback/Dialog';\nexport { Skeleton, type SkeletonProps } from './feedback/Skeleton';\nexport { EmptyState, type EmptyStateProps } from './feedback/EmptyState';\n\n// theme - the `data-theme` provider (next-themes) + the light/dark toggle\nexport { ThemeProvider } from './theme/ThemeProvider';\nexport { ThemeToggle } from './theme/ThemeToggle';\n"],"mappings":"AAMA,SAAS,kBAAsF;AAC/F,SAAS,cAAgC;AACzC,SAAS,kBAAwC;AACjD,SAAS,aAA8B;AACvC,SAAS,iBAA8E;AACvF,SAAS,eAAkC;AAC3C,SAAS,YAA4B;AACrC,SAAS,kBAAgE;AACzE,SAAS,gBAAuD;AAChE,SAAS,cAAgC;AACzC,SAAS,aAA8B;AACvC,SAAS,YAAiG;AAC1G;AAAA,EACE;AAAA,OAOK;AAGP,SAAS,aAA8B;AACvC,SAAS,gBAAoC;AAC7C,SAAS,cAAmD;AAC5D,SAAS,gBAAoC;AAC7C,SAAS,aAA8B;AACvC,SAAS,cAAgC;AACzC;AAAA,EACE;AAAA,OAOK;AACP,SAAS,sBAAyE;AAClF,SAAS,kBAA+D;AACxE,SAAS,kBAAwC;AACjD,SAAS,oBAA4C;AACrD,SAAS,mBAA0C;AAGnD,SAAS,cAAyG;AAClH,SAAS,YAAwF;AACjG,SAAS,iBAA+D;AACxE;AAAA,EACE;AAAA,OAKK;AACP,SAAS,eAAyD;AAClE,SAAS,kBAA+D;AAGxE,SAAS,aAA8B;AACvC,SAAS,aAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP,SAAS,cAAsG;AAC/G,SAAS,gBAAoC;AAC7C,SAAS,kBAAwC;AAGjD,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;","names":[]}
package/dist/styles.css CHANGED
@@ -25,6 +25,7 @@
25
25
  @keyframes sereno-pop { from { opacity: 0; transform: scale(0.96); } }
26
26
  @keyframes sereno-slide-up { from { opacity: 0; transform: translateY(10px); } }
27
27
  @keyframes sereno-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
28
+ @keyframes sereno-ping { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
28
29
  @keyframes sereno-flyout-in { from { opacity: 0; transform: translateX(-6px); } }
29
30
  @keyframes sereno-fade-in { from { opacity: 0; } }
30
31
  @keyframes sereno-toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@@ -318,6 +319,14 @@
318
319
  font-weight: var(--weight-bold);
319
320
  }
320
321
 
322
+ /* ── StatusDot pulse (SS-516) ─────────────────────────────────────────────────
323
+ The ring behind a pulsing dot (`StatusDot pulse`, `Badge pulse`). Its inline style leaves it
324
+ invisible (opacity 0), so it only shows while this animation runs. */
325
+ .sereno-status-ping { animation: sereno-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite; }
326
+ @media (prefers-reduced-motion: reduce) {
327
+ .sereno-status-ping { display: none; }
328
+ }
329
+
321
330
  /* ── Reduced motion ──────────────────────────────────────────────────────────
322
331
  The token layer already zeroes `--duration-*`, but Button's spinner and
323
332
  Skeleton's pulse use fixed loop durations - damp every animation so the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sereno-ds/ui",
3
- "version": "0.39.0",
3
+ "version": "0.40.0",
4
4
  "description": "Sereno Design System: React primitives (token-driven, inline styles, no UI base lib).",
5
5
  "license": "MIT",
6
6
  "author": "Sereno",