@finsweet/webflow-apps-utils 1.0.2 → 1.0.4

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 (293) hide show
  1. package/README.md +162 -1
  2. package/dist/index.d.ts +2 -1
  3. package/dist/index.js +2 -1
  4. package/dist/providers/GlobalProvider.mdx +322 -0
  5. package/dist/providers/GlobalProvider.svelte +58 -0
  6. package/dist/providers/GlobalProvider.svelte.d.ts +4 -0
  7. package/dist/providers/configuratorUtils.d.ts +37 -0
  8. package/dist/providers/configuratorUtils.js +219 -0
  9. package/dist/providers/globalContext.svelte.d.ts +18 -0
  10. package/dist/providers/globalContext.svelte.js +439 -0
  11. package/dist/providers/index.d.ts +5 -0
  12. package/dist/providers/index.js +7 -0
  13. package/dist/providers/types.d.ts +103 -0
  14. package/dist/providers/types.js +6 -0
  15. package/dist/router/Router.mdx +958 -0
  16. package/dist/router/Router.stories.d.ts +6 -0
  17. package/dist/router/Router.stories.js +47 -0
  18. package/dist/router/examples/RouterExample.svelte +271 -0
  19. package/dist/{ui/components/NoSettingsNeeded.svelte.d.ts → router/examples/RouterExample.svelte.d.ts} +3 -3
  20. package/dist/router/examples/index.d.ts +4 -0
  21. package/dist/router/examples/index.js +4 -0
  22. package/dist/router/examples/pages/AboutPage.svelte +568 -0
  23. package/dist/router/examples/pages/AboutPage.svelte.d.ts +13 -0
  24. package/dist/router/examples/pages/HomePage.svelte +200 -0
  25. package/dist/router/examples/pages/HomePage.svelte.d.ts +14 -0
  26. package/dist/router/examples/pages/NotFoundPage.svelte +307 -0
  27. package/dist/router/examples/pages/NotFoundPage.svelte.d.ts +17 -0
  28. package/dist/router/hooks.svelte.d.ts +2 -2
  29. package/dist/router/index.d.ts +3 -0
  30. package/dist/router/index.js +3 -0
  31. package/dist/router/{Link.svelte → providers/Link.svelte} +1 -1
  32. package/dist/router/{Route.svelte → providers/Route.svelte} +1 -1
  33. package/dist/router/{Route.svelte.d.ts → providers/Route.svelte.d.ts} +1 -1
  34. package/dist/router/{Router.svelte → providers/RouterProvider.svelte} +22 -5
  35. package/dist/router/{Router.svelte.d.ts → providers/RouterProvider.svelte.d.ts} +8 -4
  36. package/dist/router/providers/index.d.ts +3 -0
  37. package/dist/router/providers/index.js +3 -0
  38. package/dist/router/{index.svelte.d.ts → router.svelte.d.ts} +1 -3
  39. package/dist/router/{index.svelte.js → router.svelte.js} +1 -4
  40. package/dist/stores/docs/Form.mdx +542 -0
  41. package/dist/stores/forms.d.ts +41 -4
  42. package/dist/stores/forms.js +86 -32
  43. package/dist/stores/index.d.ts +0 -1
  44. package/dist/stores/index.js +0 -1
  45. package/dist/types/customCode.d.ts +1 -1
  46. package/dist/types/webflow.d.ts +31 -47
  47. package/dist/types/window.d.ts +1 -0
  48. package/dist/ui/components/LoadingScreen.svelte +2 -1
  49. package/dist/ui/components/button/Button.svelte +1 -1
  50. package/dist/ui/components/button-group/ButtonGroup.stories.js +112 -0
  51. package/dist/ui/components/{ButtonGroup.svelte → button-group/ButtonGroup.svelte} +20 -33
  52. package/dist/ui/components/button-group/ButtonGroup.svelte.d.ts +13 -0
  53. package/dist/ui/components/button-group/index.d.ts +2 -0
  54. package/dist/ui/components/button-group/index.js +1 -0
  55. package/dist/ui/components/button-group/types.d.ts +32 -0
  56. package/dist/ui/components/checkbox/Checkbox.stories.d.ts +55 -0
  57. package/dist/ui/components/checkbox/Checkbox.stories.js +162 -0
  58. package/dist/ui/components/checkbox/Checkbox.svelte +141 -0
  59. package/dist/ui/components/checkbox/Checkbox.svelte.d.ts +4 -0
  60. package/dist/ui/components/checkbox/index.d.ts +2 -0
  61. package/dist/ui/components/checkbox/index.js +1 -0
  62. package/dist/ui/components/checkbox/types.d.ts +32 -0
  63. package/dist/ui/components/controlled-buttons/ControlledButtons.stories.d.ts +32 -0
  64. package/dist/ui/components/controlled-buttons/ControlledButtons.stories.js +152 -0
  65. package/dist/ui/components/{buttons/FooterButton.svelte → controlled-buttons/ControlledButtons.svelte} +18 -67
  66. package/dist/ui/components/controlled-buttons/ControlledButtons.svelte.d.ts +4 -0
  67. package/dist/ui/components/controlled-buttons/index.d.ts +2 -0
  68. package/dist/ui/components/controlled-buttons/index.js +1 -0
  69. package/dist/ui/components/{buttons → controlled-buttons}/types.d.ts +11 -4
  70. package/dist/ui/components/copy-text/CopyText.stories.d.ts +70 -0
  71. package/dist/ui/components/copy-text/CopyText.stories.js +241 -0
  72. package/dist/ui/components/copy-text/CopyText.svelte +249 -0
  73. package/dist/ui/components/copy-text/CopyText.svelte.d.ts +4 -0
  74. package/dist/ui/components/copy-text/index.d.ts +2 -0
  75. package/dist/ui/components/copy-text/index.js +1 -0
  76. package/dist/ui/components/copy-text/types.d.ts +52 -0
  77. package/dist/ui/components/copy-text/types.js +1 -0
  78. package/dist/ui/components/divider/Divider.stories.svelte +134 -0
  79. package/dist/ui/components/{clickable/Clickable.stories.svelte.d.ts → divider/Divider.stories.svelte.d.ts} +4 -4
  80. package/dist/ui/components/divider/Divider.svelte +30 -0
  81. package/dist/ui/components/divider/Divider.svelte.d.ts +4 -0
  82. package/dist/ui/components/divider/index.d.ts +2 -0
  83. package/dist/ui/components/divider/index.js +1 -0
  84. package/dist/ui/components/divider/types.d.ts +23 -0
  85. package/dist/ui/components/divider/types.js +1 -0
  86. package/dist/ui/components/iframe/Iframe.stories.svelte +122 -0
  87. package/dist/ui/components/{ToggleItem.svelte.d.ts → iframe/Iframe.stories.svelte.d.ts} +7 -8
  88. package/dist/ui/components/iframe/Iframe.svelte +75 -0
  89. package/dist/ui/components/iframe/Iframe.svelte.d.ts +4 -0
  90. package/dist/ui/components/iframe/index.d.ts +2 -0
  91. package/dist/ui/components/iframe/index.js +1 -0
  92. package/dist/ui/components/iframe/types.d.ts +38 -0
  93. package/dist/ui/components/iframe/types.js +1 -0
  94. package/dist/ui/components/index.d.ts +13 -39
  95. package/dist/ui/components/index.js +13 -39
  96. package/dist/ui/components/input/Input.stories.d.ts +33 -0
  97. package/dist/ui/components/input/Input.stories.js +176 -0
  98. package/dist/ui/components/input/Input.svelte +358 -81
  99. package/dist/ui/components/input/types.d.ts +33 -1
  100. package/dist/ui/components/layout/Layout.stories.svelte +3 -3
  101. package/dist/ui/components/layout/Layout.svelte +10 -64
  102. package/dist/ui/components/layout/Layout.svelte.d.ts +2 -2
  103. package/dist/ui/components/layout/common/EditModeMessage.svelte +24 -12
  104. package/dist/ui/components/layout/{ExampleLayout.svelte → examples/ExampleLayout.svelte} +56 -39
  105. package/dist/ui/components/layout/examples/Wrapper.svelte +9 -0
  106. package/dist/ui/components/{Header.svelte.d.ts → layout/examples/Wrapper.svelte.d.ts} +4 -6
  107. package/dist/ui/components/layout/examples/index.d.ts +2 -0
  108. package/dist/ui/components/layout/examples/index.js +2 -0
  109. package/dist/ui/components/layout/index.d.ts +3 -2
  110. package/dist/ui/components/layout/index.js +2 -1
  111. package/dist/ui/components/layout/test-helpers/TestLayoutWithFooter.svelte +20 -0
  112. package/dist/ui/components/layout/test-helpers/TestLayoutWithFooter.svelte.d.ts +7 -0
  113. package/dist/ui/components/layout/types.d.ts +1 -10
  114. package/dist/ui/components/modal/Example.svelte +320 -0
  115. package/dist/ui/components/modal/Example.svelte.d.ts +3 -0
  116. package/dist/ui/components/modal/Modal.stories.svelte +18 -0
  117. package/dist/ui/components/modal/Modal.stories.svelte.d.ts +26 -0
  118. package/dist/ui/components/modal/Modal.svelte +490 -0
  119. package/dist/ui/components/modal/Modal.svelte.d.ts +130 -0
  120. package/dist/ui/components/modal/index.d.ts +2 -0
  121. package/dist/ui/components/modal/index.js +1 -0
  122. package/dist/ui/components/modal/types.d.ts +75 -0
  123. package/dist/ui/components/modal/types.js +1 -0
  124. package/dist/ui/components/notification/Notification.stories.svelte +239 -0
  125. package/dist/ui/components/{ToggleList.svelte.d.ts → notification/Notification.stories.svelte.d.ts} +9 -21
  126. package/dist/ui/components/notification/Notification.svelte +294 -0
  127. package/dist/ui/components/notification/Notification.svelte.d.ts +67 -0
  128. package/dist/ui/components/notification/index.d.ts +2 -0
  129. package/dist/ui/components/notification/index.js +1 -0
  130. package/dist/ui/components/notification/types.d.ts +68 -0
  131. package/dist/ui/components/notification/types.js +1 -0
  132. package/dist/ui/components/section/Section.stories.svelte +263 -0
  133. package/dist/ui/components/section/Section.stories.svelte.d.ts +27 -0
  134. package/dist/ui/components/section/Section.svelte +326 -0
  135. package/dist/ui/components/section/Section.svelte.d.ts +5 -0
  136. package/dist/ui/components/section/index.d.ts +2 -0
  137. package/dist/ui/components/section/index.js +1 -0
  138. package/dist/ui/components/section/types.d.ts +114 -0
  139. package/dist/ui/components/section/types.js +1 -0
  140. package/dist/ui/components/{ImageUpload.svelte → shared/ImageUpload.svelte} +3 -3
  141. package/dist/ui/components/{SelectBodyOrDivBlock.svelte → shared/SelectBodyOrDivBlock.svelte} +1 -1
  142. package/dist/ui/components/shared/index.d.ts +2 -0
  143. package/dist/ui/components/shared/index.js +2 -0
  144. package/dist/ui/components/text/Text.stories.svelte +67 -1
  145. package/dist/ui/components/text/Text.svelte +209 -8
  146. package/dist/ui/components/text/types.d.ts +4 -0
  147. package/dist/ui/index.css +33 -5
  148. package/dist/utils/animations/factory.d.ts +7 -0
  149. package/dist/utils/animations/factory.js +101 -0
  150. package/dist/utils/animations/index.d.ts +7 -0
  151. package/dist/utils/animations/index.js +62 -0
  152. package/dist/utils/animations/types.d.ts +39 -0
  153. package/dist/utils/animations/types.js +1 -0
  154. package/dist/utils/api/checkIfAppModeIsDesign.d.ts +1 -2
  155. package/dist/utils/api/checkIfAppModeIsDesign.js +1 -2
  156. package/dist/utils/api/clipboard/handlePaste.d.ts +6 -37
  157. package/dist/utils/api/clipboard/handlePaste.js +2 -6
  158. package/dist/utils/api/getAllAssets.d.ts +1 -2
  159. package/dist/utils/api/getAllAssets.js +1 -2
  160. package/dist/utils/api/getFinsweetComponentsEnvironment.d.ts +1 -2
  161. package/dist/utils/api/getFinsweetComponentsEnvironment.js +3 -6
  162. package/dist/utils/api/index.d.ts +0 -1
  163. package/dist/utils/api/index.js +0 -1
  164. package/dist/utils/api/insertWithXSCP.d.ts +1 -2
  165. package/dist/utils/api/insertWithXSCP.js +1 -2
  166. package/dist/utils/auth/crossWindowLogin.d.ts +3 -0
  167. package/dist/utils/auth/crossWindowLogin.js +3 -0
  168. package/dist/utils/auth/index.d.ts +9 -25
  169. package/dist/utils/auth/index.js +9 -25
  170. package/dist/utils/browser-storage/localStorage.d.ts +4 -12
  171. package/dist/utils/browser-storage/localStorage.js +4 -12
  172. package/dist/utils/browser-storage/sessionStorage.d.ts +4 -12
  173. package/dist/utils/browser-storage/sessionStorage.js +4 -12
  174. package/dist/utils/custom-code/api.d.ts +3 -7
  175. package/dist/utils/custom-code/api.js +3 -7
  176. package/dist/utils/custom-code/configs.d.ts +22 -0
  177. package/dist/utils/custom-code/configs.js +40 -0
  178. package/dist/utils/custom-code/index.d.ts +1 -0
  179. package/dist/utils/custom-code/index.js +1 -0
  180. package/dist/utils/helpers/capitalizeFirstLetter.d.ts +4 -0
  181. package/dist/utils/helpers/capitalizeFirstLetter.js +9 -0
  182. package/dist/utils/helpers/cleanupTooltipMessage.d.ts +1 -2
  183. package/dist/utils/helpers/cleanupTooltipMessage.js +1 -2
  184. package/dist/utils/helpers/getTimeNow.d.ts +4 -0
  185. package/dist/utils/helpers/getTimeNow.js +8 -0
  186. package/dist/utils/helpers/goto.d.ts +1 -4
  187. package/dist/utils/helpers/goto.js +2 -7
  188. package/dist/utils/helpers/index.d.ts +5 -0
  189. package/dist/utils/helpers/index.js +5 -0
  190. package/dist/utils/helpers/minifyCode.d.ts +10 -0
  191. package/dist/utils/helpers/minifyCode.js +73 -0
  192. package/dist/utils/helpers/noop.d.ts +1 -1
  193. package/dist/utils/helpers/noop.js +1 -1
  194. package/dist/utils/helpers/numbers.d.ts +4 -14
  195. package/dist/utils/helpers/numbers.js +4 -14
  196. package/dist/utils/helpers/objectsToModuleExports.d.ts +2 -4
  197. package/dist/utils/helpers/objectsToModuleExports.js +2 -3
  198. package/dist/utils/helpers/toHumanReadableList.d.ts +4 -0
  199. package/dist/utils/helpers/toHumanReadableList.js +11 -0
  200. package/dist/utils/helpers/trimText.d.ts +1 -8
  201. package/dist/utils/helpers/trimText.js +1 -8
  202. package/dist/utils/index.d.ts +5 -0
  203. package/dist/utils/index.js +5 -0
  204. package/dist/utils/logger/index.d.ts +0 -2
  205. package/dist/utils/logger/index.js +0 -2
  206. package/dist/utils/webflow-canvas/attributes/getAllWebflowElementAttributes.d.ts +1 -3
  207. package/dist/utils/webflow-canvas/attributes/getAllWebflowElementAttributes.js +1 -3
  208. package/dist/utils/webflow-canvas/attributes/getInstanceNamesFromObject.d.ts +1 -5
  209. package/dist/utils/webflow-canvas/attributes/getInstanceNamesFromObject.js +1 -5
  210. package/dist/utils/webflow-canvas/attributes/getWebflowElementAttribute.d.ts +1 -4
  211. package/dist/utils/webflow-canvas/attributes/getWebflowElementAttribute.js +1 -4
  212. package/dist/utils/webflow-canvas/attributes/getWebflowElementTextContent.d.ts +1 -3
  213. package/dist/utils/webflow-canvas/attributes/getWebflowElementTextContent.js +1 -3
  214. package/dist/utils/webflow-canvas/attributes/removeWebflowElementAttribute.d.ts +1 -4
  215. package/dist/utils/webflow-canvas/attributes/removeWebflowElementAttribute.js +1 -4
  216. package/dist/utils/webflow-canvas/attributes/setStyles.d.ts +1 -3
  217. package/dist/utils/webflow-canvas/attributes/setStyles.js +1 -3
  218. package/dist/utils/webflow-canvas/attributes/setWebflowElementAttribute.d.ts +1 -8
  219. package/dist/utils/webflow-canvas/attributes/setWebflowElementAttribute.js +1 -13
  220. package/dist/utils/webflow-canvas/findInstanceElement.d.ts +0 -6
  221. package/dist/utils/webflow-canvas/findInstanceElement.js +1 -7
  222. package/dist/utils/webflow-canvas/getAllChildren.d.ts +16 -0
  223. package/dist/utils/webflow-canvas/getAllChildren.js +65 -0
  224. package/dist/utils/webflow-canvas/getAllPages.d.ts +3 -10
  225. package/dist/utils/webflow-canvas/getAllPages.js +3 -10
  226. package/dist/utils/webflow-canvas/getElementClassList.d.ts +9 -0
  227. package/dist/utils/webflow-canvas/getElementClassList.js +19 -0
  228. package/dist/utils/webflow-canvas/getSiteStagingUrl.d.ts +1 -4
  229. package/dist/utils/webflow-canvas/getSiteStagingUrl.js +1 -4
  230. package/dist/utils/webflow-canvas/index.d.ts +3 -0
  231. package/dist/utils/webflow-canvas/index.js +3 -0
  232. package/package.json +14 -2
  233. package/dist/router/README.md +0 -397
  234. package/dist/stores/globalStore.d.ts +0 -10
  235. package/dist/stores/globalStore.js +0 -10
  236. package/dist/ui/components/ButtonGroup.svelte.d.ts +0 -28
  237. package/dist/ui/components/Checkbox.svelte +0 -94
  238. package/dist/ui/components/Checkbox.svelte.d.ts +0 -36
  239. package/dist/ui/components/Copy.svelte +0 -329
  240. package/dist/ui/components/Copy.svelte.d.ts +0 -35
  241. package/dist/ui/components/CustomModal.svelte +0 -192
  242. package/dist/ui/components/CustomModal.svelte.d.ts +0 -45
  243. package/dist/ui/components/DisableInEditMode.svelte +0 -66
  244. package/dist/ui/components/DisableInEditMode.svelte.d.ts +0 -33
  245. package/dist/ui/components/Divider.svelte +0 -31
  246. package/dist/ui/components/Divider.svelte.d.ts +0 -31
  247. package/dist/ui/components/Header.svelte +0 -30
  248. package/dist/ui/components/Iframe.svelte +0 -89
  249. package/dist/ui/components/Iframe.svelte.d.ts +0 -40
  250. package/dist/ui/components/InjectComponent.svelte +0 -297
  251. package/dist/ui/components/InjectComponent.svelte.d.ts +0 -27
  252. package/dist/ui/components/Modal.svelte +0 -139
  253. package/dist/ui/components/Modal.svelte.d.ts +0 -42
  254. package/dist/ui/components/Navbar.svelte +0 -132
  255. package/dist/ui/components/Navbar.svelte.d.ts +0 -29
  256. package/dist/ui/components/NoSettingsNeeded.svelte +0 -31
  257. package/dist/ui/components/Notification.svelte +0 -193
  258. package/dist/ui/components/Notification.svelte.d.ts +0 -64
  259. package/dist/ui/components/PlusMinusButton.svelte +0 -91
  260. package/dist/ui/components/PlusMinusButton.svelte.d.ts +0 -22
  261. package/dist/ui/components/PreviewBar.svelte +0 -40
  262. package/dist/ui/components/PreviewBar.svelte.d.ts +0 -20
  263. package/dist/ui/components/ScrollableContent.svelte +0 -18
  264. package/dist/ui/components/ScrollableContent.svelte.d.ts +0 -31
  265. package/dist/ui/components/Section.svelte +0 -97
  266. package/dist/ui/components/Section.svelte.d.ts +0 -50
  267. package/dist/ui/components/Spacer.svelte +0 -9
  268. package/dist/ui/components/Spacer.svelte.d.ts +0 -22
  269. package/dist/ui/components/SpinnerPlusMinus.svelte +0 -75
  270. package/dist/ui/components/SpinnerPlusMinus.svelte.d.ts +0 -23
  271. package/dist/ui/components/SpinnerUpDown.svelte +0 -194
  272. package/dist/ui/components/SpinnerUpDown.svelte.d.ts +0 -31
  273. package/dist/ui/components/Tabs.svelte +0 -71
  274. package/dist/ui/components/Tabs.svelte.d.ts +0 -26
  275. package/dist/ui/components/ToggleItem.svelte +0 -29
  276. package/dist/ui/components/ToggleList.svelte +0 -57
  277. package/dist/ui/components/buttons/FooterButton.svelte.d.ts +0 -10
  278. package/dist/ui/components/buttons/index.d.ts +0 -5
  279. package/dist/ui/components/buttons/index.js +0 -5
  280. package/dist/ui/components/clickable/Clickable.stories.svelte +0 -213
  281. package/dist/ui/components/clickable/Clickable.svelte +0 -93
  282. package/dist/ui/components/clickable/Clickable.svelte.d.ts +0 -4
  283. package/dist/ui/components/clickable/index.d.ts +0 -2
  284. package/dist/ui/components/clickable/index.js +0 -1
  285. package/dist/ui/components/clickable/types.d.ts +0 -17
  286. package/dist/utils/api/copyPaste/index.d.ts +0 -18
  287. /package/dist/router/{Link.svelte.d.ts → providers/Link.svelte.d.ts} +0 -0
  288. /package/dist/ui/components/{buttons → button-group}/types.js +0 -0
  289. /package/dist/ui/components/{clickable → checkbox}/types.js +0 -0
  290. /package/dist/{utils/api/copyPaste/index.js → ui/components/controlled-buttons/types.js} +0 -0
  291. /package/dist/ui/components/layout/{ExampleLayout.svelte.d.ts → examples/ExampleLayout.svelte.d.ts} +0 -0
  292. /package/dist/ui/components/{ImageUpload.svelte.d.ts → shared/ImageUpload.svelte.d.ts} +0 -0
  293. /package/dist/ui/components/{SelectBodyOrDivBlock.svelte.d.ts → shared/SelectBodyOrDivBlock.svelte.d.ts} +0 -0
