@seekbuddy/dsh-ui 0.0.0-stage → 0.2.0-beta.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 (195) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE +22 -0
  3. package/README.md +175 -2
  4. package/README.zh.md +176 -0
  5. package/THIRD_PARTY_NOTICES.md +42 -0
  6. package/UPSTREAM.md +56 -0
  7. package/dist/blocks.js +1582 -0
  8. package/dist/chunks/chunk-23KOEBWJ.js +104 -0
  9. package/dist/chunks/chunk-3HCOU44R.js +697 -0
  10. package/dist/chunks/chunk-5JXG4BHW.js +31 -0
  11. package/dist/chunks/chunk-5XDVPALS.js +61 -0
  12. package/dist/chunks/chunk-AY44MQMD.js +3052 -0
  13. package/dist/chunks/chunk-B3EEK7A2.js +408 -0
  14. package/dist/chunks/chunk-CEBTQO6W.js +24 -0
  15. package/dist/chunks/chunk-CI73NXA5.js +202 -0
  16. package/dist/chunks/chunk-CTQPGUZP.js +22 -0
  17. package/dist/chunks/chunk-F352IICS.js +57 -0
  18. package/dist/chunks/chunk-IOBKTEKP.js +144 -0
  19. package/dist/chunks/chunk-KETGFAOH.js +66 -0
  20. package/dist/chunks/chunk-LA3QDZYN.js +2777 -0
  21. package/dist/chunks/chunk-NE62SYOZ.js +89 -0
  22. package/dist/chunks/chunk-OQPH36OI.js +754 -0
  23. package/dist/chunks/chunk-QJKAQ6PO.js +155 -0
  24. package/dist/chunks/chunk-R6AUJQ3G.js +129 -0
  25. package/dist/chunks/chunk-RNVSCTW7.js +24 -0
  26. package/dist/chunks/chunk-RZOP2PFC.js +152 -0
  27. package/dist/chunks/chunk-TQU54HSM.js +112 -0
  28. package/dist/chunks/chunk-TUK6UGXM.js +36 -0
  29. package/dist/chunks/chunk-TZ7HRE6D.js +328 -0
  30. package/dist/chunks/chunk-VIH56PDF.js +57 -0
  31. package/dist/chunks/chunk-WUL523OW.js +27 -0
  32. package/dist/chunks/chunk-XX6MSZLS.js +261 -0
  33. package/dist/chunks/chunk-ZA47FP7C.js +7 -0
  34. package/dist/chunks/chunk-ZZNL5PWF.js +170 -0
  35. package/dist/icons.js +803 -0
  36. package/dist/index.js +1182 -0
  37. package/dist/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  38. package/dist/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  39. package/dist/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  40. package/dist/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  41. package/dist/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  42. package/dist/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  43. package/dist/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  44. package/dist/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  45. package/dist/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  46. package/dist/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  47. package/dist/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  48. package/dist/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  49. package/dist/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  50. package/dist/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  51. package/dist/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  52. package/dist/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  53. package/dist/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  54. package/dist/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  55. package/dist/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  56. package/dist/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  57. package/dist/katex.css +1 -0
  58. package/dist/katex.css.d.ts +2 -0
  59. package/dist/markdown.js +148 -0
  60. package/dist/meta.json +6876 -0
  61. package/dist/root-inputs.json +67 -0
  62. package/dist/seekbuddy-card.js +7 -0
  63. package/dist/seekbuddy-empty.js +8 -0
  64. package/dist/seekbuddy-internal/DangerButton.js +7 -0
  65. package/dist/seekbuddy-internal/Mark.js +7 -0
  66. package/dist/seekbuddy-internal/Message.js +10 -0
  67. package/dist/seekbuddy-internal/Pagination.js +9 -0
  68. package/dist/seekbuddy-internal/StatusBadge.js +7 -0
  69. package/dist/seekbuddy-internal/SubtleButton.js +7 -0
  70. package/dist/seekbuddy-internal/Switch.js +7 -0
  71. package/dist/seekbuddy-internal/Upload.js +7 -0
  72. package/dist/seekbuddy-internal/date/Calendar.js +8 -0
  73. package/dist/seekbuddy-internal/date/DatePicker.js +9 -0
  74. package/dist/seekbuddy-internal/date/DateRangePicker.js +9 -0
  75. package/dist/seekbuddy-internal/date/TimePicker.js +8 -0
  76. package/dist/seekbuddy-internal/date/fields.js +16 -0
  77. package/dist/seekbuddy-internal/qr/QrCode.js +7 -0
  78. package/dist/seekbuddy-spinner.js +7 -0
  79. package/dist/seekbuddy-tabs.js +7 -0
  80. package/dist/seekbuddy-timeline.js +8 -0
  81. package/dist/seekbuddy.js +89 -0
  82. package/dist/theme-bootstrap.js +13 -0
  83. package/dist/theme.js +37 -0
  84. package/dist/tokens.css +934 -0
  85. package/dist/tokens.css.d.ts +2 -0
  86. package/dist/types/Button.d.ts +18 -0
  87. package/dist/types/Checkbox.d.ts +19 -0
  88. package/dist/types/CodeFileIcon.d.ts +11 -0
  89. package/dist/types/CodeToolbar.d.ts +29 -0
  90. package/dist/types/ConfigField.d.ts +32 -0
  91. package/dist/types/ConnectionIndicator.d.ts +25 -0
  92. package/dist/types/DiffBlock.d.ts +51 -0
  93. package/dist/types/DisclosureRow.d.ts +35 -0
  94. package/dist/types/FileTypeIcon.d.ts +42 -0
  95. package/dist/types/FoldToggle.d.ts +19 -0
  96. package/dist/types/HoverCard.d.ts +36 -0
  97. package/dist/types/ImageLightbox.d.ts +26 -0
  98. package/dist/types/ImagePreview.d.ts +11 -0
  99. package/dist/types/Input.d.ts +11 -0
  100. package/dist/types/JsonTree.d.ts +58 -0
  101. package/dist/types/LinkIcon.d.ts +33 -0
  102. package/dist/types/Menu.d.ts +142 -0
  103. package/dist/types/MenuGroup.d.ts +21 -0
  104. package/dist/types/MenuSurface.d.ts +15 -0
  105. package/dist/types/Modal.d.ts +43 -0
  106. package/dist/types/PermissionIcon.d.ts +38 -0
  107. package/dist/types/Pill.d.ts +12 -0
  108. package/dist/types/ReadBlock.d.ts +47 -0
  109. package/dist/types/ReferenceIcon.d.ts +20 -0
  110. package/dist/types/RiskConfirmation.d.ts +19 -0
  111. package/dist/types/SearchBlock.d.ts +71 -0
  112. package/dist/types/SegmentedControl.d.ts +34 -0
  113. package/dist/types/SegmentedTabs.d.ts +25 -0
  114. package/dist/types/ShortcutKeys.d.ts +10 -0
  115. package/dist/types/SiteGlyph.d.ts +24 -0
  116. package/dist/types/StateDot.d.ts +19 -0
  117. package/dist/types/Switch.d.ts +19 -0
  118. package/dist/types/Tag.d.ts +31 -0
  119. package/dist/types/TerminalBlock.d.ts +77 -0
  120. package/dist/types/TextShimmer.d.ts +22 -0
  121. package/dist/types/Toast.d.ts +48 -0
  122. package/dist/types/Tooltip.d.ts +63 -0
  123. package/dist/types/WebBlock.d.ts +60 -0
  124. package/dist/types/ansi.d.ts +16 -0
  125. package/dist/types/blocks.d.ts +19 -0
  126. package/dist/types/clipboard.d.ts +8 -0
  127. package/dist/types/code-file-icon-artwork.d.ts +53 -0
  128. package/dist/types/code-file-types.d.ts +29 -0
  129. package/dist/types/code-highlighting.d.ts +11 -0
  130. package/dist/types/css-modules.d.ts +6 -0
  131. package/dist/types/darwin-desktop.d.ts +8 -0
  132. package/dist/types/file-size.d.ts +7 -0
  133. package/dist/types/focus.d.ts +8 -0
  134. package/dist/types/guide-artwork.d.ts +14 -0
  135. package/dist/types/head-tail-cap.d.ts +22 -0
  136. package/dist/types/icons/index.d.ts +384 -0
  137. package/dist/types/icons/props.d.ts +8 -0
  138. package/dist/types/icons/shared-artwork.d.ts +42 -0
  139. package/dist/types/icons.d.ts +6 -0
  140. package/dist/types/index.d.ts +53 -0
  141. package/dist/types/input-modality.d.ts +18 -0
  142. package/dist/types/keyboard-composition.d.ts +10 -0
  143. package/dist/types/markdown/CodeBlock.d.ts +34 -0
  144. package/dist/types/markdown/JsonBlock.d.ts +7 -0
  145. package/dist/types/markdown/MarkdownDelegate.d.ts +45 -0
  146. package/dist/types/markdown/MarkdownText.d.ts +47 -0
  147. package/dist/types/markdown/cjkFriendlyStrong.d.ts +8 -0
  148. package/dist/types/markdown/file-link.d.ts +12 -0
  149. package/dist/types/markdown/highlight.d.ts +147 -0
  150. package/dist/types/markdown/incremental.d.ts +79 -0
  151. package/dist/types/markdown/katex.d.ts +18 -0
  152. package/dist/types/markdown/local-image-syntax.d.ts +9 -0
  153. package/dist/types/markdown/mathCompatibility.d.ts +10 -0
  154. package/dist/types/markdown/parse.d.ts +24 -0
  155. package/dist/types/markdown/plain-text.d.ts +21 -0
  156. package/dist/types/markdown/render.d.ts +140 -0
  157. package/dist/types/markdown/useViewportHighlighting.d.ts +10 -0
  158. package/dist/types/markdown.d.ts +9 -0
  159. package/dist/types/overlay-top-margin.d.ts +7 -0
  160. package/dist/types/plugin-artwork.d.ts +16 -0
  161. package/dist/types/pointer-grace.d.ts +21 -0
  162. package/dist/types/rank-by-name.d.ts +21 -0
  163. package/dist/types/relative-time.d.ts +22 -0
  164. package/dist/types/seekbuddy/Card.d.ts +28 -0
  165. package/dist/types/seekbuddy/DangerButton.d.ts +31 -0
  166. package/dist/types/seekbuddy/Empty.d.ts +34 -0
  167. package/dist/types/seekbuddy/Mark.d.ts +27 -0
  168. package/dist/types/seekbuddy/Message.d.ts +52 -0
  169. package/dist/types/seekbuddy/Pagination.d.ts +66 -0
  170. package/dist/types/seekbuddy/Spinner.d.ts +20 -0
  171. package/dist/types/seekbuddy/StatusBadge.d.ts +33 -0
  172. package/dist/types/seekbuddy/SubtleButton.d.ts +30 -0
  173. package/dist/types/seekbuddy/Switch.d.ts +36 -0
  174. package/dist/types/seekbuddy/Tabs.d.ts +49 -0
  175. package/dist/types/seekbuddy/Timeline.d.ts +42 -0
  176. package/dist/types/seekbuddy/Upload.d.ts +101 -0
  177. package/dist/types/seekbuddy/date/Calendar.d.ts +94 -0
  178. package/dist/types/seekbuddy/date/DatePicker.d.ts +29 -0
  179. package/dist/types/seekbuddy/date/DateRangePicker.d.ts +41 -0
  180. package/dist/types/seekbuddy/date/TimePicker.d.ts +35 -0
  181. package/dist/types/seekbuddy/date/date.d.ts +79 -0
  182. package/dist/types/seekbuddy/date/fields.d.ts +45 -0
  183. package/dist/types/seekbuddy/index.d.ts +49 -0
  184. package/dist/types/seekbuddy/qr/QrCode.d.ts +37 -0
  185. package/dist/types/seekbuddy/qr/qr.d.ts +38 -0
  186. package/dist/types/theme-bootstrap.d.ts +3 -0
  187. package/dist/types/theme-core.d.ts +14 -0
  188. package/dist/types/theme.d.ts +4 -0
  189. package/dist/types/use-copy-feedback.d.ts +13 -0
  190. package/dist/types/useAnchoredMaxHeight.d.ts +13 -0
  191. package/dist/types/useAnchoredPosition.d.ts +35 -0
  192. package/dist/types/useDismissOnOutsidePointer.d.ts +10 -0
  193. package/dist/types/useModalLayer.d.ts +26 -0
  194. package/dist/types/user-text.d.ts +36 -0
  195. package/package.json +151 -4
