@insymetri/styleguide 0.1.14 → 0.1.16

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.
@@ -37,7 +37,7 @@
37
37
  const isDisabled = $derived(disabled || loading)
38
38
 
39
39
  const baseClasses =
40
- 'inline-flex items-center justify-center gap-8 whitespace-nowrap rounded-10 cursor-default transition-colors duration-base ease-in-out no-underline disabled:cursor-not-allowed'
40
+ 'inline-flex items-center justify-center gap-8 whitespace-nowrap rounded-8 cursor-default transition-colors duration-base ease-in-out no-underline disabled:cursor-not-allowed'
41
41
 
42
42
  const variantClasses = {
43
43
  primary:
@@ -162,7 +162,7 @@
162
162
  {placeholder}
163
163
  {disabled}
164
164
  oninput={handleInput}
165
- class="w-full box-border py-5 px-12 text-small text-input-text bg-input-bg border border-input-border rounded-10 transition-all duration-fast outline-none placeholder:text-input-placeholder hover:border-input-border-hover focus:border-input-border-hover disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-input-bg-disabled motion-reduce:transition-none"
165
+ class="w-full box-border py-5 px-12 text-small text-input-text bg-input-bg border border-input-border rounded-8 transition-all duration-fast outline-none placeholder:text-input-placeholder hover:border-input-border-hover focus:border-input-border-hover disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-input-bg-disabled motion-reduce:transition-none"
166
166
  />
167
167
  <Combobox.Portal>
168
168
  {#if filteredItems.length > 0 || emptyContent || loading}
@@ -87,7 +87,7 @@
87
87
  />
88
88
  </div>
89
89
  <button
90
- class="px-12 py-5 rounded-10 border border-button-secondary text-small text-button-secondary hover:border-button-secondary-hover cursor-default"
90
+ class="px-12 py-5 rounded-8 border border-button-secondary text-small text-button-secondary hover:border-button-secondary-hover cursor-default"
91
91
  onclick={simulateLoading}
92
92
  >
93
93
  Simulate Load
@@ -18,7 +18,7 @@
18
18
  {/if}
19
19
  <div class="relative">
20
20
  <DatePicker.Input
21
- class="flex items-center gap-4 py-5 px-12 border border-strong rounded-10 text-small text-gray-800 bg-surface transition-all duration-fast [&:has(:focus)]:border-primary [&:has(:focus)]:ring-3 [&:has(:focus)]:ring-primary"
21
+ class="flex items-center gap-4 py-5 px-12 border border-strong rounded-8 text-small text-gray-800 bg-surface transition-all duration-fast [&:has(:focus)]:border-primary [&:has(:focus)]:ring-3 [&:has(:focus)]:ring-primary"
22
22
  >
23
23
  {#snippet children({segments})}
24
24
  {#each segments as { part, value: segValue }, i (`${part}-${i}`)}
@@ -60,7 +60,7 @@
60
60
  bind:ref={triggerEl}
61
61
  {disabled}
62
62
  class={cn(
63
- 'flex items-center justify-between gap-4 py-5 pl-12 pr-8 border rounded-10 bg-button-secondary cursor-default text-small text-button-secondary box-border appearance-none font-inherit outline-none transition-colors duration-base ease-in-out hover:text-button-secondary-hover hover:border-button-secondary-hover focus:border-accent focus:ring-3 focus:ring-primary disabled:opacity-50 disabled:cursor-not-allowed',
63
+ 'flex items-center justify-between gap-4 py-5 pl-12 pr-8 border rounded-8 bg-button-secondary cursor-default text-small text-button-secondary box-border appearance-none font-inherit outline-none transition-colors duration-base ease-in-out hover:text-button-secondary-hover hover:border-button-secondary-hover focus:border-accent focus:ring-3 focus:ring-primary disabled:opacity-50 disabled:cursor-not-allowed',
64
64
  open ? 'border-button-secondary-hover' : 'border-button-secondary',
65
65
  className
66
66
  )}
@@ -65,7 +65,7 @@
65
65
  {label: 'Sign Out', value: 'signout'},
66
66
  ]}
67
67
  onSelect={handleSelect}
68
- triggerClass="inline-flex items-center gap-4 px-12 py-5 rounded-10 border border-button-secondary text-small text-button-secondary hover:border-button-secondary-hover cursor-default"
68
+ triggerClass="inline-flex items-center gap-4 px-12 py-5 rounded-8 border border-button-secondary text-small text-button-secondary hover:border-button-secondary-hover cursor-default"
69
69
  >
70
70
  {#snippet children()}
71
71
  <IIIcon iconName="user" class="w-14 h-14" />
@@ -28,7 +28,7 @@
28
28
  const isDisabled = $derived(disabled || loading)
29
29
 
30
30
  const baseClasses =
31
- 'inline-flex items-center justify-center rounded-10 cursor-default transition-colors duration-base ease-in-out disabled:cursor-not-allowed'
31
+ 'inline-flex items-center justify-center rounded-8 cursor-default transition-colors duration-base ease-in-out disabled:cursor-not-allowed'
32
32
 
33
33
  const variantClasses = {
34
34
  primary:
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type {Snippet} from 'svelte'
3
3
  import type {HTMLInputAttributes} from 'svelte/elements'
4
+ import IIIconButton from '../IIIconButton/IIIconButton.svelte'
4
5
  import {cn} from '../utils/cn'
5
6
 
6
7
  type Props = Omit<HTMLInputAttributes, 'prefix'> & {
@@ -33,7 +34,9 @@
33
34
  }: Props = $props()
34
35
 
35
36
  const showError = $derived(error || !!errorMessage)
36
- const hasAddons = $derived(!!prefix || !!suffix)
37
+ const isSearch = $derived(type === 'search')
38
+ const showClear = $derived(isSearch && !!value)
39
+ const hasAddons = $derived(!!prefix || !!suffix || isSearch)
37
40
  let shouldShake = $state(false)
38
41
  let prevShowError = $state(false)
39
42
 
@@ -58,7 +61,7 @@
58
61
  {#if hasAddons}
59
62
  <div
60
63
  class={cn(
61
- 'flex items-center bg-input-bg border border-input-border rounded-10 transition-all duration-fast hover:border-input-border-hover focus-within:border-input-border-hover motion-reduce:transition-none',
64
+ 'flex items-center bg-input-bg border border-input-border rounded-8 transition-all duration-fast hover:border-input-border-hover focus-within:border-input-border-hover motion-reduce:transition-none',
62
65
  showError && 'border-input-border-error focus-within:border-input-border-error',
63
66
  shouldShake && 'animate-shake',
64
67
  disabled && 'bg-input-bg-disabled cursor-not-allowed'
@@ -74,7 +77,7 @@
74
77
  bind:value
75
78
  {type}
76
79
  {disabled}
77
- class="py-5 px-12 text-small font-[family-name:var(--font-family)] text-input-text bg-transparent border-0 outline-none w-full box-border placeholder:text-input-placeholder disabled:text-input-text-disabled disabled:cursor-not-allowed"
80
+ class="py-5 px-12 text-small font-[family-name:var(--font-family)] text-input-text bg-transparent border-0 outline-none w-full box-border placeholder:text-input-placeholder disabled:text-input-text-disabled disabled:cursor-not-allowed [&::-webkit-search-cancel-button]:appearance-none"
78
81
  {...restProps}
79
82
  />
80
83
  {#if suffix}
@@ -82,6 +85,19 @@
82
85
  {@render suffix()}
83
86
  </span>
84
87
  {/if}
88
+ {#if showClear}
89
+ <span class="flex items-center pr-4 shrink-0">
90
+ <IIIconButton
91
+ iconName="x"
92
+ size="sm"
93
+ variant="ghost"
94
+ onclick={() => {
95
+ value = ''
96
+ ref?.focus()
97
+ }}
98
+ />
99
+ </span>
100
+ {/if}
85
101
  </div>
86
102
  {:else}
87
103
  <input
@@ -90,7 +106,7 @@
90
106
  {type}
91
107
  {disabled}
92
108
  class={cn(
93
- 'py-5 px-12 text-small font-[family-name:var(--font-family)] text-input-text bg-input-bg border border-input-border rounded-10 transition-all duration-fast outline-none w-full box-border placeholder:text-input-placeholder hover:border-input-border-hover focus:border-input-border-hover disabled:bg-input-bg-disabled disabled:text-input-text-disabled disabled:cursor-not-allowed motion-reduce:transition-none motion-reduce:animate-none',
109
+ 'py-5 px-12 text-small font-[family-name:var(--font-family)] text-input-text bg-input-bg border border-input-border rounded-8 transition-all duration-fast outline-none w-full box-border placeholder:text-input-placeholder hover:border-input-border-hover focus:border-input-border-hover disabled:bg-input-bg-disabled disabled:text-input-text-disabled disabled:cursor-not-allowed motion-reduce:transition-none motion-reduce:animate-none',
94
110
  showError && 'border-input-border-error focus:border-input-border-error focus:ring-error',
95
111
  shouldShake && 'animate-shake'
96
112
  )}
@@ -75,7 +75,7 @@
75
75
  bind:ref={triggerEl}
76
76
  {disabled}
77
77
  class={cn(
78
- 'flex items-center gap-4 py-5 pl-12 pr-8 border rounded-10 bg-button-secondary cursor-default text-small text-button-secondary box-border appearance-none font-inherit outline-none transition-colors duration-base ease-in-out hover:text-button-secondary-hover hover:border-button-secondary-hover focus:border-accent focus:ring-3 focus:ring-primary disabled:opacity-50 disabled:cursor-not-allowed',
78
+ 'flex items-center gap-4 py-5 pl-12 pr-8 border rounded-8 bg-button-secondary cursor-default text-small text-button-secondary box-border appearance-none font-inherit outline-none transition-colors duration-base ease-in-out hover:text-button-secondary-hover hover:border-button-secondary-hover focus:border-accent focus:ring-3 focus:ring-primary disabled:opacity-50 disabled:cursor-not-allowed',
79
79
  open ? 'border-button-secondary-hover' : 'border-button-secondary',
80
80
  className
81
81
  )}
@@ -69,7 +69,7 @@
69
69
  <div class="flex items-center border-b border-primary px-24" style="padding-left: calc(2.4rem - 1.2rem - 1px)">
70
70
  <DropdownMenu.Root bind:open={dropdownOpen}>
71
71
  <DropdownMenu.Trigger
72
- class="[all:unset] inline-flex items-center gap-4 py-4 pr-8 pl-12 border border-primary rounded-10 bg-surface cursor-default transition-all duration-fast hover:border-strong motion-reduce:transition-none"
72
+ class="[all:unset] inline-flex items-center gap-4 py-4 pr-8 pl-12 border border-primary rounded-8 bg-surface cursor-default transition-all duration-fast hover:border-strong motion-reduce:transition-none"
73
73
  >
74
74
  <span class="text-small-emphasis text-body">{activeLabel}</span>
75
75
  <IIIcon iconName="caret-down" class="w-14 h-14 text-secondary shrink-0" />
@@ -65,7 +65,7 @@
65
65
  {disabled}
66
66
  {rows}
67
67
  class={cn(
68
- 'py-5 px-12 text-small font-[family-name:var(--font-family)] text-body bg-surface border border-strong rounded-10 transition-all duration-fast outline-none w-full box-border resize-none overflow-hidden min-h-16 placeholder:text-tertiary focus:border-primary focus:ring-3 focus:ring-primary disabled:bg-gray-100 disabled:text-secondary disabled:cursor-not-allowed motion-reduce:transition-none',
68
+ 'py-5 px-12 text-small font-[family-name:var(--font-family)] text-body bg-surface border border-strong rounded-8 transition-all duration-fast outline-none w-full box-border resize-none overflow-hidden min-h-16 placeholder:text-tertiary focus:border-primary focus:ring-3 focus:ring-primary disabled:bg-gray-100 disabled:text-secondary disabled:cursor-not-allowed motion-reduce:transition-none',
69
69
  showError && 'border-error focus:border-error focus:ring-error'
70
70
  )}
71
71
  oninput={handleInput}
@@ -42,7 +42,7 @@
42
42
  {disabled}
43
43
  aria-label={ariaLabel}
44
44
  class={cn(
45
- 'inline-flex items-center justify-center rounded-10 cursor-default transition-colors duration-base ease-in-out text-secondary hover:bg-button-ghost-hover hover:text-button-ghost-hover data-[state=on]:bg-button-ghost-hover data-[state=on]:text-body disabled:opacity-50 disabled:cursor-not-allowed',
45
+ 'inline-flex items-center justify-center rounded-8 cursor-default transition-colors duration-base ease-in-out text-secondary hover:bg-button-ghost-hover hover:text-button-ghost-hover data-[state=on]:bg-button-ghost-hover data-[state=on]:text-body disabled:opacity-50 disabled:cursor-not-allowed',
46
46
  sizeClasses[size],
47
47
  iconSizeClasses[size],
48
48
  className
@@ -47,7 +47,7 @@
47
47
  <section>
48
48
  <h2 class="text-default-emphasis text-primary mb-8">Toolbar Example</h2>
49
49
  <p class="text-small text-secondary mb-12">Multiple toggles used together as a formatting toolbar.</p>
50
- <div class="flex items-center gap-4 p-4 border border-subtle rounded-10 bg-surface inline-flex">
50
+ <div class="flex items-center gap-4 p-4 border border-subtle rounded-8 bg-surface inline-flex">
51
51
  <IIToggle bind:pressed={filterPressed} aria-label="Filter">
52
52
  {#snippet children({pressed})}
53
53
  <IIIcon iconName="funnel-fill" />
@@ -0,0 +1,45 @@
1
+ <script lang="ts">
2
+ const shadows: Array<{name: string; class: string; desc: string}> = [
3
+ {name: 'shadow-none', class: 'shadow-none', desc: 'No shadow'},
4
+ {name: 'shadow-pill', class: 'shadow-pill', desc: 'Pills, tags, small controls'},
5
+ {name: 'shadow-subtle', class: 'shadow-subtle', desc: 'Switch knobs, active pills'},
6
+ {name: 'shadow-card', class: 'shadow-card', desc: 'Cards at rest'},
7
+ {name: 'shadow-card-hover', class: 'shadow-card-hover', desc: 'Card hover / raised state'},
8
+ {name: 'shadow-dropdown', class: 'shadow-dropdown', desc: 'Dropdown menus, popovers, comboboxes'},
9
+ {name: 'shadow-modal', class: 'shadow-modal', desc: 'Modal dialogs'},
10
+ {name: 'shadow-drawer', class: 'shadow-drawer', desc: 'Side drawers / floating panels'},
11
+ {name: 'shadow-toast', class: 'shadow-toast', desc: 'Toast notifications'},
12
+ {name: 'shadow-focus-ring', class: 'shadow-focus-ring', desc: 'Input/control focus state'},
13
+ {name: 'shadow-selection-ring', class: 'shadow-selection-ring', desc: 'Selected item indicator'},
14
+ {name: 'shadow-comm-hover', class: 'shadow-comm-hover', desc: 'Communication card hover'},
15
+ {name: 'shadow-login-card', class: 'shadow-login-card', desc: 'Login card — deep overlay'},
16
+ {name: 'shadow-dialog-overlay', class: 'shadow-dialog-overlay', desc: 'Dialog overlay — elevated panel'},
17
+ ]
18
+ </script>
19
+
20
+ <!--
21
+ Safelist: ensure Tailwind generates all shadow classes used dynamically above.
22
+ shadow-none shadow-pill shadow-subtle shadow-card shadow-card-hover shadow-dropdown
23
+ shadow-modal shadow-drawer shadow-toast shadow-focus-ring shadow-selection-ring
24
+ shadow-comm-hover shadow-login-card shadow-dialog-overlay
25
+ -->
26
+
27
+ <div class="flex flex-col gap-48 p-24 text-body">
28
+ <section>
29
+ <h2 class="text-h2 mb-16">Box Shadows</h2>
30
+ <div
31
+ style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;"
32
+ >
33
+ {#each shadows as item (item.name)}
34
+ <div class="flex flex-col gap-8">
35
+ <div
36
+ class="rounded-8 bg-surface-raised border border-primary {item.class}"
37
+ style="height: 96px;"
38
+ ></div>
39
+ <span class="text-small font-mono text-secondary">{item.name}</span>
40
+ <span class="text-tiny text-tertiary">{item.desc}</span>
41
+ </div>
42
+ {/each}
43
+ </div>
44
+ </section>
45
+ </div>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const Shadows: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type Shadows = InstanceType<typeof Shadows>;
18
+ export default Shadows;
@@ -0,0 +1 @@
1
+ export { default as Shadows } from './Shadows.svelte';
@@ -0,0 +1 @@
1
+ export { default as Shadows } from './Shadows.svelte';
@@ -1,5 +1,6 @@
1
1
  export declare const boxShadow: {
2
2
  none: string;
3
+ pill: string;
3
4
  subtle: string;
4
5
  card: string;
5
6
  'card-hover': string;
@@ -1,5 +1,7 @@
1
1
  export const boxShadow = {
2
2
  none: 'none',
3
+ // Pill elevation (pills, tags, small controls)
4
+ pill: '0 3px 6px -2px rgba(0, 0, 0, 0.02), 0 1px 1px 0 rgba(0, 0, 0, 0.04)',
3
5
  // Subtle elevation (switch knobs, active pills)
4
6
  subtle: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
5
7
  // Cards at rest
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insymetri/styleguide",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Insymetri shared UI component library built with Svelte 5",
5
5
  "type": "module",
6
6
  "scripts": {