@waveso/ui 0.15.1 → 0.17.0

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.
Files changed (87) hide show
  1. package/README.md +13 -12
  2. package/dist/accordion.js +2 -2
  3. package/dist/action-bar.js +4 -4
  4. package/dist/alert-dialog.js +5 -5
  5. package/dist/alert.d.ts +8 -1
  6. package/dist/alert.js +13 -4
  7. package/dist/animate.d.ts +1 -1
  8. package/dist/animate.js +2 -9
  9. package/dist/autocomplete.js +3 -3
  10. package/dist/avatar.d.ts +1 -1
  11. package/dist/avatar.js +4 -4
  12. package/dist/badge.d.ts +1 -1
  13. package/dist/badge.js +6 -6
  14. package/dist/button-group.d.ts +4 -2
  15. package/dist/button-group.js +5 -4
  16. package/dist/button.d.ts +1 -1
  17. package/dist/button.js +6 -6
  18. package/dist/card.d.ts +11 -4
  19. package/dist/card.js +27 -14
  20. package/dist/checkbox.js +2 -2
  21. package/dist/combobox.js +4 -4
  22. package/dist/context-menu.d.ts +2 -1
  23. package/dist/context-menu.js +14 -14
  24. package/dist/dialog.js +5 -5
  25. package/dist/drawer.js +1 -1
  26. package/dist/encrypted-text.d.ts +15 -1
  27. package/dist/encrypted-text.js +205 -67
  28. package/dist/field.d.ts +21 -3
  29. package/dist/field.js +36 -8
  30. package/dist/fieldset.d.ts +14 -0
  31. package/dist/fieldset.js +26 -0
  32. package/dist/form.d.ts +14 -14
  33. package/dist/form.js +7 -4
  34. package/dist/glyph-matrix.d.ts +25 -0
  35. package/dist/glyph-matrix.js +266 -0
  36. package/dist/gradient-reveal-text.d.ts +3 -3
  37. package/dist/gradient-reveal-text.js +8 -8
  38. package/dist/input-group.js +1 -1
  39. package/dist/input-otp.d.ts +3 -3
  40. package/dist/input-otp.js +2 -2
  41. package/dist/input.js +1 -1
  42. package/dist/item.d.ts +1 -1
  43. package/dist/item.js +17 -11
  44. package/dist/kbd.d.ts +1 -1
  45. package/dist/kbd.js +2 -2
  46. package/dist/label.js +1 -1
  47. package/dist/lib/merge-refs.d.ts +9 -0
  48. package/dist/lib/merge-refs.js +16 -0
  49. package/dist/lib/utils.js +7 -0
  50. package/dist/masonry.d.ts +1 -1
  51. package/dist/masonry.js +4 -2
  52. package/dist/menu.d.ts +2 -1
  53. package/dist/menu.js +7 -7
  54. package/dist/menubar.js +1 -1
  55. package/dist/pagination.js +1 -1
  56. package/dist/popover.js +1 -1
  57. package/dist/preview-card.js +1 -1
  58. package/dist/progress.js +2 -2
  59. package/dist/radio-group.js +1 -1
  60. package/dist/radio.js +2 -2
  61. package/dist/resizable.d.ts +43 -0
  62. package/dist/resizable.js +53 -0
  63. package/dist/scroll-area.d.ts +13 -2
  64. package/dist/scroll-area.js +26 -7
  65. package/dist/select.js +4 -4
  66. package/dist/separator.js +1 -1
  67. package/dist/sidebar.js +12 -12
  68. package/dist/slider.js +3 -3
  69. package/dist/spinner.d.ts +7 -0
  70. package/dist/spinner.js +24 -6
  71. package/dist/styles.css +581 -194
  72. package/dist/swipe-deck.d.ts +98 -0
  73. package/dist/swipe-deck.js +931 -0
  74. package/dist/switch.js +6 -6
  75. package/dist/table.d.ts +7 -1
  76. package/dist/table.js +40 -9
  77. package/dist/tabs.js +3 -3
  78. package/dist/textarea.js +1 -1
  79. package/dist/toast.js +4 -4
  80. package/dist/toggle-group.js +3 -3
  81. package/dist/toggle.d.ts +1 -1
  82. package/dist/toggle.js +11 -6
  83. package/dist/tooltip.d.ts +3 -1
  84. package/dist/tooltip.js +10 -6
  85. package/dist/video-text.d.ts +25 -0
  86. package/dist/video-text.js +147 -0
  87. package/package.json +6 -1
