@flightlesslabs/dodo-ui 0.18.0 → 0.19.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.
Files changed (41) hide show
  1. package/dist/index.d.ts +4 -1
  2. package/dist/index.js +2 -0
  3. package/dist/stories/components/Form/DatePicker/DatePicker.svelte +1 -0
  4. package/dist/stories/components/Form/NumericInput/NumericInput.svelte +1 -0
  5. package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte +1 -0
  6. package/dist/stories/components/Form/Search/Events/Events.stories.svelte +137 -0
  7. package/dist/stories/components/Form/Search/Events/Events.stories.svelte.d.ts +18 -0
  8. package/dist/stories/components/Form/Search/Roundness/Roundness.stories.svelte +21 -0
  9. package/dist/stories/components/Form/Search/Roundness/Roundness.stories.svelte.d.ts +26 -0
  10. package/dist/stories/components/Form/Search/Search.stories.svelte +40 -0
  11. package/dist/stories/components/Form/Search/Search.stories.svelte.d.ts +21 -0
  12. package/dist/stories/components/Form/Search/Search.svelte +142 -0
  13. package/dist/stories/components/Form/Search/Search.svelte.d.ts +66 -0
  14. package/dist/stories/components/Form/Search/SearchIcon/SearchIcon.stories.svelte +27 -0
  15. package/dist/stories/components/Form/Search/SearchIcon/SearchIcon.stories.svelte.d.ts +26 -0
  16. package/dist/stories/components/Form/Search/Size/Size.stories.svelte +17 -0
  17. package/dist/stories/components/Form/Search/Size/Size.stories.svelte.d.ts +26 -0
  18. package/dist/stories/components/Form/Search/WithIcon/WithIcon.stories.svelte +47 -0
  19. package/dist/stories/components/Form/Search/WithIcon/WithIcon.stories.svelte.d.ts +26 -0
  20. package/dist/stories/components/Form/Select/Select.svelte +1 -0
  21. package/dist/stories/components/Form/Select/Select.svelte.d.ts +4 -4
  22. package/dist/stories/components/Form/TextInput/TextInput.svelte +1 -0
  23. package/dist/stories/components/Layout/Accordian/Accordian.svelte.d.ts +2 -2
  24. package/dist/stories/developer tools/components/UtilityIcon/Size/Size.stories.svelte +25 -0
  25. package/dist/stories/developer tools/components/UtilityIcon/Size/Size.stories.svelte.d.ts +26 -0
  26. package/dist/stories/developer tools/components/UtilityIcon/UtilityIcon.stories.svelte +26 -0
  27. package/dist/stories/developer tools/components/UtilityIcon/UtilityIcon.stories.svelte.d.ts +21 -0
  28. package/dist/stories/developer tools/components/UtilityIcon/UtilityIcon.svelte +58 -0
  29. package/dist/stories/developer tools/components/UtilityIcon/UtilityIcon.svelte.d.ts +19 -0
  30. package/dist/types/special.d.ts +1 -1
  31. package/package.json +9 -9
  32. package/src/lib/index.ts +5 -1
  33. package/src/lib/stories/components/Form/DatePicker/DatePicker.svelte +1 -0
  34. package/src/lib/stories/components/Form/NumericInput/NumericInput.svelte +1 -0
  35. package/src/lib/stories/components/Form/PasswordInput/PasswordInput.svelte +1 -0
  36. package/src/lib/stories/components/Form/Search/Search.svelte +285 -0
  37. package/src/lib/stories/components/Form/Select/Select.svelte +5 -4
  38. package/src/lib/stories/components/Form/TextInput/TextInput.svelte +1 -0
  39. package/src/lib/stories/components/Layout/Accordian/Accordian.svelte +2 -2
  40. package/src/lib/stories/developer tools/components/UtilityIcon/UtilityIcon.svelte +90 -0
  41. package/src/lib/types/special.ts +1 -1
@@ -80,7 +80,7 @@
80
80
  onkeyup?: KeyboardEventHandler<HTMLInputElement | HTMLButtonElement>;
81
81
  /** custom Content Formatting for variant button */
82
82
  customInputContent?: (val: SelectOption) => Snippet;
83
- /** custom Content Formatting for variant button */
83
+ /** custom Menu Item Content */
84
84
  customMenuItemContent?: (val: SelectOption, selected: boolean) => Snippet;
85
85
  /** Custom Popup Content */
86
86
  customPopupContent?: (
@@ -88,7 +88,7 @@
88
88
  selectedOption: SelectOption,
89
89
  onselect: (val: SelectOption) => void,
90
90
  ) => Snippet;
91
- /** custom Content Formatting for variant button */
91
+ /** custom Placeholder MenuItem Content */
92
92
  customPlaceholderMenuItemContent?: () => Snippet;
93
93
  /** PopperPopup Max height. Use css compatible value */
94
94
  popupMaxHeight?: string;
@@ -103,7 +103,7 @@
103
103
  /** Dropdown Arrow Icon */
104
104
  customDropdownArrowIcon?: (open: boolean) => Snippet;
105
105
  /** Select Dropdown Arrow Position */
