@flytedan/flytebot-design-system 0.67.4 → 0.70.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,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/markdown.ts
21
+ var markdown_exports = {};
22
+ __export(markdown_exports, {
23
+ escapeMarkdown: () => escapeMarkdown
24
+ });
25
+ module.exports = __toCommonJS(markdown_exports);
26
+
27
+ // src/components/data/markdownEscape.ts
28
+ function escapeMarkdown(text) {
29
+ return String(text == null ? "" : text).replace(/\r\n?/g, "\n").replace(/[\\`*_[\]()<>!|~^]/g, "\\$&").replace(/\b(https?|mailto|tel):/gi, "$1\\:").split("\n").map(
30
+ (line) => line.replace(/^(\s*)([#>+-])/, "$1\\$2").replace(/^(\s*\d{1,9})([.)])/, "$1\\$2")
31
+ // task item `[ ]` is already covered by escaping `[`
32
+ ).join("\n");
33
+ }
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ escapeMarkdown
37
+ });
38
+ //# sourceMappingURL=markdown.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/markdown.ts","../src/components/data/markdownEscape.ts"],"sourcesContent":["// React-free entry (`@flytedan/flytebot-design-system/markdown`): safe to import on a server.\nexport { escapeMarkdown } from \"./components/data/markdownEscape\";\n","/* DS-7: the one definition of the markdown escape rule, shared by the renderer\n (Markdown.tsx) and by `escapeMarkdown` (a React-free entry, so a server can import it). */\n\n/** CommonMark: a backslash before any ASCII punctuation character makes it literal. */\nexport const ESCAPABLE = /\\\\([!-/:-@[-`{-~])/g;\n\n/* An escaped character is swapped for a private-use stand-in (U+E000 + its code) before any\n syntax pattern runs, so no pattern can see it, then swapped back where text is emitted. */\nconst STAND_IN_BASE = 0xe000;\nconst STAND_IN = /[-]/g;\n\n/** Hide every escaped character from the syntax patterns. Stray stand-ins already in the input are neutralised first. */\nexport const hideEscapes = (s: string): string =>\n s.replace(STAND_IN, \"�\").replace(ESCAPABLE, (_, c: string) => String.fromCharCode(STAND_IN_BASE + c.charCodeAt(0)));\n\n/** Put escaped characters back as the literal character. */\nexport const showEscapes = (s: string): string => s.replace(STAND_IN, (c) => String.fromCharCode(c.charCodeAt(0) - STAND_IN_BASE));\n\n/** Put escaped characters back with their backslash (a code span keeps its source verbatim). */\nexport const showEscapesRaw = (s: string): string => s.replace(STAND_IN, (c) => \"\\\\\" + String.fromCharCode(c.charCodeAt(0) - STAND_IN_BASE));\n\n/**\n * Backslash-escape text so `Markdown` / `MarkdownInline` render it as exactly that text:\n * every character the renderer reads as inline syntax, the `:` that starts a bare-URL or\n * mailto autolink, and any block marker (heading, quote, list, rule, table, fence) at the\n * start of a line.\n */\nexport function escapeMarkdown(text: string): string {\n return String(text == null ? \"\" : text)\n .replace(/\\r\\n?/g, \"\\n\")\n .replace(/[\\\\`*_[\\]()<>!|~^]/g, \"\\\\$&\")\n .replace(/\\b(https?|mailto|tel):/gi, \"$1\\\\:\")\n .split(\"\\n\")\n .map((line) =>\n line\n // heading, quote, bullet, rule, fence-like markers: escape the first marker character\n .replace(/^(\\s*)([#>+-])/, \"$1\\\\$2\")\n // ordered list: escape the dot or paren after the number\n .replace(/^(\\s*\\d{1,9})([.)])/, \"$1\\\\$2\")\n // task item `[ ]` is already covered by escaping `[`\n )\n .join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC2BO,SAAS,eAAe,MAAsB;AACnD,SAAO,OAAO,QAAQ,OAAO,KAAK,IAAI,EACnC,QAAQ,UAAU,IAAI,EACtB,QAAQ,uBAAuB,MAAM,EACrC,QAAQ,4BAA4B,OAAO,EAC3C,MAAM,IAAI,EACV;AAAA,IAAI,CAAC,SACJ,KAEG,QAAQ,kBAAkB,QAAQ,EAElC,QAAQ,uBAAuB,QAAQ;AAAA;AAAA,EAE5C,EACC,KAAK,IAAI;AACd;","names":[]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Backslash-escape text so `Markdown` / `MarkdownInline` render it as exactly that text:
3
+ * every character the renderer reads as inline syntax, the `:` that starts a bare-URL or
4
+ * mailto autolink, and any block marker (heading, quote, list, rule, table, fence) at the
5
+ * start of a line.
6
+ */
7
+ declare function escapeMarkdown(text: string): string;
8
+
9
+ export { escapeMarkdown };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Backslash-escape text so `Markdown` / `MarkdownInline` render it as exactly that text:
3
+ * every character the renderer reads as inline syntax, the `:` that starts a bare-URL or
4
+ * mailto autolink, and any block marker (heading, quote, list, rule, table, fence) at the
5
+ * start of a line.
6
+ */
7
+ declare function escapeMarkdown(text: string): string;
8
+
9
+ export { escapeMarkdown };
@@ -0,0 +1,7 @@
1
+ import {
2
+ escapeMarkdown
3
+ } from "./chunk-OVTWSE43.js";
4
+ export {
5
+ escapeMarkdown
6
+ };
7
+ //# sourceMappingURL=markdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flytedan/flytebot-design-system",
3
- "version": "0.67.4",
3
+ "version": "0.70.0",
4
4
  "description": "flytedesk Design System — shared component library, tokens, and business-logic kits for flytedesk apps.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -34,6 +34,11 @@
34
34
  "import": "./dist/index.js",
35
35
  "require": "./dist/index.cjs"
36
36
  },
37
+ "./markdown": {
38
+ "types": "./dist/markdown.d.ts",
39
+ "import": "./dist/markdown.js",
40
+ "require": "./dist/markdown.cjs"
41
+ },
37
42
  "./styles/*.css": "./styles/*.css",
38
43
  "./assets/*": "./assets/*"
39
44
  },
@@ -668,6 +668,12 @@
668
668
  box-shadow: 0 0 0 1px var(--blue-500);
669
669
  }
670
670
 
671
+ .fd-choice-badge { margin-left: 8px; }
672
+ .fd-radiogroup { display: flex; flex-direction: column; gap: 8px; }
673
+ .fd-radiogroup-label { font-weight: var(--w-medium); }
674
+ .fd-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
675
+ .fd-fieldset[aria-busy="true"] { opacity: 0.6; }
676
+
671
677
  /* ============ Switch ============ */
672
678
  .fd-switch {
673
679
  position: relative;
@@ -2230,28 +2236,51 @@
2230
2236
  color: var(--brand);
2231
2237
  font-size: 9px;
2232
2238
  }
2233
- .fd-dt-card {
2239
+ /* A card and, when the row has an action of its own, that action beside it: siblings, so the action is
2240
+ never inside the card's button. The item carries the hairline between rows. */
2241
+ .fd-dt-item {
2234
2242
  display: flex;
2235
- flex-direction: column;
2236
- gap: 3px;
2243
+ align-items: center;
2237
2244
  min-width: 0;
2238
- padding: 12px 14px;
2239
2245
  border-bottom: 1px solid var(--border);
2240
2246
  transition:
2241
2247
  background var(--dur-fast) var(--ease),
2242
2248
  box-shadow var(--dur-fast) var(--ease);
2243
2249
  }
2244
- .fd-dt-card:last-child {
2250
+ .fd-dt-item:last-child {
2245
2251
  border-bottom: 0;
2246
2252
  }
2253
+ .fd-dt-item > .fd-dt-card {
2254
+ flex: 1 1 auto;
2255
+ align-self: stretch;
2256
+ }
2257
+ .fd-dt-action {
2258
+ flex: none;
2259
+ padding-right: 8px;
2260
+ }
2261
+ /* The table's form of a row action: the row's last cell, as narrow as its button. */
2262
+ .fd-table td.fd-table-action,
2263
+ .fd-table th.fd-table-action-head {
2264
+ width: 1%;
2265
+ white-space: nowrap;
2266
+ text-align: right;
2267
+ }
2268
+ .fd-dt-card {
2269
+ display: flex;
2270
+ flex-direction: column;
2271
+ gap: 3px;
2272
+ min-width: 0;
2273
+ padding: 12px 14px;
2274
+ }
2247
2275
  .fd-dt-card[data-clickable] {
2248
2276
  cursor: pointer;
2249
2277
  }
2250
- .fd-dt-card[data-clickable]:hover,
2251
- .fd-dt-card[data-selected="true"] {
2278
+ /* The item is tinted, not the card, so the strip under a row's action is tinted with it. */
2279
+ .fd-dt-item:has(> .fd-dt-card[data-clickable]):hover,
2280
+ .fd-dt-item:has(> .fd-dt-card[data-selected="true"]) {
2252
2281
  background: var(--surface-brand);
2253
2282
  }
2254
- .fd-dt-card[data-selected="true"] {
2283
+ .fd-dt-item:has(> .fd-dt-card[data-selected="true"]) {
2255
2284
  box-shadow: inset 2px 0 0 var(--brand);
2256
2285
  }
2257
2286
  .fd-dt-card-title {
@@ -4850,12 +4879,28 @@
4850
4879
  text-wrap: pretty;
4851
4880
  min-width: 0;
4852
4881
  }
4853
- .fd-md > * + * {
4854
- margin-top: 10px;
4882
+ .fd-md--small {
4883
+ font-size: var(--body-sm-size);
4884
+ }
4885
+ .fd-md--muted {
4886
+ color: var(--chat-text-2);
4887
+ }
4888
+ .fd-md-inline--body {
4889
+ font-size: var(--body-size);
4890
+ }
4891
+ .fd-md-inline--small {
4892
+ font-size: var(--body-sm-size);
4893
+ }
4894
+ .fd-md-inline--muted {
4895
+ color: var(--text-2);
4855
4896
  }
4856
4897
  .fd-md-p {
4857
4898
  margin: 0;
4858
4899
  }
4900
+ /* DS-6: after .fd-md-p so sibling spacing wins at equal specificity */
4901
+ .fd-md > * + * {
4902
+ margin-top: 10px;
4903
+ }
4859
4904
  .fd-md-h {
4860
4905
  margin: 16px 0 0;
4861
4906
  font-weight: var(--w-semibold);