@invopop/popui 0.0.77-beta8 → 0.0.78

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.
@@ -30,7 +30,7 @@ $:
30
30
  { "flex-row-reverse space-x-reverse": iconPosition === "right" },
31
31
  { "bg-white": variant === "default" },
32
32
  { "bg-workspace-accent": variant === "primary" },
33
- { "bg-neutral-100 hover:bg-neutral-200 focus:bg-neutral-300": variant === "secondary" },
33
+ { "bg-neutral-100 hover:bg-neutral-200 active:bg-neutral-300": variant === "secondary" },
34
34
  { "bg-danger-500": variant === "danger" },
35
35
  { "bg-warning-500": variant === "warning" },
36
36
  { "text-sm rounded": small },
@@ -41,16 +41,16 @@ $:
41
41
  { "px-3": big && $$slots.default && !icon },
42
42
  { "px-2": !big && $$slots.default && !icon },
43
43
  { "pl-2 pr-2.5": big && $$slots.default && icon && iconPosition === "left" },
44
- { "pl-1.5 pr-2": big && $$slots.default && icon && iconPosition === "right" },
44
+ { "pl-2.5 pr-2": big && $$slots.default && icon && iconPosition === "right" },
45
45
  { "pl-1.5 pr-2": !small && !big && $$slots.default && icon && iconPosition === "left" },
46
46
  { "pl-2 pr-1.5": !small && !big && $$slots.default && icon && iconPosition === "right" },
47
47
  { "py-1.5": big && $$slots.default },
48
48
  { "py-1": !big && $$slots.default },
49
49
  { "text-white": ["primary", "danger", "dark", "warning"].includes(variant) },
50
50
  { "text-neutral-800": ["default", "secondary"].includes(variant) },
51
- { "border border-white-10 hover:border-white-20 focus:border-white-40": variant === "dark" },
51
+ { "border border-white-10 hover:border-white-20 active:border-white-40": variant === "dark" },
52
52
  {
53
- "border border-neutral-200 hover:bg-neutral-100 focus:border-neutral-300 focus:bg-neutral-200": variant === "default"
53
+ "border border-neutral-200 hover:bg-neutral-100 active:border-neutral-300 active:bg-neutral-200": variant === "default"
54
54
  },
55
55
  { "gap-1": icon && $$slots.default }
56
56
  );
@@ -0,0 +1,33 @@
1
+ <script>import { Duplicate } from "@invopop/ui-icons";
2
+ import { createEventDispatcher } from "svelte";
3
+ import BaseButton from "./BaseButton.svelte";
4
+ const dispatch = createEventDispatcher();
5
+ export let uuid = "";
6
+ export let prefixLength = 4;
7
+ export let suffixLength = 4;
8
+ export let full = false;
9
+ export let disabled = false;
10
+ function shortenString(inputString, prefixLength2, suffixLength2) {
11
+ if (inputString.length <= prefixLength2 + suffixLength2) {
12
+ return inputString;
13
+ }
14
+ const prefix = inputString.substring(0, prefixLength2);
15
+ const suffix = inputString.substring(inputString.length - suffixLength2);
16
+ return prefix + "..." + suffix;
17
+ }
18
+ $:
19
+ formattedUuid = full ? uuid : shortenString(uuid, prefixLength, suffixLength);
20
+ </script>
21
+
22
+ <BaseButton
23
+ {disabled}
24
+ big
25
+ icon={Duplicate}
26
+ iconPosition="right"
27
+ on:click={async () => {
28
+ await navigator.clipboard.writeText(uuid)
29
+ dispatch('copied', uuid)
30
+ }}
31
+ >
32
+ <span class="font-mono text-neutral-500">{formattedUuid}</span>
33
+ </BaseButton>
@@ -0,0 +1,22 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ uuid?: string | undefined;
5
+ prefixLength?: number | undefined;
6
+ suffixLength?: number | undefined;
7
+ full?: boolean | undefined;
8
+ disabled?: boolean | undefined;
9
+ };
10
+ events: {
11
+ copied: CustomEvent<any>;
12
+ } & {
13
+ [evt: string]: CustomEvent<any>;
14
+ };
15
+ slots: {};
16
+ };
17
+ export type ButtonUuidCopyProps = typeof __propDef.props;
18
+ export type ButtonUuidCopyEvents = typeof __propDef.events;
19
+ export type ButtonUuidCopySlots = typeof __propDef.slots;
20
+ export default class ButtonUuidCopy extends SvelteComponent<ButtonUuidCopyProps, ButtonUuidCopyEvents, ButtonUuidCopySlots> {
21
+ }
22
+ export {};
@@ -4,6 +4,7 @@ import InputRadio from "./InputRadio.svelte";
4
4
  export let id;
