fluent-svelte-extra 1.0.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 (145) hide show
  1. package/.prettierignore +1 -0
  2. package/.prettierrc +7 -0
  3. package/CHANGELOG.md +7 -0
  4. package/LICENSE +21 -0
  5. package/README.md +33 -0
  6. package/package.json +83 -0
  7. package/src/app.html +12 -0
  8. package/src/global.d.ts +1 -0
  9. package/src/lib/AutoSuggestBox/AutoSuggestBox.scss +44 -0
  10. package/src/lib/AutoSuggestBox/AutoSuggestBox.svelte +173 -0
  11. package/src/lib/Button/Button.scss +94 -0
  12. package/src/lib/Button/Button.svelte +48 -0
  13. package/src/lib/CalendarDatePicker/CalendarDatePicker.scss +15 -0
  14. package/src/lib/CalendarDatePicker/CalendarDatePicker.svelte +86 -0
  15. package/src/lib/CalendarView/CalendarView.scss +156 -0
  16. package/src/lib/CalendarView/CalendarView.svelte +753 -0
  17. package/src/lib/CalendarView/CalendarViewItem.scss +130 -0
  18. package/src/lib/CalendarView/CalendarViewItem.svelte +33 -0
  19. package/src/lib/Checkbox/Checkbox.scss +117 -0
  20. package/src/lib/Checkbox/Checkbox.svelte +81 -0
  21. package/src/lib/ComboBox/ComboBox.scss +152 -0
  22. package/src/lib/ComboBox/ComboBox.svelte +360 -0
  23. package/src/lib/ComboBox/ComboBoxItem.scss +80 -0
  24. package/src/lib/ComboBox/ComboBoxItem.svelte +30 -0
  25. package/src/lib/ContentDialog/ContentDialog.scss +68 -0
  26. package/src/lib/ContentDialog/ContentDialog.svelte +123 -0
  27. package/src/lib/ContextMenu/ContextMenu.scss +11 -0
  28. package/src/lib/ContextMenu/ContextMenu.svelte +104 -0
  29. package/src/lib/Expander/Expander.scss +134 -0
  30. package/src/lib/Expander/Expander.svelte +123 -0
  31. package/src/lib/Flipper/Flipper.svelte +49 -0
  32. package/src/lib/Flyout/FlyoutSurface.scss +14 -0
  33. package/src/lib/Flyout/FlyoutSurface.svelte +21 -0
  34. package/src/lib/Flyout/FlyoutWrapper.scss +81 -0
  35. package/src/lib/Flyout/FlyoutWrapper.svelte +126 -0
  36. package/src/lib/IconButton/IconButton.scss +31 -0
  37. package/src/lib/IconButton/IconButton.svelte +49 -0
  38. package/src/lib/InfoBadge/InfoBadge.scss +39 -0
  39. package/src/lib/InfoBadge/InfoBadge.svelte +81 -0
  40. package/src/lib/InfoBar/InfoBar.scss +122 -0
  41. package/src/lib/InfoBar/InfoBar.svelte +133 -0
  42. package/src/lib/ListItem/ListItem.scss +74 -0
  43. package/src/lib/ListItem/ListItem.svelte +88 -0
  44. package/src/lib/MenuBar/MenuBar.scss +10 -0
  45. package/src/lib/MenuBar/MenuBar.svelte +49 -0
  46. package/src/lib/MenuBar/MenuBarItem.scss +38 -0
  47. package/src/lib/MenuBar/MenuBarItem.svelte +135 -0
  48. package/src/lib/MenuBar/flyoutState.ts +5 -0
  49. package/src/lib/MenuFlyout/MenuFlyoutDivider.scss +7 -0
  50. package/src/lib/MenuFlyout/MenuFlyoutDivider.svelte +14 -0
  51. package/src/lib/MenuFlyout/MenuFlyoutItem.scss +147 -0
  52. package/src/lib/MenuFlyout/MenuFlyoutItem.svelte +239 -0
  53. package/src/lib/MenuFlyout/MenuFlyoutSurface.scss +42 -0
  54. package/src/lib/MenuFlyout/MenuFlyoutSurface.svelte +28 -0
  55. package/src/lib/MenuFlyout/MenuFlyoutWrapper.scss +64 -0
  56. package/src/lib/MenuFlyout/MenuFlyoutWrapper.svelte +114 -0
  57. package/src/lib/NavigationView/NavigationView.scss +0 -0
  58. package/src/lib/NavigationView/NavigationView.svelte +82 -0
  59. package/src/lib/NumberBox/NumberBox.scss +31 -0
  60. package/src/lib/NumberBox/NumberBox.svelte +267 -0
  61. package/src/lib/PersonPicture/PersonPicture.scss +35 -0
  62. package/src/lib/PersonPicture/PersonPicture.svelte +62 -0
  63. package/src/lib/ProgressBar/ProgressBar.scss +83 -0
  64. package/src/lib/ProgressBar/ProgressBar.svelte +60 -0
  65. package/src/lib/ProgressRing/ProgressRing.scss +37 -0
  66. package/src/lib/ProgressRing/ProgressRing.svelte +73 -0
  67. package/src/lib/RadioButton/RadioButton.scss +114 -0
  68. package/src/lib/RadioButton/RadioButton.svelte +67 -0
  69. package/src/lib/RangeSlider/RangeSlider.svelte +91 -0
  70. package/src/lib/ScrollView/ScrollView.svelte +9 -0
  71. package/src/lib/Slider/Slider.scss +263 -0
  72. package/src/lib/Slider/Slider.svelte +261 -0
  73. package/src/lib/TextBlock/TextBlock.scss +62 -0
  74. package/src/lib/TextBlock/TextBlock.svelte +70 -0
  75. package/src/lib/TextBox/TextBox.scss +108 -0
  76. package/src/lib/TextBox/TextBox.svelte +225 -0
  77. package/src/lib/TextBox/TextBoxButton.scss +34 -0
  78. package/src/lib/TextBox/TextBoxButton.svelte +27 -0
  79. package/src/lib/ToggleSwitch/ToggleSwitch.scss +118 -0
  80. package/src/lib/ToggleSwitch/ToggleSwitch.svelte +55 -0
  81. package/src/lib/Tooltip/TooltipSurface.scss +16 -0
  82. package/src/lib/Tooltip/TooltipSurface.svelte +27 -0
  83. package/src/lib/Tooltip/TooltipWrapper.scss +66 -0
  84. package/src/lib/Tooltip/TooltipWrapper.svelte +117 -0
  85. package/src/lib/_mixins.scss +130 -0
  86. package/src/lib/index.ts +33 -0
  87. package/src/lib/internal.ts +213 -0
  88. package/src/lib/svelte-jsx.d.ts +14 -0
  89. package/src/lib/theme.css +414 -0
  90. package/src/routes/__layout.svelte +48 -0
  91. package/src/routes/docs/__layout.svelte +122 -0
  92. package/src/routes/docs/components/button.md +43 -0
  93. package/src/routes/docs/components/calendarview.md +188 -0
  94. package/src/routes/docs/components/checkbox.md +87 -0
  95. package/src/routes/docs/components/contentdialog.md +155 -0
  96. package/src/routes/docs/components/expander.md +115 -0
  97. package/src/routes/docs/components/flyout.md +107 -0
  98. package/src/routes/docs/components/iconbutton.md +39 -0
  99. package/src/routes/docs/components/infobadge.md +54 -0
  100. package/src/routes/docs/components/infobar.md +102 -0
  101. package/src/routes/docs/components/listitem.md +87 -0
  102. package/src/routes/docs/components/personpicture.md +125 -0
  103. package/src/routes/docs/components/progressring.md +83 -0
  104. package/src/routes/docs/components/radiobutton.md +88 -0
  105. package/src/routes/docs/components/slider.md +165 -0
  106. package/src/routes/docs/components/textblock.md +46 -0
  107. package/src/routes/docs/components/textbox.md +124 -0
  108. package/src/routes/docs/components/toggleswitch.md +73 -0
  109. package/src/routes/docs/getting-started.md +116 -0
  110. package/src/routes/docs/index.md +37 -0
  111. package/src/routes/docs/internals/index.md +0 -0
  112. package/src/routes/index.svelte +121 -0
  113. package/src/routes/test/__layout-test.svelte +1 -0
  114. package/src/routes/test/index.svelte +757 -0
  115. package/src/routes/test/nav.svelte +7 -0
  116. package/src/site/data/docs.ts +176 -0
  117. package/src/site/data/home.ts +12 -0
  118. package/src/site/lib/APIDocs/APIDocs.svelte +178 -0
  119. package/src/site/lib/APIDocs/ParsedComponent.d.ts +85 -0
  120. package/src/site/lib/CopyBox/CopyBox.svelte +23 -0
  121. package/src/site/lib/Example/Example.scss +33 -0
  122. package/src/site/lib/Example/Example.svelte +18 -0
  123. package/src/site/lib/HeroCard/HeroCard.scss +24 -0
  124. package/src/site/lib/HeroCard/HeroCard.svelte +36 -0
  125. package/src/site/lib/Metadata/Metadata.svelte +14 -0
  126. package/src/site/lib/Navbar/Navbar.scss +92 -0
  127. package/src/site/lib/Navbar/Navbar.svelte +47 -0
  128. package/src/site/lib/PageSection/PageSection.scss +57 -0
  129. package/src/site/lib/PageSection/PageSection.svelte +10 -0
  130. package/src/site/lib/Showcase/Showcase.scss +53 -0
  131. package/src/site/lib/Showcase/Showcase.svelte +67 -0
  132. package/src/site/lib/Toc/Toc.scss +18 -0
  133. package/src/site/lib/Toc/Toc.svelte +59 -0
  134. package/src/site/lib/TreeView/TreeView.svelte +89 -0
  135. package/src/site/lib/index.ts +9 -0
  136. package/src/site/styles/_markdown.scss +260 -0
  137. package/src/site/styles/_mixins.scss +319 -0
  138. package/src/site/styles/global.scss +40 -0
  139. package/src/site/styles/pages/docs.scss +74 -0
  140. package/src/site/styles/pages/home.scss +134 -0
  141. package/static/bloom-mica-dark.png +0 -0
  142. package/static/bloom-mica-light.png +0 -0
  143. package/static/logo.svg +11 -0
  144. package/svelte.config.js +57 -0
  145. package/tsconfig.json +38 -0
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { NavigationView, TextBlock } from "fluent-svelte";
3
+ </script>
4
+
5
+ <NavigationView>
6
+ <TextBlock variant="title">Page Title</TextBlock>
7
+ </NavigationView>
@@ -0,0 +1,176 @@
1
+ export type DocsMap = {
2
+ name: string;
3
+ path?: string;
4
+ type?: "page" | "category";
5
+ icon?: string;
6
+ pages?: DocsMap[];
7
+ };
8
+
9
+ // SVG stuff is hopefully temporary
10
+ export const docsMap: DocsMap[] = [
11
+ {
12
+ name: "Overview",
13
+ path: "",
14
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 7c.28 0 .5.22.5.5v3a.5.5 0 01-1 0v-3c0-.28.22-.5.5-.5z"/><path d="M8 6.25a.75.75 0 100-1.5.75.75 0 000 1.5z"/><path d="M2 8a6 6 0 1112 0A6 6 0 012 8zm6-5a5 5 0 100 10A5 5 0 008 3z"/></svg>`
15
+ },
16
+ {
17
+ name: "Getting Started",
18
+ path: "/getting-started",
19
+ icon: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M13 1.5C13 1.22386 12.7761 1 12.5 1C12.2239 1 12 1.22386 12 1.5V3H10.5C10.2239 3 10 3.22386 10 3.5C10 3.77614 10.2239 4 10.5 4H12V5.5C12 5.77614 12.2239 6 12.5 6C12.7761 6 13 5.77614 13 5.5V4H14.5C14.7761 4 15 3.77614 15 3.5C15 3.22386 14.7761 3 14.5 3H13V1.5ZM3.75 2C2.7835 2 2 2.7835 2 3.75V12.25C2 13.2165 2.7835 14 3.75 14H12.25C13.2165 14 14 13.2165 14 12.25V9.25C14 8.2835 13.2165 7.5 12.25 7.5H8.5V3.75C8.5 2.7835 7.7165 2 6.75 2H3.75ZM7.5 8.5V13H3.75C3.33579 13 3 12.6642 3 12.25V8.5H7.5ZM7.5 3.75V7.5H3V3.75C3 3.33579 3.33579 3 3.75 3H6.75C7.16421 3 7.5 3.33579 7.5 3.75ZM12.25 13H8.5V8.5H12.25C12.6642 8.5 13 8.83579 13 9.25V12.25C13 12.6642 12.6642 13 12.25 13Z"/></svg>`
20
+ },
21
+ {
22
+ type: "category",
23
+ name: "Components",
24
+ pages: [
25
+ {
26
+ name: "Button",
27
+ path: "/components/button",
28
+ // Cursor Hover 16
29
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M1 5c0-1.1.9-2 2-2h10a2 2 0 012 2v5a2 2 0 01-1.16 1.82 1.5 1.5 0 00-.28-.38l-.45-.45A1 1 0 0014 10V5a1 1 0 00-1-1H3a1 1 0 00-1 1v5a1 1 0 001 1h4v1H3a2 2 0 01-2-2V5z"/><path d="M8.85 8.15A.5.5 0 008 8.5v6a.5.5 0 00.9.3l1.35-1.8h2.25a.5.5 0 00.35-.85l-4-4zM9 13V9.7l2.3 2.3H10a.5.5 0 00-.4.2L9 13z"/></svg>`
30
+ },
31
+ {
32
+ name: "Checkbox",
33
+ path: "/components/checkbox",
34
+ // Checkbox Checked 16
35
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.8536 6.85355C11.0488 6.65829 11.0488 6.34171 10.8536 6.14645C10.6583 5.95118 10.3417 5.95118 10.1464 6.14645L7 9.29289L5.85355 8.14645C5.65829 7.95118 5.34171 7.95118 5.14645 8.14645C4.95118 8.34171 4.95118 8.65829 5.14645 8.85355L6.64645 10.3536C6.84171 10.5488 7.15829 10.5488 7.35355 10.3536L10.8536 6.85355ZM3 4.5C3 3.67157 3.67157 3 4.5 3H11.5C12.3284 3 13 3.67157 13 4.5V11.5C13 12.3284 12.3284 13 11.5 13H4.5C3.67157 13 3 12.3284 3 11.5V4.5ZM11.5 4H4.5C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4Z" /></svg>`
36
+ },
37
+ {
38
+ name: "ToggleSwitch",
39
+ path: "/components/toggleswitch",
40
+ // Toggle Left 16
41
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 10C3.89543 10 3 9.10457 3 8C3 6.89543 3.89543 6 5 6C6.10457 6 7 6.89543 7 8C7 9.10457 6.10457 10 5 10Z"/><path d="M15 8C15 5.79086 13.2091 4 11 4H5C2.79086 4 1 5.79086 1 8C1 10.2091 2.79086 12 5 12H11C13.2091 12 15 10.2091 15 8ZM11 5C12.6569 5 14 6.34315 14 8C14 9.65685 12.6569 11 11 11H5C3.34315 11 2 9.65685 2 8C2 6.34315 3.34315 5 5 5H11Z"/></svg>`
42
+ },
43
+ {
44
+ name: "RadioButton",
45
+ path: "/components/radiobutton",
46
+ // Radio Button 16 Filled
47
+ icon: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5C7.23858 5 5 7.23858 5 10C5 12.7614 7.23858 15 10 15Z"/><path d="M10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2ZM3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10Z"/></svg>`
48
+ },
49
+ {
50
+ name: "TextBox",
51
+ path: "/components/textbox",
52
+ // Rename 16
53
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.5 2C6.22386 2 6 2.22386 6 2.5C6 2.77614 6.22386 3 6.5 3H7.5V13H6.5C6.22386 13 6 13.2239 6 13.5C6 13.7761 6.22386 14 6.5 14H9.5C9.77614 14 10 13.7761 10 13.5C10 13.2239 9.77614 13 9.5 13H8.5V3H9.5C9.77614 3 10 2.77614 10 2.5C10 2.22386 9.77614 2 9.5 2H6.5ZM4 4H6.5V5H4C3.44771 5 3 5.44771 3 6V9.99726C3 10.5495 3.44772 10.9973 4 10.9973H6.5V11.9973H4C2.89543 11.9973 2 11.1018 2 9.99726V6C2 4.89543 2.89543 4 4 4ZM12 10.9973H9.5V11.9973H12C13.1046 11.9973 14 11.1018 14 9.99727V6C14 4.89543 13.1046 4 12 4H9.5V5H12C12.5523 5 13 5.44772 13 6V9.99727C13 10.5496 12.5523 10.9973 12 10.9973Z"/></svg>`
54
+ },
55
+ {
56
+ name: "Slider",
57
+ path: "/components/slider",
58
+ // Options 16
59
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 9C6.93191 9 7.71496 9.63738 7.93699 10.5L13.5 10.5C13.7761 10.5 14 10.7239 14 11C14 11.2455 13.8231 11.4496 13.5899 11.4919L13.5 11.5L7.93673 11.501C7.71435 12.3631 6.93155 13 6 13C5.06845 13 4.28565 12.3631 4.06327 11.501L2.5 11.5C2.22386 11.5 2 11.2761 2 11C2 10.7545 2.17688 10.5504 2.41012 10.5081L2.5 10.5L4.06301 10.5C4.28504 9.63738 5.06809 9 6 9ZM6 10C5.44772 10 5 10.4477 5 11C5 11.5523 5.44772 12 6 12C6.55228 12 7 11.5523 7 11C7 10.4477 6.55228 10 6 10ZM10 3C10.9319 3 11.715 3.63738 11.937 4.49998L13.5 4.5C13.7761 4.5 14 4.72386 14 5C14 5.24546 13.8231 5.44961 13.5899 5.49194L13.5 5.5L11.9367 5.50102C11.7144 6.36312 10.9316 7 10 7C9.06845 7 8.28565 6.36312 8.06327 5.50102L2.5 5.5C2.22386 5.5 2 5.27614 2 5C2 4.75454 2.17688 4.55039 2.41012 4.50806L2.5 4.5L8.06301 4.49998C8.28504 3.63738 9.06809 3 10 3ZM10 4C9.44772 4 9 4.44772 9 5C9 5.55228 9.44772 6 10 6C10.5523 6 11 5.55228 11 5C11 4.44772 10.5523 4 10 4Z"/></svg>`
60
+ },
61
+ {
62
+ name: "Expander",
63
+ path: "/components/expander",
64
+ // Top Panel Expand 16
65
+ icon: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.5 11.1741L11.3737 10.1756C11.5556 9.96781 11.8714 9.94675 12.0793 10.1286C12.2871 10.3104 12.3081 10.6263 12.1263 10.8341L10.3763 12.8341C10.2814 12.9426 10.1442 13.0049 10 13.0049C9.85583 13.0049 9.71866 12.9426 9.62372 12.8341L7.87372 10.8341C7.69188 10.6263 7.71294 10.3104 7.92075 10.1286C8.12857 9.94675 8.44445 9.96781 8.6263 10.1756L9.50001 11.1742L9.50001 7.49512C9.50001 7.21898 9.72387 6.99512 10 6.99512C10.2762 6.99512 10.5 7.21898 10.5 7.49512L10.5 11.1741ZM4 16C2.89543 16 2 15.1046 2 14V6C2 4.89543 2.89543 4 4 4H16C17.1046 4 18 4.89543 18 6V14C18 15.1046 17.1046 16 16 16H4ZM3 14C3 14.5523 3.44772 15 4 15H16C16.5523 15 17 14.5523 17 14V9H11.5V8H17V6C17 5.44771 16.5523 5 16 5H4C3.44772 5 3 5.44772 3 6V8H8.50003V9H3V14Z"/></svg>`
66
+ },
67
+ {
68
+ name: "ContentDialog",
69
+ path: "/components/contentdialog",
70
+ // Window Multiple 16
71
+ icon: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M4.5 2C3.11929 2 2 3.11929 2 4.5V9.5C2 10.8807 3.11929 12 4.5 12H9.5C10.8807 12 12 10.8807 12 9.5V4.5C12 3.11929 10.8807 2 9.5 2H4.5ZM10.9146 4H3.08535C3.29127 3.4174 3.84689 3 4.5 3H9.5C10.1531 3 10.7087 3.4174 10.9146 4ZM3 5H11V9.5C11 10.3284 10.3284 11 9.5 11H4.5C3.67157 11 3 10.3284 3 9.5V5ZM6.50018 13.9999C5.68227 13.9999 4.9561 13.6072 4.5 12.9999H10.0002C11.657 12.9999 13.0002 11.6568 13.0002 9.99994V4.49976C13.6074 4.95586 14.0002 5.68203 14.0002 6.49994V9.99994C14.0002 12.2091 12.2093 13.9999 10.0002 13.9999H6.50018Z" fill="currentColor"/></svg>`
72
+ },
73
+ {
74
+ name: "Flyout",
75
+ path: "/components/flyout",
76
+ // Shape Subtract 16
77
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 2C2.89543 2 2 2.89543 2 4V9C2 9.04652 2.00159 9.09268 2.00471 9.13841C2.00623 9.16053 2.0081 9.18256 2.01033 9.20449C2.04695 9.56512 2.17939 9.89743 2.38178 10.1756C2.62877 10.515 2.97994 10.7737 3.38831 10.9047C3.39395 10.9065 3.3996 10.9083 3.40526 10.9101C3.59314 10.9685 3.79289 11 4 11H5V12C5 13.1046 5.89543 14 7 14H12C13.1046 14 14 13.1046 14 12V7C14 5.89543 13.1046 5 12 5H11V4C11 3.78664 10.9666 3.58108 10.9047 3.38828C10.7737 2.97992 10.5149 2.62875 10.1755 2.38176C10.1567 2.36804 10.1376 2.35464 10.1182 2.34157C9.83486 2.15014 9.4998 2.02941 9.13837 2.00471C9.09265 2.00159 9.04651 2 9 2H4ZM5.14309 3L3 5.1431V4C3 3.44772 3.44772 3 4 3H5.14309ZM3 6.55732L6.5573 3H8.14309L3 8.14312V6.55732ZM9.45038 3.10692C9.77643 3.27167 10 3.60973 10 4V4.293L9.293 5H7.55731L9.45038 3.10692ZM5 7.55732V9.29302L4.29303 10H4C3.60974 10 3.27169 9.77644 3.10693 9.4504L5 7.55732ZM6 7C6 6.44772 6.44772 6 7 6H12C12.5523 6 13 6.44772 13 7V12C13 12.5523 12.5523 13 12 13H7C6.44772 13 6 12.5523 6 12V7Z" fill="currentColor" /></svg>`
78
+ },
79
+ {
80
+ name: "InfoBar",
81
+ path: "/components/infobar",
82
+ // Comment Error 16
83
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.59971 3H3.5C2.67157 3 2 3.67157 2 4.5V9.5C2 10.3284 2.67157 11 3.5 11H5V13.8981L8.31213 11H12.5C13.2392 11 13.8536 10.4653 13.9773 9.7615C14.366 9.44393 14.7105 9.07424 15 8.66308V9.5C15 10.8807 13.8807 12 12.5 12H8.68787L5.62533 14.6797C4.99168 15.2342 4 14.7842 4 13.9422V12H3.5C2.11929 12 1 10.8807 1 9.5V4.5C1 3.11929 2.11929 2 3.5 2H6.25716C6.00353 2.30711 5.78261 2.64222 5.59971 3ZM10.5 10C12.9853 10 15 7.98528 15 5.5C15 3.01472 12.9853 1 10.5 1C8.01472 1 6 3.01472 6 5.5C6 7.98528 8.01472 10 10.5 10ZM10 3.5C10 3.22386 10.2239 3 10.5 3C10.7761 3 11 3.22386 11 3.5V5.5C11 5.77614 10.7761 6 10.5 6C10.2239 6 10 5.77614 10 5.5V3.5ZM11.125 7.5C11.125 7.84518 10.8452 8.125 10.5 8.125C10.1548 8.125 9.875 7.84518 9.875 7.5C9.875 7.15482 10.1548 6.875 10.5 6.875C10.8452 6.875 11.125 7.15482 11.125 7.5Z"/></svg>`
84
+ },
85
+ {
86
+ name: "InfoBadge",
87
+ path: "/components/infobadge",
88
+ // Error Circle 16
89
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 2C11.3137 2 14 4.68629 14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2ZM8 3C5.23858 3 3 5.23858 3 8C3 10.7614 5.23858 13 8 13C10.7614 13 13 10.7614 13 8C13 5.23858 10.7614 3 8 3ZM8 10C8.41421 10 8.75 10.3358 8.75 10.75C8.75 11.1642 8.41421 11.5 8 11.5C7.58579 11.5 7.25 11.1642 7.25 10.75C7.25 10.3358 7.58579 10 8 10ZM8 4.5C8.24546 4.5 8.44961 4.67688 8.49194 4.91012L8.5 5V8.5C8.5 8.77614 8.27614 9 8 9C7.75454 9 7.55039 8.82312 7.50806 8.58988L7.5 8.5V5C7.5 4.72386 7.72386 4.5 8 4.5Z"/></svg>`
90
+ },
91
+ {
92
+ name: "ProgressRing",
93
+ path: "/components/progressring",
94
+ // Arrow Clockwise 16
95
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3 8C3 5.23858 5.23858 3 8 3C9.63582 3 11.0882 3.78555 12.0004 5H10C9.72386 5 9.5 5.22386 9.5 5.5C9.5 5.77614 9.72386 6 10 6H13C13.2761 6 13.5 5.77614 13.5 5.5V2.5C13.5 2.22386 13.2761 2 13 2C12.7239 2 12.5 2.22386 12.5 2.5V4.03126C11.4006 2.78563 9.79204 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 7.72386 13.7761 7.5 13.5 7.5C13.2239 7.5 13 7.72386 13 8C13 10.7614 10.7614 13 8 13C5.23858 13 3 10.7614 3 8Z"/></svg>`
96
+ },
97
+ {
98
+ name: "PersonPicture",
99
+ path: "/components/personpicture",
100
+ // Person Circle 12
101
+ icon: `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.21693 6.26447C4.34752 6.1176 4.54252 6 4.775 6H7.225C7.45748 6 7.65248 6.1176 7.78307 6.26447C7.91264 6.41021 8 6.60757 8 6.80999V6.96999C8 7.7872 7.18342 8.5 6 8.5C4.81658 8.5 4 7.7872 4 6.96999V6.80999C4 6.60757 4.08736 6.41021 4.21693 6.26447ZM6 5C6.55228 5 7 4.55228 7 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5ZM6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11ZM6 10C3.79086 10 2 8.20914 2 6C2 3.79086 3.79086 2 6 2C8.20914 2 10 3.79086 10 6C10 8.20914 8.20914 10 6 10Z" /></svg>`
102
+ },
103
+ {
104
+ name: "IconButton",
105
+ path: "/components/iconbutton",
106
+ // Square Multiple 16
107
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
108
+ <path d="M5.08496 4C5.29088 3.4174 5.8465 3 6.49961 3H9.99961C11.6565 3 12.9996 4.34315 12.9996 6V9.5C12.9996 10.1531 12.5822 10.7087 11.9996 10.9146V6C11.9996 4.89543 11.1042 4 9.99961 4H5.08496ZM4.5 5H9.5C10.3284 5 11 5.67157 11 6.5V11.5C11 12.3284 10.3284 13 9.5 13H4.5C3.67157 13 3 12.3284 3 11.5V6.5C3 5.67157 3.67157 5 4.5 5ZM4.5 6C4.22386 6 4 6.22386 4 6.5V11.5C4 11.7761 4.22386 12 4.5 12H9.5C9.77614 12 10 11.7761 10 11.5V6.5C10 6.22386 9.77614 6 9.5 6H4.5Z" />
109
+ </svg>`
110
+ },
111
+ {
112
+ name: "TextBlock",
113
+ path: "/components/textblock",
114
+ // Text Font 16
115
+ icon: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.75044 2C4.95886 2.00001 5.14541 2.1293 5.21859 2.32446L6.94545 6.92998L6.40195 8.32877L6.09079 7.4989H3.40959L2.96829 8.67555C2.87132 8.9341 2.58311 9.06509 2.32455 8.96812C2.066 8.87115 1.93501 8.58294 2.03198 8.32438L4.28226 2.32442C4.35545 2.12927 4.54201 1.99999 4.75044 2ZM3.78464 6.4989H5.71583L4.75036 3.92399L3.78464 6.4989Z" /><path d="M6.70303 10.315C6.70008 10.3221 6.69729 10.3293 6.69466 10.3366L5.65979 13H5.50012C5.22398 13 5.00012 13.2239 5.00012 13.5C5.00012 13.7761 5.22398 14 5.50012 14H5.93136C5.97755 14.0065 6.02375 14.0063 6.06875 14H7.50012C7.77626 14 8.00012 13.7761 8.00012 13.5C8.00012 13.2239 7.77626 13 7.50012 13H6.73263L7.50709 11.0068H11.4909L12.2672 13.0047H11.5028C11.2267 13.0047 11.0028 13.2285 11.0028 13.5047C11.0028 13.7808 11.2267 14.0047 11.5028 14.0047H12.9878C12.9946 14.0048 13.0013 14.0048 13.0081 14.0047H13.5058C13.7819 14.0047 14.0058 13.7808 14.0058 13.5047C14.0058 13.2285 13.7819 13.0047 13.5058 13.0047H13.34L9.96503 4.31861C9.89033 4.12635 9.70524 3.99969 9.49898 3.99969C9.29272 3.99969 9.10762 4.12635 9.03292 4.31861L6.70303 10.315ZM11.1023 10.0068H7.89563L9.49898 5.88026L11.1023 10.0068Z" /></svg>`
116
+ },
117
+ {
118
+ name: "ListItem",
119
+ path: "/components/listitem",
120
+ // Apps list 20
121
+ icon: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
122
+ <path d="M2 3.5C2 2.67157 2.67157 2 3.5 2H4.5C5.32843 2 6 2.67157 6 3.5V4.5C6 5.32843 5.32843 6 4.5 6H3.5C2.67157 6 2 5.32843 2 4.5V3.5ZM3.5 3C3.22386 3 3 3.22386 3 3.5V4.5C3 4.77614 3.22386 5 3.5 5H4.5C4.77614 5 5 4.77614 5 4.5V3.5C5 3.22386 4.77614 3 4.5 3H3.5Z"/>
123
+ <path d="M2 9.5C2 8.67157 2.67157 8 3.5 8H4.5C5.32843 8 6 8.67157 6 9.5V10.5C6 11.3284 5.32843 12 4.5 12H3.5C2.67157 12 2 11.3284 2 10.5V9.5ZM3.5 9C3.22386 9 3 9.22386 3 9.5V10.5C3 10.7761 3.22386 11 3.5 11H4.5C4.77614 11 5 10.7761 5 10.5V9.5C5 9.22386 4.77614 9 4.5 9H3.5Z"/>
124
+ <path d="M2 15.5C2 14.6716 2.67157 14 3.5 14H4.5C5.32843 14 6 14.6716 6 15.5V16.5C6 17.3284 5.32843 18 4.5 18H3.5C2.67157 18 2 17.3284 2 16.5V15.5ZM3.5 15C3.22386 15 3 15.2239 3 15.5V16.5C3 16.7761 3.22386 17 3.5 17H4.5C4.77614 17 5 16.7761 5 16.5V15.5C5 15.2239 4.77614 15 4.5 15H3.5Z"/>
125
+ <path d="M8 4.5C8 4.22386 8.22386 4 8.5 4H17.5C17.7761 4 18 4.22386 18 4.5C18 4.77614 17.7761 5 17.5 5H8.5C8.22386 5 8 4.77614 8 4.5Z"/>
126
+ <path d="M8 10.5C8 10.2239 8.22386 10 8.5 10H17.5C17.7761 10 18 10.2239 18 10.5C18 10.7761 17.7761 11 17.5 11H8.5C8.22386 11 8 10.7761 8 10.5Z"/>
127
+ <path d="M8 16.5C8 16.2239 8.22386 16 8.5 16H17.5C17.7761 16 18 16.2239 18 16.5C18 16.7761 17.7761 17 17.5 17H8.5C8.22386 17 8 16.7761 8 16.5Z"/>
128
+ </svg>`
129
+ },
130
+ {
131
+ name: "CalendarView",
132
+ path: "/components/calendarview",
133
+ // Calendar LTR 16
134
+ icon: `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3 5.5C3 5.22386 3.22386 5 3.5 5C3.77614 5 4 5.22386 4 5.5C4 5.77614 3.77614 6 3.5 6C3.22386 6 3 5.77614 3 5.5ZM3.5 7C3.22386 7 3 7.22386 3 7.5C3 7.77614 3.22386 8 3.5 8C3.77614 8 4 7.77614 4 7.5C4 7.22386 3.77614 7 3.5 7ZM5 5.5C5 5.22386 5.22386 5 5.5 5C5.77614 5 6 5.22386 6 5.5C6 5.77614 5.77614 6 5.5 6C5.22386 6 5 5.77614 5 5.5ZM5.5 7C5.22386 7 5 7.22386 5 7.5C5 7.77614 5.22386 8 5.5 8C5.77614 8 6 7.77614 6 7.5C6 7.22386 5.77614 7 5.5 7ZM7 5.5C7 5.22386 7.22386 5 7.5 5C7.77614 5 8 5.22386 8 5.5C8 5.77614 7.77614 6 7.5 6C7.22386 6 7 5.77614 7 5.5ZM1 3.5C1 2.11929 2.11929 1 3.5 1H8.5C9.88071 1 11 2.11929 11 3.5V8.5C11 9.88071 9.88071 11 8.5 11H3.5C2.11929 11 1 9.88071 1 8.5V3.5ZM3.5 2C2.84689 2 2.29127 2.4174 2.08535 3H9.91465C9.70873 2.4174 9.15311 2 8.5 2H3.5ZM10 4H2V8.5C2 9.32843 2.67157 10 3.5 10H8.5C9.32843 10 10 9.32843 10 8.5V4Z" /></svg>`
135
+ }
136
+ ]
137
+ },
138
+ {
139
+ type: "category",
140
+ name: "Internals",
141
+ pages: []
142
+ }
143
+ ];
144
+
145
+ // {
146
+ // name: "ComboBox",
147
+ // path: "/components/combobox",
148
+ // icon: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 3C3.89543 3 3 3.89543 3 5V15C3 16.1046 3.89543 17 5 17H9.22047L9.43163 16.1553C9.44469 16.1031 9.45904 16.0513 9.47466 16H5C4.44772 16 4 15.5523 4 15V5C4 4.44772 4.44772 4 5 4H15C15.5523 4 16 4.44772 16 5V9.23163C16.3194 9.09477 16.6586 9.01856 17 9.00299V5C17 3.89543 16.1046 3 15 3H5ZM9.5 14H10.9427L11.9427 13H9.5C9.22386 13 9 13.2239 9 13.5C9 13.7761 9.22386 14 9.5 14ZM7.5 7.25C7.5 7.66421 7.16421 8 6.75 8C6.33579 8 6 7.66421 6 7.25C6 6.83579 6.33579 6.5 6.75 6.5C7.16421 6.5 7.5 6.83579 7.5 7.25ZM6.75 11C7.16421 11 7.5 10.6642 7.5 10.25C7.5 9.83579 7.16421 9.5 6.75 9.5C6.33579 9.5 6 9.83579 6 10.25C6 10.6642 6.33579 11 6.75 11ZM6.75 14C7.16421 14 7.5 13.6642 7.5 13.25C7.5 12.8358 7.16421 12.5 6.75 12.5C6.33579 12.5 6 12.8358 6 13.25C6 13.6642 6.33579 14 6.75 14ZM9.5 7C9.22386 7 9 7.22386 9 7.5C9 7.77614 9.22386 8 9.5 8H13.5C13.7761 8 14 7.77614 14 7.5C14 7.22386 13.7761 7 13.5 7H9.5ZM9.5 10C9.22386 10 9 10.2239 9 10.5C9 10.7761 9.22386 11 9.5 11H13.5C13.7761 11 14 10.7761 14 10.5C14 10.2239 13.7761 10 13.5 10H9.5ZM10.9798 15.3772L15.8092 10.5478C16.5395 9.81741 17.7237 9.81741 18.454 10.5478C19.1843 11.2781 19.1843 12.4622 18.454 13.1926L13.6246 18.022C13.343 18.3036 12.9902 18.5033 12.6039 18.5999L11.106 18.9744C10.4546 19.1372 9.86451 18.5472 10.0274 17.8958L10.4018 16.3979C10.4984 16.0116 10.6982 15.6588 10.9798 15.3772Z" /></svg>`
149
+ // },
150
+ // {
151
+ // name: "Slider",
152
+ // path: "/components/slider",
153
+ // icon: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 9C6.93191 9 7.71496 9.63738 7.93699 10.5L13.5 10.5C13.7761 10.5 14 10.7239 14 11C14 11.2455 13.8231 11.4496 13.5899 11.4919L13.5 11.5L7.93673 11.501C7.71435 12.3631 6.93155 13 6 13C5.06845 13 4.28565 12.3631 4.06327 11.501L2.5 11.5C2.22386 11.5 2 11.2761 2 11C2 10.7545 2.17688 10.5504 2.41012 10.5081L2.5 10.5L4.06301 10.5C4.28504 9.63738 5.06809 9 6 9ZM6 10C5.44772 10 5 10.4477 5 11C5 11.5523 5.44772 12 6 12C6.55228 12 7 11.5523 7 11C7 10.4477 6.55228 10 6 10ZM10 3C10.9319 3 11.715 3.63738 11.937 4.49998L13.5 4.5C13.7761 4.5 14 4.72386 14 5C14 5.24546 13.8231 5.44961 13.5899 5.49194L13.5 5.5L11.9367 5.50102C11.7144 6.36312 10.9316 7 10 7C9.06845 7 8.28565 6.36312 8.06327 5.50102L2.5 5.5C2.22386 5.5 2 5.27614 2 5C2 4.75454 2.17688 4.55039 2.41012 4.50806L2.5 4.5L8.06301 4.49998C8.28504 3.63738 9.06809 3 10 3ZM10 4C9.44772 4 9 4.44772 9 5C9 5.55228 9.44772 6 10 6C10.5523 6 11 5.55228 11 5C11 4.44772 10.5523 4 10 4Z"/></svg>`
154
+ // },
155
+
156
+ export const docsPages = filterPages(docsMap);
157
+
158
+ function filterPages(docsStructure: DocsMap[] | DocsMap): DocsMap[] {
159
+ if (Array.isArray(docsStructure)) {
160
+ // it's an array of pages/categories
161
+ return docsStructure
162
+ .map(page => filterPages(page)) // recursively flatten the structure and filter to only include pages
163
+ .flat(Infinity) as DocsMap[]; // flatten the structure to get rid of any nesting
164
+ } else {
165
+ // it's a single page/category, not a structure
166
+ if (docsStructure.type === "category") {
167
+ // it's a category
168
+ return docsStructure.pages
169
+ .map(page => filterPages(page)) // filter down and down until only pages are left
170
+ .flat(Infinity) as DocsMap[]; // flatten the array
171
+ } else {
172
+ // it's a page
173
+ return [docsStructure];
174
+ }
175
+ }
176
+ }
@@ -0,0 +1,12 @@
1
+ export const homeExampleSrc = `<script>
2
+ import { Button, TextBlock } from "fluent-svelte";
3
+ import "fluent-svelte/theme.css";
4
+
5
+ let count = 0;
6
+ </script>
7
+
8
+ <TextBlock variant="display">{count}</TextBlock>
9
+ <div>
10
+ <Button variant="accent" on:click={() => count++}>Increase Counter</Button>
11
+ <Button on:click={() => count = 0}>Reset Counter</Button>
12
+ </div>`;
@@ -0,0 +1,178 @@
1
+ <script lang="ts">
2
+ import type { ParsedComponent, ForwardedEvent, DispatchedEvent } from "./ParsedComponent";
3
+
4
+ import { InfoBar, Button } from "$lib";
5
+
6
+ export let data: ParsedComponent;
7
+ export let manualForward = false;
8
+
9
+ const forwardedEvents = <ForwardedEvent[]>data.events.filter(e => e.type === "forwarded");
10
+ const dispatchedEvents = <DispatchedEvent[]>data.events.filter(e => e.type === "dispatched");
11
+ </script>
12
+
13
+ API docs automatically generated by <a
14
+ href="https://github.com/carbon-design-system/sveld/"
15
+ target="_blank"
16
+ rel="noreffer noopener">sveld</a
17
+ >
18
+ and
19
+ <a href="https://github.com/mattjennings/vite-plugin-sveld/" target="_blank" rel="noreffer noopener"
20
+ >vite-plugin-sveld</a
21
+ >.
22
+
23
+ <h3 id="props">Props</h3>
24
+ {#if data.props.length > 0}
25
+ <table>
26
+ <thead>
27
+ <tr><th>Name</th><th>Type</th><th>Default</th><th>Description</th></tr>
28
+ </thead>
29
+ <tbody>
30
+ {#each data.props as { name, type, value, description }}
31
+ {#if !name.startsWith("__")}
32
+ <tr>
33
+ <td>
34
+ {#if typeof name !== "undefined"}
35
+ <code>{name}</code>
36
+ {:else}
37
+ Unknown
38
+ {/if}
39
+ </td>
40
+ <td>
41
+ {#if typeof type !== "undefined"}
42
+ <code>{type}</code>
43
+ {:else}
44
+ <code>any</code>
45
+ {/if}
46
+ </td>
47
+ <td>
48
+ <code>{value ?? "undefined"}</code>
49
+ </td>
50
+ <td>{description ?? "None"}</td>
51
+ </tr>
52
+ {/if}
53
+ {/each}
54
+ </tbody>
55
+ </table>
56
+ {:else}
57
+ None
58
+ {/if}
59
+
60
+ {#if data.rest_props}
61
+ <InfoBar severity="information" title="This component uses $$restProps.">
62
+ All unused props will be passed through to the underlying {@html data.rest_props.name.includes(
63
+ " | "
64
+ )
65
+ ? new Intl.ListFormat({ style: "short" }).format(
66
+ data.rest_props.name.split(" | ").map(name => `<code>${name}</code>`)
67
+ )
68
+ : `<code>${data.rest_props.name}</code>`}
69
+ {data.rest_props.type.toLowerCase()}{data.rest_props.name.includes(" | ") ? "s" : ""} as regular
70
+ attributes.
71
+ <Button
72
+ slot="action"
73
+ variant="accent"
74
+ href="https://svelte.dev/docs#template-syntax-attributes-and-props">More Info</Button
75
+ >
76
+ </InfoBar>
77
+ {/if}
78
+
79
+ <h3 id="slots">Slots</h3>
80
+ {#if data.slots.length > 0}
81
+ <table>
82
+ <thead>
83
+ <tr><th>Name</th><th>Slot Props</th><th>Fallback</th></tr>
84
+ </thead>
85
+ <tbody>
86
+ {#each data.slots as { name, slot_props, fallback }}
87
+ <tr>
88
+ <td>
89
+ {#if typeof name !== "undefined"}
90
+ <code>{name === "__default__" ? "Unnamed (Default)" : name}</code>
91
+ {:else}
92
+ Unknown
93
+ {/if}
94
+ </td>
95
+ <td>
96
+ {#if slot_props}
97
+ <code>{slot_props}</code>
98
+ {:else}
99
+ None
100
+ {/if}
101
+ </td>
102
+ <td>
103
+ {#if typeof fallback !== "undefined"}
104
+ <code>{fallback.substr(0, 300)}</code>{fallback.length > 300 ? "…" : ""}
105
+ {:else}
106
+ Empty
107
+ {/if}
108
+ </td>
109
+ </tr>
110
+ {/each}
111
+ </tbody>
112
+ </table>
113
+ {:else}
114
+ None
115
+ {/if}
116
+
117
+ <h3 id="events">Events</h3>
118
+ {#if manualForward}
119
+ <h4>Forwarded Events</h4>
120
+ {#if forwardedEvents.length > 0}
121
+ {#each forwardedEvents as { name }}
122
+ <code class="forwarded">
123
+ <a
124
+ href="https://developer.mozilla.org/en-US/docs/Web/API/Element/{name}_event"
125
+ target="_blank"
126
+ rel="noreferrer noopener">{name.trim()}</a
127
+ >
128
+ </code>
129
+ {/each}
130
+ {:else}
131
+ None
132
+ {/if}
133
+ {:else}
134
+ <p>
135
+ All DOM events are forwarded to this component's respective elements by default. <a
136
+ href="#todo">Learn More</a
137
+ >
138
+ </p>
139
+ {/if}
140
+
141
+ <h4>Dispatched Events</h4>
142
+ {#if dispatchedEvents.length > 0}
143
+ <table>
144
+ <thead>
145
+ <tr><th>Name</th><th>Detail</th></tr>
146
+ </thead>
147
+ <tbody>
148
+ {#each dispatchedEvents as { name, detail }}
149
+ <tr>
150
+ <td>
151
+ {#if typeof name !== "undefined"}
152
+ <code>{name}</code>
153
+ {:else}
154
+ Unknown
155
+ {/if}
156
+ </td>
157
+ <td>
158
+ {#if typeof detail !== "undefined"}
159
+ <code>{detail}</code>
160
+ {:else}
161
+ None
162
+ {/if}
163
+ </td>
164
+ </tr>
165
+ {/each}
166
+ </tbody>
167
+ </table>
168
+ {:else}
169
+ <p>None</p>
170
+ {/if}
171
+
172
+ <style>
173
+ .forwarded {
174
+ display: inline-flex;
175
+ margin-inline-end: 4px;
176
+ margin-block-end: 4px;
177
+ }
178
+ </style>
@@ -0,0 +1,85 @@
1
+ type ComponentPropName = string;
2
+
3
+ interface ComponentProp {
4
+ name: string;
5
+ kind: "let" | "const" | "function";
6
+ constant: boolean;
7
+ type?: string;
8
+ value?: any;
9
+ description?: string;
10
+ isFunction: boolean;
11
+ isFunctionDeclaration: boolean;
12
+ reactive: boolean;
13
+ }
14
+
15
+ const DEFAULT_SLOT_NAME = "__default__";
16
+
17
+ type ComponentSlotName = typeof DEFAULT_SLOT_NAME | string;
18
+
19
+ interface ComponentSlot {
20
+ name?: string;
21
+ default: boolean;
22
+ fallback?: string;
23
+ slot_props?: string;
24
+ }
25
+
26
+ interface SlotPropValue {
27
+ value?: string;
28
+ replace: boolean;
29
+ }
30
+
31
+ type SlotProps = Record<string, SlotPropValue>;
32
+
33
+ type ComponentEventName = string;
34
+
35
+ interface ForwardedEvent {
36
+ type: "forwarded";
37
+ name: string;
38
+ element: ComponentInlineElement | ComponentElement;
39
+ }
40
+
41
+ interface DispatchedEvent {
42
+ type: "dispatched";
43
+ name: string;
44
+ detail?: any;
45
+ }
46
+
47
+ type ComponentEvent = ForwardedEvent | DispatchedEvent;
48
+
49
+ type TypeDefName = string;
50
+
51
+ interface TypeDef extends Pick<commentParser.Tag, "type" | "name"> {
52
+ description?: string;
53
+ ts: string;
54
+ }
55
+
56
+ interface ComponentInlineElement {
57
+ type: "InlineComponent";
58
+ name: string;
59
+ }
60
+
61
+ interface ComponentElement {
62
+ type: "Element";
63
+ name: string;
64
+ }
65
+
66
+ type RestProps = undefined | ComponentInlineElement | ComponentElement;
67
+
68
+ interface Extends {
69
+ interface: string;
70
+ import: string;
71
+ }
72
+
73
+ interface ComponentPropBindings {
74
+ elements: string[];
75
+ }
76
+
77
+ export interface ParsedComponent {
78
+ props: ComponentProp[];
79
+ slots: ComponentSlot[];
80
+ events: ComponentEvent[];
81
+ typedefs: TypeDef[];
82
+ rest_props: RestProps;
83
+ extends?: Extends;
84
+ componentComment?: string;
85
+ }
@@ -0,0 +1,23 @@
1
+ <script>
2
+ import { TextBox } from "$lib";
3
+ import { TextBoxButton } from "$lib";
4
+
5
+ import Clipboard from "@fluentui/svg-icons/icons/clipboard_16_regular.svg?raw";
6
+
7
+ export let value = "";
8
+ </script>
9
+
10
+ <TextBox class="copy-box" readonly {value} {...$$restProps}>
11
+ <svelte:fragment slot="buttons">
12
+ <TextBoxButton on:click={() => navigator.clipboard.writeText(value)}>
13
+ {@html Clipboard}
14
+ </TextBoxButton>
15
+ <slot name="buttons" />
16
+ </svelte:fragment>
17
+ </TextBox>
18
+
19
+ <style lang="scss">
20
+ :global(.copy-box input) {
21
+ padding: 8px 12px;
22
+ }
23
+ </style>
@@ -0,0 +1,33 @@
1
+ @use "src/lib/mixins" as *;
2
+
3
+ .example {
4
+ @include flex($direction: column);
5
+ pre,
6
+ .example-preview {
7
+ padding: 12px;
8
+ }
9
+ .example-preview {
10
+ display: grid;
11
+ grid-gap: 12px;
12
+ background-color: var(--card-background-secondary);
13
+ background-clip: padding-box;
14
+ border-radius: var(--control-corner-radius) var(--control-corner-radius) 0 0;
15
+ border: 1px solid var(--card-stroke-default);
16
+ border-block-end: none;
17
+ :global(.info-bar) {
18
+ margin-block-end: 0;
19
+ }
20
+ }
21
+ code {
22
+ display: contents;
23
+ }
24
+ pre {
25
+ padding-inline: 18px;
26
+ font-family: var(--fds-font-family-monospace);
27
+ border-radius: 0 0 var(--control-corner-radius) var(--control-corner-radius);
28
+ }
29
+ }
30
+
31
+ :global(.example-preview > *) {
32
+ inline-size: fit-content;
33
+ }
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ export let src = "";
3
+
4
+ $: src = src.trim();
5
+ </script>
6
+
7
+ <div class="example">
8
+ <div class="example-preview">
9
+ <slot name="example" />
10
+ </div>
11
+ <code>
12
+ <pre class="language-svelte"><slot name="code" /></pre>
13
+ </code>
14
+ </div>
15
+
16
+ <style lang="scss">
17
+ @use "./Example";
18
+ </style>
@@ -0,0 +1,24 @@
1
+ @use "src/lib/mixins" as *;
2
+
3
+ .hero-card {
4
+ @include typography-body;
5
+ @include flex($direction: column);
6
+ box-sizing: border-box;
7
+ position: relative;
8
+ padding: 12px;
9
+ backdrop-filter: blur(60px) saturate(125%);
10
+ border-radius: var(--overlay-corner-radius);
11
+ background-color: var(--card-background-default);
12
+ border: 1px solid var(--card-stroke-default);
13
+ background-clip: padding-box;
14
+ box-shadow: var(--card-shadow);
15
+ transition: var(--control-normal-duration) var(--control-fast-out-slow-in-easing);
16
+ &:hover {
17
+ box-shadow: var(--flyout-shadow);
18
+ transform: translateY(-4px);
19
+ }
20
+ header {
21
+ @include flex($justify: between);
22
+ margin-bottom: 12px;
23
+ }
24
+ }
@@ -0,0 +1,36 @@
1
+ <script lang="ts">
2
+ let className = "";
3
+ export { className as class };
4
+
5
+ let element: HTMLDivElement;
6
+
7
+ export const getElement = () => element;
8
+ </script>
9
+
10
+ <div
11
+ class="hero-card {className}"
12
+ on:click
13
+ on:blur
14
+ on:focus
15
+ on:dblclick
16
+ on:contextmenu
17
+ on:mousedown
18
+ on:mouseup
19
+ on:mouseover
20
+ on:mouseout
21
+ on:mouseenter
22
+ on:mouseleave
23
+ on:keypress
24
+ on:keydown
25
+ on:keyup
26
+ bind:this={element}
27
+ >
28
+ <header>
29
+ <slot name="header" />
30
+ </header>
31
+ <slot />
32
+ </div>
33
+
34
+ <style lang="scss">
35
+ @use "./HeroCard";
36
+ </style>
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ export let title = "";
3
+ export let description = "";
4
+ </script>
5
+
6
+ <svelte:head>
7
+ <title>{title}</title>
8
+ <meta content={title} name="og:title" />
9
+ <meta content={title} name="twitter:title" />
10
+
11
+ <meta content={description} name="description" />
12
+ <meta content={description} name="og:description" />
13
+ <meta content={description} name="twitter:description" />
14
+ </svelte:head>