@likable-hair/svelte 3.0.80 → 3.0.81

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.
@@ -0,0 +1,199 @@
1
+ <script context="module"></script>
2
+
3
+ <script>import lodash from "lodash";
4
+ import Autocomplete from "../../../components/simple/forms/Autocomplete.svelte";
5
+ import Button from "../../simple/buttons/Button.svelte";
6
+ import Icon from "../../simple/media/Icon.svelte";
7
+ import { createEventDispatcher } from "svelte";
8
+ import Avatar from "../../simple/media/Avatar.svelte";
9
+ import ToolTip from "../common/ToolTip.svelte";
10
+ let dispatch = createEventDispatcher();
11
+ export let items = [], values = [], multiple = true, lang = "en", searchText = void 0, maxVisibleChips = void 0, placeholder = lang == "en" ? "Select" : "Seleziona", clearable = true, mandatory = true, menuOpened = false, openingId = void 0, width = void 0;
12
+ function handleCloseClick(event) {
13
+ event.preventDefault();
14
+ event.stopPropagation();
15
+ let valuesBefore = lodash.cloneDeep(values);
16
+ values = [];
17
+ dispatch("change", {
18
+ unselect: valuesBefore[0],
19
+ select: void 0,
20
+ selection: []
21
+ });
22
+ }
23
+ $:
24
+ autocompleteItems = items.map((e) => {
25
+ return {
26
+ ...e,
27
+ label: e.label || e.text,
28
+ data: {
29
+ ...e.data || {},
30
+ text: e.text,
31
+ src: e.src,
32
+ alt: e.alt
33
+ }
34
+ };
35
+ });
36
+ let tooltipsActivator = [];
37
+ </script>
38
+
39
+ <Autocomplete
40
+ bind:items={autocompleteItems}
41
+ bind:values
42
+ bind:searchText
43
+ bind:multiple
44
+ bind:maxVisibleChips
45
+ bind:mandatory
46
+ searchFunction={() => true}
47
+ on:change
48
+ bind:menuOpened
49
+ bind:openingId
50
+ bind:width
51
+ menuWidth="144px"
52
+ >
53
+ <svelte:fragment slot="selection-container" let:openMenu let:handleKeyDown>
54
+ <button
55
+ class="unstyled-button"
56
+ on:click={openMenu}
57
+ on:keydown={(event) => {
58
+ handleKeyDown(event)
59
+ if(event.key == 'ArrowDown' || event.key == 'ArrowUp') {
60
+ event.stopPropagation()
61
+ event.preventDefault()
62
+ }
63
+ }}
64
+ >
65
+ <slot
66
+ name="label"
67
+ {values}
68
+ {items}
69
+ {searchText}
70
+ {placeholder}
71
+ {clearable}
72
+ {handleCloseClick}
73
+ >
74
+ {#if values.length > 0}
75
+ <div class="overlapped-avatars">
76
+ {#each values as avatar, i}
77
+ {#if !!avatar.tooltip || !!avatar.label }
78
+ <ToolTip activator={tooltipsActivator[i]} appearTimeout={500}>
79
+ <div class="tooltip">{avatar.tooltip || avatar.label}</div>
80
+ </ToolTip>
81
+ {/if}
82
+ <div class="single-avatar" bind:this={tooltipsActivator[i]}>
83
+ <Avatar
84
+ text={avatar.text}
85
+ alt={avatar.alt}
86
+ src={avatar.src}
87
+ --avatar-default-border="2px solid rgb(var(--global-color-background-100))"
88
+ ></Avatar>
89
+ <button
90
+ on:click|stopPropagation={() => {
91
+ values.splice(i, 1)
92
+ values = [...values]
93
+ }}
94
+ class="unstyled-button remove-button"
95
+ >
96
+ <Icon --icon-default-size="10px" name="mdi-close"></Icon>
97
+ </button>
98
+ </div>
99
+ {/each}
100
+ </div>
101
+ {:else}
102
+ <slot
103
+ name="no-values"
104
+ {values}
105
+ {items}
106
+ {searchText}
107
+ {placeholder}
108
+ {clearable}
109
+ {handleCloseClick}
110
+ >
111
+ <Icon name="mdi-account-plus"></Icon>
112
+ </slot>
113
+ {/if}
114
+ </slot>
115
+ </button>
116
+ </svelte:fragment>
117
+ <svelte:fragment slot="item-label" let:item >
118
+ <slot name="item-label" {item}>
119
+ <div class="item-label-container">
120
+ <Avatar
121
+ text={item.data.text}
122
+ alt={item.data.alt}
123
+ src={item.data.src}
124
+ --avatar-default-border="2px solid rgb(var(--global-color-background-100))"
125
+ ></Avatar>
126
+ {item.label}
127
+ </div>
128
+ </slot>
129
+ </svelte:fragment>
130
+ </Autocomplete>
131
+
132
+ <style>
133
+ .unstyled-button {
134
+ background-color: transparent;
135
+ outline: inherit;
136
+ background-image: none;
137
+ text-transform: none;
138
+ line-height: inherit;
139
+ color: inherit;
140
+ border: none;
141
+ padding: 0;
142
+ font: inherit;
143
+ cursor: pointer;
144
+ }
145
+
146
+ .overlapped-avatars {
147
+ display: flex;
148
+ flex-direction: row-reverse;
149
+ }
150
+
151
+ .single-avatar {
152
+ position: relative
153
+ }
154
+
155
+ .single-avatar {
156
+ position: relative;
157
+ }
158
+
159
+ .remove-button {
160
+ position: absolute;
161
+ display: none;
162
+ top: 0px;
163
+ right: 0px;
164
+ height: 14px;
165
+ width: 14px;
166
+ border-radius: 9999px;
167
+ line-height: 12px;
168
+ font-size: 10px;
169
+ }
170
+
171
+ .remove-button:hover {
172
+ display: flex;
173
+ }
174
+
175
+ .single-avatar:hover .remove-button {
176
+ display: flex;
177
+ justify-content: center;
178
+ align-items: center;
179
+ z-index: 5;
180
+ background-color: rgb(var(--global-color-error-500));
181
+ border: 1px solid rgb(var(--global-color-background-100));
182
+ }
183
+
184
+ .single-avatar:not(:first-child) {
185
+ margin-right: -12px;
186
+ }
187
+
188
+ .tooltip {
189
+ background-color: rgb(var(--global-color-background-200));
190
+ padding: 4px 8px;
191
+ border-radius: 8px;
192
+ }
193
+
194
+ .item-label-container {
195
+ display: flex;
196
+ align-items: center;
197
+ gap: 4px;
198
+ }
199
+ </style>
@@ -0,0 +1,58 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ export type AvatarItem = {
3
+ value: string | number;
4
+ tooltip?: string | number;
5
+ label?: string | number;
6
+ text?: string;
7
+ src?: string;
8
+ alt?: string;
9
+ data?: any;
10
+ };
11
+ declare const __propDef: {
12
+ props: {
13
+ items?: AvatarItem[] | undefined;
14
+ values?: AvatarItem[] | undefined;
15
+ multiple?: boolean | undefined;
16
+ lang?: "it" | "en" | undefined;
17
+ searchText?: string | undefined;
18
+ maxVisibleChips?: number | undefined;
19
+ placeholder?: string | undefined;
20
+ clearable?: boolean | undefined;
21
+ mandatory?: boolean | undefined;
22
+ menuOpened?: boolean | undefined;
23
+ openingId?: string | undefined;
24
+ width?: string | undefined;
25
+ };
26
+ events: {
27
+ change: CustomEvent<any>;
28
+ } & {
29
+ [evt: string]: CustomEvent<any>;
30
+ };
31
+ slots: {
32
+ label: {
33
+ values: AvatarItem[];
34
+ items: AvatarItem[];
35
+ searchText: string | undefined;
36
+ placeholder: string;
37
+ clearable: boolean;
38
+ handleCloseClick: (event: MouseEvent) => void;
39
+ };
40
+ 'no-values': {
41
+ values: AvatarItem[];
42
+ items: AvatarItem[];
43
+ searchText: string | undefined;
44
+ placeholder: string;
45
+ clearable: boolean;
46
+ handleCloseClick: (event: MouseEvent) => void;
47
+ };
48
+ 'item-label': {
49
+ item: import("../../../components/simple/forms/Autocomplete.svelte").Item;
50
+ };
51
+ };
52
+ };
53
+ export type AvatarDropdownProps = typeof __propDef.props;
54
+ export type AvatarDropdownEvents = typeof __propDef.events;
55
+ export type AvatarDropdownSlots = typeof __propDef.slots;
56
+ export default class AvatarDropdown extends SvelteComponentTyped<AvatarDropdownProps, AvatarDropdownEvents, AvatarDropdownSlots> {
57
+ }
58
+ export {};
@@ -36,6 +36,7 @@ declare const __propDef: {
36
36
  menuBoxShadow?: string | undefined;
37
37
  menuBorderRadius?: string | undefined;
38
38
  mobileDrawer?: boolean | undefined;
39
+ menuWidth?: string | undefined;
39
40
  }, "items"> | undefined;
40
41
  selected?: Item[] | undefined;
41
42
  };
@@ -9,12 +9,7 @@ declare const __propDef: {
9
9
  } | undefined;
10
10
  menuOpened?: boolean | undefined;
11
11
  openingId?: string | undefined;
12
- pattern?: string | undefined;
13
- selectedMonth?: number | undefined;
14
12
  selectedYear?: number | undefined;
15
- visibleMonth?: number | undefined;
16
- visibleYear?: number | undefined;
17
- selectedDate?: Date | undefined;
18
13
  placeholder?: string | undefined;
19
14
  mobileDialog?: boolean | undefined;
20
15
  maxYearInRange?: number | undefined;
@@ -25,7 +20,7 @@ declare const __propDef: {
25
20
  year: number;
26
21
  }>;
27
22
  input: CustomEvent<{
28
- datetime: Date | undefined;
23
+ year: number | undefined;
29
24
  }>;
30
25
  } & {
31
26
  [evt: string]: CustomEvent<any>;
@@ -50,9 +45,9 @@ declare const __propDef: {
50
45
  };
51
46
  };
52
47
  };