@@ -1,31 +0,0 @@
1
- import 'simplebar/dist/simplebar.min.css';
2
- import 'simplebar';
3
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
4
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
5
- $$bindings?: Bindings;
6
- } & Exports;
7
- (internal: unknown, props: Props & {
8
- $$events?: Events;
9
- $$slots?: Slots;
10
- }): Exports & {
11
- $set?: any;
12
- $on?: any;
13
- };
14
- z_$$bindings?: Bindings;
15
- }
16
- type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
17
- default: any;
18
- } ? Props extends Record<string, never> ? any : {
19
- children?: any;
20
- } : {});
21
- declare const ScrollableContent: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
22
- className?: string;
23
- }, {
24
- default: {};
25
- }>, {
26
- [evt: string]: CustomEvent<any>;
27
- }, {
28
- default: {};
29
- }, {}, string>;
30
- type ScrollableContent = InstanceType<typeof ScrollableContent>;
31
- export default ScrollableContent;
@@ -1,97 +0,0 @@
1
- <script lang="ts">
2
- /**
3
- * Whether to hide the section
4
- */
5
- export let hide = false;
6
-
7
- /**
8
- * Whether to show borders
9
- */
10
- export let borders: Array<'top' | 'bottom' | 'left' | 'right'> = [];
11
- /**
12
- * Whether to show a active state
13
- */
14
- export let active = false;
15
- /**
16
- * Whether to show a clickable state
17
- */
18
- export let clickable = false;
19
-
20
- /**
21
- * Custom class name
22
- */
23
- export let className = '';
24
- /**
25
- * Whether to show a disabled state
26
- */
27
- export let disabled = false;
28
- </script>
29
-
30
- {#if !hide}
31
- <div
32
- class="section-wrap {active ? 'active' : ''} {clickable ? 'clickable' : ''} {className}"
33
- on:click
34
- on:mouseover
35
- on:mouseleave
36
- class:disabled
37
- role="button"
38
- tabindex="-1"
39
- on:focus={() => {}}
40
- on:keydown={() => {}}
41
- class:border-top={borders.includes('top')}
42
- class:border-bottom={borders.includes('bottom')}
43
- class:border-left={borders.includes('left')}
44
- class:border-right={borders.includes('right')}
45
- >
46
- <slot></slot>
47
- </div>
48
- {/if}
49
-
50
- <style>
51
- .section-wrap {
52
- display: flex;
53
- padding: var(--Spacing-12, 12px);
54
- flex-direction: column;
55
- align-items: flex-start;
56
- gap: var(--Spacing-8, 8px);
57
- align-self: stretch;
58
- position: relative;
59
- border: 1px solid transparent;
60
- }
61
-
62
- .section-wrap :global(.dropdown-wrapper) {
63
- align-self: stretch;
64
- justify-content: space-between;
65
- width: 100%;
66
- }
67
-
68
- .section-wrap.border-top {
69
- border-top: 1px solid var(--border1);
70
- }
71
- .section-wrap.border-left {
72
- border-left: 1px solid var(--border1);
73
- }
74
- .section-wrap.border-right {
75
- border-right: 1px solid var(--border1);
76
- }
77
- .section-wrap.border-bottom {
78
- border-bottom: 1px solid var(--border1);
79
- }
80
-
81
- .clickable:hover {
82
- background: var(--defaultLightHover);
83
- }
84
- .section-wrap.active {
85
- border-bottom: 1px solid var(--background2);
86
- background: var(--defaultLightActive);
87
- }
88
-
89
- .clickable {
90
- cursor: pointer;
91
- }
92
-
93
- .section-wrap.disabled {
94
- opacity: 0.5;
95
- cursor: not-allowed;
96
- }
97
- </style>
@@ -1,50 +0,0 @@
1
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
- $$bindings?: Bindings;
4
- } & Exports;
5
- (internal: unknown, props: Props & {
6
- $$events?: Events;
7
- $$slots?: Slots;
8
- }): Exports & {
9
- $set?: any;
10
- $on?: any;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
15
- default: any;
16
- } ? Props extends Record<string, never> ? any : {
17
- children?: any;
18
- } : {});
19
- declare const Section: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
20
- /**
21
- * Whether to hide the section
22
- */ hide?: boolean;
23
- /**
24
- * Whether to show borders
25
- */ borders?: Array<"top" | "bottom" | "left" | "right">;
26
- /**
27
- * Whether to show a active state
28
- */ active?: boolean;
29
- /**
30
- * Whether to show a clickable state
31
- */ clickable?: boolean;
32
- /**
33
- * Custom class name
34
- */ className?: string;
35
- /**
36
- * Whether to show a disabled state
37
- */ disabled?: boolean;
38
- }, {
39
- default: {};
40
- }>, {
41
- click: MouseEvent;
42
- mouseover: MouseEvent;
43
- mouseleave: MouseEvent;
44
- } & {
45
- [evt: string]: CustomEvent<any>;
46
- }, {
47
- default: {};
48
- }, {}, string>;
49
- type Section = InstanceType<typeof Section>;
50
- export default Section;
@@ -1,9 +0,0 @@
1
- <script lang="ts">
2
- export let height = '100%';
3
- export let width = '100%';
4
- export let backgroundColor = '';
5
- </script>
6
-
7
- <div
8
- style={`min-height: ${height}; min-width: ${width}; background-color: ${backgroundColor};`}
9
- ></div>
@@ -1,22 +0,0 @@
1
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
- $$bindings?: Bindings;
4
- } & Exports;
5
- (internal: unknown, props: Props & {
6
- $$events?: Events;
7
- $$slots?: Slots;
8
- }): Exports & {
9
- $set?: any;
10
- $on?: any;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- declare const Spacer: $$__sveltets_2_IsomorphicComponent<{
15
- height?: string;
16
- width?: string;
17
- backgroundColor?: string;
18
- }, {
19
- [evt: string]: CustomEvent<any>;
20
- }, {}, {}, string>;
21
- type Spacer = InstanceType<typeof Spacer>;
22
- export default Spacer;
@@ -1,75 +0,0 @@
1
- <script lang="ts">
2
- //TODO
3
- // - add min/max values
4
-
5
- import { createEventDispatcher } from 'svelte';
6
-
7
- import PlusMinusButton from './PlusMinusButton.svelte';
8
-
9
- export let label = 'label';
10
- export let counter = 0;
11
-
12
- const dispatch = createEventDispatcher<{
13
- counterChange: number;
14
- }>();
15
- </script>
16
-
17
- <div class="flex-vertical align-center">
18
- <div class="input_grid">
19
- <PlusMinusButton
20
- on:click={(e) => {
21
- counter = counter + e.detail; //e.detail is -1
22
- dispatch('counterChange', counter);
23
- }}
24
- delta={-1}
25
- />
26
- <input
27
- type="number"
28
- min="0"
29
- class="input_field"
30
- bind:value={counter}
31
- on:input={() => {
32
- dispatch('counterChange', counter);
33
- }}
34
- />
35
- <PlusMinusButton
36
- on:click={(e) => {
37
- counter = counter + e.detail; //e.detail is +1
38
- dispatch('counterChange', counter);
39
- }}
40
- delta={1}
41
- />
42
- </div>
43
- <div class="tiny-label">{label}</div>
44
- </div>
45
-
46
- <style>
47
- .input_grid {
48
- position: relative;
49
- flex-basis: 100%;
50
- display: grid;
51
- grid-auto-flow: column;
52
- grid-auto-columns: 1fr;
53
- column-gap: 1px;
54
- background: var(--border2);
55
- border-radius: 4px;
56
- box-shadow: var(--border2) 0px 0px 0px 1px inset;
57
- }
58
-
59
- .input_field {
60
- -webkit-box-align: center;
61
- align-items: center;
62
- color: var(--text1);
63
- font-size: var(--font-size-small);
64
- max-width: 1.5rem;
65
- background-color: var(--background5);
66
- border-top: 1px solid var(--border2);
67
- border-bottom: 1px solid var(--border2);
68
- display: flex;
69
- -webkit-box-pack: center;
70
- justify-content: center;
71
- height: 24px;
72
- opacity: 1;
73
- text-align: center;
74
- }
75
- </style>
@@ -1,23 +0,0 @@
1
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
- $$bindings?: Bindings;
4
- } & Exports;
5
- (internal: unknown, props: Props & {
6
- $$events?: Events;
7
- $$slots?: Slots;
8
- }): Exports & {
9
- $set?: any;
10
- $on?: any;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- declare const SpinnerPlusMinus: $$__sveltets_2_IsomorphicComponent<{
15
- label?: string;
16
- counter?: number;
17
- }, {
18
- counterChange: CustomEvent<number>;
19
- } & {
20
- [evt: string]: CustomEvent<any>;
21
- }, {}, {}, string>;
22
- type SpinnerPlusMinus = InstanceType<typeof SpinnerPlusMinus>;
23
- export default SpinnerPlusMinus;
@@ -1,194 +0,0 @@
1
- <script lang="ts">
2
- import { parseNumericAttribute } from '../../utils';
3
-
4
- export let value: number = 0;
5
- export let displayedValue = ''; // Will hold the display value as a string
6
- export let min = 0;
7
- export let max = 9999;
8
- export let step = 1;
9
- export let id = '';
10
- export let placeholder = '0';
11
- export let width = '100%';
12
- export let disabled = false;
13
-
14
- import { createEventDispatcher } from 'svelte';
15
- const dispatch = createEventDispatcher<{
16
- spinnerChange: number;
17
- blur: number;
18
- }>();
19
-
20
- // This will update the displayedValue when 'value' is externally modified
21
- $: displayedValue = value !== undefined ? value.toString() : '';
22
-
23
- /**
24
- * Increment the value by the step amount
25
- */
26
- const increment = () => {
27
- if (value < max) {
28
- value = Math.min(max, value + step);
29
-
30
- dispatch('spinnerChange', value);
31
- }
32
- };
33
- /**
34
- * Decrement the value by the step amount
35
- */
36
- const decrement = () => {
37
- if (value > min) {
38
- value = Math.max(min, value - step);
39
- dispatch('spinnerChange', value);
40
- }
41
- };
42
-
43
- /**
44
- * Manually update the value when the input is changed
45
- * @param event
46
- */
47
- const manualUpdate = (event: Event) => {
48
- const inputElem = event.target as HTMLInputElement;
49
- let newValue = inputElem.value;
50
-
51
- if (newValue !== '0') {
52
- newValue = newValue.replace(/^0+/, ''); // Remove leading zeros
53
- }
54
-
55
- // If newValue is empty, don't update the value
56
- if (newValue === '') {
57
- displayedValue = '';
58
- inputElem.value = '';
59
-
60
- dispatch('spinnerChange', value);
61
-
62
- return;
63
- }
64
-
65
- const numValue = parseNumericAttribute(newValue, 0);
66
- // Check for NaN and ensure the value is within the min and max bounds
67
- if (!isNaN(numValue)) {
68
- value = Math.max(min, Math.min(max, numValue));
69
- // If value exceeds max, update the displayed value to match max
70
- if (numValue > max) {
71
- displayedValue = max.toString();
72
- inputElem.value = max.toString();
73
- }
74
- } else {
75
- // If parsed value is NaN, reset to min
76
- value = min;
77
- }
78
-
79
- dispatch('spinnerChange', value);
80
- };
81
-
82
- const blurEvent = (e: Event) => {
83
- dispatch('blur', value);
84
- };
85
- </script>
86
-
87
- <div class="spinner-container" class:disabled style="width: {width};">
88
- <input
89
- {disabled}
90
- {id}
91
- type="number"
92
- {min}
93
- {max}
94
- {step}
95
- bind:value={displayedValue}
96
- on:input={manualUpdate}
97
- on:blur={blurEvent}
98
- {placeholder}
99
- />
100
- <div class="buttons-container">
101
- <button on:blur={blurEvent} {disabled} class:disabled on:click={increment} class="increment-btn"
102
- >&#8963;</button
103
- >
104
- <button on:blur={blurEvent} {disabled} class:disabled on:click={decrement} class="decrement-btn"
105
- >&#8963;</button
106
- >
107
- </div>
108
- </div>
109
-
110
- <style>
111
- input::placeholder {
112
- color: var(--text2) !important;
113
- opacity: 1; /* Firefox */
114
- }
115
-
116
- input::-ms-input-placeholder {
117
- /* Edge 12 -18 */
118
- color: var(--text2) !important;
119
- }
120
- .spinner-container {
121
- display: flex;
122
- height: 1.5rem;
123
- overflow: hidden;
124
- border-radius: var(--border-radius);
125
- border: 1px solid var(--border1, #212121);
126
- background: var(--background1, #2b2b2b);
127
- /* input-inner-shadow */
128
- box-shadow:
129
- 0px 1px 1px -1px rgba(0, 0, 0, 0.13) inset,
130
- 0px 3px 3px -3px rgba(0, 0, 0, 0.17) inset,
131
- 0px 4px 4px -4px rgba(0, 0, 0, 0.17) inset,
132
- 0px 8px 8px -8px rgba(0, 0, 0, 0.17) inset,
133
- 0px 12px 12px -12px rgba(0, 0, 0, 0.13) inset,
134
- 0px 16px 16px -16px rgba(0, 0, 0, 0.13) inset;
135
- }
136
-
137
- .spinner-container:focus-within {
138
- /* Styles for the buttons container when input is focused */
139
- border: 1px solid var(--blueBorder);
140
- }
141
-
142
- .disabled {
143
- opacity: 0.75;
144
- pointer-events: none;
145
- cursor: not-allowed;
146
- }
147
-
148
- .buttons-container {
149
- display: flex;
150
- flex-direction: column;
151
- justify-content: center;
152
- gap: 1px;
153
- background-color: var(--border1);
154
- }
155
-
156
- .increment-btn {
157
- border-radius: 0 1px 0 0;
158
- }
159
-
160
- .decrement-btn {
161
- transform: rotate(180deg);
162
- border-radius: 1px 0 0 0;
163
- }
164
-
165
- input[type='number'] {
166
- width: 100%;
167
- height: 100%;
168
- color: var(--actionPrimaryText);
169
- text-align: left;
170
- border: 0;
171
- padding-left: var(--padding-small);
172
- }
173
-
174
- input[type='number']:focus {
175
- outline: none;
176
- }
177
-
178
- button {
179
- border: none;
180
- width: 1rem;
181
- background-color: var(--actionSecondaryBackground);
182
- color: var(--text2);
183
- font-size: 0.8em;
184
- line-height: 1;
185
- height: 48%;
186
- display: grid;
187
- place-items: center;
188
- padding: 2px 0;
189
- }
190
-
191
- button:hover {
192
- background-color: var(--hoverColor);
193
- }
194
- </style>
@@ -1,31 +0,0 @@
1
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
- $$bindings?: Bindings;
4
- } & Exports;
5
- (internal: unknown, props: Props & {
6
- $$events?: Events;
7
- $$slots?: Slots;
8
- }): Exports & {
9
- $set?: any;
10
- $on?: any;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- declare const SpinnerUpDown: $$__sveltets_2_IsomorphicComponent<{
15
- value?: number;
16
- displayedValue?: string;
17
- min?: number;
18
- max?: number;
19
- step?: number;
20
- id?: string;
21
- placeholder?: string;
22
- width?: string;
23
- disabled?: boolean;
24
- }, {
25
- spinnerChange: CustomEvent<number>;
26
- blur: CustomEvent<number>;
27
- } & {
28
- [evt: string]: CustomEvent<any>;
29
- }, {}, {}, string>;
30
- type SpinnerUpDown = InstanceType<typeof SpinnerUpDown>;
31
- export default SpinnerUpDown;
@@ -1,71 +0,0 @@
1
- <script lang="ts">
2
- import type { Component } from 'svelte';
3
-
4
- export let items: {
5
- value: number;
6
- label: string;
7
- component: Component;
8
- }[] = [];
9
- export let activeTabValue = 1;
10
-
11
- /**
12
- * Handles the click event for the tab.
13
- * @param tabValue
14
- */
15
- const handleClick = (tabValue: number) => () => {
16
- activeTabValue = tabValue;
17
- };
18
- </script>
19
-
20
- <ul>
21
- {#each items as item (item.value)}
22
- <li class={activeTabValue === item.value ? 'active' : ''}>
23
- <button on:click={handleClick(item.value)}>{item.label}</button>
24
- </li>
25
- {/each}
26
- </ul>
27
- {#each items as item (item.value)}
28
- {#if activeTabValue === item.value}
29
- <div class="box">
30
- <svelte:component this={item.component} />
31
- </div>
32
- {/if}
33
- {/each}
34
-
35
- <style>
36
- .box {
37
- padding-top: 12px;
38
- border-radius: 0 0 0.5rem 0.5rem;
39
- border-top: 0;
40
- }
41
- ul {
42
- display: flex;
43
- flex-wrap: wrap;
44
- padding-left: 0;
45
- margin-bottom: 0;
46
- list-style: none;
47
- border-bottom: 1px solid #dee2e6;
48
- }
49
- li {
50
- margin-bottom: -1px;
51
- }
52
-
53
- button {
54
- border: 1px solid transparent;
55
- border-top-left-radius: 0.25rem;
56
- border-top-right-radius: 0.25rem;
57
- display: block;
58
- padding: 0.5rem 1rem;
59
- cursor: pointer;
60
- }
61
-
62
- button:hover {
63
- border-color: #e9ecef #e9ecef #dee2e6;
64
- }
65
-
66
- li.active > button {
67
- color: #495057;
68
- background-color: #fff;
69
- border-color: #dee2e6 #dee2e6 #fff;
70
- }
71
- </style>
@@ -1,26 +0,0 @@
1
- import type { Component } from 'svelte';
2
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
- $$bindings?: Bindings;
5
- } & Exports;
6
- (internal: unknown, props: Props & {
7
- $$events?: Events;
8
- $$slots?: Slots;
9
- }): Exports & {
10
- $set?: any;
11
- $on?: any;
12
- };
13
- z_$$bindings?: Bindings;
14
- }
15
- declare const Tabs: $$__sveltets_2_IsomorphicComponent<{
16
- items?: {
17
- value: number;
18
- label: string;
19
- component: Component;
20
- }[];
21
- activeTabValue?: number;
22
- }, {
23
- [evt: string]: CustomEvent<any>;
24
- }, {}, {}, string>;
25
- type Tabs = InstanceType<typeof Tabs>;
26
- export default Tabs;
@@ -1,29 +0,0 @@
1
- <script>
2
- import { BoxAddIcon, CheckCircleIcon } from '../icons';
3
- export let title = 'Toggle Item Title';
4
- export let isActive = false;
5
- </script>
6
-
7
- <div class="toggle-item_title-row">
8
- <BoxAddIcon />
9
- {title}
10
- {#if isActive}
11
- <CheckCircleIcon />
12
- {/if}
13
- </div>
14
-
15
- <style>
16
- .toggle-item_title-row {
17
- display: flex;
18
- flex-direction: row;
19
- align-items: center;
20
- justify-content: start;
21
- background-color: var(--background3);
22
- border-bottom: 1px solid var(--background5);
23
- color: var(--text1);
24
- padding: 6px 10px;
25
- gap: 8px;
26
- font-size: var(--font-size-small);
27
- font-weight: 400;
28
- }
29
- </style>