@cloudparker/moldex.js 4.1.1 → 4.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.
Files changed (23) hide show
  1. package/dist/views/core/button/components/button/button.svelte +5 -5
  2. package/dist/views/core/button/components/button-back/button-back.svelte +1 -1
  3. package/dist/views/core/button/components/button-close-icon/button-close-icon.svelte +1 -1
  4. package/dist/views/core/button/components/button-dropdown/button-dropdown.svelte +1 -1
  5. package/dist/views/core/button/components/button-list-item/button-list-item.svelte +4 -4
  6. package/dist/views/core/button/components/switch/switch.svelte +1 -1
  7. package/dist/views/core/dialog/components/dialog/dialog.svelte +3 -3
  8. package/dist/views/core/dialog/components/msg-dialog/msg-dialog.svelte +1 -1
  9. package/dist/views/core/dialog/components/picker-dialog/picker-dialog.svelte +2 -2
  10. package/dist/views/core/drawer/components/drawer/drawer.svelte +10 -5
  11. package/dist/views/core/input/components/checkbox-field/checkbox-field.svelte +3 -3
  12. package/dist/views/core/input/components/color-field/color-field.svelte +1 -1
  13. package/dist/views/core/input/components/combobox-field/combobox-field.svelte +12 -11
  14. package/dist/views/core/input/components/input-field/input-field.svelte +103 -85
  15. package/dist/views/core/input/components/label/label.svelte +3 -1
  16. package/dist/views/core/input/components/password-field/password-field.svelte +1 -1
  17. package/dist/views/core/input/components/radio-field/radio-field.svelte +1 -1
  18. package/dist/views/core/input/components/search-field/search-field.svelte +2 -1
  19. package/dist/views/core/navbar/components/navbar/navbar.svelte +7 -7
  20. package/dist/views/core/pagination/components/pagination/pagination.svelte +2 -2
  21. package/dist/views/core/sidebar/components/sidebar.svelte +2 -1
  22. package/dist/views/core/toast/components/toast/toast.svelte +1 -2
  23. package/package.json +1 -1
@@ -93,16 +93,16 @@
93
93
  let btnAppearanceClassName = $derived.by(() => {
94
94
  switch (appearance) {
95
95
  case 'none':
96
- return 'text-base-800 dark:text-base-300 hover:text-base-900 disabled:text-base-400 dark:disabled:text-base-500 dark:hover:text-base-200';
96
+ return 'text-neutral-800 dark:text-neutral-300 hover:text-neutral-900 disabled:text-neutral-400 dark:disabled:text-neutral-500 dark:hover:text-neutral-200';
97
97
  case 'base':
98
- return 'text-base-800 dark:text-base-300 hover:text-base-900 disabled:text-base-400 dark:disabled:text-base-500 dark:hover:text-base-200 bg-base-200 dark:bg-base-700 hover:bg-base-300 dark:hover:bg-base-600 disabled:hover:bg-base-200 dark:disabled:hover:bg-base-700 ';
98
+ return 'text-neutral-800 dark:text-neutral-300 hover:text-neutral-900 disabled:text-neutral-400 dark:disabled:text-neutral-500 dark:hover:text-neutral-200 bg-neutral-200 dark:bg-neutral-700 hover:bg-neutral-300 dark:hover:bg-neutral-600 disabled:hover:bg-neutral-200 dark:disabled:hover:bg-neutral-700 ';
99
99
  case 'primary':
100
- return 'text-primary-100 hover:text-primary-50 bg-primary-600 hover:bg-primary-500 disabled:text-base-400 dark:disabled:text-base-500 disabled:bg-base-200 dark:disabled:bg-base-700 disabled:hover:bg-base-200 dark:disabled:hover:bg-base-700 ';
100
+ return 'text-primary-100 hover:text-primary-50 bg-primary-600 hover:bg-primary-500 disabled:text-neutral-400 dark:disabled:text-neutral-500 disabled:bg-neutral-200 dark:disabled:bg-neutral-700 disabled:hover:bg-neutral-200 dark:disabled:hover:bg-neutral-700 ';
101
101
  case 'border':
102
102
  case 'border-base':
103
- return 'border-2 text-base-800 dark:text-base-300 hover:text-base-900 disabled:text-base-400 dark:disabled:text-base-500 dark:hover:text-base-200 border-base-200 hover:border-base-300 dark:border-base-700 dark:hover:border-base-600 dark:disabled:border-base-200 dark:disabled:hover:border-base-200 dark:disabled:border-base-700 dark:disabled:hover:border-base-700 ';
103
+ return 'border-2 text-neutral-800 dark:text-neutral-300 hover:text-neutral-900 disabled:text-neutral-400 dark:disabled:text-neutral-500 dark:hover:text-neutral-200 border-neutral-200 hover:border-neutral-300 dark:border-neutral-700 dark:hover:border-neutral-600 dark:disabled:border-neutral-200 dark:disabled:hover:border-neutral-200 dark:disabled:border-neutral-700 dark:disabled:hover:border-neutral-700 ';
104
104
  case 'border-primary':
105
- return 'border-2 text-primary hover:text-primary-500 disabled:text-base-400 dark:disabled:text-base-500 border-primary hover:border-primary-500 dark:border-primary-600 dark:hover:border-primary-500 dark:disabled:border-base-200 dark:disabled:hover:border-base-200 dark:disabled:border-base-700 dark:disabled:hover:border-base-700 ';
105
+ return 'border-2 text-primary hover:text-primary-500 disabled:text-neutral-400 dark:disabled:text-neutral-500 border-primary hover:border-primary-500 dark:border-primary-600 dark:hover:border-primary-500 dark:disabled:border-neutral-200 dark:disabled:hover:border-neutral-200 dark:disabled:border-neutral-700 dark:disabled:hover:border-neutral-700 ';
106
106
  }
107
107
  });