53
- export type YearPicketTextfieldProps = typeof __propDef.props;
54
- export type YearPicketTextfieldEvents = typeof __propDef.events;
55
- export type YearPicketTextfieldSlots = typeof __propDef.slots;
56
- export default class YearPicketTextfield extends SvelteComponentTyped<YearPicketTextfieldProps, YearPicketTextfieldEvents, YearPicketTextfieldSlots> {
48
+ export type YearPickerTextFieldProps = typeof __propDef.props;
49
+ export type YearPickerTextFieldEvents = typeof __propDef.events;
50
+ export type YearPickerTextFieldSlots = typeof __propDef.slots;
51
+ export default class YearPickerTextField extends SvelteComponentTyped<YearPickerTextFieldProps, YearPickerTextFieldEvents, YearPickerTextFieldSlots> {
57
52
  }
58
53
  export {};
@@ -8,11 +8,12 @@ import { DateTime } from "luxon";
8
8
  import { createEventDispatcher } from "svelte";
9
9
  import MediaQuery from "../../simple/common/MediaQuery.svelte";
10
10
  import Dialog from "../../simple/dialogs/Dialog.svelte";
11
+ import YearSelector from "../../simple/dates/YearSelector.svelte";
11
12
  let clazz = {};
12
13
  export { clazz as class };
13
14
  let dispatch = createEventDispatcher();
14
- export let menuOpened = false, openingId = "date-picker-text-field", pattern = "dd/MM/yyyy", selectedMonth = void 0, selectedYear = void 0, visibleMonth = void 0, visibleYear = void 0, selectedDate = void 0, placeholder = void 0, mobileDialog = true, maxYearInRange = 2100, minYearInRange = 1970;
15
- let activator, refreshPosition = false, menuElement, inputElement, mask = {
15
+ export let menuOpened = false, openingId = "year-picker-text-field", selectedYear = void 0, placeholder = void 0, mobileDialog = true, maxYearInRange = 2100, minYearInRange = 1900;
16
+ let activator, refreshPosition = false, menuElement, inputElement, pattern = "yyyy", mask = {
16
17
  value: void 0
17
18
  }, maskFactoryArgs = {
18
19
  mask: Date,
@@ -28,26 +29,6 @@ let activator, refreshPosition = false, menuElement, inputElement, mask = {
28
29
  mask: IMask.MaskedRange,
29
30
  from: minYearInRange,
30
31
  to: maxYearInRange
31
- },
32
- MM: {
33
- mask: IMask.MaskedRange,
34
- from: 1,
35
- to: 12
36
- },
37
- dd: {
38
- mask: IMask.MaskedRange,
39
- from: 1,
40
- to: 31
41
- },
42
- HH: {
43
- mask: IMask.MaskedRange,
44
- from: 0,
45
- to: 23
46
- },
47
- mm: {
48
- mask: IMask.MaskedRange,
49
- from: 0,
50
- to: 59
51
32
  }
52
33
  }
53
34
  };
@@ -61,62 +42,38 @@ onMount(() => {
61
42
  inputElement,
62
43
  maskFactoryArgs
63
44
  );
64
- if (!!selectedDate) {
65
- mask.value = DateTime.fromJSDate(selectedDate).toFormat(pattern);
45
+ if (selectedYear !== void 0) {
46
+ mask.value = selectedYear.toString();
66
47
  }
67
48
  });
68
49
  function handleInputChange(event) {
69
50
  setTimeout(() => {
70
51
  const typedValue = mask.value;
71
52
  if (typedValue !== void 0 && typedValue !== null) {
72
- const dayOfMonthIndex = pattern.indexOf("dd");
73
- const dayOfMonth = typedValue.substring(dayOfMonthIndex, dayOfMonthIndex + 2);
74
- const monthIndex = pattern.indexOf("MM");
75
- const oneBasedMonth = typedValue.substring(monthIndex, monthIndex + 2);
76
- if (oneBasedMonth.length == 2) {
77
- selectedMonth = Number(oneBasedMonth) - 1;
78
- visibleMonth = selectedMonth;
79
- }
80
53
  const yearIndex = pattern.indexOf("yyyy");
81
54
  const year = typedValue.substring(yearIndex, yearIndex + 4);
82
55
  if (year.length == 4) {
83
56
  selectedYear = Number(year);
84
- visibleYear = selectedYear;
85
- }
86
- if (typedValue.length == pattern.length) {
87
- selectedDate = DateTime.fromObject({
88
- day: Number(dayOfMonth),
89
- month: Number(oneBasedMonth),
90
- year: Number(year)
91
- }).toJSDate();
92
- } else {
93
- selectedDate = void 0;
94
57
  }
95
58
  dispatch("input", {
96
- datetime: selectedDate
59
+ year: selectedYear
97
60
  });
98
61
  }
99
62
  }, 30);
100
63
  }
101
- function handleDateSelect(ev) {
102
- if (!!selectedDate) {
103
- mask.value = DateTime.fromJSDate(selectedDate).toFormat(pattern);
64
+ function handleYearSelect(ev) {
65
+ if (!!selectedYear) {
66
+ mask.value = selectedYear.toString();
104
67
  }
105
- dispatch("day-click", {
106
- dateStat: ev.detail.dateStat
68
+ dispatch("year-click", {
69
+ year: ev.detail.year
107
70
  });
108
71
  }
109
- function handleYearSelect() {
110
- mask.value = "";
111
- }
112
- function handleMonthSelect() {
113
- mask.value = "";
114
- }
115
72
  $:
116
- if (!!selectedDate) {
73
+ if (!!selectedYear) {
117
74
  setTimeout(() => {
118
- if (!!selectedDate) {
119
- mask.value = DateTime.fromJSDate(selectedDate).toFormat(pattern);
75
+ if (!!selectedYear) {
76
+ mask.value = selectedYear.toString();
120
77
  }
121
78
  }, 30);
122
79
  }
@@ -177,16 +134,10 @@ $:
177
134
  style:width="300px"
178
135
  style:border-radius="10px"
179
136
  >
180
- <DatePicker
181
- bind:selectedDate={selectedDate}
182
- bind:selectedMonth={selectedMonth}
137
+ <YearSelector
183
138
  bind:selectedYear={selectedYear}
184
- bind:visibleMonth
185
- bind:visibleYear
186
- on:day-click={handleDateSelect}
187
- on:year-click={handleYearSelect}
188
- on:month-click={handleMonthSelect}
189
- ></DatePicker>
139
+ on:click={handleYearSelect}
140
+ ></YearSelector>
190
141
  </div>
191
142
  </Dialog>
192
143
  {:else}
@@ -205,16 +156,10 @@ $:
205
156
  <div
206
157
  style:background-color="rgb(var(--global-color-background-100))"
207
158
  >
208
- <DatePicker
209
- bind:selectedDate={selectedDate}
210
- bind:selectedMonth={selectedMonth}
159
+ <YearSelector
211
160
  bind:selectedYear={selectedYear}
212
- bind:visibleMonth
213
- bind:visibleYear
214
- on:day-click={handleDateSelect}
215
- on:year-click={handleYearSelect}
216
- on:month-click={handleMonthSelect}
217
- ></DatePicker>
161
+ on:click={handleYearSelect}
162
+ ></YearSelector>
218
163
  </div>
219
164
  </Menu>
220
165
  {/if}
@@ -5,7 +5,7 @@ import "./Autocomplete.css";
5
5
  import { scrollInMenu } from "../common/scroller";
6
6
  let clazz = {};
7
7
  export { clazz as class };
8
- export let values = [], items, searchFunction = void 0, multiple = false, disabled = false, mandatory = false, placeholder = "", width = "auto", height = "auto", maxWidth = void 0, openingId = "autocomplete-menu", searchText = void 0, maxVisibleChips = void 0, menuOpened = false, closeOnSelect = !multiple, emptySearchTextOnMenuClose = true, menuBoxShadow = "rgb(var(--global-color-background-300), .5) 0px 2px 4px", menuBorderRadius = "5px", mobileDrawer = false;
8
+ export let values = [], items, searchFunction = void 0, multiple = false, disabled = false, mandatory = false, placeholder = "", width = "auto", height = "auto", maxWidth = void 0, openingId = "autocomplete-menu", searchText = void 0, maxVisibleChips = void 0, menuOpened = false, closeOnSelect = !multiple, emptySearchTextOnMenuClose = true, menuBoxShadow = "rgb(var(--global-color-background-300), .5) 0px 2px 4px", menuBorderRadius = "5px", mobileDrawer = false, menuWidth = void 0;
9
9
  let dispatch = createEventDispatcher();
10
10
  function select(item) {
11
11
  const alreadyPresent = values.findIndex((i) => i.value === item.value) != -1;
@@ -54,18 +54,21 @@ function toggle(item) {
54
54
  else
55
55
  select(item);
56
56
  }
57
- let menuWidth = void 0, menuHeight = "auto", refreshPosition = false;
57
+ let localMenuWidth = void 0, menuHeight = "auto", refreshPosition = false;
58
58
  function openMenu() {
59
59
  refreshMenuWidth();
60
60
  menuOpened = true;
61
61
  }
62
62
  function refreshMenuWidth() {
63
63
  setTimeout(() => {
64
- menuWidth = activator.offsetWidth + "px";
64
+ if (menuWidth !== void 0)
65
+ localMenuWidth = menuWidth;
66
+ else
67
+ localMenuWidth = activator.offsetWidth + "px";
65
68
  setTimeout(() => {
66
69
  refreshPosition = true;
67
- }, 1);
68
- }, 1);
70
+ }, 3);
71
+ }, 3);
69
72
  }
70
73
  let activator, focusedIndex = void 0;
71
74
  function handleTextFieldFocus() {
@@ -152,6 +155,8 @@ import MenuOrDrawer from "../../composed/common/MenuOrDrawer.svelte";
152
155
  on:click={handleContainerClick}
153
156
  on:keypress={handleContainerClick}
154
157
  class={clazz.activator || ''}
158
+ role="button"
159
+ tabindex="0"
155
160
  >
156
161
  <slot name="selection-container" {values} {searchText} {disabled} {openMenu} {handleKeyDown}>
157
162
  <div
@@ -207,7 +212,7 @@ import MenuOrDrawer from "../../composed/common/MenuOrDrawer.svelte";
207
212
  {#if !mobileDrawer}
208
213
  <Menu
209
214
  {activator}
210
- _width={menuWidth || ""}
215
+ _width={localMenuWidth || ""}
211
216
  _height={menuHeight}
212
217
  _maxHeight="300px"
213
218
  _boxShadow={menuBoxShadow}
@@ -242,6 +247,8 @@ import MenuOrDrawer from "../../composed/common/MenuOrDrawer.svelte";
242
247
  }) != -1}
243
248
  on:click={() => toggle(item)}
244
249
  on:keypress={() => toggle(item)}
250
+ role="button"
251
+ tabindex="0"
245
252
  >
246
253
  <slot name="item-label" {item}>
247
254
  {item.label}
@@ -255,7 +262,7 @@ import MenuOrDrawer from "../../composed/common/MenuOrDrawer.svelte";
255
262
  {:else}
256
263
  <MenuOrDrawer
257
264
  {activator}
258
- _width={menuWidth || ""}
265
+ _width={localMenuWidth || ""}
259
266
  _height={menuHeight}
260
267
  _maxHeight="300px"
261
268
  _boxShadow={menuBoxShadow}
@@ -285,6 +292,8 @@ import MenuOrDrawer from "../../composed/common/MenuOrDrawer.svelte";
285
292
  }) != -1}
