@charcuterie/ui 2.18.0 → 3.1.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.
Files changed (121) hide show
  1. package/README.md +10 -0
  2. package/dist/Badge/Badge.d.ts +33 -3
  3. package/dist/Badge/Badge.d.ts.map +1 -1
  4. package/dist/Badge/Badge.js +20 -2
  5. package/dist/Badge/Badge.js.map +1 -1
  6. package/dist/Board/Board.d.ts +119 -0
  7. package/dist/Board/Board.d.ts.map +1 -0
  8. package/dist/Board/Board.js +165 -0
  9. package/dist/Board/Board.js.map +1 -0
  10. package/dist/Board/BoardCard.d.ts +120 -0
  11. package/dist/Board/BoardCard.d.ts.map +1 -0
  12. package/dist/Board/BoardCard.js +77 -0
  13. package/dist/Board/BoardCard.js.map +1 -0
  14. package/dist/Board/BoardLaneList.d.ts +103 -0
  15. package/dist/Board/BoardLaneList.d.ts.map +1 -0
  16. package/dist/Board/BoardLaneList.js +69 -0
  17. package/dist/Board/BoardLaneList.js.map +1 -0
  18. package/dist/Board/boardMove.d.ts +116 -0
  19. package/dist/Board/boardMove.d.ts.map +1 -0
  20. package/dist/Board/boardMove.js +116 -0
  21. package/dist/Board/boardMove.js.map +1 -0
  22. package/dist/Board/useBoardDrag.d.ts +44 -0
  23. package/dist/Board/useBoardDrag.d.ts.map +1 -0
  24. package/dist/Board/useBoardDrag.js +237 -0
  25. package/dist/Board/useBoardDrag.js.map +1 -0
  26. package/dist/Checkbox/Checkbox.d.ts.map +1 -1
  27. package/dist/Checkbox/Checkbox.js +15 -4
  28. package/dist/Checkbox/Checkbox.js.map +1 -1
  29. package/dist/DataTable/DataTable.d.ts +159 -0
  30. package/dist/DataTable/DataTable.d.ts.map +1 -0
  31. package/dist/DataTable/DataTable.js +197 -0
  32. package/dist/DataTable/DataTable.js.map +1 -0
  33. package/dist/DatePicker/DateGrid.d.ts +79 -0
  34. package/dist/DatePicker/DateGrid.d.ts.map +1 -0
  35. package/dist/DatePicker/DateGrid.js +220 -0
  36. package/dist/DatePicker/DateGrid.js.map +1 -0
  37. package/dist/DatePicker/DatePicker.d.ts +138 -0
  38. package/dist/DatePicker/DatePicker.d.ts.map +1 -0
  39. package/dist/DatePicker/DatePicker.js +384 -0
  40. package/dist/DatePicker/DatePicker.js.map +1 -0
  41. package/dist/DatePicker/datePresets.d.ts +29 -0
  42. package/dist/DatePicker/datePresets.d.ts.map +1 -0
  43. package/dist/DatePicker/datePresets.js +28 -0
  44. package/dist/DatePicker/datePresets.js.map +1 -0
  45. package/dist/DatePicker/parseDateInput.d.ts +106 -0
  46. package/dist/DatePicker/parseDateInput.d.ts.map +1 -0
  47. package/dist/DatePicker/parseDateInput.js +419 -0
  48. package/dist/DatePicker/parseDateInput.js.map +1 -0
  49. package/dist/DatePicker/plainDate.d.ts +167 -0
  50. package/dist/DatePicker/plainDate.d.ts.map +1 -0
  51. package/dist/DatePicker/plainDate.js +272 -0
  52. package/dist/DatePicker/plainDate.js.map +1 -0
  53. package/dist/MarkdownEditor/MarkdownEditor.d.ts +147 -0
  54. package/dist/MarkdownEditor/MarkdownEditor.d.ts.map +1 -0
  55. package/dist/MarkdownEditor/MarkdownEditor.js +492 -0
  56. package/dist/MarkdownEditor/MarkdownEditor.js.map +1 -0
  57. package/dist/MarkdownEditor/markdownCommands.d.ts +202 -0
  58. package/dist/MarkdownEditor/markdownCommands.d.ts.map +1 -0
  59. package/dist/MarkdownEditor/markdownCommands.js +379 -0
  60. package/dist/MarkdownEditor/markdownCommands.js.map +1 -0
  61. package/dist/MarkdownEditor/markdownSpans.d.ts +92 -0
  62. package/dist/MarkdownEditor/markdownSpans.d.ts.map +1 -0
  63. package/dist/MarkdownEditor/markdownSpans.js +303 -0
  64. package/dist/MarkdownEditor/markdownSpans.js.map +1 -0
  65. package/dist/Select/Select.d.ts +36 -1
  66. package/dist/Select/Select.d.ts.map +1 -1
  67. package/dist/Select/Select.js +38 -2
  68. package/dist/Select/Select.js.map +1 -1
  69. package/dist/categoricalStyles.d.ts +53 -0
  70. package/dist/categoricalStyles.d.ts.map +1 -0
  71. package/dist/categoricalStyles.js +195 -0
  72. package/dist/categoricalStyles.js.map +1 -0
  73. package/dist/index.d.ts +22 -0
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +11 -0
  76. package/dist/index.js.map +1 -1
  77. package/package.json +2 -2
  78. package/src/Badge/Badge.mdx +46 -0
  79. package/src/Badge/Badge.stories.tsx +98 -4
  80. package/src/Badge/Badge.test.tsx +157 -2
  81. package/src/Badge/Badge.tsx +49 -3
  82. package/src/Board/Board.mdx +199 -0
  83. package/src/Board/Board.stories.tsx +707 -0
  84. package/src/Board/Board.test.tsx +310 -0
  85. package/src/Board/Board.tsx +333 -0
  86. package/src/Board/BoardCard.tsx +290 -0
  87. package/src/Board/BoardLaneList.tsx +275 -0
  88. package/src/Board/boardMove.test.ts +213 -0
  89. package/src/Board/boardMove.ts +225 -0
  90. package/src/Board/useBoardDrag.ts +413 -0
  91. package/src/Checkbox/Checkbox.tsx +34 -3
  92. package/src/DataTable/DataTable.mdx +123 -0
  93. package/src/DataTable/DataTable.stories.tsx +411 -0
  94. package/src/DataTable/DataTable.test.tsx +386 -0
  95. package/src/DataTable/DataTable.tsx +497 -0
  96. package/src/DatePicker/DateGrid.tsx +467 -0
  97. package/src/DatePicker/DatePicker.mdx +170 -0
  98. package/src/DatePicker/DatePicker.stories.tsx +268 -0
  99. package/src/DatePicker/DatePicker.test.tsx +455 -0
  100. package/src/DatePicker/DatePicker.tsx +852 -0
  101. package/src/DatePicker/datePresets.ts +34 -0
  102. package/src/DatePicker/parseDateInput.test.ts +187 -0
  103. package/src/DatePicker/parseDateInput.ts +629 -0
  104. package/src/DatePicker/plainDate.test.ts +375 -0
  105. package/src/DatePicker/plainDate.ts +465 -0
  106. package/src/MarkdownEditor/MarkdownEditor.mdx +189 -0
  107. package/src/MarkdownEditor/MarkdownEditor.stories.tsx +267 -0
  108. package/src/MarkdownEditor/MarkdownEditor.test.tsx +627 -0
  109. package/src/MarkdownEditor/MarkdownEditor.tsx +862 -0
  110. package/src/MarkdownEditor/markdownCommands.test.ts +384 -0
  111. package/src/MarkdownEditor/markdownCommands.ts +566 -0
  112. package/src/MarkdownEditor/markdownSpans.test.ts +217 -0
  113. package/src/MarkdownEditor/markdownSpans.ts +458 -0
  114. package/src/Select/Select.mdx +44 -0
  115. package/src/Select/Select.stories.tsx +55 -0
  116. package/src/Select/Select.test.tsx +89 -1
  117. package/src/Select/Select.tsx +58 -2
  118. package/src/argTypes.storyHelpers.ts +39 -0
  119. package/src/categoricalStyles.ts +244 -0
  120. package/src/index.ts +89 -0
  121. package/src/sourceRules.test.ts +52 -1
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Markdown → coloured spans, with **every character kept**.
3
+ *
4
+ * This is the half of the live-hybrid editor that decides what a
5
+ * line looks like, and its one hard requirement is not a parsing
6
+ * requirement at all — it is a geometry one.
7
+ *
8
+ * ### The concatenation invariant
9
+ *
10
+ * The editing surface is a real `<textarea>` with a painted layer
11
+ * behind it, sharing one grid cell. The textarea owns the caret,
12
+ * the selection, the undo stack and the IME; the layer owns the
13
+ * colour. That only works while the two layers **wrap identically**,
14
+ * and they only wrap identically while they contain the *same
15
+ * characters in the same order*.
16
+ *
17
+ * So `toMarkdownLines(text)` is not a parser in the usual sense. It
18
+ * never drops a marker, never normalises whitespace, never resolves
19
+ * a reference, and never emits a node the source did not contain.
20
+ * Joining every span's text back together, with `\n` between lines,
21
+ * reproduces the input byte for byte — `markdownSpans.test.ts`
22
+ * asserts exactly that over a fixture corpus, and it is the test
23
+ * that stops a well-meaning "let's trim the trailing space"
24
+ * from silently shearing the caret away from the glyphs.
25
+ *
26
+ * ### It emits kinds, not HTML
27
+ *
28
+ * The return value is a list of `{ kind, text }` pairs. There is no
29
+ * HTML string anywhere in this module, no `innerHTML`, and no
30
+ * sanitiser — because there is nothing to sanitise. Docket's whole
31
+ * reason to exist is that HTML-in-the-field destroyed a previous
32
+ * tool's data, and the cheapest possible guarantee against that is
33
+ * a pipeline in which HTML is never *constructed*. React renders
34
+ * these spans as text nodes; a `<script>` in the source is a
35
+ * `<script>` on screen.
36
+ *
37
+ * ### Why it is line-based, and what that costs
38
+ *
39
+ * A CommonMark parser resolves lazy continuation, setext headings,
40
+ * link reference definitions and nested block containers across the
41
+ * whole document. This resolves one line at a time, carrying
42
+ * exactly one bit of cross-line state: whether we are inside a
43
+ * fenced code block.
44
+ *
45
+ * That is a deliberate trade. Painting is per-line and re-runs on
46
+ * every keystroke, so the cost has to be linear in the line, not in
47
+ * the document; and a mis-coloured marker is a cosmetic defect
48
+ * while a mis-*placed* one is a broken editor. The known gaps are
49
+ * written down in `MarkdownEditor.mdx` rather than hidden: setext
50
+ * headings, indented (four-space) code blocks, reference links, and
51
+ * emphasis that spans a line break all colour as plain text. They
52
+ * still **store** correctly, because the stored value is the
53
+ * textarea's, not this module's.
54
+ */
55
+ export type MarkdownSpanKind = "code" | "emphasis" | "heading" | "link" | "marker" | "plain" | "strikethrough" | "strong" | "url";
56
+ export type MarkdownSpan = {
57
+ kind: MarkdownSpanKind;
58
+ text: string;
59
+ };
60
+ export type MarkdownLineKind = "blockquote" | "code" | "heading" | "list" | "paragraph" | "table" | "thematicBreak";
61
+ export type MarkdownLine = {
62
+ kind: MarkdownLineKind;
63
+ spans: MarkdownSpan[];
64
+ };
65
+ /**
66
+ * The inline scanner.
67
+ *
68
+ * `baseKind` is what unmarked text becomes — `"plain"` in a
69
+ * paragraph, `"heading"` inside a heading — so a heading's words
70
+ * carry the heading colour while the `##` in front of them stays a
71
+ * marker.
72
+ */
73
+ export declare const toInlineSpans: (text: string, baseKind?: MarkdownSpanKind) => MarkdownSpan[];
74
+ /**
75
+ * The whole document, one entry per line.
76
+ *
77
+ * `text.split("\n")` on an empty string yields `[""]` — one empty
78
+ * line — which is right: an empty editor still has a line for the
79
+ * caret to sit on, and the painted layer still needs a row so the
80
+ * two layers agree about where line 0 is.
81
+ */
82
+ export declare const toMarkdownLines: (text: string) => MarkdownLine[];
83
+ /**
84
+ * Which line the caret is on, from a character offset.
85
+ *
86
+ * The active line is the one construct in this editor that is
87
+ * *state* rather than syntax: its markers paint at full strength
88
+ * and every other line's fade back, which is the whole "raw syntax
89
+ * on the cursor's line" behaviour.
90
+ */
91
+ export declare const toLineIndex: (text: string, offset: number) => number;
92
+ //# sourceMappingURL=markdownSpans.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdownSpans.d.ts","sourceRoot":"","sources":["../../src/MarkdownEditor/markdownSpans.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,UAAU,GACV,SAAS,GACT,MAAM,GACN,QAAQ,GACR,OAAO,GACP,eAAe,GACf,QAAQ,GACR,KAAK,CAAA;AAET,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,gBAAgB,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gBAAgB,GACxB,YAAY,GACZ,MAAM,GACN,SAAS,GACT,MAAM,GACN,WAAW,GACX,OAAO,GACP,eAAe,CAAA;AAEnB,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,gBAAgB,CAAA;IACtB,KAAK,EAAE,YAAY,EAAE,CAAA;CACtB,CAAA;AA2ED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GACxB,MAAM,MAAM,EACZ,WAAU,gBAA0B,KACnC,YAAY,EAkId,CAAA;AAkGD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,MAAM,MAAM,KACX,YAAY,EAyBd,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,MAAM,EACZ,QAAQ,MAAM,KACb,MAYF,CAAA"}
@@ -0,0 +1,303 @@
1
+ /**
2
+ * Markdown → coloured spans, with **every character kept**.
3
+ *
4
+ * This is the half of the live-hybrid editor that decides what a
5
+ * line looks like, and its one hard requirement is not a parsing
6
+ * requirement at all — it is a geometry one.
7
+ *
8
+ * ### The concatenation invariant
9
+ *
10
+ * The editing surface is a real `<textarea>` with a painted layer
11
+ * behind it, sharing one grid cell. The textarea owns the caret,
12
+ * the selection, the undo stack and the IME; the layer owns the
13
+ * colour. That only works while the two layers **wrap identically**,
14
+ * and they only wrap identically while they contain the *same
15
+ * characters in the same order*.
16
+ *
17
+ * So `toMarkdownLines(text)` is not a parser in the usual sense. It
18
+ * never drops a marker, never normalises whitespace, never resolves
19
+ * a reference, and never emits a node the source did not contain.
20
+ * Joining every span's text back together, with `\n` between lines,
21
+ * reproduces the input byte for byte — `markdownSpans.test.ts`
22
+ * asserts exactly that over a fixture corpus, and it is the test
23
+ * that stops a well-meaning "let's trim the trailing space"
24
+ * from silently shearing the caret away from the glyphs.
25
+ *
26
+ * ### It emits kinds, not HTML
27
+ *
28
+ * The return value is a list of `{ kind, text }` pairs. There is no
29
+ * HTML string anywhere in this module, no `innerHTML`, and no
30
+ * sanitiser — because there is nothing to sanitise. Docket's whole
31
+ * reason to exist is that HTML-in-the-field destroyed a previous
32
+ * tool's data, and the cheapest possible guarantee against that is
33
+ * a pipeline in which HTML is never *constructed*. React renders
34
+ * these spans as text nodes; a `<script>` in the source is a
35
+ * `<script>` on screen.
36
+ *
37
+ * ### Why it is line-based, and what that costs
38
+ *
39
+ * A CommonMark parser resolves lazy continuation, setext headings,
40
+ * link reference definitions and nested block containers across the
41
+ * whole document. This resolves one line at a time, carrying
42
+ * exactly one bit of cross-line state: whether we are inside a
43
+ * fenced code block.
44
+ *
45
+ * That is a deliberate trade. Painting is per-line and re-runs on
46
+ * every keystroke, so the cost has to be linear in the line, not in
47
+ * the document; and a mis-coloured marker is a cosmetic defect
48
+ * while a mis-*placed* one is a broken editor. The known gaps are
49
+ * written down in `MarkdownEditor.mdx` rather than hidden: setext
50
+ * headings, indented (four-space) code blocks, reference links, and
51
+ * emphasis that spans a line break all colour as plain text. They
52
+ * still **store** correctly, because the stored value is the
53
+ * textarea's, not this module's.
54
+ */
55
+ /**
56
+ * A fence opens or closes on any line whose first non-space run is
57
+ * three or more backticks or tildes. Up to three leading spaces,
58
+ * per CommonMark; a fourth would be an indented code block, which
59
+ * this module deliberately does not track.
60
+ */
61
+ const FENCE_PATTERN = /^ {0,3}(?:```|~~~)/;
62
+ const INDENT_PATTERN = /^[ \t]*/;
63
+ const BLOCKQUOTE_PATTERN = /^(?:>[ \t]?)+/;
64
+ const THEMATIC_BREAK_PATTERN = /^(?:\*[ \t]*){3,}$|^(?:-[ \t]*){3,}$|^(?:_[ \t]*){3,}$/;
65
+ const HEADING_PATTERN = /^#{1,6}[ \t]+/;
66
+ const LIST_MARKER_PATTERN = /^(?:[-*+]|\d{1,9}[.)])[ \t]+/;
67
+ const TASK_MARKER_PATTERN = /^\[[ xX]\][ \t]*/;
68
+ /**
69
+ * Sticky, because every one of these is tried at a known index
70
+ * rather than searched for. A non-sticky `exec` would happily match
71
+ * an emphasis pair fifty characters further down the line and the
72
+ * scanner would swallow everything in between.
73
+ *
74
+ * Order is the whole grammar here, and two orderings are
75
+ * load-bearing:
76
+ *
77
+ * - **Escape first.** `\*not emphasis\*` has to lose to the
78
+ * backslash, or the editor colours text the renderer will not.
79
+ * - **Code before everything.** A code span suppresses every other
80
+ * construct inside it, which is what makes `` `**` `` render as
81
+ * two asterisks rather than an unterminated bold run.
82
+ * - **Image before link**, because `![alt](url)` starts with a
83
+ * valid link at index 1.
84
+ * - **Strong before emphasis**, because `**` starts with `*`.
85
+ */
86
+ const INLINE_PATTERNS = {
87
+ code: /(`+)([^\n]*?)\1/y,
88
+ emphasis: /([*_])(?=[^\s*_])([^\n*_]*?[^\s*_])\1/y,
89
+ escape: /\\([\\`*_{}[\]()#+\-.!>~|])/y,
90
+ image: /(!\[)([^\]\n]*)(\]\()([^)\s\n]*)(\))/y,
91
+ link: /(\[)([^\]\n]*)(\]\()([^)\s\n]*)(\))/y,
92
+ strikethrough: /(~~)(?=\S)([^\n]*?\S)\1/y,
93
+ strong: /(\*\*|__)(?=\S)([^\n]*?\S)\1/y,
94
+ };
95
+ const pushSpan = (spans, kind, text) => {
96
+ if (text === "") {
97
+ return;
98
+ }
99
+ const previous = spans.at(-1);
100
+ // Merged as they are pushed rather than in a second pass. The
101
+ // scanner emits one span per plain *character*, so without this a
102
+ // 200-character paragraph is 200 React elements and every
103
+ // keystroke reconciles all of them.
104
+ if (previous?.kind === kind) {
105
+ previous.text += text;
106
+ return;
107
+ }
108
+ spans.push({ kind, text });
109
+ };
110
+ /**
111
+ * The inline scanner.
112
+ *
113
+ * `baseKind` is what unmarked text becomes — `"plain"` in a
114
+ * paragraph, `"heading"` inside a heading — so a heading's words
115
+ * carry the heading colour while the `##` in front of them stays a
116
+ * marker.
117
+ */
118
+ export const toInlineSpans = (text, baseKind = "plain") => {
119
+ const spans = [];
120
+ let index = 0;
121
+ while (index < text.length) {
122
+ INLINE_PATTERNS.escape.lastIndex = index;
123
+ const escaped = INLINE_PATTERNS.escape.exec(text);
124
+ if (escaped) {
125
+ pushSpan(spans, "marker", "\\");
126
+ pushSpan(spans, baseKind, escaped[1] ?? "");
127
+ index += escaped[0].length;
128
+ continue;
129
+ }
130
+ INLINE_PATTERNS.code.lastIndex = index;
131
+ const code = INLINE_PATTERNS.code.exec(text);
132
+ if (code) {
133
+ pushSpan(spans, "marker", code[1] ?? "");
134
+ pushSpan(spans, "code", code[2] ?? "");
135
+ pushSpan(spans, "marker", code[1] ?? "");
136
+ index += code[0].length;
137
+ continue;
138
+ }
139
+ INLINE_PATTERNS.image.lastIndex = index;
140
+ const image = INLINE_PATTERNS.image.exec(text);
141
+ if (image) {
142
+ pushSpan(spans, "marker", image[1] ?? "");
143
+ pushSpan(spans, "link", image[2] ?? "");
144
+ pushSpan(spans, "marker", image[3] ?? "");
145
+ pushSpan(spans, "url", image[4] ?? "");
146
+ pushSpan(spans, "marker", image[5] ?? "");
147
+ index += image[0].length;
148
+ continue;
149
+ }
150
+ INLINE_PATTERNS.link.lastIndex = index;
151
+ const link = INLINE_PATTERNS.link.exec(text);
152
+ if (link) {
153
+ pushSpan(spans, "marker", link[1] ?? "");
154
+ pushSpan(spans, "link", link[2] ?? "");
155
+ pushSpan(spans, "marker", link[3] ?? "");
156
+ pushSpan(spans, "url", link[4] ?? "");
157
+ pushSpan(spans, "marker", link[5] ?? "");
158
+ index += link[0].length;
159
+ continue;
160
+ }
161
+ INLINE_PATTERNS.strong.lastIndex = index;
162
+ const strong = INLINE_PATTERNS.strong.exec(text);
163
+ if (strong) {
164
+ pushSpan(spans, "marker", strong[1] ?? "");
165
+ pushSpan(spans, "strong", strong[2] ?? "");
166
+ pushSpan(spans, "marker", strong[1] ?? "");
167
+ index += strong[0].length;
168
+ continue;
169
+ }
170
+ INLINE_PATTERNS.strikethrough.lastIndex = index;
171
+ const struck = INLINE_PATTERNS.strikethrough.exec(text);
172
+ if (struck) {
173
+ pushSpan(spans, "marker", struck[1] ?? "");
174
+ pushSpan(spans, "strikethrough", struck[2] ?? "");
175
+ pushSpan(spans, "marker", struck[1] ?? "");
176
+ index += struck[0].length;
177
+ continue;
178
+ }
179
+ INLINE_PATTERNS.emphasis.lastIndex = index;
180
+ const emphasised = INLINE_PATTERNS.emphasis.exec(text);
181
+ if (emphasised) {
182
+ pushSpan(spans, "marker", emphasised[1] ?? "");
183
+ pushSpan(spans, "emphasis", emphasised[2] ?? "");
184
+ pushSpan(spans, "marker", emphasised[1] ?? "");
185
+ index += emphasised[0].length;
186
+ continue;
187
+ }
188
+ pushSpan(spans, baseKind, text[index] ?? "");
189
+ index += 1;
190
+ }
191
+ return spans;
192
+ };
193
+ const toTableSpans = (text) => {
194
+ const spans = [];
195
+ for (const part of text.split(/(\|)/)) {
196
+ if (part === "|") {
197
+ pushSpan(spans, "marker", part);
198
+ continue;
199
+ }
200
+ for (const span of toInlineSpans(part)) {
201
+ pushSpan(spans, span.kind, span.text);
202
+ }
203
+ }
204
+ return spans;
205
+ };
206
+ const toBlockLine = (line) => {
207
+ const spans = [];
208
+ const indent = INDENT_PATTERN.exec(line)?.[0] ?? "";
209
+ pushSpan(spans, "plain", indent);
210
+ let rest = line.slice(indent.length);
211
+ const quote = BLOCKQUOTE_PATTERN.exec(rest)?.[0];
212
+ if (quote !== undefined) {
213
+ pushSpan(spans, "marker", quote);
214
+ rest = rest.slice(quote.length);
215
+ }
216
+ if (THEMATIC_BREAK_PATTERN.test(rest)) {
217
+ pushSpan(spans, "marker", rest);
218
+ return { kind: "thematicBreak", spans };
219
+ }
220
+ const heading = HEADING_PATTERN.exec(rest)?.[0];
221
+ if (heading !== undefined) {
222
+ pushSpan(spans, "marker", heading);
223
+ for (const span of toInlineSpans(rest.slice(heading.length), "heading")) {
224
+ pushSpan(spans, span.kind, span.text);
225
+ }
226
+ return { kind: "heading", spans };
227
+ }
228
+ const listMarker = LIST_MARKER_PATTERN.exec(rest)?.[0];
229
+ if (listMarker !== undefined) {
230
+ pushSpan(spans, "marker", listMarker);
231
+ rest = rest.slice(listMarker.length);
232
+ const taskMarker = TASK_MARKER_PATTERN.exec(rest)?.[0];
233
+ if (taskMarker !== undefined) {
234
+ pushSpan(spans, "marker", taskMarker);
235
+ rest = rest.slice(taskMarker.length);
236
+ }
237
+ for (const span of toInlineSpans(rest)) {
238
+ pushSpan(spans, span.kind, span.text);
239
+ }
240
+ return { kind: "list", spans };
241
+ }
242
+ if (rest.startsWith("|")) {
243
+ for (const span of toTableSpans(rest)) {
244
+ pushSpan(spans, span.kind, span.text);
245
+ }
246
+ return { kind: "table", spans };
247
+ }
248
+ for (const span of toInlineSpans(rest)) {
249
+ pushSpan(spans, span.kind, span.text);
250
+ }
251
+ return {
252
+ kind: quote === undefined ? "paragraph" : "blockquote",
253
+ spans,
254
+ };
255
+ };
256
+ /**
257
+ * The whole document, one entry per line.
258
+ *
259
+ * `text.split("\n")` on an empty string yields `[""]` — one empty
260
+ * line — which is right: an empty editor still has a line for the
261
+ * caret to sit on, and the painted layer still needs a row so the
262
+ * two layers agree about where line 0 is.
263
+ */
264
+ export const toMarkdownLines = (text) => {
265
+ let isInsideFence = false;
266
+ return text.split("\n").map((line) => {
267
+ if (FENCE_PATTERN.test(line)) {
268
+ isInsideFence = !isInsideFence;
269
+ return {
270
+ kind: "code",
271
+ spans: [{ kind: "marker", text: line }],
272
+ };
273
+ }
274
+ if (isInsideFence) {
275
+ return {
276
+ kind: "code",
277
+ spans: line === ""
278
+ ? []
279
+ : [{ kind: "code", text: line }],
280
+ };
281
+ }
282
+ return toBlockLine(line);
283
+ });
284
+ };
285
+ /**
286
+ * Which line the caret is on, from a character offset.
287
+ *
288
+ * The active line is the one construct in this editor that is
289
+ * *state* rather than syntax: its markers paint at full strength
290
+ * and every other line's fade back, which is the whole "raw syntax
291
+ * on the cursor's line" behaviour.
292
+ */
293
+ export const toLineIndex = (text, offset) => {
294
+ const clamped = Math.max(0, Math.min(offset, text.length));
295
+ let lineIndex = 0;
296
+ for (let index = 0; index < clamped; index += 1) {
297
+ if (text[index] === "\n") {
298
+ lineIndex += 1;
299
+ }
300
+ }
301
+ return lineIndex;
302
+ };
303
+ //# sourceMappingURL=markdownSpans.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdownSpans.js","sourceRoot":"","sources":["../../src/MarkdownEditor/markdownSpans.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAgCH;;;;;GAKG;AACH,MAAM,aAAa,GAAG,oBAAoB,CAAA;AAE1C,MAAM,cAAc,GAAG,SAAS,CAAA;AAEhC,MAAM,kBAAkB,GAAG,eAAe,CAAA;AAE1C,MAAM,sBAAsB,GAC1B,wDAAwD,CAAA;AAE1D,MAAM,eAAe,GAAG,eAAe,CAAA;AAEvC,MAAM,mBAAmB,GAAG,8BAA8B,CAAA;AAE1D,MAAM,mBAAmB,GAAG,kBA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BACrB,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,QAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;aACjD,CAAA;QACH,CAAC;QAED,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO;gBACL,IAAI,EAAE,MAAe;gBACrB,KAAK,EACH,IAAI,KAAK,EAAE;oBACT,CAAC,CAAC,EAAE;oBACJ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;aAC9C,CAAA;QACH,CAAC;QAED,OAAO,WAAW,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,IAAY,EACZ,MAAc,EACN,EAAE;IACV,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IAE1D,IAAI,SAAS,GAAG,CAAC,CAAA;IAEjB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAChD,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;YACzB,SAAS,IAAI,CAAC,CAAA;QAChB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA"}
@@ -24,7 +24,23 @@ export type SelectItem = SelectOption | SelectOptionGroup;
24
24
  * Same arrangement as `Button`, for the same reason.
25
25
  */
26
26
  export type SelectProps = Omit<ComponentPropsWithRef<"select">, "disabled" | "onChange" | "size" | "value"> & {
27
+ /**
28
+ * Goes on the **wrapper**, which is the box a caller means when
29
+ * they size a control. See the component docblock — the chevron
30
+ * is positioned against that wrapper, so a width anywhere else
31
+ * leaves it behind.
32
+ */
27
33
  className?: string;
34
+ /**
35
+ * The escape hatch for the inner `<select>` itself, for the
36
+ * things that genuinely are not the outer box: `font-mono` on the
37
+ * option text, a `text-*` override, a `bg-*`.
38
+ *
39
+ * Sizing does **not** belong here. The inner element is `w-full`
40
+ * and a width on it desynchronises it from the wrapper the
41
+ * chevron is pinned to, which is the whole of #112.
42
+ */
43
+ controlClassName?: string;
28
44
  isDisabled?: boolean;
29
45
  /**
30
46
  * The accessible name, when this is **not** inside a `Field`. A
@@ -59,6 +75,25 @@ export type SelectProps = Omit<ComponentPropsWithRef<"select">, "disabled" | "on
59
75
  * A styled native `<select>`, and the fleet's fourteen hand-rolled
60
76
  * ones collapse onto it.
61
77
  *
78
+ * ### Sizing: `className` is the wrapper, `controlClassName` is the select
79
+ *
80
+ * This renders a wrapper around the native `<select>` because the
81
+ * chevron has to live somewhere, and the chevron is positioned
82
+ * against that wrapper. `className` therefore lands on the wrapper
83
+ * and the `<select>` stays `w-full` inside it, so
84
+ * `className="w-44"` means "this control is 176px" — chevron
85
+ * included — which is what a caller writing a width already assumes.
86
+ *
87
+ * Before this, `className` went to the inner element only. The
88
+ * wrapper stayed `w-full`, the chevron stayed at *its* edge, and
89
+ * mux-magic's rules builder measured the gap at **869.6px** with the
90
+ * control's own text clipping beside it. The width never worked;
91
+ * `ui@2.16.0`'s `tailwind-merge` only made half of it work and made
92
+ * the other half visible.
93
+ *
94
+ * For the genuinely-inner things — `font-mono` on the option text, a
95
+ * `bg-*` — there is `controlClassName`.
96
+ *
62
97
  * ### There is no state kind here, and that is the finding
63
98
  *
64
99
  * Every other interactive component in this package owns its state
@@ -91,5 +126,5 @@ export type SelectProps = Omit<ComponentPropsWithRef<"select">, "disabled" | "on
91
126
  * from nothing: type-ahead, Home/End, PageUp/PageDown, the mobile
92
127
  * wheel picker, form submission, `:invalid`, and autofill.
93
128
  */
94
- export declare const Select: ({ className, isDisabled, label, onChange, options, placeholder, size, value, ...selectProps }: SelectProps) => ReactNode;
129
+ export declare const Select: ({ className, controlClassName, isDisabled, label, onChange, options, placeholder, size, value, ...selectProps }: SelectProps) => ReactNode;
95
130
  //# sourceMappingURL=Select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAEV,qBAAqB,EACrB,SAAS,EACV,MAAM,OAAO,CAAA;AASd,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,iBAAiB,CAAA;AAEzD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,qBAAqB,CAAC,QAAQ,CAAC,EAC/B,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAC3C,GAAG;IACF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC;;;;;;;OAOG;IACH,OAAO,EAAE,SAAS,UAAU,EAAE,CAAA;IAC9B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,MAAM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;;;;;;;;;;;;;;;GAsDG;AACH,eAAO,MAAM,MAAM,GAAI,iHAWpB,WAAW,KAAG,SAsGhB,CAAA"}
@@ -7,6 +7,25 @@ const getIsGroup = (item) => "options" in item;
7
7
  * A styled native `<select>`, and the fleet's fourteen hand-rolled
8
8
  * ones collapse onto it.
9
9
  *
10
+ * ### Sizing: `className` is the wrapper, `controlClassName` is the select
11
+ *
12
+ * This renders a wrapper around the native `<select>` because the
13
+ * chevron has to live somewhere, and the chevron is positioned
14
+ * against that wrapper. `className` therefore lands on the wrapper
15
+ * and the `<select>` stays `w-full` inside it, so
16
+ * `className="w-44"` means "this control is 176px" — chevron
17
+ * included — which is what a caller writing a width already assumes.
18
+ *
19
+ * Before this, `className` went to the inner element only. The
20
+ * wrapper stayed `w-full`, the chevron stayed at *its* edge, and
21
+ * mux-magic's rules builder measured the gap at **869.6px** with the
22
+ * control's own text clipping beside it. The width never worked;
23
+ * `ui@2.16.0`'s `tailwind-merge` only made half of it work and made
24
+ * the other half visible.
25
+ *
26
+ * For the genuinely-inner things — `font-mono` on the option text, a
27
+ * `bg-*` — there is `controlClassName`.
28
+ *
10
29
  * ### There is no state kind here, and that is the finding
11
30
  *
12
31
  * Every other interactive component in this package owns its state
@@ -39,7 +58,20 @@ const getIsGroup = (item) => "options" in item;
39
58
  * from nothing: type-ahead, Home/End, PageUp/PageDown, the mobile
40
59
  * wheel picker, form submission, `:invalid`, and autofill.
41
60
  */
42
- export const Select = ({ className, isDisabled = false, label, onChange, options, placeholder, size = "md", value, ...selectProps }) => (_jsxs("div", { className: "relative inline-grid w-full items-center", children: [_jsxs("select", { ...selectProps, "aria-label": label, className: toClassName("w-full cursor-pointer appearance-none rounded-md border border-border-default bg-surface-raised text-content-primary transition-colors duration-(--duration-fast) ease-standard",
61
+ export const Select = ({ className, controlClassName, isDisabled = false, label, onChange, options, placeholder, size = "md", value, ...selectProps }) => (_jsxs("div", { className: toClassName("relative inline-grid w-full items-center",
62
+ // `className` lands HERE, not on the `<select>`, and that is
63
+ // the fix for #112 rather than a stylistic choice. The chevron
64
+ // below is `absolute end-3` against this element, so a width
65
+ // that reaches only the inner control moves the control and
66
+ // leaves the chevron pinned to the old edge — measured at
67
+ // 869.6px adrift in mux-magic's rules builder, with the
68
+ // control's own text clipping at the same time.
69
+ //
70
+ // It also matches every other component in this package:
71
+ // `className` is the outermost box. `ms-auto` — which mux-magic
72
+ // passes and which did nothing on a `w-full` inner select — is
73
+ // the tell that callers already believed this.
74
+ className), children: [_jsxs("select", { ...selectProps, "aria-label": label, className: toClassName("w-full cursor-pointer appearance-none rounded-md border border-border-default bg-surface-raised text-content-primary transition-colors duration-(--duration-fast) ease-standard",
43
75
  // Room for the chevron below, which sits in the same grid
44
76
  // cell. A `<select>`'s own arrow is what `appearance-none`
45
77
  // removes, and forgetting to put one back leaves a control
@@ -50,7 +82,11 @@ export const Select = ({ className, isDisabled = false, label, onChange, options
50
82
  // job (`[data-density]` scales `--control-height-*` past 44px on a
51
83
  // kiosk), so forcing 44px here made Select taller than Button et al.
52
84
  // at desktop density. See the controls-share-one-height decision.
53
- CONTROL_SIZE_CLASS[size], "hover:border-border-strong", FOCUS_RING_CLASS, DISABLED_CLASS, className), defaultValue: value ??
85
+ CONTROL_SIZE_CLASS[size], "hover:border-border-strong", FOCUS_RING_CLASS, DISABLED_CLASS,
86
+ // Inner-only, and deliberately not `className`. `w-full`
87
+ // above keeps this element the same width as the wrapper the
88
+ // chevron is measured from, so the two can never drift.
89
+ controlClassName), defaultValue: value ??
54
90
  (placeholder === undefined ? undefined : ""), disabled: isDisabled, onChange: (changeEvent) => {
55
91
  onChange?.(changeEvent.currentTarget.value);
56
92
  }, children: [placeholder === undefined ? null : (_jsx("option", { disabled: true, value: "", children: placeholder })), options.map((item) => getIsGroup(item) ? (_jsx("optgroup", { label: item.label, children: item.options.map((option) => (_jsx("option", { disabled: option.isDisabled, value: option.value, children: option.label }, option.value))) }, item.label)) : (_jsx("option", { disabled: item.isDisabled, value: item.value, children: item.label }, item.value)))] }), _jsx("svg", { "aria-hidden": "true", className: "pointer-events-none absolute end-3 size-4 text-content-secondary", fill: "none", focusable: false, stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.75, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "m6 9 6 6 6-6" }) })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EACL,cAAc,EACd,gBAAgB,GACjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAgE/C,MAAM,UAAU,GAAG,CACjB,IAAgB,EACW,EAAE,CAAC,SAAS,IAAI,IAAI,CAAA;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EACrB,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAW,EACX,IAAI,GAAG,IAAI,EACX,KAAK,EACL,GAAG,WAAW,EACF,EAAa,EAAE,CAAC,CAC5B,eAAK,SAAS,EAAC,0CAA0C,aACvD,qBACM,WAAW,gBACH,KAAK,EACjB,SAAS,EAAE,WAAW,CACpB,iLAAiL;YACjL,0DAA0D;YAC1D,2DAA2D;YAC3D,2DAA2D;YAC3D,wCAAwC;YACxC,MAAM;YACN,kEAAkE;YAClE,mEAAmE;YACnE,mEAAmE;YACnE,qEAAqE;YACrE,kEAAkE;YAClE,kBAAkB,CAAC,IAAI,CAAC,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,cAAc,EACd,SAAS,CACV,EACD,YAAY,EACV,KAAK;gBACL,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,C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
+ *
5
+ * Its own file rather than ten more entries in that one, because
6
+ * the two families are keyed by different things and mean different
7
+ * things. `intentStyles.ts` opens by explaining that it exists to
8
+ * delete rip-deck's duplicated `TONE_CLASS` — a *status* map, where
9
+ * every key is a claim about state. Nothing here is a claim about
10
+ * anything: an index is a user's pick for a label, and the only
11
+ * thing a component may do with it is paint it. Keeping them apart
12
+ * is also what keeps `IntentName` an exhaustive union that
13
+ * `getAsyncIntent` can switch over.
14
+ *
15
+ * **Every class name is written out in full, and that is not
16
+ * negotiable.** Tailwind v4 scans source text for *complete* class
17
+ * strings, so `` `bg-categorical-${index}-solid` `` generates
18
+ * nothing at all — the badge renders unstyled with no error, no
19
+ * warning, and no failing test unless something checks. Something
20
+ * does: `tailwindCandidates.test.ts` compiles every literal in this
21
+ * package through the real Tailwind and fails on any candidate it
22
+ * cannot generate. Forty lines of near-duplication is the price,
23
+ * and the alternative is the `--color-danger-9` that shipped in
24
+ * Docket: a token name that had never existed, resolving to
25
+ * nothing, painting transparent, and passing every assertion about
26
+ * whether the element was rendered.
27
+ */
28
+ import type { CategoricalIndex } from "@charcuterie/tokens";
29
+ import type { IntentAppearance } from "./intentStyles.ts";
30
+ export declare const CATEGORICAL_APPEARANCE_CLASS: Record<CategoricalIndex, Record<IntentAppearance, string>>;
31
+ /**
32
+ * Hover, split out for exactly the reason `INTENT_HOVER_CLASS` is:
33
+ * most things wearing a colour are not interactive. A label pill in
34
+ * a task list that lightens under the cursor is telling the user it
35
+ * can be clicked, and a `Badge` cannot be. So an interactive
36
+ * component opts in, and a static one cannot accidentally opt in.
37
+ *
38
+ * `solid` hovers toward `solidHover`, which for this family is
39
+ * **brighter** rather than deeper — the fill carries a near-black
40
+ * label, so it moves away from it in the opposite direction to an
41
+ * intent's white-labelled fill.
42
+ */
43
+ export declare const CATEGORICAL_HOVER_CLASS: Record<CategoricalIndex, Record<IntentAppearance, string>>;
44
+ /**
45
+ * The fill on its own, for the parts of a component that are a dot
46
+ * or a bar rather than a box — the swatch beside a label in a
47
+ * picker, a series marker on a chart. Same values, no border and no
48
+ * hover, because neither of those is a surface anyone can point at.
49
+ */
50
+ export declare const CATEGORICAL_SOLID_FILL_CLASS: Record<CategoricalIndex, string>;
51
+ /** The same ten as text, for a glyph or a dot's ring. */
52
+ export declare const CATEGORICAL_CONTENT_CLASS: Record<CategoricalIndex, string>;
53
+ //# sourceMappingURL=categoricalStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categoricalStyles.d.ts","sourceRoot":"","sources":["../src/categoricalStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAC/C,gBAAgB,EAChB,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CA4FjC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,gBAAgB,EAChB,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CA8DjC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAC/C,gBAAgB,EAChB,MAAM,CAYP,CAAA;AAED,yDAAyD;AACzD,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAC5C,gBAAgB,EAChB,MAAM,CAYP,CAAA"}