@histoire/controls 0.7.8 → 0.8.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 (65) hide show
  1. package/dist/components/radio/HstRadio.story.vue.d.ts +2 -0
  2. package/dist/components/radio/HstRadio.vue.d.ts +24 -0
  3. package/dist/components/select/CustomSelect.vue.d.ts +3 -6
  4. package/dist/components/select/HstSelect.vue.d.ts +3 -4
  5. package/dist/index.d.ts +324 -2
  6. package/dist/index.es.js +498 -5133
  7. package/dist/style-standalone.css +31 -0
  8. package/dist/types.d.ts +4 -0
  9. package/package.json +4 -6
  10. package/peeky.config.ts +21 -0
  11. package/src/components/HstWrapper.vue +1 -1
  12. package/src/components/checkbox/HstCheckbox.vue +3 -1
  13. package/src/components/radio/HstRadio.story.vue +47 -0
  14. package/src/components/radio/HstRadio.vue +107 -0
  15. package/src/components/select/CustomSelect.vue +3 -7
  16. package/src/components/select/HstSelect.vue +4 -8
  17. package/src/components/slider/HstSlider.vue +1 -1
  18. package/src/components/text/HstText.vue +1 -1
  19. package/src/components/textarea/HstTextarea.vue +1 -1
  20. package/src/index.ts +15 -11
  21. package/src/types.ts +4 -0
  22. package/tsconfig.json +10 -0
  23. package/vite.config.ts +12 -9
  24. package/.histoire/dist/__sandbox.html +0 -16
  25. package/.histoire/dist/assets/BaseEmpty.c5ebb434.js +0 -11
  26. package/.histoire/dist/assets/HomeView.2d2d0dfe.js +0 -24
  27. package/.histoire/dist/assets/HstCheckbox.story.ccd10161.js +0 -151
  28. package/.histoire/dist/assets/HstColorShades.story.d71deb80.js +0 -540
  29. package/.histoire/dist/assets/HstCopyIcon.ef403c78.js +0 -55
  30. package/.histoire/dist/assets/HstNumber.story.1e0e7b71.js +0 -165
  31. package/.histoire/dist/assets/HstSelect.story.8a2b4741.js +0 -290
  32. package/.histoire/dist/assets/HstSlider.story.4155f6ba.js +0 -153
  33. package/.histoire/dist/assets/HstText.story.43417ceb.js +0 -143
  34. package/.histoire/dist/assets/HstTextarea.story.3e39b89e.js +0 -111
  35. package/.histoire/dist/assets/HstTokenGrid.story.e2f237c4.js +0 -156
  36. package/.histoire/dist/assets/HstTokenList.story.bc7b0288.js +0 -184
  37. package/.histoire/dist/assets/HstWrapper.fee42109.js +0 -61
  38. package/.histoire/dist/assets/SearchPane.37a81ba7.js +0 -426
  39. package/.histoire/dist/assets/StoryView.2c1f1961.js +0 -2262
  40. package/.histoire/dist/assets/bundle-main.c70a2b14.js +0 -1156
  41. package/.histoire/dist/assets/bundle-sandbox.f56c0808.js +0 -84
  42. package/.histoire/dist/assets/const.36730b48.js +0 -717
  43. package/.histoire/dist/assets/global-components.d165b38c.js +0 -5806
  44. package/.histoire/dist/assets/search-docs-data.2e7ad186.js +0 -6
  45. package/.histoire/dist/assets/style.dc851298.css +0 -2574
  46. package/.histoire/dist/assets/vendor.31c91490.js +0 -28973
  47. package/.histoire/dist/histoire.svg +0 -51
  48. package/.histoire/dist/index.html +0 -16
  49. package/histoire-dist/__sandbox.html +0 -15
  50. package/histoire-dist/assets/BaseEmpty.a84c14c8.js +0 -1
  51. package/histoire-dist/assets/HomeView.f524bd4b.js +0 -1
  52. package/histoire-dist/assets/HstCheckbox.story.9f622545.js +0 -1
  53. package/histoire-dist/assets/HstInput.story.945401ce.js +0 -1
  54. package/histoire-dist/assets/SearchModal.76c035f2.js +0 -1
  55. package/histoire-dist/assets/StoryView.e4c41518.js +0 -15
  56. package/histoire-dist/assets/global-components.84d0ab22.js +0 -1
  57. package/histoire-dist/assets/histoire-text-dark.a529813a.svg +0 -89
  58. package/histoire-dist/assets/histoire-text.1d4474b5.svg +0 -89
  59. package/histoire-dist/assets/histoire.8af7bd1f.svg +0 -51
  60. package/histoire-dist/assets/index.58f51dd0.js +0 -1
  61. package/histoire-dist/assets/preview-settings.a634d101.js +0 -1
  62. package/histoire-dist/assets/sandbox.2c60450a.js +0 -1
  63. package/histoire-dist/assets/style.7657d2ac.css +0 -1
  64. package/histoire-dist/assets/vendor.70a554f6.js +0 -9
  65. package/histoire-dist/index.html +0 -15
@@ -1,84 +0,0 @@
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.31c91490.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.d165b38c.js";
3
- import { S as STATE_SYNC, P as PREVIEW_SETTINGS_SYNC, a as SANDBOX_READY, _ as _sfc_main } from "./const.36730b48.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
- });