286
293
  on:click={() => toggle(item)}
287
294
  on:keypress={() => toggle(item)}
295
+ role="button"
296
+ tabindex="0"
288
297
  >
289
298
  <slot name="item-label" {item}>
290
299
  {item.label}
@@ -34,6 +34,7 @@ declare const __propDef: {
34
34
  menuBoxShadow?: string | undefined;
35
35
  menuBorderRadius?: string | undefined;
36
36
  mobileDrawer?: boolean | undefined;
37
+ menuWidth?: string | undefined;
37
38
  };
38
39
  events: {
39
40
  focus: FocusEvent;
@@ -0,0 +1,8 @@
1
+ :root {
2
+ --avatar-default-width: 40px;
3
+ --avatar-default-height: 40px;
4
+ --avatar-default-border-radius: 9999px;
5
+ --avatar-default-background-color: rgb(var(--global-color-primary-500));
6
+ --avatar-default-text-color: rgb(var(--global-color-grey-50));
7
+ --avatar-default-text-weight: 700;
8
+ }
@@ -1,32 +1,81 @@
1
- <script>export let src, alt = "", width = "40px", maxWidth = void 0, minWidth = void 0, height = "40px", maxHeight = void 0, minHeight = void 0, lazyLoaded = false, referrerpolicy = "no-referrer", borderRadius = "50%";
2
- import Image from "./Image.svelte";
1
+ <script>import "./Avatar.css";
2
+ import "../../../css/main.css";
3
+ export let src = void 0, alt = "", text = void 0, referrerpolicy = "no-referrer";
3
4
  </script>
4
5
 
5
- {#if lazyLoaded}
6
- <Image
7
- {src}
8
- {width}
9
- {maxWidth}
10
- {minWidth}
11
- {height}
12
- {maxHeight}
13
- {minHeight}
14
- {borderRadius}
15
- disableHover={true}
16
- showSkeletonLoader={true}
17
- />
18
- {:else}
6
+
7
+ {#if !!src}
19
8
  <img
9
+ class="avatar"
20
10
  {src}
21
11
  {alt}
22
- style:width
23
- style:max-width={maxWidth}
24
- style:min-width={minWidth}
25
- style:height
26
- style:max-height={maxHeight}
27
- style:min-height={minHeight}
28
- style:border-radius={borderRadius}
29
- style:object-fit="cover"
30
12
  {referrerpolicy}
31
13
  />
14
+ {:else}
15
+ <div class="avatar">{text}</div>
32
16
  {/if}
17
+
18
+ <style>
19
+ .avatar {
20
+ width: var(
21
+ --avatar-width,
22
+ var(--avatar-default-width)
23
+ );
24
+ height: var(
25
+ --avatar-height,
26
+ var(--avatar-default-height)
27
+ );
28
+ min-width: var(--avatar-min-width);
29
+ max-width: var(--avatar-max-width);
30
+ height: var(
31
+ --avatar-height,
32
+ var(--avatar-default-height)
33
+ );
34
+ min-height: var(--avatar-min-height);
35
+ max-height: var(--avatar-max-height);
36
+ border-radius: var(
37
+ --avatar-border-radius,
38
+ var(--avatar-default-border-radius)
39
+ );
40
+ border: var(
41
+ --avatar-border,
42
+ var(--avatar-default-border)
43
+ )
44
+ }
45
+
46
+ img {
47
+ object-fit: cover;
48
+ }
49
+
50
+ div {
51
+ background-color: var(
52
+ --avatar-background-color,
53
+ var(--avatar-default-background-color)
54
+ );
55
+ color: var(
56
+ --avatar-text-color,
57
+ var(--avatar-default-text-color)
58
+ );
59
+ display: flex;
60
+ justify-content: center;
61
+ align-items: center;
62
+ font-size: var(
63
+ --avatar-text-size,
64
+ calc(
65
+ var(
66
+ --avatar-height,
67
+ var(--avatar-default-height)
68
+ ) - calc(
69
+ var(
70
+ --avatar-height,
71
+ var(--avatar-default-height)
72
+ ) / 1.7
73
+ )
74
+ )
75
+ );
76
+ font-weight: var(
77
+ --avatar-text-weight,
78
+ var(--avatar-default-text-weight)
79
+ );
80
+ }
81
+ </style>
@@ -1,17 +1,12 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import './Avatar.css';
3
+ import '../../../css/main.css';
2
4
  declare const __propDef: {
3
5
  props: {
4
- src: string;
6
+ src?: string | undefined;
5
7
  alt?: string | undefined;
6
- width?: string | undefined;
7
- maxWidth?: string | undefined;
8
- minWidth?: string | undefined;
9
- height?: string | undefined;
10
- maxHeight?: string | undefined;
11
- minHeight?: string | undefined;
12
- lazyLoaded?: boolean | undefined;
8
+ text?: string | undefined;
13
9
  referrerpolicy?: ReferrerPolicy | null | undefined;
14
- borderRadius?: string | undefined;
15
10
  };
16
11
  events: {
17
12
  [evt: string]: CustomEvent<any>;
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export { default as MonthSelector } from './components/simple/dates/MonthSelecto
11
11
  export { default as TimePickerTextField } from './components/simple/dates/TimePickerTextField.svelte';
12
12
  export { default as DatePickerTextField } from './components/composed/forms/DatePickerTextField.svelte';
13
13
  export { default as YearSelector } from './components/simple/dates/YearSelector.svelte';
14
+ export { default as YearPickerTextField } from './components/composed/forms/YearPickerTextField.svelte';
14
15
  export { default as Dialog } from './components/simple/dialogs/Dialog.svelte';
15
16
  export { default as Autocomplete } from './components/simple/forms/Autocomplete.svelte';
16
17
  export { default as Checkbox } from './components/simple/forms/Checkbox.svelte';
@@ -52,6 +53,7 @@ export { default as ProductsGrid } from './components/composed/shop/ProductsGrid
52
53
  export { default as HorizontalStackedProgress } from './components/composed/progress/HorizontalStackedProgress.svelte';
53
54
  export { default as ActivableButton } from './components/composed/buttons/ActivableButton.svelte';
54
55
  export { default as IconsDropdown } from './components/composed/forms/IconsDropdown.svelte';
56
+ export { default as AvatarDropdown } from './components/composed/forms/AvatarDropdown.svelte';
55
57
  export { default as PaginatedTable } from './components/composed/list/PaginatedTable.svelte';
56
58
  export { default as Filters } from './components/composed/search/Filters.svelte';
57
59
  export { default as GlobalSearchTextField } from './components/composed/search/GlobalSearchTextField.svelte';
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ export { default as MonthSelector } from './components/simple/dates/MonthSelecto
11
11
  export { default as TimePickerTextField } from './components/simple/dates/TimePickerTextField.svelte';
12
12
  export { default as DatePickerTextField } from './components/composed/forms/DatePickerTextField.svelte';
13
13
  export { default as YearSelector } from './components/simple/dates/YearSelector.svelte';
14
+ export { default as YearPickerTextField } from './components/composed/forms/YearPickerTextField.svelte';
14
15
  export { default as Dialog } from './components/simple/dialogs/Dialog.svelte';
15
16
  export { default as Autocomplete } from './components/simple/forms/Autocomplete.svelte';
16
17
  export { default as Checkbox } from './components/simple/forms/Checkbox.svelte';
@@ -52,6 +53,7 @@ export { default as ProductsGrid } from './components/composed/shop/ProductsGrid
52
53
  export { default as HorizontalStackedProgress } from './components/composed/progress/HorizontalStackedProgress.svelte';
53
54
  export { default as ActivableButton } from './components/composed/buttons/ActivableButton.svelte';
54
55
  export { default as IconsDropdown } from './components/composed/forms/IconsDropdown.svelte';
56
+ export { default as AvatarDropdown } from './components/composed/forms/AvatarDropdown.svelte';
55
57
  export { default as PaginatedTable } from './components/composed/list/PaginatedTable.svelte';
56
58
  export { default as Filters } from './components/composed/search/Filters.svelte';
57
59
  export { default as GlobalSearchTextField } from './components/composed/search/GlobalSearchTextField.svelte';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@likable-hair/svelte",
3
3
  "description": "A Svelte component for likablehair",
4
- "version": "3.0.80",
4
+ "version": "3.0.81",
5
5
  "scripts": {
6
6
  "host": "vite --host",
7
7
  "dev": "vite dev",