@adamosuiteservices/ui 2.19.3 → 2.20.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.
package/dist/colors.css CHANGED
@@ -1 +1 @@
1
- :root{--default-25: oklch(.985 0 0);--default-50: oklch(.969 0 0);--default-100: oklch(.942 0 0);--default-200: oklch(.894 0 0);--default-300: oklch(.81 0 0);--default-400: oklch(.705 0 0);--default-500: oklch(.205 0 0);--default-600: oklch(.173 0 0);--default-700: oklch(.145 0 0);--default-800: oklch(.115 0 0);--default-900: oklch(.085 0 0);--default: var(--default-500);--sign-25: oklch(.9913 .0013 286.38);--sign-50: oklch(.9822 .0041 271.37);--sign-100: oklch(.9442 .0123 276.09);--sign-200: oklch(.8877 .025 275.88);--sign-300: oklch(.7804 .0516 277.7);--sign-400: oklch(.602 .0996 276.31);--sign-500: oklch(.4976 .1199 273.84);--sign-600: oklch(.4215 .1013 274.88);--sign-700: oklch(.386 .0871 274.07);--sign-800: oklch(.3227 .0681 274.09);--sign-900: oklch(.1925 .0327 274.82);--sign: var(--sign-500);--id-25: oklch(.9847 .0083 236.56);--id-50: oklch(.9771 .0125 236.62);--id-100: oklch(.9514 .025 236.82);--id-200: oklch(.9011 .0571 231.47);--id-300: oklch(.8297 .1025 229.8);--id-400: oklch(.7586 .1404 232.13);--id-500: oklch(.6861 .1512 238.37);--id-600: oklch(.5934 .139578 241.5185);--id-700: oklch(.5029 .1197 242.45);--id-800: oklch(.4438 .1014 241.26);--id-900: oklch(.3917 .086 241.41);--id: var(--id-500);--pay-25: oklch(.9796 .0075 186.9);--pay-50: oklch(.9572 .0138 191.39);--pay-100: oklch(.9142 .0277 188.27);--pay-200: oklch(.8315 .0554 187.51);--pay-300: oklch(.7477 .0802 186.37);--pay-400: oklch(.6706 .0984 184.77);--pay-500: oklch(.5963 .1044 182.21);--pay-600: oklch(.5091 .0885 182.45);--pay-700: oklch(.4146 .0713 182.72);--pay-800: oklch(.3181 .0532 183.32);--pay-900: oklch(.2094 .0331 184.68);--pay: var(--pay-500);--risk-25: oklch(.9873 .006673 295.4541);--risk-50: oklch(.9691 .0161 293.76);--risk-100: oklch(.9426 .0283 292.41);--risk-200: oklch(.8943 .0549 293.28);--risk-300: oklch(.8103 .1012 292.92);--risk-400: oklch(.7052 .1618 292.33);--risk-500: oklch(.6012 .2213 291.26);--risk-600: oklch(.5371 .2485 291.51);--risk-700: oklch(.4866 .2429 290.94);--risk-800: oklch(.4278 .2124 290.82);--risk-900: oklch(.3762 .1802 291.97);--risk: var(--risk-500);--check-25: oklch(.985 .02 265);--check-50: oklch(.96 .04 265);--check-100: oklch(.93 .07 265);--check-200: oklch(.87 .11 265);--check-300: oklch(.8 .15 265);--check-400: oklch(.73 .19 265);--check-500: oklch(.67 .215 265);--check-600: oklch(.62 .23 265);--check-700: oklch(.54 .2 265);--check-800: oklch(.46 .165 265);--check-900: oklch(.38 .13 265);--check: var(--primary-500);--neutrals-0: oklch(1 0 0);--neutrals-25: oklch(.9913 .0013 286.38);--neutrals-50: oklch(.9846 .0017 247.84);--neutrals-100: oklch(.967 .0029 264.54);--neutrals-200: oklch(.9276 .0058 264.53);--neutrals-300: oklch(.8745 .0081 253.86);--neutrals-400: oklch(.7162 .0166 257.21);--neutrals-500: oklch(.5537 .0205 261.3);--neutrals-600: oklch(.4517 .0207 248.28);--neutrals-700: oklch(.3758 .0275 256.82);--neutrals-800: oklch(.2808 .0286 252.97);--neutrals-900: oklch(.2129 .0303 261.25);--neutrals: var(--neutrals-500);--error-25: oklch(.9793 .0086 17.3);--error-50: oklch(.9566 .0185 17.48);--error-100: oklch(.9167 .0379 17.86);--error-200: oklch(.8342 .0807 18.91);--error-300: oklch(.7579 .1239 20.37);--error-400: oklch(.6897 .1695 22.57);--error-500: oklch(.6368 .2078 25.33);--error-600: oklch(.54 .1741 25.17);--error-700: oklch(.4398 .1373 24.79);--error-800: oklch(.4437 .1613 26.9);--error-900: oklch(.3958 .1331 25.72);--error: var(--error-500);--destructive-25: var(--error-25);--destructive-50: var(--error-50);--destructive-100: var(--error-100);--destructive-200: var(--error-200);--destructive-300: var(--error-300);--destructive-400: var(--error-400);--destructive-500: var(--error-500);--destructive-600: var(--error-500);--destructive-700: var(--error-700);--destructive-800: var(--error-800);--destructive-900: var(--error-900);--destructive: var(--error-500);--warning-25: oklch(.9863 .0102 81.8);--warning-50: oklch(.9734 .0209 79.1);--warning-100: oklch(.9489 .0434 81.89);--warning-200: oklch(.8981 .0848 80.33);--warning-300: oklch(.8522 .1214 79.12);--warning-400: oklch(.8075 .1498 75.8);--warning-500: oklch(.7686 .1647 70.08);--warning-600: oklch(.6509 .1388 70.3);--warning-700: oklch(.5297 .1114 71.53);--warning-800: oklch(.6658 .1574 58.32);--warning-900: oklch(.4137 .1054 45.9);--warning: var(--warning-500);--success-25: oklch(.9837 .0107 158.85);--success-50: oklch(.9675 .0214 158.6);--success-100: oklch(.9356 .0428 158.05);--success-200: oklch(.8762 .0868 156.45);--success-300: oklch(.818 .1286 154.62);--success-400: oklch(.7684 .1652 152.34);--success-500: oklch(.7227 .192 149.58);--success-600: oklch(.6271 .1699 149.21);--success-700: oklch(.4977 .1287 150.03);--success-800: oklch(.4479 .1083 151.33);--success-900: oklch(.3925 .0896 152.54);--success: var(--success-500);--waiting-25: oklch(.9885 .0063 236.62);--waiting-50: oklch(.9771 .0125 236.62);--waiting-100: oklch(.9514 .025 236.62);--waiting-200: oklch(.9011 .05 236.62);--waiting-300: oklch(.8297 .0875 236.62);--waiting-400: oklch(.7586 .125 236.62);--waiting-500: oklch(.6861 .1625 236.62);--waiting-600: oklch(.5934 .1438 236.62);--waiting-700: oklch(.5029 .125 236.62);--waiting-800: oklch(.4438 .1063 236.62);--waiting-900: oklch(.3917 .0875 236.62);--waiting: var(--waiting-500)}
1
+ :root{--default-25: oklch(.985 0 0);--default-50: oklch(.969 0 0);--default-100: oklch(.942 0 0);--default-200: oklch(.894 0 0);--default-300: oklch(.81 0 0);--default-400: oklch(.705 0 0);--default-500: oklch(.205 0 0);--default-600: oklch(.173 0 0);--default-700: oklch(.145 0 0);--default-800: oklch(.115 0 0);--default-900: oklch(.085 0 0);--default: var(--default-500);--sign-25: oklch(.9913 .0013 286.38);--sign-50: oklch(.9822 .0041 271.37);--sign-100: oklch(.9442 .0123 276.09);--sign-200: oklch(.8877 .025 275.88);--sign-300: oklch(.7804 .0516 277.7);--sign-400: oklch(.602 .0996 276.31);--sign-500: oklch(.4976 .1199 273.84);--sign-600: oklch(.4215 .1013 274.88);--sign-700: oklch(.386 .0871 274.07);--sign-800: oklch(.3227 .0681 274.09);--sign-900: oklch(.1925 .0327 274.82);--sign: var(--sign-500);--id-25: oklch(.9847 .0083 236.56);--id-50: oklch(.9771 .0125 236.62);--id-100: oklch(.9514 .025 236.82);--id-200: oklch(.9011 .0571 231.47);--id-300: oklch(.8297 .1025 229.8);--id-400: oklch(.7586 .1404 232.13);--id-500: oklch(.6861 .1512 238.37);--id-600: oklch(.5934 .139578 241.5185);--id-700: oklch(.5029 .1197 242.45);--id-800: oklch(.4438 .1014 241.26);--id-900: oklch(.3917 .086 241.41);--id: var(--id-500);--pay-25: oklch(.9796 .0075 186.9);--pay-50: oklch(.9572 .0138 191.39);--pay-100: oklch(.9142 .0277 188.27);--pay-200: oklch(.8315 .0554 187.51);--pay-300: oklch(.7477 .0802 186.37);--pay-400: oklch(.6706 .0984 184.77);--pay-500: oklch(.5963 .1044 182.21);--pay-600: oklch(.5091 .0885 182.45);--pay-700: oklch(.4146 .0713 182.72);--pay-800: oklch(.3181 .0532 183.32);--pay-900: oklch(.2094 .0331 184.68);--pay: var(--pay-500);--risk-25: oklch(.9873 .006673 295.4541);--risk-50: oklch(.9691 .0161 293.76);--risk-100: oklch(.9426 .0283 292.41);--risk-200: oklch(.8943 .0549 293.28);--risk-300: oklch(.8103 .1012 292.92);--risk-400: oklch(.7052 .1618 292.33);--risk-500: oklch(.6012 .2213 291.26);--risk-600: oklch(.5371 .2485 291.51);--risk-700: oklch(.4866 .2429 290.94);--risk-800: oklch(.4278 .2124 290.82);--risk-900: oklch(.3762 .1802 291.97);--risk: var(--risk-500);--check-25: oklch(.985 .02 265);--check-50: oklch(.96 .04 265);--check-100: oklch(.93 .07 265);--check-200: oklch(.87 .11 265);--check-300: oklch(.8 .15 265);--check-400: oklch(.73 .19 265);--check-500: oklch(.67 .215 265);--check-600: oklch(.62 .23 265);--check-700: oklch(.54 .2 265);--check-800: oklch(.46 .165 265);--check-900: oklch(.38 .13 265);--check: var(--check-500);--neutrals-0: oklch(1 0 0);--neutrals-25: oklch(.9913 .0013 286.38);--neutrals-50: oklch(.9846 .0017 247.84);--neutrals-100: oklch(.967 .0029 264.54);--neutrals-200: oklch(.9276 .0058 264.53);--neutrals-300: oklch(.8745 .0081 253.86);--neutrals-400: oklch(.7162 .0166 257.21);--neutrals-500: oklch(.5537 .0205 261.3);--neutrals-600: oklch(.4517 .0207 248.28);--neutrals-700: oklch(.3758 .0275 256.82);--neutrals-800: oklch(.2808 .0286 252.97);--neutrals-900: oklch(.2129 .0303 261.25);--neutrals: var(--neutrals-500);--error-25: oklch(.9793 .0086 17.3);--error-50: oklch(.9566 .0185 17.48);--error-100: oklch(.9167 .0379 17.86);--error-200: oklch(.8342 .0807 18.91);--error-300: oklch(.7579 .1239 20.37);--error-400: oklch(.6897 .1695 22.57);--error-500: oklch(.6368 .2078 25.33);--error-600: oklch(.54 .1741 25.17);--error-700: oklch(.4398 .1373 24.79);--error-800: oklch(.4437 .1613 26.9);--error-900: oklch(.3958 .1331 25.72);--error: var(--error-500);--destructive-25: var(--error-25);--destructive-50: var(--error-50);--destructive-100: var(--error-100);--destructive-200: var(--error-200);--destructive-300: var(--error-300);--destructive-400: var(--error-400);--destructive-500: var(--error-500);--destructive-600: var(--error-500);--destructive-700: var(--error-700);--destructive-800: var(--error-800);--destructive-900: var(--error-900);--destructive: var(--error-500);--warning-25: oklch(.9863 .0102 81.8);--warning-50: oklch(.9734 .0209 79.1);--warning-100: oklch(.9489 .0434 81.89);--warning-200: oklch(.8981 .0848 80.33);--warning-300: oklch(.8522 .1214 79.12);--warning-400: oklch(.8075 .1498 75.8);--warning-500: oklch(.7686 .1647 70.08);--warning-600: oklch(.6509 .1388 70.3);--warning-700: oklch(.5297 .1114 71.53);--warning-800: oklch(.6658 .1574 58.32);--warning-900: oklch(.4137 .1054 45.9);--warning: var(--warning-500);--success-25: oklch(.9837 .0107 158.85);--success-50: oklch(.9675 .0214 158.6);--success-100: oklch(.9356 .0428 158.05);--success-200: oklch(.8762 .0868 156.45);--success-300: oklch(.818 .1286 154.62);--success-400: oklch(.7684 .1652 152.34);--success-500: oklch(.7227 .192 149.58);--success-600: oklch(.6271 .1699 149.21);--success-700: oklch(.4977 .1287 150.03);--success-800: oklch(.4479 .1083 151.33);--success-900: oklch(.3925 .0896 152.54);--success: var(--success-500);--waiting-25: oklch(.9885 .0063 236.62);--waiting-50: oklch(.9771 .0125 236.62);--waiting-100: oklch(.9514 .025 236.62);--waiting-200: oklch(.9011 .05 236.62);--waiting-300: oklch(.8297 .0875 236.62);--waiting-400: oklch(.7586 .125 236.62);--waiting-500: oklch(.6861 .1625 236.62);--waiting-600: oklch(.5934 .1438 236.62);--waiting-700: oklch(.5029 .125 236.62);--waiting-800: oklch(.4438 .1063 236.62);--waiting-900: oklch(.3917 .0875 236.62);--waiting: var(--waiting-500)}
@@ -0,0 +1 @@
1
+ export * from './sticky-section';
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+ type StickySectionContextValue = {
3
+ /** Whether the section is currently stuck to the top. */
4
+ isSticky: boolean;
5
+ /** The computed top offset in pixels used by the IntersectionObserver. */
6
+ topOffset: number;
7
+ };
8
+ export type StickySectionProps = Readonly<{
9
+ /**
10
+ * Fixed top offset in pixels. When provided, the component skips the
11
+ * `offsetSelector` measurement and uses this value directly.
12
+ */
13
+ topOffset?: number;
14
+ /**
15
+ * CSS selector of the element whose height is used as the top offset.
16
+ * Defaults to `"[data-slot='sidebar-top-bar']"` (the library's sidebar top bar).
17
+ * Ignored when `topOffset` is provided.
18
+ */
19
+ offsetSelector?: string;
20
+ /** Controlled sticky state. When provided, internal detection is bypassed. */
21
+ isSticky?: boolean;
22
+ /** Called whenever the sticky state changes, with the new state and offset. */
23
+ onIsStickyChange?: (isSticky: boolean, topOffset: number) => void;
24
+ children: ReactNode | ((isSticky: boolean, topOffset: number) => ReactNode);
25
+ }>;
26
+ export declare function StickySection({ topOffset: userTopOffset, offsetSelector, isSticky: controlledIsSticky, onIsStickyChange, children, }: StickySectionProps): import("react/jsx-runtime").JSX.Element;
27
+ export declare function useStickySection(): StickySectionContextValue;
28
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "white" | "default" | "success" | "success-medium" | "warning" | "warning-medium" | "destructive" | "destructive-medium" | "outline" | "secondary" | "info" | "default-medium" | "waiting" | "waiting-medium" | "info-medium" | "muted" | null | undefined;
4
+ variant?: "white" | "default" | "success" | "success-medium" | "warning" | "warning-medium" | "destructive" | "destructive-medium" | "outline" | "secondary" | "info" | "waiting" | "default-medium" | "waiting-medium" | "info-medium" | "muted" | null | undefined;
5
5
  size?: "lg" | null | undefined;
6
6
  shape?: "pill" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -0,0 +1,11 @@
1
+ export type ElementRect = {
2
+ x: number;
3
+ y: number;
4
+ width: number;
5
+ height: number;
6
+ top: number;
7
+ right: number;
8
+ bottom: number;
9
+ left: number;
10
+ };
11
+ export declare function useElementRect(selector: string): ElementRect | null;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-BB_1_6y_.cjs"),o=require("react");function b(n){const[u,r]=o.useState(null);return o.useEffect(()=>{const s=document.querySelector(n);if(!s){r(null);return}const e=()=>{const t=s.getBoundingClientRect();r({x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left})};e();const i=new ResizeObserver(e);return i.observe(s),window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{i.disconnect(),window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}},[n]),u}const x=o.createContext(null);function y({topOffset:n,offsetSelector:u="[data-slot='sidebar-top-bar']",isSticky:r,onIsStickyChange:s,children:e}){const i=o.useRef(null),[t,v]=o.useState(!1),p=b(u),c=n??p?.height??64,l=r!==void 0,f=l?r:t;return o.useEffect(()=>{const d=new IntersectionObserver(([w])=>{const S=!w.isIntersecting;l||v(S),s&&s(S,c)},{threshold:[0],rootMargin:`${c}px 0px 0px 0px`});return i.current&&d.observe(i.current),()=>{d.disconnect()}},[c,l,s]),a.jsxRuntimeExports.jsxs(x.Provider,{value:{isSticky:f,topOffset:c},children:[a.jsxRuntimeExports.jsx("div",{ref:i,className:"absolute top-0 h-px"}),typeof e=="function"?e(f,c):e]})}function m(){const n=o.useContext(x);if(!n)throw new Error("useStickySection must be used within StickySection");return n}exports.StickySection=y;exports.useStickySection=m;
@@ -0,0 +1,65 @@
1
+ import { j as p } from "./jsx-runtime-BzflLqGi.js";
2
+ import { useState as a, useEffect as v, createContext as b, useRef as h, useContext as y } from "react";
3
+ function R(n) {
4
+ const [c, r] = a(null);
5
+ return v(() => {
6
+ const o = document.querySelector(n);
7
+ if (!o) {
8
+ r(null);
9
+ return;
10
+ }
11
+ const t = () => {
12
+ const e = o.getBoundingClientRect();
13
+ r({
14
+ x: e.x,
15
+ y: e.y,
16
+ width: e.width,
17
+ height: e.height,
18
+ top: e.top,
19
+ right: e.right,
20
+ bottom: e.bottom,
21
+ left: e.left
22
+ });
23
+ };
24
+ t();
25
+ const s = new ResizeObserver(t);
26
+ return s.observe(o), window.addEventListener("scroll", t), window.addEventListener("resize", t), () => {
27
+ s.disconnect(), window.removeEventListener("scroll", t), window.removeEventListener("resize", t);
28
+ };
29
+ }, [n]), c;
30
+ }
31
+ const w = b(null);
32
+ function k({
33
+ topOffset: n,
34
+ offsetSelector: c = "[data-slot='sidebar-top-bar']",
35
+ isSticky: r,
36
+ onIsStickyChange: o,
37
+ children: t
38
+ }) {
39
+ const s = h(null), [e, x] = a(!1), m = R(c), i = n ?? m?.height ?? 64, u = r !== void 0, f = u ? r : e;
40
+ return v(() => {
41
+ const l = new IntersectionObserver(
42
+ ([S]) => {
43
+ const d = !S.isIntersecting;
44
+ u || x(d), o && o(d, i);
45
+ },
46
+ { threshold: [0], rootMargin: `${i}px 0px 0px 0px` }
47
+ );
48
+ return s.current && l.observe(s.current), () => {
49
+ l.disconnect();
50
+ };
51
+ }, [i, u, o]), /* @__PURE__ */ p.jsxs(w.Provider, { value: { isSticky: f, topOffset: i }, children: [
52
+ /* @__PURE__ */ p.jsx("div", { ref: s, className: "absolute top-0 h-px" }),
53
+ typeof t == "function" ? t(f, i) : t
54
+ ] });
55
+ }
56
+ function O() {
57
+ const n = y(w);
58
+ if (!n)
59
+ throw new Error("useStickySection must be used within StickySection");
60
+ return n;
61
+ }
62
+ export {
63
+ k as StickySection,
64
+ O as useStickySection
65
+ };