108
108
 
@@ -34,7 +34,7 @@
34
34
  appearance="none"
35
35
  size="none"
36
36
  {iconPath}
37
- className="w-12 h-12 rounded-full hover:bg-base-50 dark:hover:bg-base-900 {className}"
37
+ className="w-12 h-12 rounded-full hover:bg-neutral-50 dark:hover:bg-neutral-900 {className}"
38
38
  {iconClassName}
39
39
  {onClick}
40
40
  />
@@ -33,7 +33,7 @@
33
33
  <Button
34
34
  {id}
35
35
  {iconPath}
36
- className="w-12 h-12 rounded-full text-base-500 hover:text-base-600 hover:bg-base-50 dark:hover:bg-base-900 transition-all {className}"
36
+ className="w-12 h-12 rounded-full text-neutral-500 hover:text-neutral-600 hover:bg-neutral-50 dark:hover:bg-neutral-900 transition-all {className}"
37
37
  {iconClassName}
38
38
  {onClick}
39
39
  />
@@ -135,7 +135,7 @@
135
135
 
136
136
  <div
137
137
  role="dialog"
138
- class="absolute right-0 z-10 max-h-[50vh] min-w-40 origin-top overflow-y-auto rounded-md bg-white shadow-lg transition duration-100 ease-out dark:bg-base-800 dark:shadow-black {dropdownClassName} {dropdownState ===
138
+ class="absolute right-0 z-10 max-h-[50vh] min-w-40 origin-top overflow-y-auto rounded-md bg-white shadow-lg transition duration-100 ease-out dark:bg-neutral-800 dark:shadow-black {dropdownClassName} {dropdownState ===
139
139
  DropdownStateEnum.OPENED
140
140
  ? `scale-100 transform opacity-100 ${dropdownOpenClassName}`
141
141
  : `scale-60 transform opacity-0 ${dropdownCloseClassName}`}"
@@ -128,7 +128,7 @@
128
128
  {/if}
129
129
  {#if subtitle}
130
130
  <div
131
- class="overflow-hidden whitespace-nowrap overflow-ellipsis text-base-400 dark:text-base-300 text-sm font-light {subtitleClassName}"
131
+ class="overflow-hidden whitespace-nowrap overflow-ellipsis text-neutral-400 dark:text-neutral-300 text-sm font-light {subtitleClassName}"
132
132
  >
133
133
  {subtitle || ''}
134
134
  </div>
@@ -140,14 +140,14 @@
140
140
  path={isChecked ? checkboxIconPath : uncheckboxIconPath}
141
141
  className="w-5 h-5 {checkboxClassName} {isChecked
142
142
  ? `text-primary ${checkboxIconClassName}`
143
- : `text-base-400 ${uncheckboxIconClassName}`}"
143
+ : `text-neutral-400 ${uncheckboxIconClassName}`}"
144
144
  />
145
145
  </div>
146
146
  {/if}
147
147
 
148
148
  {#if hasArrow}
149
149
  <div class="flex-none">
150
- <Icon path={arrowIconPath} className="w-5 h-5 text-base-500 {arrowClassName} " />
150
+ <Icon path={arrowIconPath} className="w-5 h-5 text-neutral-500 {arrowClassName} " />
151
151
  </div>
152
152
  {/if}
153
153
  {#if hasMenu}
@@ -167,7 +167,7 @@
167
167
  <Button
168
168
  id="{id}-list-item-{index}"
169
169
  type="button"
170
- className="w-full !text-start !justify-start gap-4 hover:bg-base-50 transition rounded-none dark:hover:bg-base-700 h-full {className}"
170
+ className="w-full !text-start !justify-start gap-4 hover:bg-neutral-50 transition rounded-none dark:hover:bg-neutral-700 h-full {className}"
171
171
  {onClick}
172
172
  {disabled}
173
173
  {appearance}
@@ -58,7 +58,7 @@
58
58
  onclick={toggle}
59
59
  aria-label="Switch"
60
60
  class="relative inline-flex items-center rounded-full transition-colors duration-300
61
- {checked ? 'bg-primary-600' : 'bg-base-300'}
61
+ {checked ? 'bg-primary-600' : 'bg-neutral-300'}
62
62
  {disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}
63
63
  {sizeClass.wrapper} {className}"
64
64
  >
@@ -305,7 +305,7 @@
305
305
  <!-- svelte-ignore a11y_no_static_element_interactions -->
306
306
  <div
307
307
  tabindex="-1"
308
- class="relative flex flex-col transform overflow-hidden bg-base-50 dark:bg-base-800 text-left transition-all outline-none {size ==
308
+ class="relative flex flex-col transform overflow-hidden bg-neutral-50 dark:bg-neutral-800 text-left transition-all outline-none {size ==
309
309
  DialogSizeEnum.FULL
310
310
  ? 'max-h-dvh max-w-dvw'
311
311
  : 'max-h-[90dvh] max-w-[90dvw]'} {screenSizeClassNameMap[size]} {isOpened
@@ -337,12 +337,12 @@
337
337
  </div>
338
338
  <div class="py-2 flex-grow">
339
339
  {#if hasTitle}
340
- <div class="text-xl text-base-800 dark:text-base-300 {titleClassName}">
340
+ <div class="text-xl text-neutral-800 dark:text-neutral-300 {titleClassName}">
341
341
  {@html customTitle || title || ''}
342
342
  </div>
343
343
  {/if}
344
344
  {#if hasSubtitle}
345
- <div class="text-sm text-gray-500 dark:text-base-500 {subtitleClassName}">
345
+ <div class="text-sm text-gray-500 dark:text-neutral-500 {subtitleClassName}">
346
346
  {subtitle || ''}
347
347
  </div>
348
348
  {/if}
@@ -17,6 +17,6 @@
17
17
  });
18
18
  </script>
19
19
 
20
- <div class="p-6 text-base-800 dark:text-base-300 {className}">
20
+ <div class="p-6 text-neutral-800 dark:text-neutral-300 {className}">
21
21
  <div>{@html msg || ''}</div>
22
22
  </div>
@@ -168,14 +168,14 @@
168
168
  path={isSelected ? checkboxIconPath : uncheckboxIconPath}
169
169
  className="w-5 h-5 {checkboxClassName} {isSelected
170
170
  ? `text-primary ${checkboxIconClassName}`
171
- : `text-base-400 ${uncheckboxIconClassName}`}"
171
+ : `text-neutral-400 ${uncheckboxIconClassName}`}"
172
172
  />
