noph-ui 0.7.6 → 0.7.8
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 +2 -2
- package/dist/checkbox/Checkbox.svelte +4 -2
- package/dist/checkbox/Checkbox.svelte.d.ts +1 -1
- package/dist/checkbox/types.d.ts +3 -1
- package/dist/radio/Radio.svelte +4 -4
- package/dist/radio/Radio.svelte.d.ts +1 -1
- package/dist/radio/types.d.ts +3 -1
- package/dist/snackbar/Snackbar.svelte +15 -10
- package/dist/text-field/TextField.svelte +3 -3
- package/dist/text-field/types.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,12 +56,12 @@ Beta (No breaking changes expected)
|
|
|
56
56
|
|
|
57
57
|
- Buttons
|
|
58
58
|
- Cards
|
|
59
|
-
- Checkbox
|
|
59
|
+
- Checkbox
|
|
60
60
|
- Divider
|
|
61
61
|
- Icon buttons
|
|
62
62
|
- Lists (Docs missing)
|
|
63
63
|
- Progress indicators
|
|
64
|
-
- Radio
|
|
64
|
+
- Radio
|
|
65
65
|
- Ripple
|
|
66
66
|
- Segmented buttons
|
|
67
67
|
- Snackbar
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
let {
|
|
6
6
|
indeterminate = $bindable(),
|
|
7
7
|
checked = $bindable(),
|
|
8
|
+
element = $bindable(),
|
|
9
|
+
style,
|
|
8
10
|
...attributes
|
|
9
11
|
}: CheckboxProps = $props()
|
|
10
12
|
</script>
|
|
11
13
|
|
|
12
|
-
<div class=
|
|
14
|
+
<div {style} class={['np-host', attributes.class]} bind:this={element}>
|
|
13
15
|
<div class="np-container">
|
|
14
16
|
<label class="np-input-wrapper">
|
|
15
17
|
<input
|
|
@@ -130,7 +132,7 @@
|
|
|
130
132
|
visibility: hidden;
|
|
131
133
|
}
|
|
132
134
|
.np-background {
|
|
133
|
-
background-color: var(--np-color-primary);
|
|
135
|
+
background-color: var(--np-checkbox-selected-container-color, var(--np-color-primary));
|
|
134
136
|
}
|
|
135
137
|
.np-background,
|
|
136
138
|
.np-icon {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CheckboxProps } from './types.ts';
|
|
2
|
-
declare const Checkbox: import("svelte").Component<CheckboxProps, {}, "checked" | "indeterminate">;
|
|
2
|
+
declare const Checkbox: import("svelte").Component<CheckboxProps, {}, "element" | "checked" | "indeterminate">;
|
|
3
3
|
type Checkbox = ReturnType<typeof Checkbox>;
|
|
4
4
|
export default Checkbox;
|
package/dist/checkbox/types.d.ts
CHANGED
package/dist/radio/Radio.svelte
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import Ripple from '../ripple/Ripple.svelte'
|
|
3
3
|
import type { RadioProps } from './types.ts'
|
|
4
4
|
|
|
5
|
-
let { ...attributes }: RadioProps = $props()
|
|
5
|
+
let { element = $bindable(), style, ...attributes }: RadioProps = $props()
|
|
6
6
|
|
|
7
7
|
let touchEl: HTMLSpanElement | undefined = $state()
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
|
-
<label class=
|
|
10
|
+
<label {style} class={['np-host', attributes.class]} bind:this={element}>
|
|
11
11
|
<input {...attributes} type="radio" class="np-input" />
|
|
12
12
|
<div class="np-container" aria-hidden="true">
|
|
13
13
|
{#if !attributes.disabled}
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
position: relative;
|
|
44
44
|
display: inline-flex;
|
|
45
45
|
vertical-align: top;
|
|
46
|
-
width: 20px;
|
|
47
|
-
height: 20px;
|
|
46
|
+
width: var(--np-radio-icon-size, 20px);
|
|
47
|
+
height: var(--np-radio-icon-size, 20px);
|
|
48
48
|
cursor: pointer;
|
|
49
49
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
50
50
|
outline: none;
|
package/dist/radio/types.d.ts
CHANGED
|
@@ -70,21 +70,26 @@
|
|
|
70
70
|
>
|
|
71
71
|
{/if}
|
|
72
72
|
{#if icon}
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
<div class="np-snackbar-icon-container">
|
|
74
|
+
<IconButton
|
|
75
|
+
--np-icon-button-icon-color="var(--np-snackbar-text-color, var(--np-color-inverse-on-surface))"
|
|
76
|
+
--np-icon-button-container-shape="0"
|
|
77
|
+
--np-icon-button-container-height={buttonHeight}
|
|
78
|
+
--np-icon-button-container-width="2.5rem"
|
|
79
|
+
aria-label="Close"
|
|
80
|
+
onclick={onIconClick}
|
|
81
|
+
>
|
|
82
|
+
{@render icon()}</IconButton
|
|
83
|
+
>
|
|
84
|
+
</div>
|
|
83
85
|
{/if}
|
|
84
86
|
</div>
|
|
85
87
|
</div>
|
|
86
88
|
|
|
87
89
|
<style>
|
|
90
|
+
.np-snackbar-icon-container {
|
|
91
|
+
width: 2.75rem;
|
|
92
|
+
}
|
|
88
93
|
.np-snackbar-supporting-text {
|
|
89
94
|
font-weight: 400;
|
|
90
95
|
}
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
: !label?.length
|
|
66
66
|
? '--top-space:1rem;--bottom-space:1rem;'
|
|
67
67
|
: '') + style}
|
|
68
|
-
class=
|
|
68
|
+
class={['text-field', attributes.class]}
|
|
69
69
|
bind:this={element}
|
|
70
70
|
>
|
|
71
71
|
<div
|
|
@@ -112,11 +112,11 @@
|
|
|
112
112
|
<div class="content">
|
|
113
113
|
{#if attributes.type === 'textarea'}
|
|
114
114
|
<textarea
|
|
115
|
+
aria-label={label}
|
|
115
116
|
{...attributes}
|
|
116
117
|
bind:value
|
|
117
118
|
bind:this={textElement}
|
|
118
119
|
class="input"
|
|
119
|
-
aria-label={label}
|
|
120
120
|
{placeholder}
|
|
121
121
|
rows={attributes.rows || 2}
|
|
122
122
|
></textarea>
|
|
@@ -128,12 +128,12 @@
|
|
|
128
128
|
</span>
|
|
129
129
|
{/if}
|
|
130
130
|
<input
|
|
131
|
+
aria-label={label}
|
|
131
132
|
{...attributes}
|
|
132
133
|
bind:value
|
|
133
134
|
bind:this={textElement}
|
|
134
135
|
class="input"
|
|
135
136
|
{placeholder}
|
|
136
|
-
aria-label={label}
|
|
137
137
|
aria-invalid={error}
|
|
138
138
|
/>
|
|
139
139
|
{#if suffixText}
|
|
@@ -13,10 +13,10 @@ interface FieldProps {
|
|
|
13
13
|
noAsterisk?: boolean;
|
|
14
14
|
element?: HTMLSpanElement;
|
|
15
15
|
}
|
|
16
|
-
export interface InputFieldProps extends
|
|
16
|
+
export interface InputFieldProps extends HTMLInputAttributes, FieldProps {
|
|
17
17
|
type?: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url';
|
|
18
18
|
}
|
|
19
|
-
export interface TextAreaFieldProps extends
|
|
19
|
+
export interface TextAreaFieldProps extends HTMLTextareaAttributes, FieldProps {
|
|
20
20
|
type: 'textarea';
|
|
21
21
|
}
|
|
22
22
|
export type TextFieldProps = InputFieldProps | TextAreaFieldProps;
|