beez-ui 0.6.2 → 0.8.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.
- package/CHANGELOG.md +150 -96
- package/README.md +33 -6
- package/dist/components/account-menu.d.ts +53 -0
- package/dist/components/account-menu.js +405 -0
- package/dist/components/alert.js +1 -1
- package/dist/components/animated-collapse.d.ts +19 -0
- package/dist/components/animated-collapse.js +81 -0
- package/dist/components/animated-count.d.ts +13 -0
- package/dist/components/animated-count.js +105 -0
- package/dist/components/animated-list-item.d.ts +25 -0
- package/dist/components/animated-list-item.js +132 -0
- package/dist/components/avatar.d.ts +2 -1
- package/dist/components/avatar.js +4 -3
- package/dist/components/bouncing-dots-loader.d.ts +19 -0
- package/dist/components/bouncing-dots-loader.js +47 -0
- package/dist/components/calendar.js +102 -0
- package/dist/components/carousel.js +61 -48
- package/dist/components/checkbox.js +1 -1
- package/dist/components/confirm-delete-button.d.ts +29 -0
- package/dist/components/confirm-delete-button.js +254 -0
- package/dist/components/data-table.js +34 -4
- package/dist/components/dropdown-menu.js +5 -2
- package/dist/components/empty-state.d.ts +24 -0
- package/dist/components/empty-state.js +37 -0
- package/dist/components/error-state.d.ts +20 -0
- package/dist/components/error-state.js +145 -0
- package/dist/components/external-browser-handoff.d.ts +27 -0
- package/dist/components/external-browser-handoff.js +306 -0
- package/dist/components/file-upload.d.ts +78 -0
- package/dist/components/file-upload.js +678 -0
- package/dist/components/filter-query-bar.js +11 -6
- package/dist/components/form.d.ts +5 -0
- package/dist/components/form.js +11 -9
- package/dist/components/info-popover.d.ts +23 -0
- package/dist/components/info-popover.js +158 -0
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/month-calendar-header.d.ts +65 -0
- package/dist/components/month-calendar-header.js +337 -0
- package/dist/components/month-grid.d.ts +59 -0
- package/dist/components/month-grid.js +301 -0
- package/dist/components/notification-bell.d.ts +50 -0
- package/dist/components/notification-bell.js +338 -0
- package/dist/components/notification-panel.d.ts +56 -0
- package/dist/components/notification-panel.js +281 -0
- package/dist/components/open-in-browser-cta.d.ts +22 -0
- package/dist/components/open-in-browser-cta.js +61 -0
- package/dist/components/pagination.d.ts +1 -0
- package/dist/components/pagination.js +9 -4
- package/dist/components/presence-swap.d.ts +22 -0
- package/dist/components/presence-swap.js +162 -0
- package/dist/components/progress-ring.d.ts +20 -0
- package/dist/components/progress-ring.js +53 -0
- package/dist/components/pwa-update-control.d.ts +18 -0
- package/dist/components/pwa-update-control.js +119 -0
- package/dist/components/radio-group.js +1 -1
- package/dist/components/reaction-button.d.ts +26 -0
- package/dist/components/reaction-button.js +114 -0
- package/dist/components/rich-link-editor.d.ts +25 -0
- package/dist/components/rich-link-editor.js +320 -0
- package/dist/components/rich-markdown-content.d.ts +10 -0
- package/dist/components/rich-markdown-content.js +56 -0
- package/dist/components/rich-text-content.d.ts +19 -0
- package/dist/components/rich-text-content.js +26 -0
- package/dist/components/select.js +1 -1
- package/dist/components/sheet.js +12 -9
- package/dist/components/sidebar.js +9 -5
- package/dist/components/skeleton.d.ts +6 -0
- package/dist/components/skeleton.js +7 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/typing-animation.js +42 -15
- package/dist/emoji-picker.d.ts +27 -0
- package/dist/emoji-picker.js +283 -0
- package/dist/hooks/use-horizontal-swipe.d.ts +23 -0
- package/dist/hooks/use-horizontal-swipe.js +80 -0
- package/dist/hooks/use-is-hydrated.d.ts +6 -0
- package/dist/hooks/use-is-hydrated.js +20 -0
- package/dist/hooks/use-minute-clock.d.ts +23 -0
- package/dist/hooks/use-minute-clock.js +147 -0
- package/dist/hooks/use-month-transition-direction.d.ts +21 -0
- package/dist/hooks/use-month-transition-direction.js +110 -0
- package/dist/hooks/use-rich-link-editor.d.ts +55 -0
- package/dist/hooks/use-rich-link-editor.js +515 -0
- package/dist/hooks/use-viewer-time-zone.d.ts +6 -0
- package/dist/hooks/use-viewer-time-zone.js +20 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +43 -0
- package/dist/lib/browser-clipboard.d.ts +13 -0
- package/dist/lib/browser-clipboard.js +48 -0
- package/dist/lib/browser-navigation.d.ts +21 -0
- package/dist/lib/browser-navigation.js +42 -0
- package/dist/lib/column-filter-value.d.ts +12 -0
- package/dist/lib/column-filter-value.js +52 -0
- package/dist/lib/file-acceptance.d.ts +43 -0
- package/dist/lib/file-acceptance.js +107 -0
- package/dist/lib/format-file-size.d.ts +16 -0
- package/dist/lib/format-file-size.js +34 -0
- package/dist/lib/fuzzy-search.d.ts +17 -0
- package/dist/lib/fuzzy-search.js +183 -0
- package/dist/lib/horizontal-swipe.d.ts +23 -0
- package/dist/lib/horizontal-swipe.js +29 -0
- package/dist/lib/in-app-browser.d.ts +35 -0
- package/dist/lib/in-app-browser.js +80 -0
- package/dist/lib/month-grid.d.ts +42 -0
- package/dist/lib/month-grid.js +74 -0
- package/dist/lib/name-initials.d.ts +7 -0
- package/dist/lib/name-initials.js +11 -0
- package/dist/lib/rich-text/link-markdown-constants.d.ts +147 -0
- package/dist/lib/rich-text/link-markdown-constants.js +458 -0
- package/dist/lib/rich-text/link-markdown-types.d.ts +53 -0
- package/dist/lib/rich-text/link-markdown-types.js +1 -0
- package/dist/lib/rich-text/link-markdown.d.ts +193 -0
- package/dist/lib/rich-text/link-markdown.js +592 -0
- package/dist/lib/rich-text/rich-markdown.d.ts +41 -0
- package/dist/lib/rich-text/rich-markdown.js +105 -0
- package/dist/lib/rich-text/rich-text-editor-dom.d.ts +26 -0
- package/dist/lib/rich-text/rich-text-editor-dom.js +79 -0
- package/dist/motion/glide-indicator.d.ts +37 -3
- package/dist/motion/glide-indicator.js +37 -3
- package/dist/motion/motion-slot.js +47 -18
- package/dist/motion/surface-keyframes.js +18 -6
- package/dist/motion/tokens.d.ts +41 -2
- package/dist/motion/tokens.js +40 -1
- package/dist/providers/beez-ui-provider.js +49 -17
- package/dist/styles.css +1 -1
- package/package.json +212 -2
package/dist/motion/tokens.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Defines the timing, curves and physics shared by Motion animations, aligned with beui.dev/components/motion.
|
|
3
|
+
* Public: consumers animate their own product surfaces with these tokens so they move like the library.
|
|
4
|
+
*/
|
|
2
5
|
export const MOTION_TIMING = {
|
|
3
6
|
fast: .14,
|
|
4
7
|
enter: .18,
|
|
@@ -16,6 +19,14 @@ export const MOTION_TIMING = {
|
|
|
16
19
|
listStagger: .035,
|
|
17
20
|
closeEnter: .2,
|
|
18
21
|
closeDelay: .16,
|
|
22
|
+
sheetExit: .24,
|
|
23
|
+
reveal: .4,
|
|
24
|
+
/** Heart and badge pops that confirm a toggle. */
|
|
25
|
+
pop: .32,
|
|
26
|
+
/** Height of expanding and collapsing regions. */
|
|
27
|
+
collapse: .26,
|
|
28
|
+
monthSwap: .24,
|
|
29
|
+
cursorBlink: 1,
|
|
19
30
|
skeleton: 1.8
|
|
20
31
|
};
|
|
21
32
|
/** Items beyond this position share the last stagger delay, so long lists never lag behind. */
|
|
@@ -62,6 +73,13 @@ export const SPRING_LAYOUT = {
|
|
|
62
73
|
damping: 32,
|
|
63
74
|
mass: .6
|
|
64
75
|
};
|
|
76
|
+
/** Keyboard highlight in menus and lists: quick enough to keep up with a held arrow key. */
|
|
77
|
+
export const SPRING_HIGHLIGHT = {
|
|
78
|
+
type: "spring",
|
|
79
|
+
stiffness: 700,
|
|
80
|
+
damping: 45,
|
|
81
|
+
mass: .5
|
|
82
|
+
};
|
|
65
83
|
/** Tab indicator glide, tuned to settle without overshooting the list edges. */
|
|
66
84
|
export const SPRING_TABS = {
|
|
67
85
|
type: "spring",
|
|
@@ -89,6 +107,13 @@ export const SPRING_THUMB = {
|
|
|
89
107
|
damping: 80,
|
|
90
108
|
mass: 4
|
|
91
109
|
};
|
|
110
|
+
/** Small, confident pops for counters, badges and toggled icons. */
|
|
111
|
+
export const SPRING_POP = {
|
|
112
|
+
type: "spring",
|
|
113
|
+
stiffness: 520,
|
|
114
|
+
damping: 30,
|
|
115
|
+
mass: .5
|
|
116
|
+
};
|
|
92
117
|
/** Primary actions compress noticeably; dense navigation items stay subtle. */
|
|
93
118
|
export const MOTION_PRESS_SCALE = .93;
|
|
94
119
|
export const MOTION_SUBTLE_PRESS_SCALE = .98;
|
|
@@ -99,9 +124,23 @@ export const MOTION_ITEM_CHECK_SCALE = .75;
|
|
|
99
124
|
export const MOTION_ICON_SWAP_SCALE = .25;
|
|
100
125
|
export const MOTION_CLOSE_BUTTON_SCALE = .8;
|
|
101
126
|
export const MOTION_LIST_ITEM_DISTANCE = 6;
|
|
127
|
+
/** Scale a freshly inserted list item starts from, and a leaving one shrinks to. */
|
|
128
|
+
export const MOTION_ITEM_ENTER_SCALE = .98;
|
|
129
|
+
/** Loaded images settle from a slight zoom, so they develop in place instead of popping in. */
|
|
130
|
+
export const MOTION_REVEAL_SCALE = 1.06;
|
|
131
|
+
export const MOTION_REVEAL_BLUR_PX = 6;
|
|
132
|
+
/** Calendar months slide just enough to show the direction of navigation. */
|
|
133
|
+
export const MOTION_MONTH_DISTANCE = 12;
|
|
134
|
+
/** Skeleton shine travels from fully before the box to fully past it, as a `translate` value. */
|
|
135
|
+
export const MOTION_SHIMMER_TRANSLATE = ["-100% 0", "100% 0"];
|
|
136
|
+
/** Hovered interactive cards gain a soft drop shadow; the rest value has the same shape, invisible. */
|
|
137
|
+
export const MOTION_CARD_SHADOW_LIFT = "0px 4px 16px 0px rgba(0, 0, 0, 0.08)";
|
|
138
|
+
export const MOTION_CARD_SHADOW_REST = "0px 0px 0px 0px rgba(0, 0, 0, 0)";
|
|
102
139
|
export const MOTION_SURFACE_SCALE = .96;
|
|
103
140
|
/** Fraction of the surface kept hidden by the clip at the start of its reveal, in percent. */
|
|
104
141
|
export const MOTION_SURFACE_CLIP_PERCENT = 92;
|
|
142
|
+
/** Room left outside a revealing surface for its ring and drop shadow (`shadow-lg` spans ~22px). */
|
|
143
|
+
export const MOTION_SURFACE_CLIP_BLEED_PX = 24;
|
|
105
144
|
export const MOTION_TOOLTIP_DISTANCE = 8;
|
|
106
145
|
export const MOTION_DIALOG_DISTANCE = 20;
|
|
107
146
|
export const MOTION_CONTENT_DISTANCE = 4;
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
/** Shares optional rendering adapters without importing a framework into the core. */
|
|
4
|
-
import { createContext, useContext } from "react";
|
|
4
|
+
import { createContext, useContext, useSyncExternalStore } from "react";
|
|
5
5
|
import { MotionConfig } from "motion/react";
|
|
6
6
|
import { ThemeProvider } from "next-themes";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* next-themes renders an inline script that applies the stored theme before hydration. It only
|
|
10
|
+
* runs when it arrives in server HTML; a script created by a client render never executes, and
|
|
11
|
+
* React 19 warns about it. Client-only renders mark it as a data block, which React accepts.
|
|
12
|
+
*/
|
|
13
|
+
const CLIENT_RENDER_THEME_SCRIPT_PROPS = { type: "application/json" };
|
|
14
|
+
/** Nothing to subscribe to: the value only distinguishes server/hydration from client renders. */
|
|
15
|
+
function subscribeToRenderEnvironment() {
|
|
16
|
+
return () => {};
|
|
17
|
+
}
|
|
8
18
|
/** Native elements remain the implicit fallback for unconfigured adapters. */
|
|
9
19
|
const EMPTY_COMPONENTS = {};
|
|
10
20
|
const AdapterContext = createContext(EMPTY_COMPONENTS);
|
|
11
21
|
/** Merges nested overrides while preserving stable adapter identities. */
|
|
12
22
|
export function BeezUIProvider(t0) {
|
|
13
|
-
const $ = _c(
|
|
23
|
+
const $ = _c(13);
|
|
14
24
|
const { children, components: t1, themeOptions } = t0;
|
|
15
25
|
const components = t1 === undefined ? EMPTY_COMPONENTS : t1;
|
|
16
26
|
const parent = useContext(AdapterContext);
|
|
@@ -27,35 +37,57 @@ export function BeezUIProvider(t0) {
|
|
|
27
37
|
t2 = $[2];
|
|
28
38
|
}
|
|
29
39
|
const value = t2;
|
|
40
|
+
const isClientOnlyRender = useSyncExternalStore(subscribeToRenderEnvironment, _temp, _temp2);
|
|
30
41
|
let t3;
|
|
31
|
-
if ($[3] !==
|
|
32
|
-
t3 =
|
|
42
|
+
if ($[3] !== isClientOnlyRender || $[4] !== themeOptions?.scriptProps) {
|
|
43
|
+
t3 = isClientOnlyRender ? {
|
|
44
|
+
...CLIENT_RENDER_THEME_SCRIPT_PROPS,
|
|
45
|
+
...themeOptions?.scriptProps
|
|
46
|
+
} : themeOptions?.scriptProps;
|
|
47
|
+
$[3] = isClientOnlyRender;
|
|
48
|
+
$[4] = themeOptions?.scriptProps;
|
|
49
|
+
$[5] = t3;
|
|
50
|
+
} else {
|
|
51
|
+
t3 = $[5];
|
|
52
|
+
}
|
|
53
|
+
const scriptProps = t3;
|
|
54
|
+
let t4;
|
|
55
|
+
if ($[6] !== children || $[7] !== value) {
|
|
56
|
+
t4 = /* @__PURE__ */ _jsx(MotionConfig, {
|
|
33
57
|
reducedMotion: "user",
|
|
34
58
|
children: /* @__PURE__ */ _jsx(AdapterContext.Provider, {
|
|
35
59
|
value,
|
|
36
60
|
children
|
|
37
61
|
})
|
|
38
62
|
});
|
|
39
|
-
$[
|
|
40
|
-
$[
|
|
41
|
-
$[
|
|
63
|
+
$[6] = children;
|
|
64
|
+
$[7] = value;
|
|
65
|
+
$[8] = t4;
|
|
42
66
|
} else {
|
|
43
|
-
|
|
67
|
+
t4 = $[8];
|
|
44
68
|
}
|
|
45
|
-
let
|
|
46
|
-
if ($[
|
|
47
|
-
|
|
69
|
+
let t5;
|
|
70
|
+
if ($[9] !== scriptProps || $[10] !== t4 || $[11] !== themeOptions) {
|
|
71
|
+
t5 = /* @__PURE__ */ _jsx(ThemeProvider, {
|
|
48
72
|
attribute: "class",
|
|
49
73
|
...themeOptions,
|
|
50
|
-
|
|
74
|
+
scriptProps,
|
|
75
|
+
children: t4
|
|
51
76
|
});
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
77
|
+
$[9] = scriptProps;
|
|
78
|
+
$[10] = t4;
|
|
79
|
+
$[11] = themeOptions;
|
|
80
|
+
$[12] = t5;
|
|
55
81
|
} else {
|
|
56
|
-
|
|
82
|
+
t5 = $[12];
|
|
57
83
|
}
|
|
58
|
-
return
|
|
84
|
+
return t5;
|
|
85
|
+
}
|
|
86
|
+
function _temp2() {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
function _temp() {
|
|
90
|
+
return true;
|
|
59
91
|
}
|
|
60
92
|
/** Reads adapters internally; native components work without a provider. */
|
|
61
93
|
export function useBeezUIComponents() {
|