@invopop/popui 0.0.86 → 0.0.87

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,12 @@
1
+ <script>import Select from "svelte-select-kit";
2
+ import ComboBoxContent from "./ComboBoxContent.svelte";
3
+ export let disabled = false;
4
+ export let id = Math.random().toString(36).slice(2, 7);
5
+ export let placeholder = "";
6
+ export let value = "";
7
+ export let options = [];
8
+ </script>
9
+
10
+ <Select.Root label={id}>
11
+ <ComboBoxContent {disabled} {placeholder} {options} bind:value />
12
+ </Select.Root>
@@ -0,0 +1,21 @@
1
+ import { SvelteComponent } from "svelte";
2
+ import type { SelectOption } from './types';
3
+ declare const __propDef: {
4
+ props: {
5
+ disabled?: boolean | undefined;
6
+ id?: string | undefined;
7
+ placeholder?: string | undefined;
8
+ value?: string | undefined;
9
+ options?: SelectOption[] | undefined;
10
+ };
11
+ events: {
12
+ [evt: string]: CustomEvent<any>;
13
+ };
14
+ slots: {};
15
+ };
16
+ export type ComboBoxProps = typeof __propDef.props;
17
+ export type ComboBoxEvents = typeof __propDef.events;
18
+ export type ComboBoxSlots = typeof __propDef.slots;
19
+ export default class ComboBox extends SvelteComponent<ComboBoxProps, ComboBoxEvents, ComboBoxSlots> {
20
+ }
21
+ export {};
@@ -0,0 +1,33 @@
1
+ <script>import Select, { getStore } from "svelte-select-kit";
2
+ export let disabled = false;
3
+ export let placeholder = "";
4
+ export let value = "";
5
+ export let options = [];
6
+ const { matchCount } = getStore();
7
+ </script>
8
+
9
+ <Select.Input
10
+ bind:value
11
+ {disabled}
12
+ {placeholder}
13
+ class="py-1.5 px-2.5 border w-full rounded-md placeholder:text-neutral-500 text-base tracking-tight border-neutral-200 hover:border-neutral-300 text-neutral-800 outline-none caret-workspace-accent focus:border-workspace-accent focus:shadow-active"
14
+ />
15
+ <Select.ListBox let:open>
16
+ {#if open}
17
+ <div
18
+ class="{$matchCount === 0
19
+ ? 'invisible'
20
+ : ''} mt-[3px] border border-neutral-200 bg-white shadow-lg rounded-md p-1 space-y-0.5"
21
+ >
22
+ {#each options as option}
23
+ <Select.Item
24
+ id={String(option.value)}
25
+ value={String(option.value)}
26
+ class="py-1.5 border border-transparent rounded pl-2 pr-1.5 flex items-center justify-start w-full data-[active=true]:bg-workspace-accent-100"
27
+ >
28
+ {option.label}
29
+ </Select.Item>
30
+ {/each}
31
+ </div>
32
+ {/if}
33
+ </Select.ListBox>
@@ -0,0 +1,20 @@
1
+ import { SvelteComponent } from "svelte";
2
+ import type { SelectOption } from './types';
3
+ declare const __propDef: {
4
+ props: {
5
+ disabled?: boolean | undefined;
6
+ placeholder?: string | undefined;
7
+ value?: string | undefined;
8
+ options?: SelectOption[] | undefined;
9
+ };
10
+ events: {
11
+ [evt: string]: CustomEvent<any>;
12
+ };
13
+ slots: {};
14
+ };
15
+ export type ComboBoxContentProps = typeof __propDef.props;
16
+ export type ComboBoxContentEvents = typeof __propDef.events;
17
+ export type ComboBoxContentSlots = typeof __propDef.slots;
18
+ export default class ComboBoxContent extends SvelteComponent<ComboBoxContentProps, ComboBoxContentEvents, ComboBoxContentSlots> {
19
+ }
20
+ export {};
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ import ButtonFile from './ButtonFile.svelte';
12
12
  import ButtonUuidCopy from './ButtonUuidCopy.svelte';
13
13
  import CardCheckbox from './CardCheckbox.svelte';
14
14
  import CardRelation from './CardRelation.svelte';
15
+ import ComboBox from './ComboBox.svelte';
15
16
  import CompanySelector from './CompanySelector.svelte';
16
17
  import CounterWorkflow from './CounterWorkflow.svelte';
17
18
  import DataListItem from './DataListItem.svelte';
@@ -71,4 +72,4 @@ import twTheme from './tw.theme.js';
71
72
  import { resolveIcon } from './helpers.js';
72
73
  import { getCountryName } from './helpers.js';
73
74
  import { getStatusType } from './helpers.js';
74
- export { AlertDialog, BaseButton, BaseCard, BaseCounter, BaseDropdown, BaseFlag, BaseTable, BaseTableActions, BaseTableHeaderContent, Breadcrumbs, ButtonFile, ButtonUuidCopy, CardCheckbox, CardRelation, CompanySelector, CounterWorkflow, DataListItem, DatePicker, DrawerContext, DrawerContextItem, DropdownSelect, EmptyStateIcon, EmptyStateIllustration, FeedEvents, FeedIconEvent, FeedIconStatus, FeedItem, FeedItemDetail, FeedViewer, GlobalSearch, InputCheckbox, InputError, InputLabel, InputRadio, InputSearch, InputSelect, InputText, InputTextarea, InputToggle, MenuItem, MenuItemCollapsible, ProfileAvatar, ProfileSelector, SectionLayout, SeparatorHorizontal, ShortcutWrapper, StatusLabel, StepIconList, Table, TableBody, TableCaption, TableFooter, TableHeader, TableRow, TableHead, TableCell, Tabs, TabsContent, TabsList, TabsTrigger, TagBeta, TagSearch, TagStatus, TitleMain, TitleSection, Tooltip, TooltipContent, TooltipTrigger, UuidCopy, twTheme, resolveIcon, getCountryName, getStatusType };
75
+ export { AlertDialog, BaseButton, BaseCard, BaseCounter, BaseDropdown, BaseFlag, BaseTable, BaseTableActions, BaseTableHeaderContent, Breadcrumbs, ButtonFile, ButtonUuidCopy, CardCheckbox, CardRelation, ComboBox, CompanySelector, CounterWorkflow, DataListItem, DatePicker, DrawerContext, DrawerContextItem, DropdownSelect, EmptyStateIcon, EmptyStateIllustration, FeedEvents, FeedIconEvent, FeedIconStatus, FeedItem, FeedItemDetail, FeedViewer, GlobalSearch, InputCheckbox, InputError, InputLabel, InputRadio, InputSearch, InputSelect, InputText, InputTextarea, InputToggle, MenuItem, MenuItemCollapsible, ProfileAvatar, ProfileSelector, SectionLayout, SeparatorHorizontal, ShortcutWrapper, StatusLabel, StepIconList, Table, TableBody, TableCaption, TableFooter, TableHeader, TableRow, TableHead, TableCell, Tabs, TabsContent, TabsList, TabsTrigger, TagBeta, TagSearch, TagStatus, TitleMain, TitleSection, Tooltip, TooltipContent, TooltipTrigger, UuidCopy, twTheme, resolveIcon, getCountryName, getStatusType };
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ import ButtonFile from './ButtonFile.svelte'
12
12
  import ButtonUuidCopy from './ButtonUuidCopy.svelte'
13
13
  import CardCheckbox from './CardCheckbox.svelte'
14
14
  import CardRelation from './CardRelation.svelte'
15
+ import ComboBox from './ComboBox.svelte'
15
16
  import CompanySelector from './CompanySelector.svelte'
16
17
  import CounterWorkflow from './CounterWorkflow.svelte'
17
18
  import DataListItem from './DataListItem.svelte'
@@ -83,6 +84,7 @@ export {
83
84
  ButtonUuidCopy,
84
85
  CardCheckbox,
85
86
  CardRelation,
87
+ ComboBox,
86
88
  CompanySelector,
87
89
  CounterWorkflow,
88
90
  DataListItem,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.0.86",
4
+ "version": "0.0.87",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run package",
@@ -102,6 +102,7 @@
102
102
  "svelte-floating-ui": "^1.5.8",
103
103
  "svelte-intersection-observer-action": "^0.0.4",
104
104
  "svelte-portal": "^2.2.1",
105
+ "svelte-select-kit": "^0.1.1",
105
106
  "svelte-transition": "^0.0.10",
106
107
  "svelte-viewport-info": "^1.0.2",
107
108
  "tailwind-variants": "^1.0.0",