@histoire/controls 0.17.16 → 1.0.0-alpha.1

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 (117) hide show
  1. package/.histoire/dist/__sandbox.html +16 -0
  2. package/.histoire/dist/assets/BaseEmpty.d30f3079.js +11 -0
  3. package/.histoire/dist/assets/HomeView.8e044be6.js +24 -0
  4. package/.histoire/dist/assets/HstCheckbox.story.3d04d85b.js +144 -0
  5. package/.histoire/dist/assets/HstColorShades.story.68cf74d1.js +532 -0
  6. package/.histoire/dist/assets/HstCopyIcon.e40e725e.js +51 -0
  7. package/.histoire/dist/assets/HstNumber.story.1e1964ff.js +160 -0
  8. package/.histoire/dist/assets/HstSelect.story.04860383.js +277 -0
  9. package/.histoire/dist/assets/HstText.story.c915d831.js +137 -0
  10. package/.histoire/dist/assets/HstTextarea.story.802b9c26.js +105 -0
  11. package/.histoire/dist/assets/HstTokenGrid.story.025819d6.js +148 -0
  12. package/.histoire/dist/assets/HstTokenList.story.d3aa6575.js +176 -0
  13. package/.histoire/dist/assets/HstWrapper.246b6982.js +56 -0
  14. package/.histoire/dist/assets/SearchPane.daa2675c.js +426 -0
  15. package/.histoire/dist/assets/StoryView.2f64dad1.js +2260 -0
  16. package/.histoire/dist/assets/bundle-main.784e5bf7.js +1156 -0
  17. package/.histoire/dist/assets/bundle-sandbox.5e153933.js +84 -0
  18. package/.histoire/dist/assets/const.268165fd.js +658 -0
  19. package/.histoire/dist/assets/global-components.6736b2a9.js +5722 -0
  20. package/.histoire/dist/assets/search-docs-data.b9a75539.js +6 -0
  21. package/.histoire/dist/assets/style.04507241.css +2504 -0
  22. package/.histoire/dist/assets/vendor.2833ae3d.js +28970 -0
  23. package/.histoire/dist/index.html +16 -0
  24. package/dist/components/HstCopyIcon.vue.d.ts +3 -12
  25. package/dist/components/HstWrapper.vue.d.ts +4 -27
  26. package/dist/components/button/HstButton.story.vue.d.ts +1 -1
  27. package/dist/components/button/HstButton.vue.d.ts +3 -12
  28. package/dist/components/button/HstButtonGroup.story.vue.d.ts +1 -1
  29. package/dist/components/button/HstButtonGroup.vue.d.ts +7 -16
  30. package/dist/components/checkbox/HstCheckbox.story.vue.d.ts +1 -1
  31. package/dist/components/checkbox/HstCheckbox.vue.d.ts +5 -14
  32. package/dist/components/checkbox/HstCheckboxList.story.vue.d.ts +1 -1
  33. package/dist/components/checkbox/HstCheckboxList.vue.d.ts +7 -16
  34. package/dist/components/checkbox/HstSimpleCheckbox.story.vue.d.ts +1 -1
  35. package/dist/components/checkbox/HstSimpleCheckbox.vue.d.ts +5 -14
  36. package/dist/components/colorselect/HstColorSelect.story.vue.d.ts +1 -1
  37. package/dist/components/colorselect/HstColorSelect.vue.d.ts +5 -14
  38. package/dist/components/design-tokens/HstColorShades.story.vue.d.ts +1 -1
  39. package/dist/components/design-tokens/HstColorShades.vue.d.ts +3 -12
  40. package/dist/components/design-tokens/HstTokenGrid.story.vue.d.ts +1 -1
  41. package/dist/components/design-tokens/HstTokenGrid.vue.d.ts +5 -28
  42. package/dist/components/design-tokens/HstTokenList.story.vue.d.ts +1 -1
  43. package/dist/components/design-tokens/HstTokenList.vue.d.ts +4 -13
  44. package/dist/components/json/HstJson.story.vue.d.ts +1 -1
  45. package/dist/components/json/HstJson.vue.d.ts +5 -14
  46. package/dist/components/number/HstNumber.story.vue.d.ts +1 -1
  47. package/dist/components/number/HstNumber.vue.d.ts +5 -14
  48. package/dist/components/radio/HstRadio.story.vue.d.ts +1 -1
  49. package/dist/components/radio/HstRadio.vue.d.ts +7 -16
  50. package/dist/components/select/CustomSelect.vue.d.ts +7 -16
  51. package/dist/components/select/HstSelect.story.vue.d.ts +1 -1
  52. package/dist/components/select/HstSelect.vue.d.ts +7 -16
  53. package/dist/components/slider/HstSlider.story.vue.d.ts +1 -1
  54. package/dist/components/slider/HstSlider.vue.d.ts +5 -14
  55. package/dist/components/text/HstText.story.vue.d.ts +1 -1
  56. package/dist/components/text/HstText.vue.d.ts +5 -14
  57. package/dist/components/textarea/HstTextarea.story.vue.d.ts +1 -1
  58. package/dist/components/textarea/HstTextarea.vue.d.ts +5 -14
  59. package/dist/index.d.ts +736 -2492
  60. package/dist/index.es.css +1 -0
  61. package/dist/index.es.js +5281 -4823
  62. package/dist/style-standalone.css +74 -66
  63. package/dist/utils.d.ts +1 -1
  64. package/package.json +32 -32
  65. package/src/components/HstCopyIcon.vue +2 -2
  66. package/src/components/HstWrapper.vue +1 -2
  67. package/src/components/button/HstButton.story.vue +1 -1
  68. package/src/components/button/HstButtonGroup.story.vue +2 -2
  69. package/src/components/button/HstButtonGroup.vue +8 -5
  70. package/src/components/checkbox/HstCheckbox.spec.ts +3 -3
  71. package/src/components/checkbox/HstCheckbox.story.vue +1 -1
  72. package/src/components/checkbox/HstCheckbox.vue +2 -2
  73. package/src/components/checkbox/HstCheckboxList.story.vue +1 -1
  74. package/src/components/checkbox/HstCheckboxList.vue +9 -6
  75. package/src/components/checkbox/HstSimpleCheckbox.story.vue +1 -1
  76. package/src/components/checkbox/HstSimpleCheckbox.vue +2 -2
  77. package/src/components/checkbox/__snapshots__/HstCheckbox.spec.ts.snap +4 -0
  78. package/src/components/colorselect/HstColorSelect.vue +1 -4
  79. package/src/components/design-tokens/HstColorShades.story.vue +2 -2
  80. package/src/components/design-tokens/HstColorShades.vue +3 -3
  81. package/src/components/design-tokens/HstTokenGrid.story.vue +6 -6
  82. package/src/components/design-tokens/HstTokenGrid.vue +1 -1
  83. package/src/components/design-tokens/HstTokenList.story.vue +23 -23
  84. package/src/components/json/HstJson.story.vue +1 -1
  85. package/src/components/json/HstJson.vue +21 -18
  86. package/src/components/number/HstNumber.story.vue +1 -1
  87. package/src/components/number/HstNumber.vue +8 -8
  88. package/src/components/radio/HstRadio.story.vue +1 -1
  89. package/src/components/radio/HstRadio.vue +7 -5
  90. package/src/components/select/CustomSelect.vue +10 -8
  91. package/src/components/select/HstSelect.story.vue +1 -1
  92. package/src/components/select/HstSelect.vue +1 -1
  93. package/src/components/slider/HstSlider.vue +4 -4
  94. package/src/components/text/HstText.story.vue +1 -1
  95. package/src/components/textarea/HstTextarea.story.vue +1 -1
  96. package/src/index.ts +8 -8
  97. package/tailwind.config.cjs +1 -1
  98. package/tsconfig.json +26 -25
  99. package/vite.config.ts +9 -9
  100. package/dist/style.css +0 -1
  101. package/histoire-dist/__sandbox.html +0 -15
  102. package/histoire-dist/assets/BaseEmpty.a84c14c8.js +0 -1
  103. package/histoire-dist/assets/HomeView.f524bd4b.js +0 -1
  104. package/histoire-dist/assets/HstCheckbox.story.9f622545.js +0 -1
  105. package/histoire-dist/assets/HstInput.story.945401ce.js +0 -1
  106. package/histoire-dist/assets/SearchModal.76c035f2.js +0 -1
  107. package/histoire-dist/assets/StoryView.e4c41518.js +0 -15
  108. package/histoire-dist/assets/global-components.84d0ab22.js +0 -1
  109. package/histoire-dist/assets/histoire-text-dark.a529813a.svg +0 -89
  110. package/histoire-dist/assets/histoire-text.1d4474b5.svg +0 -89
  111. package/histoire-dist/assets/index.58f51dd0.js +0 -1
  112. package/histoire-dist/assets/preview-settings.a634d101.js +0 -1
  113. package/histoire-dist/assets/sandbox.2c60450a.js +0 -1
  114. package/histoire-dist/assets/style.7657d2ac.css +0 -1
  115. package/histoire-dist/assets/vendor.70a554f6.js +0 -9
  116. package/histoire-dist/index.html +0 -15
  117. /package/{histoire-dist/assets/histoire.8af7bd1f.svg → .histoire/dist/histoire.svg} +0 -0
