@dvcol/neo-svelte 0.1.1 → 0.1.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.3](https://github.com/dvcol/neo-svelte/compare/v0.1.2...v0.1.3) (2024-11-25)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **theme:** makes remember by default ([55d1738](https://github.com/dvcol/neo-svelte/commit/55d1738062e7879f9524890766082b56d935a891))
11
+ * **types:** correct props types & relative img path ([35bd74a](https://github.com/dvcol/neo-svelte/commit/35bd74a6046d07aeb9425a1191d7b3d178af3140))
12
+
13
+ ### [0.1.2](https://github.com/dvcol/neo-svelte/compare/v0.1.1...v0.1.2) (2024-11-25)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **selector:** prevent $effect loop when provider props change ([2d9f6b1](https://github.com/dvcol/neo-svelte/commit/2d9f6b150ea69e6e66b111bf0b3ac4baea83c8d5))
19
+ * **style:** bundle theme scss with component & make reset optional ([1712a25](https://github.com/dvcol/neo-svelte/commit/1712a25ad42b3528783f09da1f8cd9fecc54f20f))
20
+
5
21
  ### 0.1.1 (2024-11-25)
6
22
 
7
23
 
@@ -408,6 +408,6 @@
408
408
  .neo-card-content::-webkit-resizer,
409
409
  .neo-card-action::-webkit-resizer,
410
410
  .neo-card-footer::-webkit-resizer {
411
- background: url("~/assets/neo-icon-resizer-bottom-right.svg") no-repeat bottom;
411
+ background: url("../assets/neo-icon-resizer-bottom-right.svg") no-repeat bottom;
412
412
  background-clip: border-box;
413
413
  }</style>
@@ -150,7 +150,7 @@
150
150
  * Change the state of the input
151
151
  * @param state
152
152
  */
153
- export const mark: NeoInputMethods<HTMLInputElement>['mark'] = (state: NeoInputState) => {
153
+ export const mark: NeoInputMethods['mark'] = (state: NeoInputState) => {
154
154
  if (state.touched !== undefined) touched = state.touched;
155
155
  if (state.valid !== undefined) valid = state.valid;
156
156
  if (state.dirty === undefined) return onmark?.({ touched, dirty, valid, value });
@@ -167,7 +167,7 @@
167
167
  /**
168
168
  * Clear the input state
169
169
  */
170
- export const clear: NeoInputMethods<HTMLInputElement>['clear'] = (state?: NeoInputState) => {
170
+ export const clear: NeoInputMethods['clear'] = (state?: NeoInputState) => {
171
171
  value = '';
172
172
  focus();
173
173
  if (!state) {
@@ -18,10 +18,10 @@ declare const NeoInput: $$__sveltets_2_IsomorphicComponent<NeoInputProps, {
18
18
  /**
19
19
  * Change the state of the input
20
20
  * @param state
21
- */ mark: NeoInputMethods<HTMLInputElement>["mark"];
21
+ */ mark: NeoInputMethods["mark"];
22
22
  /**
23
23
  * Clear the input state
24
- */ clear: NeoInputMethods<HTMLInputElement>["clear"];
24
+ */ clear: NeoInputMethods["clear"];
25
25
  }, "value" | "ref" | "valid" | "dirty" | "touched" | "labelRef">;
26
26
  type NeoInput = InstanceType<typeof NeoInput>;
27
27
  export default NeoInput;
@@ -148,7 +148,7 @@
148
148
  * Change the state of the input
149
149
  * @param state
150
150
  */
151
- export const mark: NeoInputMethods<HTMLTextAreaElement>['mark'] = (state: NeoInputState) => {
151
+ export const mark: NeoInputMethods['mark'] = (state: NeoInputState) => {
152
152
  if (state.touched !== undefined) touched = state.touched;
153
153
  if (state.valid !== undefined) valid = state.valid;
154
154
  if (state.dirty === undefined) return onmark?.({ touched, dirty, valid });
@@ -165,7 +165,7 @@
165
165
  /**
166
166
  * Clear the input state
167
167
  */
168
- export const clear: NeoInputMethods<HTMLTextAreaElement>['clear'] = (state?: NeoInputState) => {
168
+ export const clear: NeoInputMethods['clear'] = (state?: NeoInputState) => {
169
169
  value = '';
170
170
  focus();
171
171
  if (!state) {
@@ -763,6 +763,6 @@
763
763
  outline: none;
764
764
  }
765
765
  .neo-textarea-group .neo-textarea::-webkit-resizer {
766
- background: url("~/assets/neo-icon-resizer-bottom-right.svg") no-repeat bottom;
766
+ background: url("../assets/neo-icon-resizer-bottom-right.svg") no-repeat bottom;
767
767
  background-clip: border-box;
768
768
  }</style>
@@ -18,10 +18,10 @@ declare const NeoTextarea: $$__sveltets_2_IsomorphicComponent<NeoTextareaProps,
18
18
  /**
19
19
  * Change the state of the input
20
20
  * @param state
21
- */ mark: NeoInputMethods<HTMLTextAreaElement>["mark"];
21
+ */ mark: NeoInputMethods["mark"];
22
22
  /**
23
23
  * Clear the input state
24
- */ clear: NeoInputMethods<HTMLTextAreaElement>["clear"];
24
+ */ clear: NeoInputMethods["clear"];
25
25
  }, "value" | "ref" | "valid" | "dirty" | "touched" | "labelRef">;
26
26
  type NeoTextarea = InstanceType<typeof NeoTextarea>;
27
27
  export default NeoTextarea;
@@ -24,21 +24,7 @@ export type NeoInputState = {
24
24
  */
25
25
  value?: string;
26
26
  };
27
- export type NeoInputMethods<T extends HTMLElement> = HTMLRefProps<T> & {
28
- /**
29
- * Change the input state. If no value is provided, the state attributes will be unchanged.
30
- * @param state
31
- */
32
- mark: (state: NeoInputState) => unknown;
33
- /**
34
- * Clear the input. If a state is provided, the input state will be updated accordingly.
35
- * If a partial state is provided, the input state will be reinitialized and the provided state will be merged.
36
- * @param state
37
- */
38
- clear: (state?: NeoInputState) => unknown;
39
- };
40
- export type NeoInputElevation = ShadowElevation;
41
- export type NeoInputContext<T extends HTMLElement = HTMLElement> = NeoInputState & NeoInputMethods<T> & {
27
+ export type NeoInputStyles = {
42
28
  /**
43
29
  * Input elevation.
44
30
  * @default 3
@@ -80,6 +66,21 @@ export type NeoInputContext<T extends HTMLElement = HTMLElement> = NeoInputState
80
66
  */
81
67
  readonly?: boolean;
82
68
  };
69
+ export type NeoInputMethods = {
70
+ /**
71
+ * Change the input state. If no value is provided, the state attributes will be unchanged.
72
+ * @param state
73
+ */
74
+ mark: (state: NeoInputState) => unknown;
75
+ /**
76
+ * Clear the input. If a state is provided, the input state will be updated accordingly.
77
+ * If a partial state is provided, the input state will be reinitialized and the provided state will be merged.
78
+ * @param state
79
+ */
80
+ clear: (state?: NeoInputState) => unknown;
81
+ };
82
+ export type NeoInputElevation = ShadowElevation;
83
+ export type NeoInputContext<T extends HTMLElement = HTMLElement> = HTMLRefProps<T> & NeoInputState & NeoInputStyles & NeoInputMethods;
83
84
  export declare const NeoInputLabelPosition: {
84
85
  readonly Inside: "inside";
85
86
  readonly Top: "top";
@@ -194,7 +195,7 @@ export type NeoCommonInputProps<T extends HTMLElement> = {
194
195
  * The ref to bind to the label.
195
196
  */
196
197
  labelRef?: HTMLLabelElement;
197
- } & NeoInputContext<T> & HTMLActionProps;
198
+ } & HTMLRefProps<T> & NeoInputState & NeoInputStyles & HTMLActionProps;
198
199
  export type NeoInputProps<T extends HTMLInputElement = HTMLInputElement> = {
199
200
  /**
200
201
  * A snippet to display as the input prefix.