5
5
  export let title = "";
6
6
  export let description = "";
7
+ export let accentText = "";
7
8
  export let checked = false;
8
9
  $:
9
10
  styles = clsx(
@@ -22,7 +23,14 @@ export let icon = void 0;
22
23
  <div class="flex flex-col space-y-0.5">
23
24
  <span class="text-base text-neutral-800 font-medium">{title}</span>
24
25
  {#if description}
25
- <span class="text-sm text-neutral-500">{description}</span>
26
+ <span class="flex items-center space-x-1">
27
+ {#if accentText}
28
+ <p class="text-workspace-accent text-sm font-bold">{accentText}</p>
29
+ {/if}
30
+ <p class="text-sm text-neutral-500" class:first-letter:uppercase={!accentText}>
31
+ {description}
32
+ </p>
33
+ </span>
26
34
  {:else}
27
35
  <span class="text-sm text-neutral-300">No description</span>
28
36
  {/if}
@@ -5,6 +5,7 @@ declare const __propDef: {
5
5
  id: any;
6
6
  title?: string | undefined;
7
7
  description?: string | undefined;
8
+ accentText?: string | undefined;
8
9
  checked?: boolean | undefined;
9
10
  icon?: IconSource | undefined;
10
11
  };
@@ -8,12 +8,12 @@ $:
8
8
  restIcons = icons.slice(maxItems, icons.length);
9
9
  </script>
10
10
 
11
- <div class="flex flex-col space-y-2 sm:flex-row sm:space-y-0 items-center overflow-x-auto">
11
+ <div class="flex flex-col space-y-2 sm:flex-row sm:space-y-0 items-center">
12
12
  {#each mainIcons as icon, i (i)}
13
13
  <Tooltip>
14
- <TooltipTrigger>
14
+ <TooltipTrigger class="flex-shrink-0">
15
15
  <div
16
- class="p-1.5 border rounded-md border-neutral-200 flex items-center space-x-1 bg-white text-neutral-800 flex-shrink-0"
16
+ class="p-1.5 border rounded-md border-neutral-200 flex items-center space-x-1 bg-white text-neutral-800"
17
17
  >
18
18
  <img src={icon.url} alt={icon.name} class="w-4 h-4" />
19
19
  </div>
@@ -28,7 +28,7 @@ $:
28
28
  {#if restIcons.length}
29
29
  <div class="hidden sm:block h-px w-3 border border-neutral-200 mx-px flex-shrink-0" />
30
30
  <Tooltip>
31
- <TooltipTrigger>
31
+ <TooltipTrigger class="flex-shrink-0">
32
32
  <div
33
33
  class="flex items-center justify-center text-neutral-500 font-medium text-base h-7 w-7"
34
34
  >
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ import BaseTableActions from './BaseTableActions.svelte';
9
9
  import BaseTableHeaderContent from './BaseTableHeaderContent.svelte';
10
10
  import Breadcrumbs from './Breadcrumbs.svelte';
11
11
  import ButtonFile from './ButtonFile.svelte';
12
+ import ButtonUuidCopy from './ButtonUuidCopy.svelte';
12
13
  import CardCheckbox from './CardCheckbox.svelte';
13
14
  import CardRelation from './CardRelation.svelte';
14
15
  import CompanySelector from './CompanySelector.svelte';
@@ -70,4 +71,4 @@ import twTheme from './tw.theme.js';
70
71
  import { resolveIcon } from './helpers.js';
71
72
  import { getCountryName } from './helpers.js';
72
73
  import { getStatusType } from './helpers.js';
73
- export { AlertDialog, BaseButton, BaseCard, BaseCounter, BaseDropdown, BaseFlag, BaseTable, BaseTableActions, BaseTableHeaderContent, Breadcrumbs, ButtonFile, 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 };
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 };
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ import BaseTableActions from './BaseTableActions.svelte'
9
9
  import BaseTableHeaderContent from './BaseTableHeaderContent.svelte'
10
10
  import Breadcrumbs from './Breadcrumbs.svelte'
11
11
  import ButtonFile from './ButtonFile.svelte'
12
+ import ButtonUuidCopy from './ButtonUuidCopy.svelte'
12
13
  import CardCheckbox from './CardCheckbox.svelte'
13
14
  import CardRelation from './CardRelation.svelte'
14
15
  import CompanySelector from './CompanySelector.svelte'
@@ -79,6 +80,7 @@ export {
79
80
  BaseTableHeaderContent,
80
81
  Breadcrumbs,
81
82
  ButtonFile,
83
+ ButtonUuidCopy,
82
84
  CardCheckbox,
83
85
  CardRelation,
84
86
  CompanySelector,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.0.77-beta8",
4
+ "version": "0.0.78",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run package",