sveltacular 0.0.38 → 0.0.39

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.
@@ -3,6 +3,7 @@ import Section from "../generic/section/section.svelte";
3
3
  export let method = "get";
4
4
  export let title = void 0;
5
5
  export let action = void 0;
6
+ export let size = "full";
6
7
  const dispatch = createEventDispatcher();
7
8
  const onSubmit = (e) => {
8
9
  e.preventDefault();
@@ -10,7 +11,7 @@ const onSubmit = (e) => {
10
11
  };
11
12
  </script>
12
13
 
13
- <Section {title}>
14
+ <Section {title} {size}>
14
15
  <form {method} {action} on:submit={onSubmit}>
15
16
  <slot />
16
17
  </form>
@@ -1,9 +1,11 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import type { FormFieldSizeOptions } from '../index.js';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  method?: "get" | "post" | "put" | "delete" | undefined;
5
6
  title?: string | undefined;
6
7
  action?: string | undefined;
8
+ size?: FormFieldSizeOptions | undefined;
7
9
  };
8
10
  events: {
9
11
  submit: CustomEvent<void>;
@@ -13,7 +13,9 @@ const onClick = () => {
13
13
  navigateTo(href);
14
14
  };
15
15
  const container = getContext("CardContainer");
16
- container.register(id);
16
+ if (container) {
17
+ container.register(id);
18
+ }
17
19
  </script>
18
20
 
19
21
  <li {role} {id} on:click={onClick} class="{size} {role}">
@@ -1,4 +1,5 @@
1
- <script>import { navigateTo } from "../../index.js";
1
+ <script>import { navigateTo, uniqueId } from "../../index.js";
2
+ import { getContext } from "svelte";
2
3
  export let value;
3
4
  export let caption = "below";
4
5
  export let href = void 0;
@@ -7,13 +8,18 @@ const onClick = () => {
7
8
  return;
8
9
  navigateTo(href);
9
10
  };
11
+ const id = uniqueId();
12
+ const container = getContext("CardContainer");
13
+ if (container) {
14
+ container.register(id);
15
+ }
10
16
  $:
11
17
  formattedValue = typeof value === "number" ? value.toLocaleString() : value;
12
18
  $:
13
19
  isLink = !!href;
14
20
  </script>
15
21
 
16
- <button on:click={onClick} class:isLink>
22
+ <button on:click={onClick} class:isLink {id}>
17
23
  <figure class={caption}>
18
24
  <span class="value">{formattedValue}</span>
19
25
  <figcaption><slot /></figcaption>
@@ -2,10 +2,11 @@
2
2
  import Header from "../header/header.svelte";
3
3
  export let title = void 0;
4
4
  export let level = 2;
5
+ export let size = "full";
5
6
  setContext("section", { level, title });
6
7
  </script>
7
8
 
8
- <section class="level-{level}">
9
+ <section class="level-{level} {size}">
9
10
  {#if title}
10
11
  <Header />
11
12
  {/if}
@@ -17,4 +18,19 @@ setContext("section", { level, title });
17
18
  margin-top: 1rem;
18
19
  margin-bottom: 1rem;
19
20
  font-family: var(--base-font-family, sans-serif);
21
+ }
22
+ section.sm {
23
+ max-width: 25rem;
24
+ }
25
+ section.md {
26
+ max-width: 35rem;
27
+ }
28
+ section.lg {
29
+ max-width: 50rem;
30
+ }
31
+ section.xl {
32
+ max-width: 65rem;
33
+ }
34
+ section.full {
35
+ width: 100%;
20
36
  }</style>
@@ -1,9 +1,11 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  import type { SectionLevel } from '../../types/generic.js';
3
+ import type { FormFieldSizeOptions } from '../../index.js';
3
4
  declare const __propDef: {
4
5
  props: {
5
6
  title?: string | undefined;
6
7
  level?: SectionLevel | undefined;
8
+ size?: FormFieldSizeOptions | undefined;
7
9
  };
8
10
  events: {
9
11
  [evt: string]: CustomEvent<any>;
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export { default as FileArea } from './forms/file-area/file-area.svelte';
9
9
  export { default as NumberBox } from './forms/number-box/number-box.svelte';
10
10
  export { default as MoneyBox } from './forms/money-box/money-box.svelte';
11
11
  export { default as RadioGroup } from './forms/radio-group/radio-group.svelte';
12
+ export { default as RadioBox } from './forms/radio-group/radio-box.svelte';
12
13
  export { default as TextArea } from './forms/text-area/text-area.svelte';
13
14
  export { default as TextBox } from './forms/text-box/text-box.svelte';
14
15
  export { default as FormField } from './forms/form-field.svelte';
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export { default as FileArea } from './forms/file-area/file-area.svelte';
10
10
  export { default as NumberBox } from './forms/number-box/number-box.svelte';
11
11
  export { default as MoneyBox } from './forms/money-box/money-box.svelte';
12
12
  export { default as RadioGroup } from './forms/radio-group/radio-group.svelte';
13
+ export { default as RadioBox } from './forms/radio-group/radio-box.svelte';
13
14
  export { default as TextArea } from './forms/text-area/text-area.svelte';
14
15
  export { default as TextBox } from './forms/text-box/text-box.svelte';
15
16
  export { default as FormField } from './forms/form-field.svelte';
@@ -21,7 +21,7 @@ export let wrap = false;
21
21
  flex-wrap: nowrap;
22
22
  column-gap: 1rem;
23
23
  }
24
- div *.auto {
24
+ div.auto {
25
25
  width: auto;
26
26
  }
27
27
  div.wrap {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltacular",
3
- "version": "0.0.38",
3
+ "version": "0.0.39",
4
4
  "description": "A Svelte component library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",