noph-ui 0.3.2 → 0.4.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.
@@ -1,2 +1 @@
1
1
  export { default as Checkbox } from './Checkbox.svelte';
2
- export type { CheckboxProps } from './types.ts';
@@ -7,7 +7,7 @@
7
7
  selected?: boolean
8
8
  start?: Snippet
9
9
  end?: Snippet
10
- type: 'button'
10
+ variant: 'button'
11
11
  supportingText?: Snippet
12
12
  }
13
13
  interface AnchorProps extends HTMLAnchorAttributes {
@@ -15,7 +15,7 @@
15
15
  start?: Snippet
16
16
  end?: Snippet
17
17
  disabled?: boolean
18
- type: 'link'
18
+ variant: 'link'
19
19
  supportingText?: Snippet
20
20
  }
21
21
  interface TextProps extends HTMLAttributes<HTMLDivElement> {
@@ -23,7 +23,7 @@
23
23
  start?: Snippet
24
24
  end?: Snippet
25
25
  disabled?: boolean
26
- type?: 'text'
26
+ variant?: 'text'
27
27
  supportingText?: Snippet
28
28
  }
29
29
 
@@ -64,7 +64,7 @@
64
64
  {@render end()}
65
65
  </div>
66
66
  {/if}
67
- {#if !disabled && !(attributes.type === 'text' || attributes.type === undefined)}
67
+ {#if !disabled && !(attributes.variant === 'text' || attributes.variant === undefined)}
68
68
  <Ripple forceHover={focused} />
69
69
  {/if}
70
70
  {/snippet}
@@ -73,11 +73,11 @@
73
73
  <div aria-disabled="true" class="np-item disabled {attributes.class}">
74
74
  {@render content()}
75
75
  </div>
76
- {:else if attributes.type === 'text' || attributes.type === undefined}
76
+ {:else if attributes.variant === 'text' || attributes.variant === undefined}
77
77
  <div {...attributes} class="{selected ? 'selected ' : ''} np-item {attributes.class}">
78
78
  {@render content()}
79
79
  </div>
80
- {:else if attributes.type === 'button'}
80
+ {:else if attributes.variant === 'button'}
81
81
  <button
82
82
  {...attributes}
83
83
  class="{selected ? 'selected ' : ''} np-item {attributes.class}"
@@ -88,7 +88,7 @@
88
88
  focused = false
89
89
  }}>{@render content()}</button
90
90
  >
91
- {:else if attributes.type === 'link'}
91
+ {:else if attributes.variant === 'link'}
92
92
  <a
93
93
  {...attributes}
94
94
  class="{selected ? 'selected ' : ''} np-item {attributes.class}"
@@ -4,7 +4,7 @@ interface ButtonProps extends HTMLButtonAttributes {
4
4
  selected?: boolean;
5
5
  start?: Snippet;
6
6
  end?: Snippet;
7
- type: 'button';
7
+ variant: 'button';
8
8
  supportingText?: Snippet;
9
9
  }
10
10
  interface AnchorProps extends HTMLAnchorAttributes {
@@ -12,7 +12,7 @@ interface AnchorProps extends HTMLAnchorAttributes {
12
12
  start?: Snippet;
13
13
  end?: Snippet;
14
14
  disabled?: boolean;
15
- type: 'link';
15
+ variant: 'link';
16
16
  supportingText?: Snippet;
17
17
  }
18
18
  interface TextProps extends HTMLAttributes<HTMLDivElement> {
@@ -20,7 +20,7 @@ interface TextProps extends HTMLAttributes<HTMLDivElement> {
20
20
  start?: Snippet;
21
21
  end?: Snippet;
22
22
  disabled?: boolean;
23
- type?: 'text';
23
+ variant?: 'text';
24
24
  supportingText?: Snippet;
25
25
  }
26
26
  type $$ComponentProps = ButtonProps | AnchorProps | TextProps;
@@ -7,7 +7,7 @@
7
7
  selected?: boolean
8
8
  start?: Snippet
9
9
  end?: Snippet
10
- type: 'button'
10
+ variant: 'button'
11
11
  supportingText?: Snippet
12
12
  }
13
13
  interface AnchorProps extends HTMLAnchorAttributes {
@@ -15,7 +15,7 @@
15
15
  start?: Snippet
16
16
  end?: Snippet
17
17
  disabled?: boolean
18
- type: 'link'
18
+ variant: 'link'
19
19
  supportingText?: Snippet
20
20
  }
21
21
  interface TextProps extends HTMLAttributes<HTMLDivElement> {
@@ -23,7 +23,7 @@
23
23
  start?: Snippet
24
24
  end?: Snippet
25
25
  disabled?: boolean
26
- type?: 'text'
26
+ variant?: 'text'
27
27
  supportingText?: Snippet
28
28
  }
29
29
 
@@ -4,7 +4,7 @@ interface ButtonProps extends HTMLButtonAttributes {
4
4
  selected?: boolean;
5
5
  start?: Snippet;
6
6
  end?: Snippet;
7
- type: 'button';
7
+ variant: 'button';
8
8
  supportingText?: Snippet;
9
9
  }
10
10
  interface AnchorProps extends HTMLAnchorAttributes {
@@ -12,7 +12,7 @@ interface AnchorProps extends HTMLAnchorAttributes {
12
12
  start?: Snippet;
13
13
  end?: Snippet;
14
14
  disabled?: boolean;
15
- type: 'link';
15
+ variant: 'link';
16
16
  supportingText?: Snippet;
17
17
  }
18
18
  interface TextProps extends HTMLAttributes<HTMLDivElement> {
@@ -20,7 +20,7 @@ interface TextProps extends HTMLAttributes<HTMLDivElement> {
20
20
  start?: Snippet;
21
21
  end?: Snippet;
22
22
  disabled?: boolean;
23
- type?: 'text';
23
+ variant?: 'text';
24
24
  supportingText?: Snippet;
25
25
  }
26
26
  type $$ComponentProps = ButtonProps | AnchorProps | TextProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";
@@ -28,9 +28,9 @@
28
28
 
29
29
  <li class="np-menu-item" role="menuitem">
30
30
  {#if isButton(attributes)}
31
- <Item {...attributes} type="button" />
31
+ <Item {...attributes} variant="button" />
32
32
  {:else}
33
- <Item {...attributes} type="link" />
33
+ <Item {...attributes} variant="link" />
34
34
  {/if}
35
35
  </li>
36
36
 
@@ -1,2 +1 @@
1
1
  export { default as Radio } from './Radio.svelte';
2
- export type { RadioProps } from './types.ts';
@@ -1,2 +1 @@
1
1
  export { default as TextField } from './TextField.svelte';
2
- export type { TextAreaFieldProps, TextFieldProps } from './types.ts';
@@ -0,0 +1,3 @@
1
+ export type { RadioProps } from './radio/types.ts';
2
+ export type { CheckboxProps } from './checkbox/types.ts';
3
+ export type { TextAreaFieldProps, TextFieldProps } from './text-field/types.ts';
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {
@@ -32,6 +32,9 @@
32
32
  "types": "./dist/icons/index.d.ts",
33
33
  "svelte": "./dist/icons/index.js"
34
34
  },
35
+ "./types": {
36
+ "types": "./dist/types.d.ts"
37
+ },
35
38
  "./defaultTheme": {
36
39
  "import": "./dist/themes/defaultTheme.css",
37
40
  "require": "./dist/themes/defaultTheme.css"