173
173
  </div>
174
174
  {/if}
175
175
 
176
176
  {#if hasArrow}
177
177
  <div>
178
- <Icon path={arrowIconPath} className="w-5 h-5 text-base-500 {arrowClassName} " />
178
+ <Icon path={arrowIconPath} className="w-5 h-5 text-neutral-500 {arrowClassName} " />
179
179
  </div>
180
180
  {/if}
181
181
  </ButtonListItem>
@@ -1,7 +1,6 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
 
4
-
5
4
  type PositionType = 'left' | 'right' | 'top' | 'bottom';
6
5
 
7
6
  type PropsType = {
@@ -60,7 +59,7 @@
60
59
  <div {id} class="relative z-30 {containerClassName}" role="dialog" aria-modal="true">
61
60
  <!-- Backdrop -->
62
61
  <div
63
- class="fixed inset-0 bg-base-900/10 bg-base-50/10 transition-opacity ease-linear duration-300 {isOpened
62
+ class="fixed inset-0 bg-neutral-900/10 bg-neutral-50/10 transition-opacity ease-linear duration-300 {isOpened
64
63
  ? 'opacity-100'
65
64
  : 'opacity-0'} {backdropClassName}"
66
65
  aria-hidden="true"
@@ -86,7 +85,7 @@
86
85
  {drawerClassName} "
87
86
  >
88
87
  <div
89
- class="grow w-72 bg-white dark:bg-base-800 text-base-800 dark:text-base-200 border-base-100 dark:border-base-700 {className}"
88
+ class="grow w-72 bg-white dark:bg-neutral-800 text-neutral-800 dark:text-neutral-200 border-neutral-100 dark:border-neutral-700 {className}"
90
89
  >
91
90
  {#if children}
92
91
  {@render children()}
@@ -97,9 +96,15 @@
97
96
  {@render floatingSnippet()}
98
97
  {/if}
99
98
  </div>
100
- </div>
99
+ </div>
101
100
 
102
- <button class="flex-grow cursor-auto" type="button" onclick={handelBackdropClick} aria-label="Close drawer" title="Close drawer"></button>
101
+ <button
102
+ class="flex-grow cursor-auto"
103
+ type="button"
104
+ onclick={handelBackdropClick}
105
+ aria-label="Close drawer"
106
+ title="Close drawer"
107
+ ></button>
103
108
  </div>
104
109
  </div>
105
110
  {/if}
@@ -46,10 +46,10 @@
46
46
 
47
47
  {#snippet labelSnippet()}
48
48
  <div class="text-sm leading-6 mx-4 flex-grow">
49
- <div class="font-medium text-sm text-base-900 dark:text-base-100 {labelClassName}">
49
+ <div class="font-medium text-sm text-neutral-900 dark:text-neutral-100 {labelClassName}">
50
50
  {label || ''}
51
51
  </div>
52
- <div class="text-xs text-base-500 dark:text-base-500 {descClassName}">{desc || ''}</div>
52
+ <div class="text-xs text-neutral-500 dark:text-neutral-500 {descClassName}">{desc || ''}</div>
53
53
  </div>
54
54
  {/snippet}
55
55
  <div class=" {containerClassName}">
@@ -64,7 +64,7 @@
64
64
  aria-describedby="comments-description"
65
65
  name={name || id}
66
66
  type="checkbox"
67
- class="h-6 w-6 appearance-none cursor-pointer rounded color-primary hover:color-primary bg-base-200 dark:bg-base-700 dark:checked:bg-primary checked:bg-primary checked:focus:bg-primary checked:hover:bg-primary focus:ring-primary focus:shadow-primary outline-primary border-base-300 dark:border-base-600 {className}"
67
+ class="h-6 w-6 appearance-none cursor-pointer rounded color-primary hover:color-primary bg-neutral-200 dark:bg-neutral-700 dark:checked:bg-primary checked:bg-primary checked:focus:bg-primary checked:hover:bg-primary focus:ring-primary focus:shadow-primary outline-primary border-neutral-300 dark:border-neutral-600 {className}"
68
68
  onchange={(ev) => handleChange(ev)}
69
69
  />
70
70
  {#if position == 'left'}
@@ -85,7 +85,7 @@
85
85
  <button
86
86
  id="btn-color-picker-{name || id}"
87
87
  type="button"
88
- class="px-2 h-full hover:bg-base-100 dark:hover:bg-base-900 focus:outline-primary {btnRoundedClassName}"
88
+ class="px-2 h-full hover:bg-neutral-100 dark:hover:bg-neutral-900 focus:outline-primary {btnRoundedClassName}"
89
89
  use:ripple
90
90
  onclick={handleColorBtnClick}
91
91
  >
@@ -52,11 +52,7 @@
52
52
  <script lang="ts">
53
53
  import ButtonListItem from '../../../button/components/button-list-item/button-list-item.svelte';
54
54
  import Button from '../../../button/components/button/button.svelte';
55
- import {
56
- mdiCheckCircle,
57
- mdiCheckCircleOutline,
58
- mdiUnfoldMoreHorizontal
59
- } from '../../../icon';
55
+
60
56
  import Icon from '../../../icon/components/icon/icon.svelte';
61
57
  import NoData from '../../../no-data/components/no-data/no-data.svelte';
62
58
  import type { Snippet } from 'svelte';
@@ -64,6 +60,7 @@
64
60
  import SearchField from '../search-field/search-field.svelte';
65
61
  import { SvelteSet } from 'svelte/reactivity';
66
62
  import VirtualScrollingList from '../../../common/components/virtual-scrolling/virtual-scrolling-list.svelte';
63
+ import { mdiCheckCircle, mdiCheckCircleOutline, mdiUnfoldMoreHorizontal } from '../../../icon/index.js';
67
64
 
68
65
  let {
69
66
  appearance,
@@ -153,7 +150,11 @@
153
150
 
154
151
  if (dropPosition === 'bottom' && spaceBelow < dropdownHeight && spaceAbove > dropdownHeight) {
155
152
  placement = 'bottom-full mb-1';
156
- } else if (dropPosition === 'top' && spaceAbove < dropdownHeight && spaceBelow > dropdownHeight) {
153
+ } else if (
154
+ dropPosition === 'top' &&
155
+ spaceAbove < dropdownHeight &&
156
+ spaceBelow > dropdownHeight
157
+ ) {
157
158
  placement = 'mt-1';
158
159
  } else if (dropPosition === 'middle') {
159
160
  const spaceNeeded = dropdownHeight / 2;
@@ -364,7 +365,7 @@
364
365
  {#if hasComboboxIcon}
365
366
  <Icon
366
367
  path={comboboxIconPath}
367
- className=" text-base-500 {comboboxIconSizeClassName} {comboboxIconClassName}"
368
+ className=" text-neutral-500 {comboboxIconSizeClassName} {comboboxIconClassName}"
368
369
  />
369
370
  {/if}
370
371
  </div>
@@ -377,13 +378,13 @@
377
378
  <div class="flex items-center {displayClassName}" title={displayItemsTitle}>
378
379
  {#each displayItems?.slice(0, displayItemsCount) as item, index}
379
380
  <div
380
- class="inline-flex items-center bg-base-200 text-base-700 text-sm font-medium px-2 mx-1 rounded-full text-nowrap {chipClassName}"
381
+ class="inline-flex items-center bg-neutral-200 text-neutral-700 text-sm font-medium px-2 mx-1 rounded-full text-nowrap {chipClassName}"
381
382
  >
382
383
  {item}
383
384
  </div>
384
385
  {/each}
385
386
  {#if displayItemsCount && displayItems?.length > (displayItemsCount || 1)}
386
- <div class="px-2 text-base-400">+ {displayItems?.length - (displayItemsCount || 1)}</div>
387
+ <div class="px-2 text-neutral-400">+ {displayItems?.length - (displayItemsCount || 1)}</div>
387
388
  {/if}
388
389
  </div>
389
390
  {:else}
@@ -428,7 +429,7 @@
428
429
  <!-- svelte-ignore a11y_interactive_supports_focus -->
429
430
  <div
430
431
  bind:clientHeight={dropdownHeight}
431
- class="absolute z-10 {placementClassName} max-h-80 w-full flex flex-col rounded-md bg-white dark:bg-base-900 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm {hasDropdownHeader
432
+ class="absolute z-10 {placementClassName} max-h-80 w-full flex flex-col rounded-md bg-white dark:bg-neutral-900 text-neutral-600 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm {hasDropdownHeader
432
433
  ? ''
433
434
  : 'pt-1'} {hasDropdownFooter ? '' : 'pb-1'} {dropdownClassName}"
434
435
  id="options"
@@ -489,7 +490,7 @@
489
490
  path={isSelected ? checkboxIconPath : uncheckboxIconPath}
490
491
  className="w-5 h-5 {checkboxClassName} {isSelected
491
492
  ? `text-primary ${checkboxIconClassName}`
492
- : `text-base-400 ${uncheckboxIconClassName}`}"
493
+ : `text-neutral-400 ${uncheckboxIconClassName}`}"
493
494
  />
494
495
  </div>
495
496
  {/if}
@@ -141,123 +141,141 @@
141
141
 
142
142
  let inputRef: HTMLInputElement | HTMLTextAreaElement | null = $state(null);
143
143
 
144
- let sizeClassName = $state('');
145
- let appearanceClassName = $state('');
146
- let floatingLabelClassName = $state('');
147
- let floatingLabelPaddingClassName = $state('');
148
- let floatingLabelTextClassName = $state('');
144
+ let nameDerived = $derived(name || id);
145
+ let idDerived = $derived(id || name);
149
146
 
150
- export function focus() {
151
- inputRef && inputRef.focus();
152
- }
153
-
154
- export function getElement() {
155
- return inputRef;
156
- }
157
-
158
- export function select() {
159
- return inputRef && (inputRef as HTMLInputElement).select();
160
- }
161
-
162
- export function getBoundingClientRect() {
163
- if (inputRef) {
164
- return inputRef.getBoundingClientRect();
147
+ let containerClassNameDerived = $derived.by(() => {
148
+ if (floatingLabel || leftSnippet != null || rightSnippet != null) {
149
+ return (containerClassName || '') + ' relative';
165
150
  }
166
- }
151
+ return containerClassName;
152
+ });
167
153
 
168
- $effect(() => {
169
- if (floatingLabel || leftSnippet != null || rightSnippet != null) {
170
- containerClassName = (containerClassName || '') + ' relative';
154
+ let sizeClassName = $derived.by(() => {
155
+ let sizeClassName = '';
156
+ if (size) {
157
+ switch (size) {
158
+ case 'lg':
159
+ sizeClassName = 'p-4 text-base';
160
+ break;
161
+ case 'md':
162
+ sizeClassName = 'p-2.5 text-sm';
163
+ break;
164
+ case 'sm':
165
+ sizeClassName = 'p-2 text-xs';
166
+ break;
167
+ case 'xs':
168
+ sizeClassName = 'p-1 text-xs';
169
+ break;
170
+ }
171
171
  }
172
+ return sizeClassName;
172
173
  });
173
174
 
174
- $effect(() => {
175
+ let floatingLabelPaddingClassName = $derived.by(() => {
175
176
  if (floatingLabel) {
176
177
  if (size) {
177
- let flpcn = '';
178
+ let floatingClassName = '';
178
179
  switch (size) {
179
180
  case 'lg':
180
- flpcn = ` px-1 peer-focus:px-1 peer-placeholder-shown:px-4 `;
181
- floatingLabelTextClassName = 'text-base';
181
+ floatingClassName = ` px-1 peer-focus:px-1 peer-placeholder-shown:px-4 `;
182
182
  break;
183
183
  case 'md':
184
- flpcn = ' px-1 peer-focus:px-1 peer-placeholder-shown:px-2.5 ';
185
- floatingLabelTextClassName = 'text-sm';
184
+ floatingClassName = ' px-1 peer-focus:px-1 peer-placeholder-shown:px-2.5 ';
185
+ break;
186
+ case 'sm':
187
+ floatingClassName = ' px-1 peer-focus:px-1 peer-placeholder-shown:px-2';
188
+ break;
189
+ case 'xs':
190
+ floatingClassName = ' px-0 peer-focus:px-0 peer-placeholder-shown:px-1 ';
191
+ break;
192
+ }
193
+ return floatingClassName;
194
+ }
195
+ }
196
+ return '';
197
+ });
186
198
 
199
+ let floatingLabelTextClassName = $derived.by(() => {
200
+ let className = '';
201
+ if (floatingLabel) {
202
+ if (size) {
203
+ switch (size) {
204
+ case 'lg':
205
+ className = 'text-base';
206
+ break;
207
+ case 'md':
208
+ className = 'text-sm';
187
209
  break;
188
210
  case 'sm':
189
- flpcn = ' px-1 peer-focus:px-1 peer-placeholder-shown:px-2';
190
- floatingLabelTextClassName = 'text-xs';
211
+ className = 'text-xs';
191
212
  break;
192
213
  case 'xs':
193
- flpcn = ' px-0 peer-focus:px-0 peer-placeholder-shown:px-1 ';
194
- floatingLabelTextClassName = 'text-xs';
214
+ className = 'text-xs';
195
215
  break;
196
216
  }
197
- floatingLabelPaddingClassName = flpcn;
198
217
  }
218
+ }
219
+ return className;
220
+ });
199
221
 
200
- floatingLabelClassName = `absolute duration-300 transform top-0 rounded -translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-0 peer-placeholder-shown:start-0 peer-focus:start-1 bg-white peer-focus:bg-white dark:bg-base-700 peer-focus:bg-base-800 peer-placeholder-shown:bg-transparent start-1 ${floatingLabelPaddingClassName} ${floatingLabelTextClassName}`;
222
+ let floatingLabelClassName = $derived.by(() => {
223
+ if (floatingLabel) {
224
+ return `absolute duration-300 transform top-0 rounded -translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-0 peer-placeholder-shown:start-0 peer-focus:start-1 bg-white peer-focus:bg-white dark:bg-neutral-700 peer-focus:bg-neutral-800 peer-placeholder-shown:bg-transparent start-1 ${floatingLabelPaddingClassName} ${floatingLabelTextClassName}`;
201
225
  }
226
+ return '';
202
227
  });
203
228
 
204
- $effect(() => {
229
+ let appearanceClassName = $derived.by(() => {
230
+ let className = '';
205
231
  if (appearance) {
206
232
  switch (appearance) {
207
233
  case 'normal':
208
- appearanceClassName =
209
- 'border rounded-lg bg-base-100 dark:bg-base-700 border-base-300 dark:border-base-500 text-base-950 dark:text-base-50 focus:ring-primary-500 focus:border-primary-500 dark:focus:ring-primary-500 dark:focus:border-primary-500 focus:bg-base-50 dark:focus:bg-base-800 ';
234
+ className =
235
+ 'border rounded-lg bg-neutral-100 dark:bg-neutral-700 border-neutral-300 dark:border-neutral-500 text-neutral-950 dark:text-neutral-50 focus:ring-primary-500 focus:border-primary-500 dark:focus:ring-primary-500 dark:focus:border-primary-500 focus:bg-neutral-50 dark:focus:bg-neutral-800 ';
210
236
  break;
211
237
  case 'box':
212
- appearanceClassName =
213
- 'border bg-base-100 dark:bg-base-700 border-base-300 dark:border-base-500 text-base-950 dark:text-base-50 focus:ring-primary-500 focus:border-primary-500 dark:focus:ring-primary-500 dark:focus:border-primary-500 focus:bg-base-50 dark:focus:bg-base-800 ';
238
+ className =
239
+ 'border bg-neutral-100 dark:bg-neutral-700 border-neutral-300 dark:border-neutral-500 text-neutral-950 dark:text-neutral-50 focus:ring-primary-500 focus:border-primary-500 dark:focus:ring-primary-500 dark:focus:border-primary-500 focus:bg-neutral-50 dark:focus:bg-neutral-800 ';
214
240
  break;
215
241
  case 'fill':
216
- appearanceClassName =
217
- ' border-0 appearance-none focus:ring-0 bg-base-100 dark:bg-base-700 text-base-950 dark:text-base-50 focus:bg-base-50 dark:focus:bg-base-800 ';
242
+ className =
243
+ ' border-0 appearance-none focus:ring-0 bg-neutral-100 dark:bg-neutral-700 text-neutral-950 dark:text-neutral-50 focus:bg-neutral-50 dark:focus:bg-neutral-800 ';
218
244
  break;
219
245
  case 'underline':
220
- appearanceClassName =
221
- 'bg-transparent border-0 border-b-2 appearance-none focus:ring-0 text-base-950 dark:text-base-50 border-base-300 dark:border-base-700 focus:border-primary-500 dark:focus:border-primary-500';
246
+ className =
247
+ 'bg-transparent border-0 border-b-2 appearance-none focus:ring-0 text-neutral-950 dark:text-neutral-50 border-neutral-300 dark:border-neutral-700 focus:border-primary-500 dark:focus:border-primary-500';
222
248
  break;
223
249
  case 'fill-underline':
224
- appearanceClassName =
225
- 'border-0 border-b-2 appearance-none ring-0 text-base-950 dark:text-base-50 bg-base-100 dark:bg-base-700 border-base-300 dark:border-base-500 focus:border-primary-500 dark:focus:border-primary-500 ';
250
+ className =
251
+ 'border-0 border-b-2 appearance-none ring-0 text-neutral-950 dark:text-neutral-50 bg-neutral-100 dark:bg-neutral-700 border-neutral-300 dark:border-neutral-500 focus:border-primary-500 dark:focus:border-primary-500 ';
226
252
  break;
227
253
  case 'none':
228
- appearanceClassName =
229
- 'border-0 focus:ring-0 appearance-none text-base-950 dark:text-base-50 bg-transparent dark:bg-transparent focus:bg-base-100 dark:focus:bg-base-800 hover:bg-base-100 dark:hover:bg-base-800';
254
+ className =
255
+ 'border-0 focus:ring-0 appearance-none text-neutral-950 dark:text-neutral-50 bg-transparent dark:bg-transparent focus:bg-neutral-100 dark:focus:bg-neutral-800 hover:bg-neutral-100 dark:hover:bg-neutral-800';
230
256
  break;
231
257
  }
232
258
  }
259
+ return className;
233
260
  });
234
261
 
235
- $effect(() => {
236
- if (size) {
237
- switch (size) {
238
- case 'lg':
239
- sizeClassName = 'p-4 text-base';
240
- break;
241
- case 'md':
242
- sizeClassName = 'p-2.5 text-sm';
243
- break;
244
- case 'sm':
245
- sizeClassName = 'p-2 text-xs';
246
- break;
247
- case 'xs':
248
- sizeClassName = 'p-1 text-xs';
249
- break;
250
- }
251
- }
252
- });
262
+ export function focus() {
263
+ inputRef && inputRef.focus();
264
+ }
253
265
 
254
- $effect(() => {
255
- if (name && !id) {
256
- id = name;
257
- } else if (id && !name) {
258
- name = id;
266
+ export function getElement() {
267
+ return inputRef;
268
+ }
269
+
270
+ export function select() {
271
+ return inputRef && (inputRef as HTMLInputElement).select();
272
+ }
273
+
274
+ export function getBoundingClientRect() {
275
+ if (inputRef) {
276
+ return inputRef.getBoundingClientRect();
259
277
  }
260
- });
278
+ }
261
279
 
262
280
  $effect(() => {
263
281
  setTimeout(() => {
@@ -270,9 +288,9 @@
270
288
 
271
289
  {#snippet labelSnippet()}
272
290
  <Label
273
- forName={id}
291
+ forName={idDerived}
274
292
  {label}
275
- className=" {floatingLabel ? '' : 'mb-1 '} {floatingLabelClassName} {labelClassName}"
293
+ className=" {floatingLabel ? '' : 'mb-1 '} {floatingLabelClassName} {labelClassName}"
276
294
  {required}
277
295
  {requiredSymbolColor}
278
296
  {requiredSymbol}
@@ -284,10 +302,10 @@
284
302
  {@render labelSnippet()}
285
303
  {/if}
286
304
 
287
- <div class="w-full {containerClassName}">
305
+ <div class="w-full {containerClassNameDerived}">
288
306
  {#if leftSnippet}
289
307
  <div
290
- class="absolute flex items-center justify-center left-children {leftSnippetContainerClassName}"
308
+ class="left-children absolute flex items-center justify-center {leftSnippetContainerClassName}"
291
309
  >
292
310
  {@render leftSnippet()}
293
311
  </div>
@@ -297,10 +315,10 @@
297
315
  <textarea
298
316
  bind:this={inputRef}
299
317
  bind:value
300
- class="block w-full peer outline-none {appearanceClassName} {sizeClassName} {className}"
318
+ class="peer block w-full outline-none {appearanceClassName} {sizeClassName} {className}"
301
319
  {title}
302
- {id}
303
- {name}
320
+ id={idDerived}
321
+ name={nameDerived}
304
322
  {placeholder}
305
323
  {required}
306
324
  {disabled}
@@ -328,11 +346,11 @@
328
346
  <input
329
347
  bind:this={inputRef}
330
348
  bind:value
331
- class="block w-full peer outline-none {appearanceClassName} {sizeClassName} {className}"
349
+ class="peer block w-full outline-none {appearanceClassName} {sizeClassName} {className}"
332
350
  {title}
333
351
  {type}
334
- {id}
335
- {name}
352
+ id={idDerived}
353
+ name={nameDerived}
336
354
  {placeholder}
337
355
  {required}
338
356
  {disabled}
@@ -365,14 +383,14 @@
365
383
  {/if}
366
384
  {#if contentSnippet}
367
385
  <div
368
- class="absolute inset-0 pointer-events-none block w-full overflow-hidden {appearanceClassName} {sizeClassName} {contentSnippetClassName}"
386
+ class="pointer-events-none absolute inset-0 block w-full overflow-hidden {appearanceClassName} {sizeClassName} {contentSnippetClassName}"
369
387
  >
370
388
  {@render contentSnippet()}
371
389
  </div>
372
390
  {/if}
373
391
  {#if rightSnippet}
374
392
  <div
375
- class="absolute flex items-center justify-center right-children {rightSnippetContainerClassName}"
393
+ class="right-children absolute flex items-center justify-center {rightSnippetContainerClassName}"
376
394
  >
377
395
  {@render rightSnippet()}
378
396
  </div>
@@ -26,7 +26,9 @@
26
26
 
27
27
  <label
28
28
  for={forName || ''}
29
- class="block text-sm text-base-500 dark:text-base-400 {hasRequiredSymbol && required ? 'required' : ''} {className}"
29
+ class="block text-sm text-neutral-500 dark:text-neutral-400 {hasRequiredSymbol && required
30
+ ? 'required'
31
+ : ''} {className}"
30
32
  style="--requiredSymbolColor:{requiredSymbolColor}; --requiredSymbol: '{requiredSymbol}'; "
31
33
  >
32
34
  {#if children}
@@ -74,7 +74,7 @@
74
74
  <button
75
75
  id="btn-eye-{name || id}"
76
76
  type="button"
77
- class="px-3 h-full hover:bg-base-100 focus:outline-primary {btnRoundedClassName} {buttonClassName}"
77
+ class="px-3 h-full hover:bg-neutral-100 focus:outline-primary {btnRoundedClassName} {buttonClassName}"
78
78
  use:ripple
79
79
  onclick={handleTogglePassword}
80
80
  >
@@ -129,7 +129,7 @@
129
129
  type="radio"
130
130
  value={item.value}
131
131
  checked={value === item.value}
132
- class="h-6 w-6 appearance-none rounded-full bg-base-200 dark:bg-base-700 dark:checked:bg-primary checked:bg-primary checked:hover:bg-primary checked:focus:bg-primary focus:ring-primary focus:shadow-primary outline-primary border-base-300 dark:border-base-600 {className}"
132
+ class="h-6 w-6 appearance-none rounded-full bg-neutral-200 dark:bg-neutral-700 dark:checked:bg-primary checked:bg-primary checked:hover:bg-primary checked:focus:bg-primary focus:ring-primary focus:shadow-primary outline-primary border-neutral-300 dark:border-neutral-600 {className}"
133
133
  onchange={(ev) => handleChange(ev, item)}
134
134
  />
135
135
 
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
- import { mdiMagnify } from '../../../icon';
2
+
3
3
  import Icon from '../../../icon/components/icon/icon.svelte';
4
+ import { mdiMagnify } from '../../../icon/index.js';
4
5
  import InputField, { type InputFieldProps } from '../input-field/input-field.svelte';
5
6
 
6
7
  let {
@@ -78,13 +78,13 @@
78
78
  </script>
79
79
 
80
80
  <nav
81
- class="sticky top-0 z-20 flex h-16 shrink-0 items-center px-2 border-b border-base-100 dark:border-base-700 bg-white dark:bg-base-800 shadow-sm {className}"
81
+ class="sticky top-0 z-20 flex h-16 shrink-0 items-center px-2 border-b border-neutral-100 dark:border-neutral-700 bg-white dark:bg-neutral-800 shadow-sm {className}"
82
82
  >
83
83
  {#if hasBack}
84
84
  <div class="h-full flex items-center">
85
85
  <ButtonBack
86
86
  iconPath={backIconPath}
87
- className="text-base-800 dark:text-base-100 {backButtonClassName}"
87
+ className="text-neutral-800 dark:text-neutral-100 {backButtonClassName}"
88
88
  onClick={onBack}
89
89
  />
90
90
  </div>
@@ -93,7 +93,7 @@
93
93
  <div class="h-full">
94
94
  <button
95
95
  type="button"
96
- class="h-full px-2 text-base-800 dark:text-base-100 {drawerButtonClassName}"
96
+ class="h-full px-2 text-neutral-800 dark:text-neutral-100 {drawerButtonClassName}"
97
97
  disabled={disabledLogo}
98
98
  onclick={onMore}
99
99
  >
@@ -106,7 +106,7 @@
106
106
  <button
107
107
  id="btn-more"
108
108
  type="button"
109
- class="h-full px-2 rounded-0 text-base-800 dark:text-base-100 {logoButtonClassName}"
109
+ class="h-full px-2 rounded-0 text-neutral-800 dark:text-neutral-100 {logoButtonClassName}"
110
110
  disabled={!onLogo}
111
111
  onclick={onLogo}
112
112
  >
@@ -125,12 +125,12 @@
125
125
  <div class="h-full flex items-center">
126
126
  <div>
127
127
  {#if hasTitle}
128
- <div class="font-bold px-2 text-base-800 dark:text-base-100 {titleClassName}">
128
+ <div class="font-bold px-2 text-neutral-800 dark:text-neutral-100 {titleClassName}">
129
129
  {title || ''}
130
130
  </div>
131
131
  {/if}
132
132
  {#if hasSubtitle}
133
- <div class="text-sm px-2 text-base-600 dark:text-base-500 {subtitleClassName}">
133
+ <div class="text-sm px-2 text-neutral-600 dark:text-neutral-500 {subtitleClassName}">
134
134
  {subtitle || ''}
135
135
  </div>
136
136
  {/if}
@@ -158,7 +158,7 @@
158
158
  <button
159
159
  id="btn-more"
160
160
  type="button"
161
- class="h-full px-2 text-base-800 dark:text-base-100 {drawerButtonClassName}"
161
+ class="h-full px-2 text-neutral-800 dark:text-neutral-100 {drawerButtonClassName}"
162
162
  disabled={!onMore}
163
163
  onclick={onMore}
164
164
  >
@@ -94,7 +94,7 @@
94
94
  <Button {disabled} {onClick} iconPath={icon} />
95
95
  {/snippet}
96
96
 
97
- <div class="flex items-center flex-wrap justify-end text-base-500 gap-3 -mb-2">
97
+ <div class="flex items-center flex-wrap justify-end text-neutral-500 gap-3 -mb-2">
98
98
  <div class="flex-grow">{itemsText} {itemsCount}</div>
99
99
  <div class="flex items-center flex-nowrap gap-2">
100
100
  <div>{pageSizeText}</div>
@@ -108,7 +108,7 @@
108
108
  onMenu={(ev, menu) => handlePageSizeMenu(ev, menu as string)}
109
109
  />
110
110
  </div>
111
- <div class="text-base-500">
111
+ <div class="text-neutral-500">
112
112
  <span>
113
113
  {pageText}
114
114
  </span>
@@ -38,7 +38,8 @@
38
38
 
39
39
  <div
40
40
  {id}
41
- class="hidden bg-white dark:bg-base-800 text-base-800 dark:text-base-200 border-base-100 dark:border-base-700 pt-16 {responsiveClassName} {position == 'right'
41
+ class="hidden bg-white dark:bg-neutral-800 text-neutral-800 dark:text-neutral-200 border-neutral-100 dark:border-neutral-700 pt-16 {responsiveClassName} {position ==
42
+ 'right'
42
43
  ? 'right-0'
43
44
  : ''} {className}"
44
45
  >
@@ -11,7 +11,6 @@
11
11
  </script>
12
12
 
13
13
  <script lang="ts">
14
-
15
14
  let isPlaced: boolean = $state(false);
16
15
  let isOpened: boolean = $state(false);
17
16
 
@@ -46,7 +45,7 @@
46
45
  {#if isPlaced}
47
46
  <div
48
47
  {id}
49
- class="fixed bottom-20 left-1/2 transform -translate-x-1/2 p-3 px-6 max-w-full text-gray-700 bg-white shadow-xl dark:shadow-base-700 dark:bg-base-600 dark:text-base-300 rounded-full transition-opacity duration-300 {isOpened
48
+ class="fixed bottom-20 left-1/2 transform -translate-x-1/2 p-3 px-6 max-w-full text-gray-700 bg-white shadow-xl dark:shadow-neutral-700 dark:bg-neutral-600 dark:text-neutral-300 rounded-full transition-opacity duration-300 {isOpened
50
49
  ? 'opacity-100'
51
50
  : 'opacity-0'} toast {className}"
52
51
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudparker/moldex.js",
3
- "version": "4.1.1",
3
+ "version": "4.1.3",
4
4
  "keywords": [
5
5
  "svelte"
6
6
  ],