@@ -0,0 +1,408 @@
1
+ import {
2
+ __publicField
3
+ } from "./chunk-ZA47FP7C.js";
4
+
5
+ // src/seekbuddy/qr/QrCode.tsx
6
+ import { useMemo } from "react";
7
+ import clsx from "clsx";
8
+
9
+ // src/seekbuddy/qr/qr.ts
10
+ var MAX_VERSION = 20;
11
+ var EC_LEVEL_BITS = 0;
12
+ var EC_BLOCKS = [
13
+ [0, 0, 0, 0, 0],
14
+ [10, 1, 16, 0, 0],
15
+ [16, 1, 28, 0, 0],
16
+ [26, 1, 44, 0, 0],
17
+ [18, 2, 32, 0, 0],
18
+ [24, 2, 43, 0, 0],
19
+ [16, 4, 27, 0, 0],
20
+ [18, 4, 31, 0, 0],
21
+ [22, 2, 38, 2, 39],
22
+ [22, 3, 36, 2, 37],
23
+ [26, 4, 43, 1, 44],
24
+ [30, 1, 50, 4, 51],
25
+ [22, 6, 36, 2, 37],
26
+ [22, 8, 37, 1, 38],
27
+ [24, 4, 40, 5, 41],
28
+ [24, 5, 41, 5, 42],
29
+ [28, 7, 45, 3, 46],
30
+ [28, 10, 46, 1, 47],
31
+ [26, 9, 43, 4, 44],
32
+ [26, 3, 44, 11, 45],
33
+ [26, 3, 41, 13, 42]
34
+ ];
35
+ var ALIGNMENT = [
36
+ [],
37
+ [],
38
+ [6, 18],
39
+ [6, 22],
40
+ [6, 26],
41
+ [6, 30],
42
+ [6, 34],
43
+ [6, 22, 38],
44
+ [6, 24, 42],
45
+ [6, 26, 46],
46
+ [6, 28, 50],
47
+ [6, 30, 54],
48
+ [6, 32, 58],
49
+ [6, 34, 62],
50
+ [6, 26, 46, 66],
51
+ [6, 26, 48, 70],
52
+ [6, 26, 50, 74],
53
+ [6, 30, 54, 78],
54
+ [6, 30, 56, 82],
55
+ [6, 30, 58, 86],
56
+ [6, 34, 62, 90]
57
+ ];
58
+ var EXP = new Uint8Array(512);
59
+ var LOG = new Uint8Array(256);
60
+ {
61
+ let value = 1;
62
+ for (let index = 0; index < 255; index += 1) {
63
+ EXP[index] = value;
64
+ LOG[value] = index;
65
+ value <<= 1;
66
+ if (value & 256) value ^= 285;
67
+ }
68
+ for (let index = 255; index < 512; index += 1) EXP[index] = EXP[index - 255];
69
+ }
70
+ function gfMul(a, b) {
71
+ return a === 0 || b === 0 ? 0 : EXP[LOG[a] + LOG[b]];
72
+ }
73
+ function generator(degree) {
74
+ let poly = new Uint8Array([1]);
75
+ for (let index = 0; index < degree; index += 1) {
76
+ const next = new Uint8Array(poly.length + 1);
77
+ for (let position = 0; position < poly.length; position += 1) {
78
+ next[position] = next[position] ^ poly[position];
79
+ next[position + 1] = next[position + 1] ^ gfMul(poly[position], EXP[index]);
80
+ }
81
+ poly = next;
82
+ }
83
+ return poly;
84
+ }
85
+ function remainder(data, ecCount) {
86
+ const gen = generator(ecCount);
87
+ const buffer = new Uint8Array(data.length + ecCount);
88
+ buffer.set(data);
89
+ for (let index = 0; index < data.length; index += 1) {
90
+ const factor = buffer[index];
91
+ if (factor === 0) continue;
92
+ for (let position = 1; position < gen.length; position += 1) {
93
+ buffer[index + position] = buffer[index + position] ^ gfMul(gen[position], factor);
94
+ }
95
+ }
96
+ return buffer.slice(data.length);
97
+ }
98
+ var Bits = class {
99
+ constructor() {
100
+ __publicField(this, "values", []);
101
+ }
102
+ /**
103
+ * 追加 `length` 位。
104
+ *
105
+ * @param value - 数值
106
+ * @param length - 位数
107
+ */
108
+ push(value, length) {
109
+ for (let index = length - 1; index >= 0; index -= 1) this.values.push(value >>> index & 1);
110
+ }
111
+ };
112
+ function capacityOf(version) {
113
+ const [ecCount, blocks1, data1, blocks2, data2] = EC_BLOCKS[version];
114
+ const dataCodewords = blocks1 * data1 + blocks2 * data2;
115
+ void ecCount;
116
+ const countBits = version < 10 ? 8 : 16;
117
+ return Math.floor((dataCodewords * 8 - 4 - countBits) / 8);
118
+ }
119
+ function codewordsOf(bytes, version) {
120
+ const [ecCount, blocks1, data1, blocks2, data2] = EC_BLOCKS[version];
121
+ const dataTotal = blocks1 * data1 + blocks2 * data2;
122
+ const bits = new Bits();
123
+ bits.push(4, 4);
124
+ bits.push(bytes.length, version < 10 ? 8 : 16);
125
+ for (const byte of bytes) bits.push(byte, 8);
126
+ const terminator = Math.min(4, dataTotal * 8 - bits.values.length);
127
+ bits.push(0, terminator);
128
+ while (bits.values.length % 8 !== 0) bits.values.push(0);
129
+ const data = new Uint8Array(dataTotal);
130
+ for (let index = 0; index < bits.values.length / 8; index += 1) {
131
+ let byte = 0;
132
+ for (let offset = 0; offset < 8; offset += 1) byte = byte << 1 | bits.values[index * 8 + offset];
133
+ data[index] = byte;
134
+ }
135
+ for (let index = bits.values.length / 8; index < dataTotal; index += 1) {
136
+ data[index] = (index - bits.values.length / 8) % 2 === 0 ? 236 : 17;
137
+ }
138
+ const dataBlocks = [];
139
+ const ecBlocks = [];
140
+ let cursor = 0;
141
+ for (const [count, size] of [
142
+ [blocks1, data1],
143
+ [blocks2, data2]
144
+ ]) {
145
+ for (let index = 0; index < count; index += 1) {
146
+ const block = data.slice(cursor, cursor + size);
147
+ cursor += size;
148
+ dataBlocks.push(block);
149
+ ecBlocks.push(remainder(block, ecCount));
150
+ }
151
+ }
152
+ const out = [];
153
+ const maxData = Math.max(data1, data2);
154
+ for (let index = 0; index < maxData; index += 1) {
155
+ for (const block of dataBlocks) if (index < block.length) out.push(block[index]);
156
+ }
157
+ for (let index = 0; index < ecCount; index += 1) {
158
+ for (const block of ecBlocks) out.push(block[index]);
159
+ }
160
+ return new Uint8Array(out);
161
+ }
162
+ function put(grid, x, y, dark) {
163
+ grid.modules[y * grid.size + x] = dark ? 1 : 0;
164
+ grid.reserved[y * grid.size + x] = 1;
165
+ }
166
+ function functionPatterns(version) {
167
+ const size = version * 4 + 17;
168
+ const grid = { size, modules: new Uint8Array(size * size), reserved: new Uint8Array(size * size) };
169
+ for (const [ox, oy] of [
170
+ [0, 0],
171
+ [size - 7, 0],
172
+ [0, size - 7]
173
+ ]) {
174
+ for (let y = -1; y <= 7; y += 1) {
175
+ for (let x = -1; x <= 7; x += 1) {
176
+ const px = ox + x;
177
+ const py = oy + y;
178
+ if (px < 0 || py < 0 || px >= size || py >= size) continue;
179
+ const ring = Math.max(Math.abs(x - 3), Math.abs(y - 3));
180
+ put(grid, px, py, x >= 0 && x <= 6 && y >= 0 && y <= 6 && ring !== 2);
181
+ }
182
+ }
183
+ }
184
+ const centers = ALIGNMENT[version];
185
+ for (const cy of centers) {
186
+ for (const cx of centers) {
187
+ if (cx === 6 && cy === 6 || cx === 6 && cy === size - 7 || cx === size - 7 && cy === 6) continue;
188
+ for (let y = -2; y <= 2; y += 1) {
189
+ for (let x = -2; x <= 2; x += 1) {
190
+ put(grid, cx + x, cy + y, Math.max(Math.abs(x), Math.abs(y)) !== 1);
191
+ }
192
+ }
193
+ }
194
+ }
195
+ for (let index = 8; index < size - 8; index += 1) {
196
+ put(grid, index, 6, index % 2 === 0);
197
+ put(grid, 6, index, index % 2 === 0);
198
+ }
199
+ put(grid, 8, size - 8, true);
200
+ for (let index = 0; index < 9; index += 1) {
201
+ if (index !== 6) put(grid, index, 8, false);
202
+ if (index !== 6) put(grid, 8, index, false);
203
+ }
204
+ for (let index = 0; index < 8; index += 1) {
205
+ put(grid, size - 1 - index, 8, false);
206
+ if (index < 7) put(grid, 8, size - 1 - index, false);
207
+ }
208
+ if (version >= 7) {
209
+ for (let index = 0; index < 18; index += 1) {
210
+ const a = Math.floor(index / 3);
211
+ const b = index % 3 + size - 11;
212
+ put(grid, a, b, false);
213
+ put(grid, b, a, false);
214
+ }
215
+ }
216
+ return grid;
217
+ }
218
+ function placeData(grid, codewords) {
219
+ const { size } = grid;
220
+ let bit = 0;
221
+ let upward = true;
222
+ for (let right = size - 1; right >= 1; right -= 2) {
223
+ const column = right <= 6 ? right - 1 : right;
224
+ for (let step = 0; step < size; step += 1) {
225
+ const y = upward ? size - 1 - step : step;
226
+ for (const x of [column, column - 1]) {
227
+ if (grid.reserved[y * size + x] === 1) continue;
228
+ const byte = codewords[bit >>> 3];
229
+ const dark = byte !== void 0 && (byte >>> 7 - (bit & 7) & 1) === 1;
230
+ grid.modules[y * size + x] = dark ? 1 : 0;
231
+ bit += 1;
232
+ }
233
+ }
234
+ upward = !upward;
235
+ }
236
+ }
237
+ var MASKS = [
238
+ (x, y) => (x + y) % 2 === 0,
239
+ (_x, y) => y % 2 === 0,
240
+ (x) => x % 3 === 0,
241
+ (x, y) => (x + y) % 3 === 0,
242
+ (x, y) => (Math.floor(y / 2) + Math.floor(x / 3)) % 2 === 0,
243
+ (x, y) => x * y % 2 + x * y % 3 === 0,
244
+ (x, y) => (x * y % 2 + x * y % 3) % 2 === 0,
245
+ (x, y) => ((x + y) % 2 + x * y % 3) % 2 === 0
246
+ ];
247
+ function penalty(modules, size) {
248
+ let score = 0;
249
+ const at = (x, y) => modules[y * size + x];
250
+ for (let line = 0; line < size; line += 1) {
251
+ for (const horizontal of [true, false]) {
252
+ let run = 1;
253
+ for (let index = 1; index < size; index += 1) {
254
+ const current = horizontal ? at(index, line) : at(line, index);
255
+ const previous = horizontal ? at(index - 1, line) : at(line, index - 1);
256
+ if (current === previous) {
257
+ run += 1;
258
+ if (run === 5) score += 3;
259
+ else if (run > 5) score += 1;
260
+ } else run = 1;
261
+ }
262
+ }
263
+ }
264
+ for (let y = 0; y < size - 1; y += 1) {
265
+ for (let x = 0; x < size - 1; x += 1) {
266
+ const value = at(x, y);
267
+ if (value === at(x + 1, y) && value === at(x, y + 1) && value === at(x + 1, y + 1)) score += 3;
268
+ }
269
+ }
270
+ const FINDER_AHEAD = 1488;
271
+ const FINDER_BEHIND = 93;
272
+ for (let line = 0; line < size; line += 1) {
273
+ let row = 0;
274
+ let column = 0;
275
+ for (let index = 0; index < size; index += 1) {
276
+ row = row << 1 & 2047 | at(index, line);
277
+ column = column << 1 & 2047 | at(line, index);
278
+ if (index < 10) continue;
279
+ if (row === FINDER_AHEAD || row === FINDER_BEHIND) score += 40;
280
+ if (column === FINDER_AHEAD || column === FINDER_BEHIND) score += 40;
281
+ }
282
+ }
283
+ const dark = modules.reduce((total, value) => total + value, 0);
284
+ const ratio = dark * 100 / (size * size);
285
+ score += Math.abs(Math.ceil(ratio / 5) - 10) * 10;
286
+ return score;
287
+ }
288
+ function writeFormat(grid, mask) {
289
+ const { size } = grid;
290
+ const data = EC_LEVEL_BITS << 3 | mask;
291
+ let rest = data << 10;
292
+ for (let index = 4; index >= 0; index -= 1) {
293
+ if (rest & 1 << index + 10) rest ^= 1335 << index;
294
+ }
295
+ const bits = (data << 10 | rest) ^ 21522;
296
+ const set = (x, y, dark) => void (grid.modules[y * size + x] = dark ? 1 : 0);
297
+ for (let index = 0; index < 15; index += 1) {
298
+ const dark = (bits >>> index & 1) === 1;
299
+ if (index < 6) set(8, index, dark);
300
+ else if (index === 6) set(8, 7, dark);
301
+ else if (index === 7) set(8, 8, dark);
302
+ else if (index === 8) set(7, 8, dark);
303
+ else set(14 - index, 8, dark);
304
+ if (index < 8) set(size - 1 - index, 8, dark);
305
+ else set(8, size - 15 + index, dark);
306
+ }
307
+ }
308
+ function writeVersion(grid, version) {
309
+ if (version < 7) return;
310
+ const { size } = grid;
311
+ let rest = version << 12;
312
+ for (let index = 5; index >= 0; index -= 1) {
313
+ if (rest & 1 << index + 12) rest ^= 7973 << index;
314
+ }
315
+ const bits = version << 12 | rest;
316
+ for (let index = 0; index < 18; index += 1) {
317
+ const dark = (bits >>> index & 1) === 1 ? 1 : 0;
318
+ const a = Math.floor(index / 3);
319
+ const b = index % 3 + size - 11;
320
+ grid.modules[b * size + a] = dark;
321
+ grid.modules[a * size + b] = dark;
322
+ }
323
+ }
324
+ function encodeQr(text) {
325
+ if (text === "") return null;
326
+ const bytes = new TextEncoder().encode(text);
327
+ let version = 0;
328
+ for (let candidate = 1; candidate <= MAX_VERSION; candidate += 1) {
329
+ if (capacityOf(candidate) >= bytes.length) {
330
+ version = candidate;
331
+ break;
332
+ }
333
+ }
334
+ if (version === 0) return null;
335
+ const codewords = codewordsOf(bytes, version);
336
+ const base = functionPatterns(version);
337
+ placeData(base, codewords);
338
+ let best = null;
339
+ for (let mask = 0; mask < MASKS.length; mask += 1) {
340
+ const modules = Uint8Array.from(base.modules);
341
+ const condition = MASKS[mask];
342
+ for (let y = 0; y < base.size; y += 1) {
343
+ for (let x = 0; x < base.size; x += 1) {
344
+ if (base.reserved[y * base.size + x] === 1) continue;
345
+ if (condition(x, y)) modules[y * base.size + x] = modules[y * base.size + x] ^ 1;
346
+ }
347
+ }
348
+ const candidate = { size: base.size, modules, reserved: base.reserved };
349
+ writeFormat(candidate, mask);
350
+ writeVersion(candidate, version);
351
+ if (best === null || penalty(modules, base.size) < penalty(best.modules, base.size)) {
352
+ best = { mask, modules };
353
+ }
354
+ }
355
+ return {
356
+ size: base.size,
357
+ version,
358
+ modules: Array.from(best.modules, (value) => value === 1)
359
+ };
360
+ }
361
+
362
+ // .build/css/seekbuddy/qr/QrCode.module.mjs
363
+ var id = "@seekbuddy/dsh-ui/seekbuddy/qr/QrCode.module.css";
364
+ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
365
+ const element = document.createElement("style");
366
+ element.setAttribute("data-dsh-ui-primitives", id);
367
+ element.textContent = ".kJqaaq_qr{border-radius:var(--dsw-radius-sm);display:block}";
368
+ document.head.appendChild(element);
369
+ }
370
+ var QrCode_module_default = { "qr": "kJqaaq_qr" };
371
+
372
+ // src/seekbuddy/qr/QrCode.tsx
373
+ import { jsx, jsxs } from "react/jsx-runtime";
374
+ var QUIET = 4;
375
+ function QrCode({ text, label, fallback, size = 180, className }) {
376
+ const drawing = useMemo(() => {
377
+ const matrix = encodeQr(text);
378
+ if (matrix === null) return null;
379
+ let path = "";
380
+ for (let y = 0; y < matrix.size; y += 1) {
381
+ for (let x = 0; x < matrix.size; x += 1) {
382
+ if (matrix.modules[y * matrix.size + x]) path += `M${String(x + QUIET)} ${String(y + QUIET)}h1v1h-1z`;
383
+ }
384
+ }
385
+ return { path, extent: matrix.size + QUIET * 2 };
386
+ }, [text]);
387
+ if (drawing === null) return fallback ?? null;
388
+ return /* @__PURE__ */ jsxs(
389
+ "svg",
390
+ {
391
+ className: clsx(QrCode_module_default.qr, className),
392
+ width: size,
393
+ height: size,
394
+ viewBox: `0 0 ${String(drawing.extent)} ${String(drawing.extent)}`,
395
+ role: "img",
396
+ "aria-label": label,
397
+ shapeRendering: "crispEdges",
398
+ children: [
399
+ /* @__PURE__ */ jsx("rect", { width: drawing.extent, height: drawing.extent, fill: "#fff" }),
400
+ /* @__PURE__ */ jsx("path", { d: drawing.path, fill: "#000" })
401
+ ]
402
+ }
403
+ );
404
+ }
405
+
406
+ export {
407
+ QrCode
408
+ };
@@ -0,0 +1,24 @@
1
+ // src/seekbuddy/DangerButton.tsx
2
+ import clsx from "clsx";
3
+ import { forwardRef } from "react";
4
+ import { Button } from "@seekbuddy/dsh-ui";
5
+
6
+ // .build/css/seekbuddy/DangerButton.module.mjs
7
+ var id = "@seekbuddy/dsh-ui/seekbuddy/DangerButton.module.css";
8
+ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
9
+ const element = document.createElement("style");
10
+ element.setAttribute("data-dsh-ui-primitives", id);
11
+ element.textContent = ".t5_aDG_danger{color:var(--dsw-alias-state-error-primary);border-color:var(--dsw-alias-state-error-primary)}.t5_aDG_danger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger)}.t5_aDG_danger:active:not(:disabled){background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 18%, transparent)}.t5_aDG_danger:focus-visible{outline-offset:2px;outline-style:solid}";
12
+ document.head.appendChild(element);
13
+ }
14
+ var DangerButton_module_default = { "danger": "t5_aDG_danger" };
15
+
16
+ // src/seekbuddy/DangerButton.tsx
17
+ import { jsx } from "react/jsx-runtime";
18
+ var DangerButton = forwardRef(function DangerButton2({ className, ...rest }, ref) {
19
+ return /* @__PURE__ */ jsx(Button, { ...rest, ref, variant: "outline", className: clsx(DangerButton_module_default.danger, className) });
20
+ });
21
+
22
+ export {
23
+ DangerButton
24
+ };
@@ -0,0 +1,202 @@
1
+ import {
2
+ DatePicker
3
+ } from "./chunk-NE62SYOZ.js";
4
+ import {
5
+ DateRangePicker
6
+ } from "./chunk-QJKAQ6PO.js";
7
+ import {
8
+ TimePicker
9
+ } from "./chunk-IOBKTEKP.js";
10
+
11
+ // src/seekbuddy/date/fields.tsx
12
+ import clsx from "clsx";
13
+ import { useAnchoredPosition, useDismissOnOutsidePointer } from "@seekbuddy/dsh-ui";
14
+ import { IconClockOutlineRegular } from "@seekbuddy/dsh-ui/icons";
15
+ import { useCallback, useId, useRef, useState } from "react";
16
+ import { createPortal } from "react-dom";
17
+
18
+ // .build/css/seekbuddy/date/fields.module.mjs
19
+ var id = "@seekbuddy/dsh-ui/seekbuddy/date/fields.module.css";
20
+ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
21
+ const element = document.createElement("style");
22
+ element.setAttribute("data-dsh-ui-primitives", id);
23
+ element.textContent = ".FzjDnq_field{display:inline-flex;position:relative}.FzjDnq_trigger{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);min-width:160px;height:32px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);cursor:pointer;text-align:left;align-items:center;gap:6px;padding:0 8px;font-size:14px;line-height:22px;display:inline-flex}.FzjDnq_trigger:hover:not(:disabled){border-color:var(--dsw-alias-border-l3)}.FzjDnq_trigger:focus-visible,.FzjDnq_open{border-color:var(--dsw-alias-state-business-primary);outline:none}.FzjDnq_trigger:disabled{cursor:not-allowed;opacity:.4}.FzjDnq_value{font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.FzjDnq_placeholder{color:var(--dsw-alias-label-dimmed)}.FzjDnq_icon{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:inline-flex}.FzjDnq_srOnly{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.FzjDnq_panel{z-index:1100;box-sizing:border-box;border-radius:var(--dsw-radius-lg);background:var(--dsw-specific-menu);backdrop-filter:var(--dsw-menu-backdrop-filter);--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-elevation-prominent);padding:12px;position:fixed}";
24
+ document.head.appendChild(element);
25
+ }
26
+ var fields_module_default = { "icon": "FzjDnq_icon", "field": "FzjDnq_field", "value": "FzjDnq_value", "srOnly": "FzjDnq_srOnly", "placeholder": "FzjDnq_placeholder", "trigger": "FzjDnq_trigger", "panel": "FzjDnq_panel", "open": "FzjDnq_open" };
27
+
28
+ // src/seekbuddy/date/fields.tsx
29
+ import { jsx, jsxs } from "react/jsx-runtime";
30
+ var MEASURE_STYLE = { visibility: "hidden", left: 0, top: 0 };
31
+ function FieldShell({ labels, display, placeholder, disabled = false, icon, className, children }) {
32
+ const id2 = useId();
33
+ const rootRef = useRef(null);
34
+ const triggerRef = useRef(null);
35
+ const panelRef = useRef(null);
36
+ const [open, setOpen] = useState(false);
37
+ const position = useAnchoredPosition({ open, anchorRef: triggerRef, panelRef, gap: 4, margin: 8 });
38
+ useDismissOnOutsidePointer(rootRef, open, setOpen, panelRef);
39
+ const close = useCallback(() => {
40
+ setOpen(false);
41
+ triggerRef.current?.focus();
42
+ }, []);
43
+ const onPanelKeyDown = (event) => {
44
+ if (event.key !== "Escape") return;
45
+ event.stopPropagation();
46
+ close();
47
+ };
48
+ const onPanelBlur = (event) => {
49
+ const next = event.relatedTarget;
50
+ if (next instanceof Node && (panelRef.current?.contains(next) === true || rootRef.current?.contains(next) === true))
51
+ return;
52
+ if (next === null) return;
53
+ setOpen(false);
54
+ };
55
+ const panel = open && /* @__PURE__ */ jsx(
56
+ "div",
57
+ {
58
+ ref: panelRef,
59
+ id: `${id2}-dialog`,
60
+ role: "dialog",
61
+ "aria-label": labels.open,
62
+ className: fields_module_default.panel,
63
+ style: position ?? MEASURE_STYLE,
64
+ onKeyDown: onPanelKeyDown,
65
+ onBlur: onPanelBlur,
66
+ children: children(close)
67
+ }
68
+ );
69
+ return /* @__PURE__ */ jsxs("span", { ref: rootRef, className: clsx(fields_module_default.field, className), children: [
70
+ /* @__PURE__ */ jsxs(
71
+ "button",
72
+ {
73
+ ref: triggerRef,
74
+ type: "button",
75
+ className: clsx(fields_module_default.trigger, open && fields_module_default.open),
76
+ disabled,
77
+ "aria-haspopup": "dialog",
78
+ "aria-expanded": open,
79
+ "aria-controls": open ? `${id2}-dialog` : void 0,
80
+ onClick: () => setOpen((current) => !current),
81
+ onKeyDown: (event) => {
82
+ if (event.key === "Escape" && open) close();
83
+ },
84
+ children: [
85
+ /* @__PURE__ */ jsx("span", { className: clsx(fields_module_default.value, display === null && fields_module_default.placeholder), children: display ?? placeholder ?? "" }),
86
+ /* @__PURE__ */ jsx("span", { className: fields_module_default.srOnly, children: labels.open }),
87
+ /* @__PURE__ */ jsx("span", { className: fields_module_default.icon, "aria-hidden": "true", children: icon })
88
+ ]
89
+ }
90
+ ),
91
+ panel !== false && createPortal(panel, document.body)
92
+ ] });
93
+ }
94
+ function CalendarGlyph() {
95
+ return /* @__PURE__ */ jsxs(
96
+ "svg",
97
+ {
98
+ viewBox: "0 0 16 16",
99
+ width: "16",
100
+ height: "16",
101
+ fill: "none",
102
+ stroke: "currentColor",
103
+ strokeWidth: "1.3",
104
+ strokeLinecap: "round",
105
+ children: [
106
+ /* @__PURE__ */ jsx("rect", { x: "2.5", y: "3.5", width: "11", height: "10", rx: "2" }),
107
+ /* @__PURE__ */ jsx("path", { d: "M2.5 6.5h11M5.5 2v3M10.5 2v3" })
108
+ ]
109
+ }
110
+ );
111
+ }
112
+ var slashes = (iso) => iso.replaceAll("-", "/");
113
+ function DateField({
114
+ formatValue,
115
+ placeholder,
116
+ disabled,
117
+ className,
118
+ labels,
119
+ onChange,
120
+ ...picker
121
+ }) {
122
+ const display = picker.value === null ? null : formatValue === void 0 ? slashes(picker.value) : formatValue(picker.value);
123
+ return /* @__PURE__ */ jsx(
124
+ FieldShell,
125
+ {
126
+ labels,
127
+ display,
128
+ placeholder,
129
+ disabled,
130
+ icon: /* @__PURE__ */ jsx(CalendarGlyph, {}),
131
+ className,
132
+ children: (close) => /* @__PURE__ */ jsx(
133
+ DatePicker,
134
+ {
135
+ ...picker,
136
+ labels,
137
+ autoFocus: true,
138
+ onChange: (date) => {
139
+ onChange(date);
140
+ close();
141
+ }
142
+ }
143
+ )
144
+ }
145
+ );
146
+ }
147
+ function DateRangeField({
148
+ formatValue,
149
+ placeholder,
150
+ disabled,
151
+ className,
152
+ labels,
153
+ onChange,
154
+ ...picker
155
+ }) {
156
+ const display = picker.value === null ? null : formatValue === void 0 ? `${slashes(picker.value.start)} - ${slashes(picker.value.end)}` : formatValue(picker.value);
157
+ return /* @__PURE__ */ jsx(
158
+ FieldShell,
159
+ {
160
+ labels,
161
+ display,
162
+ placeholder,
163
+ disabled,
164
+ icon: /* @__PURE__ */ jsx(CalendarGlyph, {}),
165
+ className,
166
+ children: (close) => /* @__PURE__ */ jsx(
167
+ DateRangePicker,
168
+ {
169
+ ...picker,
170
+ labels,
171
+ autoFocus: true,
172
+ onChange: (range) => {
173
+ onChange(range);
174
+ close();
175
+ },
176
+ onCancel: close
177
+ }
178
+ )
179
+ }
180
+ );
181
+ }
182
+ function TimeField({ formatValue, placeholder, disabled, className, labels, ...picker }) {
183
+ const display = picker.value === null ? null : formatValue === void 0 ? picker.value : formatValue(picker.value);
184
+ return /* @__PURE__ */ jsx(
185
+ FieldShell,
186
+ {
187
+ labels,
188
+ display,
189
+ placeholder,
190
+ disabled,
191
+ icon: /* @__PURE__ */ jsx(IconClockOutlineRegular, {}),
192
+ className,
193
+ children: () => /* @__PURE__ */ jsx(TimePicker, { ...picker, labels, autoFocus: true })
194
+ }
195
+ );
196
+ }
197
+
198
+ export {
199
+ DateField,
200
+ DateRangeField,
201
+ TimeField
202
+ };
@@ -0,0 +1,22 @@
1
+ // src/seekbuddy/Card.tsx
2
+ import clsx from "clsx";
3
+
4
+ // .build/css/seekbuddy/Card.module.mjs
5
+ var id = "@seekbuddy/dsh-ui/seekbuddy/Card.module.css";
6
+ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
7
+ const element = document.createElement("style");
8
+ element.setAttribute("data-dsh-ui-primitives", id);
9
+ element.textContent = ".wbxAxW_card{--card-pad:16px;box-sizing:border-box;padding:var(--card-pad);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);--dsw-elevation-stroke-color:var(--dsw-alias-border-l3);box-shadow:var(--dsw-elevation-panel);border:0;margin:0;list-style:none}.wbxAxW_none{--card-pad:0}.wbxAxW_sm{--card-pad:14px}.wbxAxW_md{--card-pad:16px}.wbxAxW_interactive{cursor:pointer}.wbxAxW_interactive:hover{background-image:linear-gradient(var(--dsw-alias-interactive-bg-hover), var(--dsw-alias-interactive-bg-hover))}.wbxAxW_card:focus-visible{outline-offset:2px;outline-style:solid}";
10
+ document.head.appendChild(element);
11
+ }
12
+ var Card_module_default = { "none": "wbxAxW_none", "sm": "wbxAxW_sm", "md": "wbxAxW_md", "card": "wbxAxW_card", "interactive": "wbxAxW_interactive" };
13
+
14
+ // src/seekbuddy/Card.tsx
15
+ import { jsx } from "react/jsx-runtime";
16
+ function Card({ padding = "md", interactive = false, as: Element = "div", className, ...rest }) {
17
+ return /* @__PURE__ */ jsx(Element, { ...rest, className: clsx(Card_module_default.card, Card_module_default[padding], interactive && Card_module_default.interactive, className) });
18
+ }
19
+
20
+ export {
21
+ Card
22
+ };