@iroco/ui 1.6.18 → 1.8.0

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.
@@ -14,15 +14,9 @@
14
14
 
15
15
  {#snippet template({ ...args })}
16
16
  <Alert {...args} onclose={() => alert('click')}>
17
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eros lacus, commodo eu tristique
18
- non, ultricies eu tellus. Nulla facilisi. Integer a tincidunt purus. Proin vulputate tristique
19
- magna. Aliquam id eros id ante malesuada interdum. Phasellus tristique ac leo at fringilla. Cras
20
- a viverra nibh, vitae rutrum ante. Sed pharetra nibh ac velit dignissim ornare sed accumsan
21
- lacus. Vestibulum tincidunt purus sapien, ac dapibus sem semper a. Nullam venenatis vestibulum
22
- risus id molestie. Aliquam facilisis nunc at nunc aliquam hendrerit. Etiam sodales sodales
23
- lectus, ut suscipit lacus vehicula nec. Proin vel magna sed orci condimentum ornare in a odio.
24
- In varius eu augue eget tincidunt. Ut quis porttitor nulla. Nulla leo nunc, efficitur non ipsum
25
- vel, tincidunt auctor lectus.
17
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
18
+ <p>Nunc eros lacus, commodo eu tristique non, ultricies eu tellus.</p>
19
+ <p>Nulla facilisi. Integer a tincidunt purus.</p>
26
20
  </Alert>
27
21
  {/snippet}
28
22
 
package/dist/Alert.svelte CHANGED
@@ -5,14 +5,21 @@
5
5
  interface Props {
6
6
  type?: 'success' | 'danger' | 'flash';
7
7
  showClose?: boolean;
8
+ fullWidth?: boolean;
8
9
  onclose?: MouseEventHandler<HTMLButtonElement>;
9
10
  children?: import('svelte').Snippet;
10
11
  }
11
12
 
12
- let { type = 'success', showClose = true, onclose, children }: Props = $props();
13
+ let {
14
+ type = 'success',
15
+ showClose = true,
16
+ fullWidth = false,
17
+ onclose,
18
+ children
19
+ }: Props = $props();
13
20
  </script>
14
21
 
15
- <div class={`alert alert--${type}`}>
22
+ <div class={['alert', `alert--${type}`, { fullWidth }]}>
16
23
  {#if showClose}
17
24
  <button onclick={onclose} class="alert__close">
18
25
  <IconClose width="2em" height="2em" />
@@ -59,4 +66,8 @@
59
66
  .alert__close:focus {
60
67
  outline-color: var(--color-secondary);
61
68
  outline-style: auto;
69
+ }
70
+
71
+ .fullWidth {
72
+ width: 100%;
62
73
  }</style>
@@ -2,6 +2,7 @@ import type { MouseEventHandler } from 'svelte/elements';
2
2
  interface Props {
3
3
  type?: 'success' | 'danger' | 'flash';
4
4
  showClose?: boolean;
5
+ fullWidth?: boolean;
5
6
  onclose?: MouseEventHandler<HTMLButtonElement>;
6
7
  children?: import('svelte').Snippet;
7
8
  }
@@ -0,0 +1,33 @@
1
+ <script module lang="ts">
2
+ import { Highlight } from './index';
3
+ import { defineMeta, setTemplate } from '@storybook/addon-svelte-csf';
4
+
5
+ const { Story } = defineMeta({
6
+ title: 'Iroco-UI/Atoms/Highlight',
7
+ component: Highlight
8
+ });
9
+ </script>
10
+
11
+ <script lang="ts">
12
+ setTemplate(template);
13
+ </script>
14
+
15
+ {#snippet template({ ...args })}
16
+ <Highlight {...args}>
17
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eros lacus, commodo eu tristique
18
+ non, ultricies eu tellus. Nulla facilisi. Integer a tincidunt purus. Proin vulputate tristique
19
+ magna. Aliquam id eros id ante malesuada interdum. Phasellus tristique ac leo at fringilla. Cras
20
+ a viverra nibh, vitae rutrum ante. Sed pharetra nibh ac velit dignissim ornare sed accumsan
21
+ lacus. Vestibulum tincidunt purus sapien, ac dapibus sem semper a. Nullam venenatis vestibulum
22
+ risus id molestie. Aliquam facilisis nunc at nunc aliquam hendrerit. Etiam sodales sodales
23
+ lectus, ut suscipit lacus vehicula nec. Proin vel magna sed orci condimentum ornare in a odio.
24
+ In varius eu augue eget tincidunt. Ut quis porttitor nulla. Nulla leo nunc, efficitur non ipsum
25
+ vel, tincidunt auctor lectus.
26
+ </Highlight>
27
+ {/snippet}
28
+
29
+ <Story name="Default" />
30
+ <Story name="Secondary" args={{ kind: 'secondary' }} />
31
+ <Story name="Danger" args={{ kind: 'danger' }} />
32
+ <Story name="Flash" args={{ kind: 'flash' }} />
33
+ <Story name="Success" args={{ kind: 'success' }} />
@@ -0,0 +1,19 @@
1
+ import { Highlight } from './index';
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: {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
12
+ };
13
+ z_$$bindings?: Bindings;
14
+ }
15
+ declare const Highlight: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Highlight = InstanceType<typeof Highlight>;
19
+ export default Highlight;
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ kind: 'secondary' | 'primary' | 'danger' | 'warning';
4
+ children;
5
+ }
6
+
7
+ let { kind = 'primary', children }: Props = $props();
8
+ </script>
9
+
10
+ <div class={`boo boo--${kind}`}>
11
+ {@render children?.()}
12
+ </div>
13
+
14
+ <style>
15
+ .boo {
16
+ border-style: solid;
17
+ border-width: 1px;
18
+ border-radius: 5px;
19
+ padding: 1rem;
20
+ }
21
+
22
+ .boo--primary {
23
+ border-color: var(--color-primary);
24
+ }
25
+
26
+ .boo--secondary {
27
+ border-color: var(--color-secondary);
28
+ }
29
+
30
+ .boo--danger {
31
+ border-color: var(--color-danger);
32
+ }
33
+
34
+ .boo--warning {
35
+ border-color: var(--color-warning);
36
+ }
37
+ </style>
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ kind: 'secondary' | 'primary' | 'danger' | 'warning';
3
+ children: any;
4
+ }
5
+ declare const Highlight: import("svelte").Component<Props, {}, "">;
6
+ type Highlight = ReturnType<typeof Highlight>;
7
+ export default Highlight;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import './scss/style.scss';
2
2
  export { default as Alert } from './Alert.svelte';
3
3
  export { default as Button } from './Button.svelte';
4
+ export { default as Highlight } from './Highlight.svelte';
4
5
  export { default as DataTable } from './DataTable.svelte';
5
6
  export { default as IconBurger } from './IconBurger.svelte';
6
7
  export { default as IconClose } from './IconClose.svelte';
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import './scss/style.scss';
2
2
  export { default as Alert } from './Alert.svelte';
3
3
  export { default as Button } from './Button.svelte';
4
+ export { default as Highlight } from './Highlight.svelte';
4
5
  export { default as DataTable } from './DataTable.svelte';
5
6
  export { default as IconBurger } from './IconBurger.svelte';
6
7
  export { default as IconClose } from './IconClose.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iroco/ui",
3
- "version": "1.6.18",
3
+ "version": "1.8.0",
4
4
  "description": "Iroco design system based on Svelte",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {