@dendelion/func-ui 0.1.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/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/README.md +61 -0
- package/dist/components/backdrop/backdrop.d.ts +15 -0
- package/dist/components/backdrop/backdrop.d.ts.map +1 -0
- package/dist/components/backdrop/index.d.ts +3 -0
- package/dist/components/backdrop/index.d.ts.map +1 -0
- package/dist/components/button/button.d.ts +19 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/index.d.ts +3 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/card/card.d.ts +20 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/index.d.ts +3 -0
- package/dist/components/card/index.d.ts.map +1 -0
- package/dist/components/glass/glass.d.ts +15 -0
- package/dist/components/glass/glass.d.ts.map +1 -0
- package/dist/components/glass/index.d.ts +3 -0
- package/dist/components/glass/index.d.ts.map +1 -0
- package/dist/components/glow/glow.d.ts +16 -0
- package/dist/components/glow/glow.d.ts.map +1 -0
- package/dist/components/glow/index.d.ts +3 -0
- package/dist/components/glow/index.d.ts.map +1 -0
- package/dist/components/grain/grain.d.ts +11 -0
- package/dist/components/grain/grain.d.ts.map +1 -0
- package/dist/components/grain/index.d.ts +3 -0
- package/dist/components/grain/index.d.ts.map +1 -0
- package/dist/components/icon-button/icon-button.d.ts +17 -0
- package/dist/components/icon-button/icon-button.d.ts.map +1 -0
- package/dist/components/icon-button/index.d.ts +3 -0
- package/dist/components/icon-button/index.d.ts.map +1 -0
- package/dist/components/stamp/index.d.ts +3 -0
- package/dist/components/stamp/index.d.ts.map +1 -0
- package/dist/components/stamp/stamp.d.ts +21 -0
- package/dist/components/stamp/stamp.d.ts.map +1 -0
- package/dist/components/toast/index.d.ts +5 -0
- package/dist/components/toast/index.d.ts.map +1 -0
- package/dist/components/toast/toast-context.d.ts +17 -0
- package/dist/components/toast/toast-context.d.ts.map +1 -0
- package/dist/components/toast/toast-provider.d.ts +14 -0
- package/dist/components/toast/toast-provider.d.ts.map +1 -0
- package/dist/components/toast/use-toast.d.ts +2 -0
- package/dist/components/toast/use-toast.d.ts.map +1 -0
- package/dist/components/tooltip/index.d.ts +3 -0
- package/dist/components/tooltip/index.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +17 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/fonts/KyivTypeSerif-Bold.woff2 +0 -0
- package/dist/fonts/KyivTypeSerif-Heavy.woff2 +0 -0
- package/dist/fonts/KyivTypeSerif-Medium.woff2 +0 -0
- package/dist/fonts/montserrat-alternates-latin-400-normal.woff2 +0 -0
- package/dist/fonts/montserrat-alternates-latin-500-normal.woff2 +0 -0
- package/dist/fonts/montserrat-alternates-latin-600-normal.woff2 +0 -0
- package/dist/fonts/montserrat-alternates-latin-700-normal.woff2 +0 -0
- package/dist/fonts/tiny5-latin-400-normal.woff2 +0 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +514 -0
- package/dist/index.mjs.map +1 -0
- package/dist/utils/style-helpers.d.ts +2 -0
- package/dist/utils/style-helpers.d.ts.map +1 -0
- package/package.json +105 -0
- package/postcss.config.js +6 -0
- package/public/fonts/KyivTypeSerif-Bold.woff2 +0 -0
- package/public/fonts/KyivTypeSerif-Heavy.woff2 +0 -0
- package/public/fonts/KyivTypeSerif-Medium.woff2 +0 -0
- package/public/fonts/montserrat-alternates-latin-400-normal.woff2 +0 -0
- package/public/fonts/montserrat-alternates-latin-500-normal.woff2 +0 -0
- package/public/fonts/montserrat-alternates-latin-600-normal.woff2 +0 -0
- package/public/fonts/montserrat-alternates-latin-700-normal.woff2 +0 -0
- package/public/fonts/tiny5-latin-400-normal.woff2 +0 -0
- package/src/globals.scss +133 -0
- package/src/styles/_mixins.scss +30 -0
- package/src/styles/_tokens.scss +46 -0
- package/tailwind.config.js +7 -0
- package/tailwind.ts +66 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.1](https://github.com/adooone/func-ui/compare/v0.1.0...v0.1.1) (2026-08-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Documentation
|
|
7
|
+
|
|
8
|
+
* **ideas:** Move IDEA-1 to review and add IDEA-8 branch-per-idea flow ([77a0464](https://github.com/adooone/func-ui/commit/77a0464a351e563caf070fc39fd02b3e365ab594))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dendelion
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Func UI
|
|
2
|
+
|
|
3
|
+
A glossy, noisy, cosy React component library — **frosted glass**, **film grain**,
|
|
4
|
+
and a **lava-lamp glow**. Extracted from the [df.adoo.one](https://df.adoo.one) CV site.
|
|
5
|
+
|
|
6
|
+
> `@dendelion/func-ui` · React 18 · Tailwind-friendly · CSS-modules under the hood
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pnpm add @dendelion/func-ui
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import { Backdrop, Glass } from '@dendelion/func-ui';
|
|
16
|
+
import '@dendelion/func-ui/dist/index.css';
|
|
17
|
+
|
|
18
|
+
export default function App() {
|
|
19
|
+
return (
|
|
20
|
+
<Backdrop>
|
|
21
|
+
<Glass className="p-12">Frosted. Noisy. Cosy.</Glass>
|
|
22
|
+
</Backdrop>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Toggle dark mode by adding/removing the `dark` class on `<html>` — every token
|
|
28
|
+
(`--fui-*`) retints automatically.
|
|
29
|
+
|
|
30
|
+
## Components (foundation)
|
|
31
|
+
|
|
32
|
+
| Component | What it is |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| `Backdrop` | Full-bleed ambient shell — composes `Glow` + `Grain` behind content |
|
|
35
|
+
| `Grain` | Drifting film-grain overlay |
|
|
36
|
+
| `Glow` | The lava-lamp gooey glow (colour follows `--fui-glow`) |
|
|
37
|
+
| `Glass` | The frosted translucent surface primitive |
|
|
38
|
+
|
|
39
|
+
More chunks (Card, Button, IconButton, ThemeToggle, Layout, Page, Nav) are on the way.
|
|
40
|
+
|
|
41
|
+
## Tailwind preset
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
// tailwind.config.ts
|
|
45
|
+
import { funcPreset } from '@dendelion/func-ui/tailwind';
|
|
46
|
+
export default { presets: [funcPreset], content: [/* ... */] };
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Develop
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pnpm install
|
|
53
|
+
pnpm dev # run the showcase
|
|
54
|
+
pnpm build # build the library (dist/)
|
|
55
|
+
pnpm build:showcase # build the showcase site (dist/app/)
|
|
56
|
+
pnpm ci # types + lint + build
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
MIT © Dendelion
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface BackdropProps {
|
|
3
|
+
/** Render the drifting film-grain layer. Defaults to true. */
|
|
4
|
+
grain?: boolean;
|
|
5
|
+
/** Render the lava glow layer. Defaults to true. */
|
|
6
|
+
glow?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Full-bleed ambient background: the lava {@link Glow} and film {@link Grain}
|
|
12
|
+
* layered behind its children. Use it as the outermost shell of a page.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Backdrop({ grain, glow, className, children }: BackdropProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=backdrop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backdrop.d.ts","sourceRoot":"","sources":["../../../src/components/backdrop/backdrop.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oDAAoD;IACpD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAY,EAAE,IAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,aAAa,+BAYzF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/backdrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
4
|
+
size?: 'sm' | 'md';
|
|
5
|
+
fullWidth?: boolean;
|
|
6
|
+
/** Leading icon slot. */
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
/** Trailing icon slot. */
|
|
9
|
+
iconRight?: ReactNode;
|
|
10
|
+
/** Pressed-in look for toggles and nav tabs. Also sets aria-pressed. */
|
|
11
|
+
isActive?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A chunky, uppercase button with the signature hard offset shadow that snaps
|
|
15
|
+
* flush on press. Ghost is a shadow-outlined variant; secondary is frosted;
|
|
16
|
+
* danger is for destructive actions.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAI9E,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;IACvD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB;IACzB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM,2GAkCjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes, MouseEventHandler } from 'react';
|
|
2
|
+
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** `sm` is the dense list-row size; `md` the roomy default. */
|
|
4
|
+
size?: 'sm' | 'md';
|
|
5
|
+
/**
|
|
6
|
+
* Makes the whole card clickable — adds role, tab stop, Enter/Space
|
|
7
|
+
* activation, and hover/press styling.
|
|
8
|
+
*/
|
|
9
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
10
|
+
}
|
|
11
|
+
declare function CardRoot({ size, onClick, className, children, ...props }: CardProps): import("react").JSX.Element;
|
|
12
|
+
declare function Title({ className, children, ...props }: HTMLAttributes<HTMLHeadingElement>): import("react").JSX.Element;
|
|
13
|
+
declare function Body({ className, children, ...props }: HTMLAttributes<HTMLParagraphElement>): import("react").JSX.Element;
|
|
14
|
+
/** A frosted card surface with the film offset shadow. Compose with Card.Title / Card.Body. */
|
|
15
|
+
export declare const Card: typeof CardRoot & {
|
|
16
|
+
Title: typeof Title;
|
|
17
|
+
Body: typeof Body;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI9E,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,+DAA+D;IAC/D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;CAC7C;AASD,iBAAS,QAAQ,CAAC,EAAE,IAAW,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAcnF;AAED,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,kBAAkB,CAAC,+BAMnF;AAED,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,oBAAoB,CAAC,+BAMpF;AAED,+FAA+F;AAC/F,eAAO,MAAM,IAAI;;;CAA2C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface GlassProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Backdrop-blur radius in px. Defaults to the token (50).
|
|
5
|
+
* Pass 0 to disable the filter entirely — useful for Glass nested inside
|
|
6
|
+
* Glass, where the backdrop is already blurred.
|
|
7
|
+
*/
|
|
8
|
+
blur?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The core frosted-glass surface: a translucent fill behind a heavy backdrop
|
|
12
|
+
* blur, with a soft ambient shadow. The building block for panels and cards.
|
|
13
|
+
*/
|
|
14
|
+
export declare const Glass: import('react').ForwardRefExoticComponent<GlassProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//# sourceMappingURL=glass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glass.d.ts","sourceRoot":"","sources":["../../../src/components/glass/glass.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,cAAc,EAAc,MAAM,OAAO,CAAC;AAI5E,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,uGAmBhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/glass/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface GlowProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
/**
|
|
4
|
+
* Seed for the procedurally generated blobs. Each mount picks a random lamp
|
|
5
|
+
* by default; pass a fixed seed for a reproducible one (e.g. with SSR).
|
|
6
|
+
*/
|
|
7
|
+
seed?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The signature lava-lamp ambient glow — gooey blobs drifting behind a soft
|
|
11
|
+
* radial halo. Colour follows `--fui-glow` (via `currentColor`), so it retints
|
|
12
|
+
* with the theme; size/position are controlled by the parent. Blob shapes are
|
|
13
|
+
* procedurally generated: random per mount unless `seed` is given.
|
|
14
|
+
*/
|
|
15
|
+
export declare function Glow({ className, seed }: GlowProps): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=glow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glow.d.ts","sourceRoot":"","sources":["../../../src/components/glow/glow.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAwHD;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,SAAS,+BAsGlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/glow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface GrainProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Overlay opacity (0–1). Defaults to 0.06. */
|
|
4
|
+
opacity?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Animated film-grain overlay. Drop it inside a positioned container to add a
|
|
8
|
+
* drifting noise texture. Purely decorative — `aria-hidden` by default.
|
|
9
|
+
*/
|
|
10
|
+
export declare function Grain({ opacity, className, style, ...props }: GrainProps): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=grain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grain.d.ts","sourceRoot":"","sources":["../../../src/components/grain/grain.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,OAAO,CAAC;AAI3D,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,+BAaxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/grain/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
icon: ReactNode;
|
|
4
|
+
/** Accessible name — rendered as aria-label and title. */
|
|
5
|
+
label: string;
|
|
6
|
+
variant?: 'default' | 'ghost' | 'danger';
|
|
7
|
+
size?: 'sm' | 'md';
|
|
8
|
+
/** Pressed-in look for toggles. Also sets aria-pressed. */
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A square icon-only button. Default is a frosted chip with the offset
|
|
13
|
+
* shadow; ghost is chrome-less for dense toolbars; danger for destructive
|
|
14
|
+
* actions.
|
|
15
|
+
*/
|
|
16
|
+
export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAI9E,MAAM,WAAW,eAAgB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC9E,IAAI,EAAE,SAAS,CAAC;IAChB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IACzC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,+GAuBrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/stamp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes, MouseEventHandler } from 'react';
|
|
2
|
+
export type StampVariant = 'neutral' | 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
export interface StampProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
variant?: StampVariant;
|
|
5
|
+
size?: 'sm' | 'md';
|
|
6
|
+
/** Leading square status dot in the text colour. */
|
|
7
|
+
dot?: boolean;
|
|
8
|
+
/** Override the variant background with any CSS colour. */
|
|
9
|
+
fillColor?: string;
|
|
10
|
+
/** Override the variant text colour with any CSS colour. */
|
|
11
|
+
textColor?: string;
|
|
12
|
+
/** When set, the stamp renders as a real button with hover/press states. */
|
|
13
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A compact status badge on the semantic status tokens. Pass `onClick` to get
|
|
17
|
+
* a genuinely clickable stamp — it renders as a `<button>` with hover lift,
|
|
18
|
+
* no wrapper needed.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Stamp({ variant, size, dot, fillColor, textColor, onClick, className, style, children, ...props }: StampProps): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=stamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stamp.d.ts","sourceRoot":"","sources":["../../../src/components/stamp/stamp.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI9E,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEhF,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC7D,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,oDAAoD;IACpD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;CAC1C;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,EACpB,OAAmB,EACnB,IAAW,EACX,GAAW,EACX,SAAS,EACT,SAAS,EACT,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,UAAU,+BAiBZ"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ToastProvider } from './toast-provider';
|
|
2
|
+
export type { ToastProviderProps } from './toast-provider';
|
|
3
|
+
export { useToast } from './use-toast';
|
|
4
|
+
export type { ToastContextValue, ToastOptions, ToastPosition, ToastVariant, } from './toast-context';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,GACb,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ToastVariant = 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
4
|
+
export interface ToastOptions {
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
variant?: ToastVariant;
|
|
8
|
+
/** Auto-dismiss after this many ms; 0 keeps the toast until dismissed. */
|
|
9
|
+
duration?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ToastContextValue {
|
|
12
|
+
/** Show a toast; returns its id for programmatic dismissal. */
|
|
13
|
+
toast: (options: ToastOptions) => string;
|
|
14
|
+
dismiss: (id: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const ToastContext: import('react').Context<ToastContextValue | null>;
|
|
17
|
+
//# sourceMappingURL=toast-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-context.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpE,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,mDAAgD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ToastPosition } from './toast-context';
|
|
3
|
+
export interface ToastProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
position?: ToastPosition;
|
|
6
|
+
/** Default auto-dismiss in ms for toasts that don't set their own. */
|
|
7
|
+
defaultDuration?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Portal-renders the toast stack and provides the `useToast` context.
|
|
11
|
+
* Wrap the app once, near the root.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ToastProvider({ children, position, defaultDuration, }: ToastProviderProps): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=toast-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-provider.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAC;AAG1F,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,sEAAsE;IACtE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AASD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAyB,EACzB,eAAsB,GACvB,EAAE,kBAAkB,+BA4EpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-toast.d.ts","sourceRoot":"","sources":["../../../src/components/toast/use-toast.ts"],"names":[],"mappings":"AAGA,wBAAgB,QAAQ,gDAIvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
/** Tooltip content. Pass undefined/null to disable without unwrapping the child. */
|
|
5
|
+
content?: ReactNode;
|
|
6
|
+
/** A single element that becomes the trigger (handlers are merged in). */
|
|
7
|
+
children: ReactElement;
|
|
8
|
+
placement?: TooltipPlacement;
|
|
9
|
+
/** Hover delay in ms — keyboard focus shows immediately. */
|
|
10
|
+
delay?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A portal tooltip on hover and keyboard focus. Position is computed against
|
|
14
|
+
* the trigger and clamped to the viewport; Escape, scroll, and resize hide it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Tooltip({ content, children, placement, delay }: TooltipProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAKf,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,oFAAoF;IACpF,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,0EAA0E;IAC1E,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAYD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAiB,EAAE,KAAW,EAAE,EAAE,YAAY,+BA4G1F"}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("clsx"),X=require("tailwind-merge"),e=require("react/jsx-runtime"),d=require("react"),I=require("react-dom");function b(...o){return X.twMerge(W.clsx(o))}const z="grain-module__grain___sp9ca",H={grain:z};function O({opacity:o,className:t,style:s,..._}){const a=o!=null?{"--fui-grain-opacity":String(o)}:void 0;return e.jsx("div",{"aria-hidden":!0,className:b(H.grain,t),style:{...a,...s},..._})}const K="glow-module__glow___kEcKf",Y="glow-module__blob___b1llZ",Z="glow-module__wobble___kfp96",J="glow-module__botBlob___XG8Xf",M={glow:K,blob:Y,wobble:Z,botBlob:J};function U(o){let t=o|0;return()=>{t=t+1831565813|0;let s=Math.imul(t^t>>>15,1|t);return s=s+Math.imul(s^s>>>7,61|s)^s,((s^s>>>14)>>>0)/4294967296}}function G(o,t,s,_){const a=6+Math.floor(o()*4),r=.12+o()*.28,i=.85+o()*.4,u=.85+o()*.4,f=o()*Math.PI*2,m=[];for(let c=0;c<a;c++){const l=f+c/a*Math.PI*2,h=_*(1-r+o()*r*2);m.push([t+Math.cos(l)*h*i,s+Math.sin(l)*h*u])}let n=`M${m[0][0].toFixed(1)},${m[0][1].toFixed(1)}`;for(let c=0;c<a;c++){const l=m[(c-1+a)%a],h=m[c],g=m[(c+1)%a],y=m[(c+2)%a],B=h[0]+(g[0]-l[0])/6,E=h[1]+(g[1]-l[1])/6,p=g[0]-(y[0]-h[0])/6,w=g[1]-(y[1]-h[1])/6;n+=`C${B.toFixed(1)},${E.toFixed(1)} ${p.toFixed(1)},${w.toFixed(1)} ${g[0].toFixed(1)},${g[1].toFixed(1)}`}return`${n}Z`}function V(o){const t=U(o),s=4+Math.floor(t()*2),_=[];for(let i=0;i<s;i++){const u=13+t()*8,f=270+t()*50,m=350+t()*24,n=24+t()*28,c=6+t()*8,l=196+t()*42;_.push({d:G(t,f,m,u),opacity:.6+t()*.4,dur:n,delay:-((i+t()*.6)/s*n),rise:m-l,wobbleDur:c,wobbleDelay:-(t()*c),sway:3+t()*5})}const a=3+Math.floor(t()*2),r=[];for(let i=0;i<a;i++){const u=12+t()*6,f=268+t()*54,m=352+t()*24,n=36+t()*30,c=9+t()*8,l=205+t()*45;r.push({d:G(t,f,m,u),opacity:.85+t()*.15,dur:n,delay:-((i+t()*.6)/a*n),rise:m-l,wobbleDur:c,wobbleDelay:-(t()*c),sway:2+t()*3})}return{blobs:_,depthBlobs:r}}function D({className:o,seed:t}){const s=d.useId().replace(/:/g,""),_=`goo-${s}`,a=`goo-soft-${s}`,r=`clip-${s}`,i=`grad-${s}`,[u]=d.useState(()=>Math.floor(Math.random()*2**31)),{blobs:f,depthBlobs:m}=d.useMemo(()=>V(t??u),[t,u]),n=c=>c.map(l=>e.jsx("g",{className:M.blob,style:{opacity:l.opacity,"--lava-dur":`${l.dur.toFixed(1)}s`,"--lava-delay":`${l.delay.toFixed(1)}s`,"--lava-rise":`${l.rise.toFixed(0)}px`},children:e.jsx("path",{className:M.wobble,d:l.d,style:{"--lava-wdur":`${l.wobbleDur.toFixed(1)}s`,"--lava-wdelay":`${l.wobbleDelay.toFixed(1)}s`,"--lava-sway":`${l.sway.toFixed(1)}px`}})},l.d));return e.jsxs("svg",{className:b(M.glow,o),viewBox:"0 0 600 600","aria-hidden":!0,role:"presentation",children:[e.jsxs("defs",{children:[e.jsxs("filter",{id:_,colorInterpolationFilters:"sRGB",children:[e.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"8",result:"blur"}),e.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 21 -9",result:"cm"}),e.jsx("feBlend",{})]}),e.jsxs("filter",{id:a,colorInterpolationFilters:"sRGB",children:[e.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"10",result:"blur"}),e.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 14 -6"})]}),e.jsx("clipPath",{id:r,children:e.jsx("path",{d:"M262,174h60l33.5,182.3c0,0,2.7,12.8,2.5,22.8c-7.5,0-131,0-131,0s-0.7-9.3,0-18C227.6,352.9,262,174,262,174z"})}),e.jsxs("radialGradient",{id:i,cx:"300",cy:"300",r:"400",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{offset:"0.0714",stopColor:"currentColor",stopOpacity:"0.19"}),e.jsx("stop",{offset:"0.3107",stopColor:"currentColor",stopOpacity:"0.13"}),e.jsx("stop",{offset:"0.553",stopColor:"currentColor",stopOpacity:"0.06"}),e.jsx("stop",{offset:"0.7828",stopColor:"currentColor",stopOpacity:"0.02"}),e.jsx("stop",{offset:"0.9847",stopColor:"currentColor",stopOpacity:"0"})]})]}),e.jsx("rect",{fill:`url(#${i})`,width:"600",height:"600"}),e.jsx("g",{filter:`url(#${a})`,clipPath:`url(#${r})`,fill:"currentColor",opacity:.2,children:n(m)}),e.jsxs("g",{filter:`url(#${_})`,clipPath:`url(#${r})`,fill:"currentColor",children:[n(f),e.jsx("path",{className:M.botBlob,d:"M354,381.2c6.8,3.4,5.4,7.4-5.6,10.4c-10.7,3.1-31.1,5.1-54.4,8.4c-23.3,3.3-43.7,0.8-54.4-2.4c-11-3.4-12.4-7.6-5.6-13.8c6.8-7,18.9-14.6,29.6-17.4c11-3.3,20.6-1.8,30.4-1.4c9.8,0.4,19.4,5.1,30.4,8.3C335.1,376.8,347.2,378.6,354,381.2z"})]})]})}const Q="backdrop-module__backdrop___CoxJ-",A="backdrop-module__glowLayer___esKR8",tt="backdrop-module__grainLayer___44u-y",ot="backdrop-module__content___W2hOD",N={backdrop:Q,glowLayer:A,grainLayer:tt,content:ot};function et({grain:o=!0,glow:t=!0,className:s,children:_}){return e.jsxs("div",{className:b(N.backdrop,s),children:[t&&e.jsx("div",{className:N.glowLayer,children:e.jsx(D,{})}),o&&e.jsx(O,{className:N.grainLayer}),e.jsx("div",{className:N.content,children:_})]})}const st="glass-module__glass___Z6fy2",nt={glass:st},rt=d.forwardRef(function({blur:t,className:s,style:_,children:a,...r},i){const u=t===0?{backdropFilter:"none",WebkitBackdropFilter:"none"}:t!=null?{"--fui-glass-blur":`${t}px`}:void 0;return e.jsx("div",{ref:i,className:b(nt.glass,s),style:{...u,..._},...r,children:a})}),ct="button-module__button___Z331g",at="button-module__active___weXhI",lt="button-module__primary___ppbyq",it="button-module__secondary___esy5L",ut="button-module__ghost___NisA0",dt="button-module__danger___Wnvuq",_t="button-module__md___REpcP",mt="button-module__sm___QYj0l",pt="button-module__fullWidth___H0P0F",ft="button-module__iconSlot___BGOaK",$={button:ct,active:at,primary:lt,secondary:it,ghost:ut,danger:dt,md:_t,sm:mt,fullWidth:pt,iconSlot:ft},bt=d.forwardRef(function({variant:t="primary",size:s="md",fullWidth:_=!1,icon:a,iconRight:r,isActive:i=!1,className:u,children:f,...m},n){return e.jsxs("button",{ref:n,type:"button","aria-pressed":i||void 0,className:b($.button,$[t],$[s],_&&$.fullWidth,i&&$.active,u),...m,children:[a&&e.jsx("span",{className:$.iconSlot,children:a}),f,r&&e.jsx("span",{className:$.iconSlot,children:r})]})}),ht="icon-button-module__iconButton___avg6i",gt="icon-button-module__active___XaJ4h",yt="icon-button-module__ghost___Wbxog",wt="icon-button-module__danger___p0Xz5",xt="icon-button-module__sm___4l7PX",vt="icon-button-module__md___48iuw",L={iconButton:ht,default:"icon-button-module__default___9frNR",active:gt,ghost:yt,danger:wt,sm:xt,md:vt},jt=d.forwardRef(function({icon:t,label:s,variant:_="default",size:a="md",isActive:r=!1,className:i,...u},f){return e.jsx("button",{ref:f,type:"button","aria-label":s,title:s,"aria-pressed":r||void 0,className:b(L.iconButton,L[_],L[a],r&&L.active,i),...u,children:t})}),$t="stamp-module__stamp___5qaNY",Ct="stamp-module__dot___qZyCR",kt="stamp-module__neutral___6CXei",Bt="stamp-module__info___hH0OA",Mt="stamp-module__success___vtscx",Nt="stamp-module__warning___H6sZS",Lt="stamp-module__error___G-HEQ",Ft="stamp-module__sm___N-jia",St="stamp-module__md___Cz5Vg",F={stamp:$t,dot:Ct,neutral:kt,info:Bt,success:Mt,warning:Nt,error:Lt,sm:Ft,md:St};function Tt({variant:o="neutral",size:t="sm",dot:s=!1,fillColor:_,textColor:a,onClick:r,className:i,style:u,children:f,...m}){const n=r?"button":"span",c=_||a?{backgroundColor:_,color:a}:void 0;return e.jsxs(n,{type:r?"button":void 0,onClick:r,className:b(F.stamp,F[o],F[t],i),style:{...c,...u},...m,children:[s&&e.jsx("span",{className:F.dot,"aria-hidden":!0}),f]})}const Rt="tooltip-module__tooltip___e-rkz",Et="tooltip-module__ready___LI2J6",P={tooltip:Rt,ready:Et},S=8,T=8;function R(o,t){return s=>{typeof o=="function"&&o(s),t(s)}}function Gt({content:o,children:t,placement:s="top",delay:_=300}){const a=d.useId(),[r,i]=d.useState(!1),[u,f]=d.useState(null),m=d.useRef(null),n=d.useRef(null),c=d.useRef(void 0),l=d.useCallback(()=>{window.clearTimeout(c.current),i(!1),f(null)},[]);d.useEffect(()=>()=>window.clearTimeout(c.current),[]),d.useEffect(()=>{if(!r)return;const p=w=>{w.key==="Escape"&&l()};return window.addEventListener("keydown",p),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{window.removeEventListener("keydown",p),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[r,l]),d.useLayoutEffect(()=>{if(!r)return;const p=n.current,w=m.current;if(!p||!w)return;const x=w.getBoundingClientRect();let v,j;switch(s){case"bottom":v=p.bottom+S,j=p.left+p.width/2-x.width/2;break;case"left":v=p.top+p.height/2-x.height/2,j=p.left-x.width-S;break;case"right":v=p.top+p.height/2-x.height/2,j=p.right+S;break;default:v=p.top-x.height-S,j=p.left+p.width/2-x.width/2}j=Math.min(Math.max(j,T),window.innerWidth-x.width-T),v=Math.min(Math.max(v,T),window.innerHeight-x.height-T),f({top:v,left:j})},[r,s]);const h=o==null||o===!1||o==="",g=d.Children.only(t),y=g.props,B=p=>{n.current=p.getBoundingClientRect(),i(!0)};if(h)return t;const E=d.cloneElement(g,{onMouseEnter:R(y.onMouseEnter,p=>{const w=p.currentTarget;window.clearTimeout(c.current),c.current=window.setTimeout(()=>B(w),_)}),onMouseLeave:R(y.onMouseLeave,l),onFocus:R(y.onFocus,p=>{B(p.currentTarget)}),onBlur:R(y.onBlur,l),"aria-describedby":r?a:y["aria-describedby"]});return e.jsxs(e.Fragment,{children:[E,r&&I.createPortal(e.jsx("div",{ref:m,id:a,role:"tooltip",className:b(P.tooltip,u&&P.ready),style:u?{top:u.top,left:u.left}:void 0,children:o}),document.body)]})}const q=d.createContext(null),Pt="toast-module__stack___hDi0s",It="toast-module__top-left___rIwtH",Ot="toast-module__top-center___OapVt",Dt="toast-module__top-right___Ci4Ki",qt="toast-module__bottom-left___y6xhK",Wt="toast-module__bottom-center___yYVrc",Xt="toast-module__bottom-right___JeMil",zt="toast-module__toast___y1lVX",Ht="toast-module__toast-in___TYYwQ",Kt="toast-module__title___1Oqh8",Yt="toast-module__description___eiUSB",Zt="toast-module__close___IDukn",Jt="toast-module__info___Nh8S9",Ut="toast-module__success___hlKLc",Vt="toast-module__warning___XUMJt",Qt="toast-module__error___pSFFC",C={stack:Pt,topLeft:It,topCenter:Ot,topRight:Dt,bottomLeft:qt,bottomCenter:Wt,bottomRight:Xt,toast:zt,toastIn:Ht,title:Kt,description:Yt,close:Zt,info:Jt,success:Ut,warning:Vt,error:Qt};function At({children:o,position:t="bottom-right",defaultDuration:s=5e3}){const[_,a]=d.useState([]),r=d.useRef(new Map),i=d.useRef(0),u=d.useCallback(n=>{a(l=>l.filter(h=>h.id!==n));const c=r.current.get(n);c!==void 0&&(window.clearTimeout(c),r.current.delete(n))},[]),f=d.useCallback(n=>{i.current+=1;const c=`fui-toast-${i.current}`;a(h=>[...h,{id:c,title:n.title,description:n.description,variant:n.variant??"info"}]);const l=n.duration??s;return l>0&&r.current.set(c,window.setTimeout(()=>u(c),l)),c},[s,u]);d.useEffect(()=>{const n=r.current;return()=>{for(const c of n.values())window.clearTimeout(c)}},[]);const m=d.useMemo(()=>({toast:f,dismiss:u}),[f,u]);return e.jsxs(q.Provider,{value:m,children:[o,I.createPortal(e.jsx("div",{className:b(C.stack,C[t]),children:_.map(n=>e.jsxs("div",{role:n.variant==="error"?"alert":"status",className:b(C.toast,C[n.variant]),children:[n.title&&e.jsx("p",{className:C.title,children:n.title}),n.description&&e.jsx("p",{className:C.description,children:n.description}),e.jsx("button",{type:"button","aria-label":"Dismiss",className:C.close,onClick:()=>u(n.id),children:"×"})]},n.id))}),document.body)]})}function to(){const o=d.useContext(q);if(!o)throw new Error("useToast must be used within a <ToastProvider>");return o}const oo="card-module__card___HG0v6",eo="card-module__interactive___lCSFj",so="card-module__sm___ug17X",no="card-module__md___BAzpC",ro="card-module__title___9LIjW",co="card-module__body___b17cz",k={card:oo,interactive:eo,sm:so,md:no,title:ro,body:co};function ao(o){o.target===o.currentTarget&&(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),o.currentTarget.click())}function lo({size:o="md",onClick:t,className:s,children:_,...a}){const r=t!=null;return e.jsx("div",{className:b(k.card,k[o],r&&k.interactive,s),onClick:t,...r?{role:"button",tabIndex:0,onKeyDown:ao}:void 0,...a,children:_})}function io({className:o,children:t,...s}){return e.jsx("h3",{className:b(k.title,o),...s,children:t})}function uo({className:o,children:t,...s}){return e.jsx("p",{className:b(k.body,o),...s,children:t})}const _o=Object.assign(lo,{Title:io,Body:uo});exports.Backdrop=et;exports.Button=bt;exports.Card=_o;exports.Glass=rt;exports.Glow=D;exports.Grain=O;exports.IconButton=jt;exports.Stamp=Tt;exports.ToastProvider=At;exports.Tooltip=Gt;exports.cn=b;exports.useToast=to;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|