@noxlovette/material 0.1.1 → 0.1.2

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.
@@ -13,7 +13,6 @@ on screen until confirmed, dismissed, or a required action has been taken.
13
13
  import { dialogue } from './theme.js';
14
14
  import type { DialogueProps } from './types.js';
15
15
  import { Dialog } from 'bits-ui';
16
- import clsx from 'clsx';
17
16
  import { enterExit } from '../../../animation/enterExit.js';
18
17
  import { easeEmphasized, easeEmphasizedDecel } from '../../../animation/easing.js';
19
18
  import { Button } from '../../buttons/index.js';
@@ -33,7 +32,6 @@ on screen until confirmed, dismissed, or a required action has been taken.
33
32
  children,
34
33
  disabled = false,
35
34
  class: className,
36
- toggle = () => {},
37
35
  contentProps,
38
36
  onconfirm,
39
37
  ...rootRest
@@ -43,14 +41,7 @@ on screen until confirmed, dismissed, or a required action has been taken.
43
41
  $derived(dialogue());
44
42
  </script>
45
43
 
46
- <Dialog.Root
47
- bind:open
48
- {...rootRest}
49
- onOpenChange={(v) => {
50
- if (!v) toggle?.();
51
- rootRest.onOpenChange?.(v);
52
- }}
53
- >
44
+ <Dialog.Root bind:open {...rootRest}>
54
45
  <Dialog.Portal disabled={portalDisabled}>
55
46
  <Dialog.Overlay forceMount>
56
47
  {#snippet child({ props, open })}
@@ -73,7 +64,7 @@ on screen until confirmed, dismissed, or a required action has been taken.
73
64
  method="POST"
74
65
  action={confirmAction}
75
66
  use:enhance
76
- onsubmit={(e) => {
67
+ onsubmit={(e: any) => {
77
68
  if (onconfirm) {
78
69
  e.preventDefault();
79
70
  onconfirm();
@@ -11,6 +11,7 @@ Text fields allow users to enter and edit text.
11
11
  import { Icon } from '../../../utils/index.js';
12
12
  import { textfield } from './theme.js';
13
13
  import type { TextfieldProps } from './types.js';
14
+ import { useId } from 'bits-ui';
14
15
 
15
16
  let {
16
17
  value = $bindable(),
@@ -19,7 +20,7 @@ Text fields allow users to enter and edit text.
19
20
  trailingIconProps,
20
21
  placeholder = '',
21
22
  label,
22
- id,
23
+ id = useId(),
23
24
  class: className,
24
25
  characterLimit,
25
26
  disabled = false,
@@ -32,6 +33,7 @@ Text fields allow users to enter and edit text.
32
33
  }: TextfieldProps = $props();
33
34
 
34
35
  const cls = $derived(textfield({ disabled, error }));
36
+
35
37
  const inputProps = $derived({
36
38
  id,
37
39
  class: cls.input(),
@@ -16,11 +16,11 @@ export type TextfieldProps = TextFieldVariants & Omit<HTMLInputAttributes, 'chil
16
16
  */
17
17
  label: string;
18
18
  /**
19
- * The ID for the input element.
19
+ * The ID for the input element. Auto-generated but can be replaced
20
20
  */
21
- id: string;
21
+ id?: string;
22
22
  /**
23
- * The placeholder text for the input element.
23
+ * The placeholder text for the input element. Not used in M3
24
24
  */
25
25
  placeholder?: '';
26
26
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noxlovette/material",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {