beez-ui 0.11.0 → 2.0.1

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 (52) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/README.md +62 -15
  3. package/THIRD_PARTY_NOTICES.md +31 -0
  4. package/assets/fonts/ibmplexmono-LICENSE.txt +93 -93
  5. package/assets/fonts/{poppins-LICENSE.txt → inter-LICENSE.txt} +2 -2
  6. package/assets/fonts/inter-latin-variable.woff2 +0 -0
  7. package/dist/components/account-menu.js +2 -2
  8. package/dist/components/alert-dialog.d.ts +4 -2
  9. package/dist/components/alert-dialog.js +78 -66
  10. package/dist/components/animated-collapse.js +106 -36
  11. package/dist/components/button-interaction.d.ts +23 -0
  12. package/dist/components/button-interaction.js +22 -0
  13. package/dist/components/button-label.d.ts +8 -0
  14. package/dist/components/button-label.js +322 -0
  15. package/dist/components/button.d.ts +23 -10
  16. package/dist/components/button.js +111 -64
  17. package/dist/components/calendar.d.ts +2 -2
  18. package/dist/components/calendar.js +4 -4
  19. package/dist/components/carousel.d.ts +3 -3
  20. package/dist/components/carousel.js +3 -3
  21. package/dist/components/control-button.d.ts +16 -0
  22. package/dist/components/control-button.js +215 -0
  23. package/dist/components/data-table.js +7 -7
  24. package/dist/components/dialog.js +3 -2
  25. package/dist/components/dropdown-menu.js +1 -1
  26. package/dist/components/file-upload.js +5 -5
  27. package/dist/components/filter-presets-bar.js +6 -6
  28. package/dist/components/filter-query-bar.js +2 -2
  29. package/dist/components/input-group.d.ts +2 -2
  30. package/dist/components/input-group.js +2 -2
  31. package/dist/components/pagination.d.ts +2 -2
  32. package/dist/components/pagination.js +2 -2
  33. package/dist/components/reaction-button.js +2 -2
  34. package/dist/components/rich-link-editor.js +7 -7
  35. package/dist/components/rich-text-content.js +1 -1
  36. package/dist/components/sheet.js +2 -2
  37. package/dist/components/sidebar.js +3 -3
  38. package/dist/components/typing-animation.js +1 -1
  39. package/dist/constants/button.d.ts +16 -0
  40. package/dist/constants/button.js +16 -0
  41. package/dist/motion/arc-press.d.ts +6 -0
  42. package/dist/motion/arc-press.js +59 -0
  43. package/dist/motion/arc-tokens.d.ts +32 -0
  44. package/dist/motion/arc-tokens.js +42 -0
  45. package/dist/providers/beez-ui-provider.d.ts +1 -1
  46. package/dist/providers/beez-ui-provider.js +6 -1
  47. package/dist/styles.css +1 -1
  48. package/fonts.css +5 -5
  49. package/package.json +3 -2
  50. package/styles.css +4 -4
  51. package/theme.css +248 -87
  52. package/assets/fonts/poppins-latin-600.woff2 +0 -0
@@ -0,0 +1,16 @@
1
+ /** Tuning shared by Button's Arc press feedback and label width morph. */
2
+ /** Buttons wider than this press a little less so large surfaces don't feel spongy. */
3
+ export declare const BUTTON_WIDE_THRESHOLD_PX = 220;
4
+ /** Buttons up to this width are icon-sized and press a little deeper. */
5
+ export declare const BUTTON_ICON_THRESHOLD_PX = 48;
6
+ /** Press scale for wide buttons. */
7
+ export declare const BUTTON_WIDE_PRESS_SCALE = 0.985;
8
+ /** Press scale for icon-sized buttons. */
9
+ export declare const BUTTON_ICON_PRESS_SCALE = 0.96;
10
+ /** Press scale for every other button. */
11
+ export declare const BUTTON_DEFAULT_PRESS_SCALE = 0.97;
12
+ /**
13
+ * After the label changes, resizes inside this window spring to the new width; later resizes
14
+ * (late web fonts, parent reflows) jump so nothing wobbles on first paint.
15
+ */
16
+ export declare const BUTTON_MORPH_WINDOW_MS = 700;
@@ -0,0 +1,16 @@
1
+ /** Tuning shared by Button's Arc press feedback and label width morph. */
2
+ /** Buttons wider than this press a little less so large surfaces don't feel spongy. */
3
+ export const BUTTON_WIDE_THRESHOLD_PX = 220;
4
+ /** Buttons up to this width are icon-sized and press a little deeper. */
5
+ export const BUTTON_ICON_THRESHOLD_PX = 48;
6
+ /** Press scale for wide buttons. */
7
+ export const BUTTON_WIDE_PRESS_SCALE = .985;
8
+ /** Press scale for icon-sized buttons. */
9
+ export const BUTTON_ICON_PRESS_SCALE = .96;
10
+ /** Press scale for every other button. */
11
+ export const BUTTON_DEFAULT_PRESS_SCALE = .97;
12
+ /**
13
+ * After the label changes, resizes inside this window spring to the new width; later resizes
14
+ * (late web fonts, parent reflows) jump so nothing wobbles on first paint.
15
+ */
16
+ export const BUTTON_MORPH_WINDOW_MS = 700;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Scales the element down while pressed and springs it back on release.
3
+ * @param element - Rendered button, link or Slot child; nothing happens until it is attached.
4
+ * @param isEnabled - False skips the feedback, for reduced motion or variants that should not press.
5
+ */
6
+ export declare function useArcPress(element: HTMLElement | null, isEnabled: boolean): void;
@@ -0,0 +1,59 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ /**
4
+ * Press feedback adapted from Arc (https://uiarc.dev), Copyright (c) 2026 Elia Kuratli, MIT License.
5
+ * The full license text ships in THIRD_PARTY_NOTICES.md. Works on whatever node a Slot or Base UI
6
+ * renders, so `asChild` links press exactly like native buttons.
7
+ */
8
+ import { useEffect } from "react";
9
+ import { animate, press } from "motion/react";
10
+ import { BUTTON_DEFAULT_PRESS_SCALE, BUTTON_ICON_PRESS_SCALE, BUTTON_ICON_THRESHOLD_PX, BUTTON_WIDE_PRESS_SCALE, BUTTON_WIDE_THRESHOLD_PX } from "../constants/button.js";
11
+ import { ARC_DURATION, ARC_EASE, ARC_SPRING_SNAPPY } from "./arc-tokens.js";
12
+ /** Matches triggers of menus, popovers and dialogs, which never scale: Radix measures them on pointerdown. */
13
+ const LAYER_ANCHOR_SELECTOR = "[aria-haspopup]:not([aria-haspopup=\"false\"]), [data-state], [role=\"combobox\"]";
14
+ /** Matches elements that ignore presses: disabled, busy or marked unavailable. */
15
+ const INERT_SELECTOR = ":disabled, [data-disabled], [aria-disabled=\"true\"], [aria-busy=\"true\"]";
16
+ /** Icon buttons press a little deeper and wide buttons a little less, so every size reads as the same push. */
17
+ function getPressScale(width) {
18
+ if (width > BUTTON_WIDE_THRESHOLD_PX) return BUTTON_WIDE_PRESS_SCALE;
19
+ if (width && width <= BUTTON_ICON_THRESHOLD_PX) return BUTTON_ICON_PRESS_SCALE;
20
+ return BUTTON_DEFAULT_PRESS_SCALE;
21
+ }
22
+ /**
23
+ * Scales the element down while pressed and springs it back on release.
24
+ * @param element - Rendered button, link or Slot child; nothing happens until it is attached.
25
+ * @param isEnabled - False skips the feedback, for reduced motion or variants that should not press.
26
+ */
27
+ export function useArcPress(element, isEnabled) {
28
+ const $ = _c(4);
29
+ let t0;
30
+ let t1;
31
+ if ($[0] !== element || $[1] !== isEnabled) {
32
+ t0 = () => {
33
+ if (!element || !isEnabled) {
34
+ return;
35
+ }
36
+ return press(element, () => {
37
+ if (element.matches(INERT_SELECTOR) || element.matches(LAYER_ANCHOR_SELECTOR)) {
38
+ return;
39
+ }
40
+ animate(element, { scale: getPressScale(element.offsetWidth) }, {
41
+ duration: ARC_DURATION.instant,
42
+ ease: [...ARC_EASE.standard]
43
+ });
44
+ return () => {
45
+ animate(element, { scale: 1 }, ARC_SPRING_SNAPPY);
46
+ };
47
+ });
48
+ };
49
+ t1 = [element, isEnabled];
50
+ $[0] = element;
51
+ $[1] = isEnabled;
52
+ $[2] = t0;
53
+ $[3] = t1;
54
+ } else {
55
+ t0 = $[2];
56
+ t1 = $[3];
57
+ }
58
+ useEffect(t0, t1);
59
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Motion presets adapted from Arc (https://uiarc.dev), Copyright (c) 2026 Elia Kuratli, MIT License.
3
+ * The full license text ships in THIRD_PARTY_NOTICES.md. Internal: only Arc-derived components use these.
4
+ */
5
+ /** Durations in seconds, from an instant color answer to a considered layout change. */
6
+ export declare const ARC_DURATION: {
7
+ readonly instant: 0.12;
8
+ readonly fast: 0.16;
9
+ readonly standard: 0.24;
10
+ };
11
+ /** Cubic-bezier curves for entrances and color or opacity tweens. */
12
+ export declare const ARC_EASE: {
13
+ readonly enter: readonly [0.16, 1, 0.3, 1];
14
+ readonly standard: readonly [0.22, 1, 0.36, 1];
15
+ };
16
+ /** Presses, toggles and small indicators: settles fast with a hint of life. */
17
+ export declare const ARC_SPRING_SNAPPY: {
18
+ readonly type: "spring";
19
+ readonly visualDuration: 0.26;
20
+ readonly bounce: 0.12;
21
+ };
22
+ /** Shape morphs and width changes that follow new content. */
23
+ export declare const ARC_SPRING_MORPH: {
24
+ readonly type: "spring";
25
+ readonly visualDuration: 0.42;
26
+ readonly bounce: 0.16;
27
+ };
28
+ /** Blur radii in pixels for brief content crossfades. */
29
+ export declare const ARC_BLUR: {
30
+ readonly subtle: 2;
31
+ readonly soft: 4;
32
+ };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Motion presets adapted from Arc (https://uiarc.dev), Copyright (c) 2026 Elia Kuratli, MIT License.
3
+ * The full license text ships in THIRD_PARTY_NOTICES.md. Internal: only Arc-derived components use these.
4
+ */
5
+ /** Durations in seconds, from an instant color answer to a considered layout change. */
6
+ export const ARC_DURATION = {
7
+ instant: .12,
8
+ fast: .16,
9
+ standard: .24
10
+ };
11
+ /** Cubic-bezier curves for entrances and color or opacity tweens. */
12
+ export const ARC_EASE = {
13
+ enter: [
14
+ .16,
15
+ 1,
16
+ .3,
17
+ 1
18
+ ],
19
+ standard: [
20
+ .22,
21
+ 1,
22
+ .36,
23
+ 1
24
+ ]
25
+ };
26
+ /** Presses, toggles and small indicators: settles fast with a hint of life. */
27
+ export const ARC_SPRING_SNAPPY = {
28
+ type: "spring",
29
+ visualDuration: .26,
30
+ bounce: .12
31
+ };
32
+ /** Shape morphs and width changes that follow new content. */
33
+ export const ARC_SPRING_MORPH = {
34
+ type: "spring",
35
+ visualDuration: .42,
36
+ bounce: .16
37
+ };
38
+ /** Blur radii in pixels for brief content crossfades. */
39
+ export const ARC_BLUR = {
40
+ subtle: 2,
41
+ soft: 4
42
+ };
@@ -18,7 +18,7 @@ export interface BeezUIComponents {
18
18
  export interface BeezUIProviderProps {
19
19
  children: ReactNode;
20
20
  components?: BeezUIComponents;
21
- /** Shares light/dark/system behavior while keeping the library's class-based theme contract. */
21
+ /** Shares light/dark/system behavior; the theme is written as a class and as Arc's `data-theme` attribute. */
22
22
  themeOptions?: Omit<ThemeProviderProps, "children" | "attribute">;
23
23
  }
24
24
  /** Merges nested overrides while preserving stable adapter identities. */
@@ -6,6 +6,11 @@ import { MotionConfig } from "motion/react";
6
6
  import { ThemeProvider } from "next-themes";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  /**
9
+ * Arc's foundation selects dark tokens with `data-theme`; the class keeps Tailwind's `dark` variant and
10
+ * consumer styles written for it.
11
+ */
12
+ const THEME_ATTRIBUTES = ["class", "data-theme"];
13
+ /**
9
14
  * next-themes renders an inline script that applies the stored theme before hydration. It only
10
15
  * runs when it arrives in server HTML; a script created by a client render never executes, and
11
16
  * React 19 warns about it. Client-only renders mark it as a data block, which React accepts.
@@ -69,7 +74,7 @@ export function BeezUIProvider(t0) {
69
74
  let t5;
70
75
  if ($[9] !== scriptProps || $[10] !== t4 || $[11] !== themeOptions) {
71
76
  t5 = /* @__PURE__ */ _jsx(ThemeProvider, {
72
- attribute: "class",
77
+ attribute: THEME_ATTRIBUTES,
73
78
  ...themeOptions,
74
79
  scriptProps,
75
80
  children: t4