@@ -0,0 +1,98 @@
1
+ import { ButtonProps } from "./button.js";
2
+ import * as React from "react";
3
+ //#region src/swipe-deck.d.ts
4
+ type SwipeDirection = "left" | "right" | "up" | "down";
5
+ type SwipeDeckLayout = "stack" | "fan" | "cascade" | "pile";
6
+ interface SwipeDeckSwipeDetails {
7
+ /** The `value` of the card that left. */
8
+ value: string;
9
+ /** The direction it left in. */
10
+ direction: SwipeDirection;
11
+ }
12
+ type SwipeDeckProps = React.ComponentProps<"div"> & {
13
+ /**
14
+ * Called once a card has left the deck. Remove it from your list to discard
15
+ * it, or move it to the end of your list to cycle it to the back.
16
+ */
17
+ onSwipe?: (details: SwipeDeckSwipeDetails) => void;
18
+ /** The directions a card can leave in. Defaults to left and right. */
19
+ directions?: readonly SwipeDirection[];
20
+ /** Stops cards leaving by pointer, keyboard or action. */
21
+ disabled?: boolean;
22
+ /**
23
+ * How the cards behind the front one sit: `stack` peeks them above it, `fan`
24
+ * turns them out like a hand of cards, `cascade` steps them up and to the
25
+ * side, and `pile` scatters them. Defaults to `stack`.
26
+ */
27
+ layout?: SwipeDeckLayout;
28
+ /** How far the cards behind spread out, from 0 (not at all) to 2. Defaults to 0.5. */
29
+ spread?: number;
30
+ /** How much each card behind shrinks, from 0 (not at all) to 1. Defaults to 0.5. */
31
+ depth?: number;
32
+ /** How many cards show, the front one included; at least 1. Defaults to 4. */
33
+ visible?: number;
34
+ };
35
+ type SwipeDeckItemProps = React.ComponentProps<"div"> & {
36
+ /** Names the card in `onSwipe`. Use the same id as its `key`. */
37
+ value: string;
38
+ };
39
+ type SwipeDeckEmptyProps = React.ComponentProps<"div">;
40
+ type SwipeDeckActionProps = ButtonProps & {
41
+ /** The direction the front card leaves in when pressed. */
42
+ direction: SwipeDirection;
43
+ };
44
+ /**
45
+ * A pile of cards people swipe away: drag or throw the front card, press an
46
+ * arrow key while the deck is focused, or use a `SwipeDeckAction`. A let-go
47
+ * card whose position and throw carry it past a quarter of its width leaves:
48
+ * it slides out the way it is heading until clear of the stack, held by a
49
+ * spring that a hard throw runs out against, then fades. Short of that, it
50
+ * springs back. Your list stays the source of truth — `onSwipe` tells you
51
+ * which card left and which way, and you remove it or move it to the back.
52
+ *
53
+ * End the deck with a `SwipeDeckEmpty`: it lies under the last card, so
54
+ * dragging that card shows what comes next. The deck carries `data-empty`
55
+ * once no card is in front (the last one leaving, or none left), for styles
56
+ * of your own.
57
+ *
58
+ * Give the deck an `aria-label`. Screen readers hear the next card after each
59
+ * swipe: its `aria-label` when it has one, otherwise all of its text.
60
+ */
61
+ declare function SwipeDeck({ onSwipe, directions, disabled, layout, spread, depth, visible, className, style, onKeyDown, children, ref, ...props }: SwipeDeckProps): React.JSX.Element;
62
+ /**
63
+ * One card in the deck. It sits in the deck's first grid cell with every other
64
+ * card, so the deck takes the size of its largest card.
65
+ *
66
+ * Styling hooks: `data-front` on the top card, `data-swiping` while it is
67
+ * dragged, `data-leaving` from the moment it leaves, `data-ending-style` once
68
+ * it is clear of the stack and fading (the `motion-fade-lg` recipe), and
69
+ * `data-swipe-direction` for the way it leans or leaves. CSS variables:
70
+ * `--swipe-deck-index` (its place in the pile, 0 at the front),
71
+ * `--swipe-deck-place` (that place as it springs from one to the next, less
72
+ * the lift while the front card is dragged out, as `--swipe-deck-slot`),
73
+ * `--swipe-deck-movement-x` / `-y` in px, and `--swipe-deck-progress` from 0
74
+ * at rest to 1 where letting go makes the card leave.
75
+ *
76
+ * The card owns its translate, rotate and scale, so its motion recipe can only
77
+ * be a `motion-fade-*` one: a recipe that transitions those would lag every
78
+ * drag.
79
+ */
80
+ declare function SwipeDeckItem({ value, className, style, ref, onPointerDown, onClickCapture, onDragStart, ...props }: SwipeDeckItemProps): React.JSX.Element;
81
+ /**
82
+ * What the deck shows once its cards run out: a message, an action (start
83
+ * over, carry on), anything you put in it. It sits where the cards sit, at
84
+ * their size, inside a dashed outline of their shape (`data-slot`
85
+ * `swipe-deck-empty-outline`, to restyle or hide). It is drawn as soon as one
86
+ * card is left and has come to rest, under that card, so dragging it shows
87
+ * what comes next; it
88
+ * can be reached (Tab, clicks) and screen readers hear it (its `aria-label`,
89
+ * or its text) once that last card has gone too.
90
+ */
91
+ declare function SwipeDeckEmpty({ className, children, ref, ...props }: SwipeDeckEmptyProps): React.JSX.Element;
92
+ /**
93
+ * A button that sends the front card off in `direction`: the way to swipe
94
+ * without dragging. Disabled when the deck is empty or can't go that way.
95
+ */
96
+ declare function SwipeDeckAction({ direction, disabled, onClick, ...props }: SwipeDeckActionProps): React.JSX.Element;
97
+ //#endregion
98
+ export { SwipeDeck, SwipeDeckAction, type SwipeDeckActionProps, SwipeDeckEmpty, type SwipeDeckEmptyProps, SwipeDeckItem, type SwipeDeckItemProps, type SwipeDeckLayout, type SwipeDeckProps, type SwipeDeckSwipeDetails, type SwipeDirection };