@forsakringskassan/docs-live-example 1.4.4 → 1.4.6

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.
package/README.md CHANGED
@@ -52,7 +52,7 @@ Vi rekommenderar att använda `LiveExample` som suffix på alla live-exempel.
52
52
 
53
53
  Följande boilerplate kan användas:
54
54
 
55
- ```vue
55
+ ```vue static
56
56
  <template>
57
57
  <live-example :components :template :livedata>
58
58
  <!-- Example configuration -->
@@ -136,6 +136,61 @@ Det går också med fördel att använda `createElement` (se beskrivning längre
136
136
  },
137
137
  ```
138
138
 
139
+ Resultatet:
140
+
141
+ ```vue live-example
142
+ <template>
143
+ <live-example :template>
144
+ <div>
145
+ <label for="config-element"> Element </label>
146
+ <select id="config-element" v-model="tagName">
147
+ <option value="div">div</option>
148
+ <option value="p">p</option>
149
+ <option value="em">em</option>
150
+ </select>
151
+ </div>
152
+ <div>
153
+ <label>
154
+ <input
155
+ type="checkbox"
156
+ v-model="placeholderText"
157
+ :value="true"
158
+ />
159
+ Use placeholder text
160
+ </label>
161
+ </div>
162
+ </live-example>
163
+ </template>
164
+
165
+ <script lang="ts">
166
+ import { defineComponent } from "vue";
167
+ import {
168
+ LiveExample,
169
+ createElement,
170
+ } from "@forsakringskassan/docs-live-example";
171
+
172
+ export default defineComponent({
173
+ name: "AwesomeComponentLiveExample",
174
+ components: { LiveExample },
175
+ data() {
176
+ return {
177
+ tagName: "div",
178
+ placeholderText: false,
179
+ };
180
+ },
181
+ computed: {
182
+ template(): string {
183
+ const { tagName, placeholderText } = this;
184
+ const message = placeholderText
185
+ ? "Lorem ipsum dolor sit amet"
186
+ : "Hello World!";
187
+ return createElement(tagName, message);
188
+ },
189
+ },
190
+ });
191
+ </script>
192
+ ```
193
+
139
194
  ## `createElement`
140
195
 
141
196
  A helper function to render the markup for the live example.
@@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<{
14
14
  * time).
15
15
  */
16
16
  language: {
17
- type: PropType<"html" | "auto" | "vue">;
17
+ type: PropType<"vue" | "html" | "auto">;
18
18
  required: false;
19
19
  default: string;
20
20
  validator(value: string): boolean;
@@ -59,7 +59,7 @@ declare const _default: import("vue").DefineComponent<{
59
59
  * time).
60
60
  */
61
61
  language: {
62
- type: PropType<"html" | "auto" | "vue">;
62
+ type: PropType<"vue" | "html" | "auto">;
63
63
  required: false;
64
64
  default: string;
65
65
  validator(value: string): boolean;
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{
12
12
  required: true;
13
13
  };
14
14
  templateLanguage: {
15
- type: PropType<"html" | "vue">;
15
+ type: PropType<"vue" | "html">;
16
16
  required: true;
17
17
  };
18
18
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -28,7 +28,7 @@ declare const _default: import("vue").DefineComponent<{
28
28
  required: true;
29
29
  };
30
30
  templateLanguage: {
31
- type: PropType<"html" | "vue">;
31
+ type: PropType<"vue" | "html">;
32
32
  required: true;
33
33
  };
34
34
  }>>, {}, {}>;
package/dist/cjs/index.js CHANGED
@@ -918,7 +918,7 @@ var require_core = __commonJS({
918
918
  }
919
919
  return mode;
920
920
  }
921
- var version = "11.9.0";
921
+ var version = "11.10.0";
922
922
  var HTMLInjectionError = class extends Error {
923
923
  constructor(reason, html) {
924
924
  super(reason);
package/dist/esm/index.js CHANGED
@@ -912,7 +912,7 @@ var require_core = __commonJS({
912
912
  }
913
913
  return mode;
914
914
  }
915
- var version = "11.9.0";
915
+ var version = "11.10.0";
916
916
  var HTMLInjectionError = class extends Error {
917
917
  constructor(reason, html) {
918
918
  super(reason);
package/dist/main.css CHANGED
@@ -9,14 +9,26 @@
9
9
 
10
10
  :root {
11
11
  --live-example-space: 1.5rem;
12
+ --live-example-controls-width: 17rem;
13
+ }
14
+
15
+ .code-preview {
16
+ container-type: inline-size;
17
+ container-name: example-container;
12
18
  }
13
19
 
14
20
  .live-example__container {
15
21
  border: var(--f-border-width-small) solid #ddddde;
16
22
  border-radius: 4px;
17
23
  display: grid;
18
- grid-template-columns: 1fr auto;
19
- grid-template-areas: "example controls" "code code";
24
+ grid-template-columns: 1fr;
25
+ grid-template-areas: "example" "controls" "code";
26
+ }
27
+ @container example-container (width >= 43.0379746835rem) {
28
+ .live-example__container {
29
+ grid-template-columns: 1fr var(--live-example-controls-width);
30
+ grid-template-areas: "example controls" "code code";
31
+ }
20
32
  }
21
33
  .live-example__example {
22
34
  grid-area: example;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/docs-live-example",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "Components used for live examples",
5
5
  "keywords": [
6
6
  "documentation"