@sierra-95/svelte-scaffold 1.2.17 → 1.2.19

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,21 +1,34 @@
1
1
  <script lang="ts">
2
- export let id: string = '';
3
- export let label: string = '';
4
- export let value: string | number = '';
5
- export let options: { value: string | number; label: string; disabled?: boolean }[] = [];
6
- export let background: string ='transparent';
7
- export let width: string = '100%';
8
- export let maxWidth: string = '';
9
- export let height: string = '100%';
10
- export let textColor: string = 'inherit';
11
- export let optionsColor: string = 'inherit';
12
- export let optionsBackground: string = 'white';
13
- export let showInput = true;
2
+ let {
3
+ id = '',
4
+ label = '',
5
+ value = $bindable<string | number>(),
6
+ options = [],
7
+ background = 'transparent',
8
+ width = '100%',
9
+ maxWidth = '',
10
+ height = '100%',
11
+ textColor = 'inherit',
12
+ optionsColor = 'inherit',
13
+ optionsBackground = 'white',
14
+ showInput = true,
15
+ readonly = false,
16
+ ...rest
17
+ } = $props();
14
18
  </script>
15
19
 
16
20
  {#if showInput}
17
21
  <label class="sierra-input" style="width: {width}; max-width: {maxWidth}; color: {textColor}" for={id}>{label}
18
- <select bind:value={value} id={id} name={id} required style="background-color: {background}; height: {height}">
22
+ <select
23
+ {...rest}
24
+ disabled={readonly}
25
+ bind:value={value} id={id} name={id}
26
+ style="background-color: {background}; height: {height}"
27
+ required={rest.required}
28
+ onchange={(e) => {
29
+ rest.onchange?.(e);
30
+ }}
31
+ >
19
32
  {#each options as option}
20
33
  <option
21
34
  value={option.value}
@@ -1,25 +1,8 @@
1
- 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> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
- $$bindings?: Bindings;
4
- } & Exports;
5
- (internal: unknown, props: Props & {
6
- $$events?: Events;
7
- $$slots?: Slots;
8
- }): Exports & {
9
- $set?: any;
10
- $on?: any;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- declare const Select: $$__sveltets_2_IsomorphicComponent<{
1
+ declare const Select: import("svelte").Component<{
15
2
  id?: string;
16
3
  label?: string;
17
- value?: string | number;
18
- options?: {
19
- value: string | number;
20
- label: string;
21
- disabled?: boolean;
22
- }[];
4
+ value?: any;
5
+ options?: any[];
23
6
  background?: string;
24
7
  width?: string;
25
8
  maxWidth?: string;
@@ -28,8 +11,7 @@ declare const Select: $$__sveltets_2_IsomorphicComponent<{
28
11
  optionsColor?: string;
29
12
  optionsBackground?: string;
30
13
  showInput?: boolean;
31
- }, {
32
- [evt: string]: CustomEvent<any>;
33
- }, {}, {}, string>;
34
- type Select = InstanceType<typeof Select>;
14
+ readonly?: boolean;
15
+ } & Record<string, any>, {}, "value">;
16
+ type Select = ReturnType<typeof Select>;
35
17
  export default Select;
package/dist/global.css CHANGED
@@ -147,16 +147,39 @@ body[data-theme='dark']{
147
147
  --background-v1-gradient-line-end: var(--background-v1-gradient-line-dark-end);
148
148
  }
149
149
 
150
- /**Sierra Input*/
150
+ /**START OF INPUTS*/
151
+ select:focus,
152
+ input:focus,
153
+ textarea:focus {
154
+ outline: none;
155
+ box-shadow: none;
156
+ }
151
157
  .sierra-input{
152
158
  display: flex;
153
159
  flex-direction: column;
154
160
  gap: 0.2rem;
155
161
  }
162
+ /*select*/
163
+ .sierra-input select {
164
+ border-radius: 5px;
165
+ border: 1px solid var(--input-border);
166
+ background-color: unset;
167
+ }
168
+ select option {
169
+ background-color: var(--background-tertiary);
170
+ }
171
+
172
+ .sierra-input select:disabled{
173
+ border: 1px solid rgb(from var(--input-border) r g b / 0.3) !important;
174
+ }
175
+ /*input and textarea*/
156
176
  .sierra-input input, .sierra-input textarea {
157
177
  padding: 0.75rem;
158
178
  border-radius: 4px;
159
179
  }
180
+ .sierra-input input:read-only, .sierra-input textarea:read-only {
181
+ border: 1px solid rgb(from var(--input-border) r g b / 0.3) !important;
182
+ }
160
183
 
161
184
  .sierra-input .underline-input{
162
185
  border: none !important;
@@ -175,55 +198,11 @@ body[data-theme='dark']{
175
198
  .sierra-input button i{
176
199
  color: var(--icon-theme);
177
200
  }
201
+ /* END OF INPUTS **/
178
202
 
179
- button{
180
- cursor: pointer;
181
- }
182
203
 
183
- .sierra-text-ellipsis{
184
- white-space: nowrap;
185
- overflow: hidden;
186
- text-overflow: ellipsis;
187
- }
188
- .sierra-text-wrap {
189
- white-space: normal;
190
- overflow-wrap: break-word;
191
- word-break: break-word;
192
- }
193
-
194
- .sierra-translate {
195
- display: inline-block;
196
- transition: transform 0.3s ease;
197
- }
198
-
199
- .sierra-translate:hover {
200
- transform: translateY(-5px);
201
- }
202
204
 
203
- .sierra-flex-col{
204
- display: flex;
205
- flex-direction: column;
206
- }
207
- /**Select, Input**/
208
- select:focus,
209
- input:focus,
210
- textarea:focus {
211
- outline: none;
212
- box-shadow: none;
213
- }
214
- select {
215
- border-radius: 5px;
216
- border: 1px solid var(--input-border);
217
- background-color: unset;
218
- }
219
-
220
- select option {
221
- background-color: var(--background-tertiary);
222
- }
223
-
224
-
225
-
226
- /* Scrollbar */
205
+ /* START OF SCROLLBAR */
227
206
  ::-webkit-scrollbar {
228
207
  width: 8px;
229
208
  }
@@ -241,7 +220,9 @@ select option {
241
220
  background: var(--scroll-bar-thumb-hover);
242
221
  }
243
222
 
244
- /**Button Ripple Effect */
223
+ /* END OF SCROLLBAR */
224
+
225
+ /**START OF BUTTON RIPPLE EFFECT */
245
226
  button:disabled{
246
227
  opacity: 0.6;
247
228
  cursor: not-allowed;
@@ -263,10 +244,40 @@ button:disabled{
263
244
  background: currentColor;
264
245
  }
265
246
 
266
- /**/
247
+ /**END OF BUTTON RIPPLE EFFECT */
248
+
249
+ /*START OF CONVINIENCE CLASSES*/
250
+ button{
251
+ cursor: pointer;
252
+ }
267
253
  i.fa-chevron-down {
268
254
  transition: transform 0.2s;
269
255
  }
270
256
  i.fa-chevron-down.active {
271
257
  transform: rotate(180deg);
258
+ }
259
+
260
+ .sierra-text-ellipsis{
261
+ white-space: nowrap;
262
+ overflow: hidden;
263
+ text-overflow: ellipsis;
264
+ }
265
+ .sierra-text-wrap {
266
+ white-space: normal;
267
+ overflow-wrap: break-word;
268
+ word-break: break-word;
269
+ }
270
+
271
+ .sierra-translate {
272
+ display: inline-block;
273
+ transition: transform 0.3s ease;
274
+ }
275
+
276
+ .sierra-translate:hover {
277
+ transform: translateY(-5px);
278
+ }
279
+
280
+ .sierra-flex-col{
281
+ display: flex;
282
+ flex-direction: column;
272
283
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sierra-95/svelte-scaffold",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",