106
- dropdownArrowPosition?: DropdownArrowPosition;
106
+ dropdownArrowPosition?: IconPosition;
107
107
  /** Popup stick horizontally */
108
108
  popupPositionX?: PositionX;
109
109
  /** Popup stick vertically */
@@ -136,7 +136,7 @@
136
136
  } from '$lib/index.js';
137
137
  import type { TextInputInputEvent } from '../TextInput/TextInput.svelte';
138
138
  import type { ButtonClickEvent } from '../Button/Button.svelte';
139
- import type { DropdownArrowPosition } from '$lib/types/special.js';
139
+ import type { IconPosition } from '$lib/types/special.js';
140
140
 
141
141
  let {
142
142
  size = 'normal',
@@ -393,6 +393,7 @@
393
393
  value={searchable ? searchTerm : selectedOption?.label}
394
394
  {readonly}
395
395
  variant={searchable ? 'input' : 'button'}
396
+ {size}
396
397
  >
397
398
  {#snippet customInputContent()}
398
399
  {#if customInputContentTyped}
@@ -157,6 +157,7 @@
157
157
  {name}
158
158
  {id}
159
159
  {disabled}
160
+ {size}
160
161
  bind:ref
161
162
  bind:focused
162
163
  {oninput}
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" module>
2
2
  import type { ComponentSize } from '$lib/types/size.js';
3
- import type { DropdownArrowPosition } from '$lib/types/special.js';
3
+ import type { IconPosition } from '$lib/types/special.js';
4
4
  import Icon from '@iconify/svelte';
5
5
  import { onMount, type Snippet } from 'svelte';
6
6
  import type { EventHandler } from 'svelte/elements';
@@ -29,7 +29,7 @@
29
29
  /** How large should the button be? */
30
30
  size?: ComponentSize;
31
31
  /** Select Dropdown Arrow Position */
32
- dropdownArrowPosition?: DropdownArrowPosition;
32
+ dropdownArrowPosition?: IconPosition;
33
33
  /** Dropdown Arrow Icon */
34
34
  customDropdownArrowIcon?: (open: boolean) => Snippet;
35
35
  }
@@ -0,0 +1,90 @@
1
+ <script lang="ts" module>
2
+ import type { ComponentSize } from '$lib/types/size.js';
3
+ import type { Snippet } from 'svelte';
4
+
5
+ export interface UtilityIconProps {
6
+ /** Button contents goes here*/
7
+ children?: Snippet;
8
+ /** Button ref */
9
+ ref?: HTMLSpanElement;
10
+ /** How large should the button be? */
11
+ size?: ComponentSize;
12
+ /** Button disabled state */
13
+ disabled?: boolean;
14
+ /** Id */
15
+ id?: string;
16
+ /** Custom css class*/
17
+ class?: string;
18
+ }
19
+ </script>
20
+
21
+ <script lang="ts">
22
+ let {
23
+ children,
24
+ size = 'normal',
25
+ id,
26
+ class: className = '',
27
+ disabled = false,
28
+ ref = $bindable<HTMLButtonElement>(),
29
+ }: UtilityIconProps = $props();
30
+ </script>
31
+
32
+ <span
33
+ class={['dodo-ui-UtilityIcon', `size--${size}`, className].join(' ')}
34
+ class:disabled
35
+ {id}
36
+ bind:this={ref}
37
+ >
38
+ {#if children}
39
+ {@render children()}
40
+ {/if}
41
+ </span>
42
+
43
+ <style lang="scss">
44
+ :global(:root) {
45
+ --dodo-ui-UtilityIcon-disabled-color: var(--dodo-color-neutral-400);
46
+ }
47
+
48
+ :global(.dodo-theme--dark) {
49
+ --dodo-ui-UtilityIcon-disabled-color: var(--dodo-color-neutral-500);
50
+ }
51
+
52
+ .dodo-ui-UtilityIcon {
53
+ outline: none;
54
+ transition: all 150ms;
55
+ text-decoration: none;
56
+ margin: 0;
57
+ display: inline-flex;
58
+ justify-content: center;
59
+ align-items: center;
60
+ font-family: inherit;
61
+ background-color: transparent;
62
+ color: var(--dodo-color-neutral-600);
63
+ font-family: inherit;
64
+
65
+ &.size {
66
+ &--normal {
67
+ height: var(--dodo-ui-element-height-normal);
68
+ width: var(--dodo-ui-element-height-normal);
69
+ font-size: 1rem;
70
+ }
71
+
72
+ &--small {
73
+ height: var(--dodo-ui-element-height-small);
74
+ width: var(--dodo-ui-element-height-small);
75
+ font-size: 0.9rem;
76
+ }
77
+
78
+ &--large {
79
+ height: var(--dodo-ui-element-height-large);
80
+ width: var(--dodo-ui-element-height-large);
81
+ font-size: 1.1rem;
82
+ }
83
+ }
84
+
85
+ &.disabled {
86
+ cursor: initial;
87
+ color: var(--dodo-ui-UtilityIcon-disabled-color);
88
+ }
89
+ }
90
+ </style>
@@ -1 +1 @@
1
- export type DropdownArrowPosition = false | 'before' | 'after';
1
+ export type IconPosition = false | 'before' | 'after';