@manafishrov/ui 1.3.6 → 1.3.8

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@manafishrov/ui",
4
- "version": "1.3.6",
4
+ "version": "1.3.8",
5
5
  "description": "Styled component library for Manafish interfaces ",
6
6
  "license": "AGPL-3.0-or-later",
7
7
  "repository": {
@@ -162,7 +162,7 @@ export const SelectTrigger: Component<
162
162
  data-size={size}
163
163
  class={cn(
164
164
  'px-2.5 text-sm *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*="size-"])]:size-4 gap-1.5 min-w-0 shadow-xs flex w-full items-center justify-between rounded-lg border border-input bg-transparent whitespace-nowrap transition-[color,box-shadow] outline-none select-none disabled:cursor-not-allowed disabled:opacity-50 data-placeholder-shown:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center dark:bg-input/30 dark:hover:bg-input/50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*="size-"])]:text-muted-foreground',
165
- 'data-[size=default]:h-10 data-[size=sm]:h-8 data-[size=sm]:rounded-[min(var(--radius-md),10px)]',
165
+ 'data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)]',
166
166
  'focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 data-[focus-visible]:border-ring data-[focus-visible]:ring-[3px] data-[focus-visible]:ring-ring/50',
167
167
  'data-[invalid=true]:border-destructive data-[invalid=true]:ring-[3px] data-[invalid=true]:ring-destructive/20 dark:data-[invalid=true]:ring-destructive/40',
168
168
  'data-[disabled=true]:bg-input/50 data-[disabled=true]:opacity-50 dark:data-[disabled=true]:bg-input/80',
@@ -5,6 +5,7 @@ import {
5
5
  Select,
6
6
  SelectContent,
7
7
  SelectControl,
8
+ SelectIndicator,
8
9
  SelectPositioner,
9
10
  SelectTrigger,
10
11
  SelectValue,
@@ -13,11 +14,18 @@ import {
13
14
  import { useFieldContext } from './context';
14
15
  import { WithTrailingAddon } from './WithTrailingAddon';
15
16
 
16
- const SelectInput: Component<{ placeholder: string; children: JSX.Element }> = (props) => (
17
+ const SelectInput: Component<{
18
+ placeholder: string;
19
+ showSelectIndicator: boolean | undefined;
20
+ children: JSX.Element;
21
+ }> = (props) => (
17
22
  <>
18
23
  <SelectControl>
19
24
  <SelectTrigger>
20
25
  <SelectValue placeholder={props.placeholder} />
26
+ <Show when={props.showSelectIndicator !== false}>
27
+ <SelectIndicator />
28
+ </Show>
21
29
  </SelectTrigger>
22
30
  </SelectControl>
23
31
  <SelectPositioner>
@@ -30,21 +38,25 @@ export type SelectFieldProps = ComponentProps<typeof Select> & {
30
38
  label?: string;
31
39
  description?: string;
32
40
  placeholder?: string;
41
+ showSelectIndicator?: boolean;
33
42
  trailingAddon?: JSXElement;
34
43
  };
35
44
 
45
+ const SELECT_FIELD_PROPS = [
46
+ 'label',
47
+ 'description',
48
+ 'required',
49
+ 'disabled',
50
+ 'readOnly',
51
+ 'placeholder',
52
+ 'showSelectIndicator',
53
+ 'children',
54
+ 'trailingAddon',
55
+ ] as const;
56
+
36
57
  export const SelectField: Component<SelectFieldProps> = (props) => {
37
58
  const field = useFieldContext<string[]>();
38
- const [local, others] = splitProps(props, [
39
- 'label',
40
- 'description',
41
- 'required',
42
- 'disabled',
43
- 'readOnly',
44
- 'placeholder',
45
- 'children',
46
- 'trailingAddon',
47
- ]);
59
+ const [local, others] = splitProps(props, SELECT_FIELD_PROPS);
48
60
 
49
61
  return (
50
62
  <Field
@@ -69,7 +81,12 @@ export const SelectField: Component<SelectFieldProps> = (props) => {
69
81
  readOnly={local.readOnly ?? false}
70
82
  {...others}
71
83
  >
72
- <SelectInput placeholder={local.placeholder ?? ''}>{local.children}</SelectInput>
84
+ <SelectInput
85
+ placeholder={local.placeholder ?? ''}
86
+ showSelectIndicator={local.showSelectIndicator}
87
+ >
88
+ {local.children}
89
+ </SelectInput>
73
90
  </Select>
74
91
  </WithTrailingAddon>
75
92
  <FieldError errors={field().state.meta.errors} />
@@ -24,7 +24,7 @@ export const toast = createToaster({
24
24
  const ToastItem: Component<{ toast: Accessor<ToastOptions> }> = (props) => (
25
25
  <Toast.Root
26
26
  class={cn(
27
- 'group gap-3 p-4 pr-10 shadow-lg min-w-72 pointer-events-auto relative flex w-full items-center rounded-lg border bg-popover transition-all',
27
+ 'group gap-3 p-4 pr-10 shadow-lg min-w-72 pointer-events-auto relative flex w-full items-center rounded-lg border bg-popover',
28
28
  'data-[state=open]:sm:slide-in-from-bottom-full data-[state=open]:animate-in data-[state=open]:slide-in-from-top-full',
29
29
  'border-border text-popover-foreground',
30
30
  )}
@@ -50,7 +50,7 @@ const ToastItem: Component<{ toast: Accessor<ToastOptions> }> = (props) => (
50
50
  {props.toast().title}
51
51
  </Toast.Title>
52
52
  </Show>
53
- <Show when={props.toast().description}>
53
+ <Show when={props.toast().description} fallback={<div aria-hidden='true' class='h-5' />}>
54
54
  <Toast.Description class='text-sm opacity-90'>
55
55
  {props.toast().description}
56
56
  </Toast.Description>
@@ -1,11 +1,12 @@
1
1
  /* Toast positioning and animations - required for Ark UI stacking behavior */
2
2
 
3
3
  [data-scope='toast'][data-part='root'] {
4
- translate: var(--x, 0px) var(--y, 0px);
5
- scale: var(--scale, 1);
6
- z-index: var(--z-index, 1);
7
- height: var(--height, auto);
8
- opacity: var(--opacity, 1);
4
+ translate: var(--x) var(--y);
5
+ scale: var(--scale);
6
+ z-index: var(--z-index);
7
+ height: var(--height);
8
+ min-height: 48px;
9
+ opacity: var(--opacity);
9
10
  will-change: translate, opacity, scale, height;
10
11
  transition:
11
12
  translate 400ms,