@@ -0,0 +1,84 @@
1
+ import { S as reactive, aa as parseQuery, r as ref, D as createApp, E as createPinia, w as watch, c as computed, p as onMounted, _ as h } from "./vendor.2833ae3d.js";
2
+ import { m as mapFile, f as files, r as registerGlobalComponents, b as toRawDeep, h as histoireConfig, i as isDark, d as applyStateToVariant } from "./global-components.6736b2a9.js";
3
+ import { S as STATE_SYNC, P as PREVIEW_SETTINGS_SYNC, a as SANDBOX_READY, _ as _sfc_main } from "./const.268165fd.js";
4
+ var sandbox = "";
5
+ const receivedSettings = reactive({});
6
+ function applyPreviewSettings(settings) {
7
+ Object.assign(receivedSettings, settings);
8
+ }
9
+ const query = parseQuery(window.location.search);
10
+ const file = ref(mapFile(files.find((f) => f.id === query.storyId)));
11
+ const app = createApp({
12
+ name: "SandboxApp",
13
+ setup() {
14
+ const story = computed(() => file.value.story);
15
+ const variant = computed(() => {
16
+ var _a;
17
+ return (_a = story.value) == null ? void 0 : _a.variants.find((v) => v.id === query.variantId);
18
+ });
19
+ let synced = false;
20
+ let mounted = false;
21
+ window.addEventListener("message", (event) => {
22
+ var _a, _b;
23
+ if (((_a = event.data) == null ? void 0 : _a.type) === STATE_SYNC) {
24
+ if (!mounted)
25
+ return;
26
+ synced = true;
27
+ applyStateToVariant(variant.value, event.data.state);
28
+ } else if (((_b = event.data) == null ? void 0 : _b.type) === PREVIEW_SETTINGS_SYNC) {
29
+ applyPreviewSettings(event.data.settings);
30
+ }
31
+ });
32
+ watch(() => variant.value.state, (value) => {
33
+ var _a;
34
+ if (synced && mounted) {
35
+ synced = false;
36
+ return;
37
+ }
38
+ (_a = window.parent) == null ? void 0 : _a.postMessage({
39
+ type: STATE_SYNC,
40
+ state: toRawDeep(value)
41
+ });
42
+ }, {
43
+ deep: true
44
+ });
45
+ onMounted(() => {
46
+ mounted = true;
47
+ });
48
+ return {
49
+ story,
50
+ variant
51
+ };
52
+ },
53
+ render() {
54
+ return [
55
+ h("div", { class: "htw-sandbox-hidden" }, [
56
+ h(file.value.component, {
57
+ story: file.value.story
58
+ })
59
+ ]),
60
+ this.story && this.variant ? h(_sfc_main, {
61
+ story: this.story,
62
+ variant: this.variant,
63
+ onReady: () => {
64
+ var _a;
65
+ (_a = window.parent) == null ? void 0 : _a.postMessage({
66
+ type: SANDBOX_READY
67
+ });
68
+ }
69
+ }) : null
70
+ ];
71
+ }
72
+ });
73
+ app.use(createPinia());
74
+ registerGlobalComponents(app);
75
+ app.mount("#app");
76
+ watch(isDark, (value) => {
77
+ if (value) {
78
+ document.documentElement.classList.add(histoireConfig.sandboxDarkClass);
79
+ } else {
80
+ document.documentElement.classList.remove(histoireConfig.sandboxDarkClass);
81
+ }
82
+ }, {
83
+ immediate: true
84
+ });